Skip to content

Commit

Permalink
Imported Upstream version 2.17.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dex4er committed Dec 5, 2013
1 parent c996fc4 commit ab51e05
Show file tree
Hide file tree
Showing 26 changed files with 663 additions and 534 deletions.
71 changes: 71 additions & 0 deletions COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
fakechroot is distributed under the GNU Lesser General Public License (LGPL
2.1 or greater).

Additional copyrights:

dedotdot function taken from mini_httpd - small HTTP server
Copyright (C) 1999,2000 by Jef Poskanzer <jef@mail.acme.com>.

execl function taken from GNU C Library.
Copyright (C) 1991,92,94,97,98,99,2002,2005 Free Software Foundation, Inc.

execle function taken from GNU C Library.
Copyright (C) 1991,97,98,99,2002,2005 Free Software Foundation, Inc.

execlp function taken from GNU C Library.
Copyright (C) 1991,93,96,97,98,99,2002,2005 Free Software Foundation, Inc.

execvp function taken from GNU C Library.
Copyright (C) 1991,92, 1995-99, 2002, 2004, 2005, 2007, 2009
Free Software Foundation, Inc.

fts_* functions taken from OpenBSD.
Copyright (c) 1990, 1993, 1994
The Regents of the University of California.
This software is distributed under the BSD-style license.

ftw function taken from GNU C Library.
Copyright (C) 1996-2004, 2006-2008, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.

getcwd_real function taken from OpenBSD.
Copyright (c) 1989, 1991, 1993 The Regents of the University of California.
All rights reserved.

getcwd_real function taken from uClibc.
Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
Licensed under the LGPL v2.1.

__opendir2 function taken from FreeBSD.
Copyright (c) 1983, 1993 The Regents of the University of California.
Copyright (c) 2000 Daniel Eischen.
This software is distributed under the BSD-style license.

popen function taken from OpenBSD.
Copyright (c) 1988, 1993 The Regents of the University of California.

rawmemchr function taken from uClibc
Copyright (C) 2002 Manuel Novoa III
Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>

realpath function taken from Gnulib.
Copyright (c) 1996-2010 Free Software Foundation, Inc.

rpl_lstat function taken from Gnulib.
Copyright (C) 1997-2006, 2008-2010 Free Software Foundation, Inc.

setenv, clearenv, unsetenv functions taken from uClibc.
Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
modified for uClibc by Erik Andersen <andersen@codepoet.org>

stpcpy function taken from Gnulib.
Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2010 Free Software
Foundation, Inc.

strchrnul function taken from Gnulib.
Copyright (C) 2003, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.

strlcpy function taken from OpenBSD.
Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I m4

SUBDIRS = man src scripts test

EXTRA_DIST = LICENSE NEWS.md README.md THANKS autogen.sh makedist.sh
EXTRA_DIST = COPYING LICENSE NEWS.md README.md THANKS autogen.sh makedist.sh

test: all
( cd test && $(MAKE) $(AM_MAKEFLAGS) test )
Expand Down
6 changes: 4 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ host_triplet = @host@
subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/config.h.in THANKS build-aux/compile \
$(srcdir)/config.h.in COPYING THANKS build-aux/compile \
build-aux/config.guess build-aux/config.sub \
build-aux/install-sh build-aux/missing build-aux/ltmain.sh \
$(top_srcdir)/build-aux/compile \
Expand Down Expand Up @@ -276,6 +276,8 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POD2MAN = @POD2MAN@
PROVE = @PROVE@
RANLIB = @RANLIB@
SED = @SED@
Expand Down Expand Up @@ -340,7 +342,7 @@ top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = man src scripts test
EXTRA_DIST = LICENSE NEWS.md README.md THANKS autogen.sh makedist.sh
EXTRA_DIST = COPYING LICENSE NEWS.md README.md THANKS autogen.sh makedist.sh
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive

Expand Down
11 changes: 11 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## Version 2.17.1

5 Dec 2013

* The `fakechroot`(1) command runs proper wrapper rather than original
command, if it is listed on `FAKECHROOT_CMD_SUBST` variable.
* Fixes were made for `chroot`(8) wrapper. It scanned /etc/ld.so.conf
incorrectly and now enters to physical path, avoiding symlinks.
* The `chroot`(2) function allows to use more than 2048 bytes for
`LD_LIBRARY_PATH` environment variable.

## Version 2.17

24 Nov 2013
Expand Down
87 changes: 49 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

[![Build Status](https://travis-ci.org/dex4er/fakechroot.png?branch=master)](https://travis-ci.org/dex4er/fakechroot)


What is it?
===========

Expand All @@ -14,46 +15,57 @@ users to create own chrooted environment with possibility to install another
packages without need for root privileges.


News
====

### 24 Nov 2013

Version 2.17 is released. The `FAKECHROOT_ELFLOADER` environment variable
changes the default dynamic linker. New `env`(1) wrapper was added. It is safe
to use relative paths which won't escape from fake chroot. Fixes were make for
`readline`(2), `mktemp`(3), `_xftw64`(glibc), `__realpath_chk`(glibc)
functions. New functions `mkostemp`(3), `mkostemp64`(3), `mkostemps`(3),
`mkostemps64`(3), `mkstemps`(3) and `mkstemps64`(3) were implemented.

### 11 Dec 2011

Version 2.16 is released. The fakechroot script loads additional environment
settings from configuration directory (`--config-dir` option). By default
additional settings are provided for `chroot`(8) and `debootstrap`(8)
commands. Wrapped `chroot`(8) command loads `ld.so.conf` paths to
`LD_LIBRARY_PATH` environment variable. Fixes were made for `getpeeraddr`(3)
and `getsockaddr`(3) functions.

### 29 Sep 2011

Version 2.15 is released. New function `faccessat`(2) was added: it fixes
`test -r` command. The `popen`(3) function were reimplemented based on OpenBSD
source to prevent some coredumps with newer GNU C Library.


How does it work?
=================

fakechroot replaces more library functions (`chroot`(2), `open`(2), etc.) by
ones that simulate the effect the real library functions would have had, had
the user really been in chroot. These wrapper functions are in a shared
library `/usr/lib/fakechroot/libfakechroot.so` which is loaded through the
`LD_PRELOAD` mechanism of the dynamic loader. (See `ld.so`(8))

In fake chroot you can install Debian bootstrap with `debootstrap` command.
In this environment you can use i.e. `apt-get`(8) command to install another
packages from common user's account.
fakechroot replaces some libc library functions (`chroot`(2), `open`(2), etc.)
by ones that simulate the effect of being called with root privileges.

These wrapper functions are in a shared library `libfakechroot.so` which is
loaded through the `LD_PRELOAD` mechanism of the dynamic loader. (See
`ld.so`(8))

In fake chroot you can install Debian bootstrap with `debootstrap` command. In
this environment you can use i.e. `apt-get`(8) command to install another
packages. You don't need a special privileges and you can run it from common
user's account.


An example session
==================

```sh
$ id
uid=1000(dexter) gid=1000(dexter) groups=1000(dexter)

$ fakechroot fakeroot debootstrap sid /tmp/sid
I: Retrieving Release
I: Retrieving Release.gpg
I: Checking Release signature
...
I: Base system installed successfully.

$ fakechroot fakeroot chroot /tmp/sid apt-get install -q hello
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
hello
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 57.4 kB of archives.
After this operation, 558 kB of additional disk space will be used.
Get:1 http://ftp.us.debian.org/debian/ sid/main hello amd64 2.8-4 [57.4 kB]
Fetched 57.4 kB in 0s (127 kB/s)
Selecting previously unselected package hello.
(Reading database ... 24594 files and directories currently installed.)
Unpacking hello (from .../archives/hello_2.8-4_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for install-info ...
Setting up hello (2.8-4) ...

$ fakechroot chroot /tmp/sid hello
Hello, world!
```


Where is it used?
Expand All @@ -69,6 +81,5 @@ fakechroot had found another purposes:
* to be a supporter for [pbuilder](http://pbuilder.alioth.debian.org/) building system
* to be a supporter for [Apport](https://wiki.ubuntu.com/Apport) retracer
* to be a supporter for [libguestfs tools](http://libguestfs.org/) for accessing and modifying virtual machine disk images
* to be a part of [Slind](https://www.slind.org/Main_Page) - a minimal Debian-based distro for embedded devices as libfakechroot-cross project
* to be a supporter for [febootstrap](http://et.redhat.com/~rjones/febootstrap/), the tool which can set up new Fedora system.
* to be a part of [cuntubuntu](https://play.google.com/store/apps/details?id=com.cuntubuntu) - Ubuntu for Android without root
Loading

0 comments on commit ab51e05

Please sign in to comment.