#!/bin/sh # This script first starts faked (the daemon), and then it will run # the requested program with fake root privileges. usage () { cat - >&2 <<EOF fakeroot, create a fake root environment. usage: fakeroot [-l|--lib fakerootlib] [-f|--faked fakedbin] [-i file] [-s file] [-u|--unknown-is-real] [-b|--fd-base fd] [-h|--help] [-v|--version] [--] [command] EOF exit 1 } stderr () { local i for i do echo >&2 "fakeroot: $i" done } fatal () { stderr "$@" exit 1 } # strip /bin/fakeroot to find install prefix FAKEROOT_PREFIX=/usr FAKEROOT_BINDIR=/usr/bin USEABSLIBPATH=0 LIB=libfakeroot-sysv.so PATHS=/usr/lib/x86_64-linux-gnu/libfakeroot:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot FAKED=${FAKEROOT_BINDIR}/faked-sysv FAKED_MODE="unknown-is-root" export FAKED_MODE libfound=no GETOPTTEST=`getopt -T` if test "$?" -eq 4; then # GNU getopt FAKE_TEMP=`getopt -l lib: -l faked: -l unknown-is-real -l fd-base: -l version -l help -- +l:f:i:s:ub:vh "$@"` else FAKE_TEMP=`getopt l:f:i:s:ub:vh "$@"` fi if test "$?" -ne 0; then usage fi eval set -- "$FAKE_TEMP" FAKEDOPTS="" PIPEIN="" WAITINTRAP=0 while test "X$1" != "X--"; do case "$1" in -l|--lib) shift LIB=`eval echo "$1"` PATHS= ;; -f|--faked) shift FAKED="$1" ;; -i) shift if test -f "$1"; then FAKEDOPTS=$FAKEDOPTS" --load" PIPEIN="<$1" else stderr "database file \`$1' does not exist." fi ;; -s) shift FAKEDOPTS=$FAKEDOPTS" --save-file $1" [ -p $1 ] || WAITINTRAP=1 ;; -u|--unknown-is-real) FAKEDOPTS=$FAKEDOPTS" --unknown-is-real" FAKED_MODE="unknown-is-real" ;; -b|--fd-base) shift FAKEROOT_FD_BASE="$1" ;; -v|--version) echo "fakeroot version 1.22" exit 0 ;; -h|--help) usage ;; esac shift done shift #get rid of the '--' # make sure the preload is available ABSLIB="" if [ -n "$PATHS" ] then for dir in `echo $PATHS | sed 's/:/ /g'` do if test -r "$dir/$LIB" then libfound=yes ABSLIB="$dir/$LIB" fi done else if test -r "$LIB" then libfound=yes ABSLIB="$LIB" fi fi if test $libfound = no then fatal "preload library \`$LIB' not found, aborting." fi if test -n "$FAKEROOTKEY" then fatal "FAKEROOTKEY set to $FAKEROOTKEY" \ "nested operation not yet supported" fi unset FAKEROOTKEY KEY_PID=`eval $FAKED $FAKEDOPTS $PIPEIN` FAKEROOTKEY=`echo $KEY_PID|cut -d: -f1` PID=`echo $KEY_PID|cut -d: -f2` if [ "$WAITINTRAP" -eq 0 ]; then trap "kill -s TERM $PID" EXIT INT else trap 'FAKEROOTKEY=$FAKEROOTKEY LD_LIBRARY_PATH="$PATHS" LD_PRELOAD="$LIB" /bin/ls -l / >/dev/null 2>&1; while kill -s TERM $PID 2>/dev/null; do sleep 0.1; done' EXIT INT #trap 'FAKEROOTKEY=$FAKEROOTKEY LD_PRELOAD="$LIB" /bin/ls -l / >/dev/null 2>&1; while kill -s TERM $PID 2>/dev/null; do sleep 0.1; done' EXIT INT fi if test -z "$FAKEROOTKEY" || test -z "$PID"; then fatal "error while starting the \`faked' daemon." fi if test $USEABSLIBPATH -ne 0 ; then LIB=$ABSLIB fi # Keep other library paths if test -n "$LD_LIBRARY_PATH"; then PATHS="$PATHS:$LD_LIBRARY_PATH" fi # ...and preloaded libs if test -n "$LD_PRELOAD"; then LIB="$LIB:$LD_PRELOAD" fi export FAKEROOT_FD_BASE if test -z "$*"; then FAKEROOTKEY=$FAKEROOTKEY LD_LIBRARY_PATH="$PATHS" LD_PRELOAD="$LIB" ${SHELL:-/bin/sh} #FAKEROOTKEY=$FAKEROOTKEY LD_PRELOAD="$LIB" ${SHELL:-/bin/sh} RESULT=$? else FAKEROOTKEY=$FAKEROOTKEY LD_LIBRARY_PATH="$PATHS" LD_PRELOAD="$LIB" "$@" #FAKEROOTKEY=$FAKEROOTKEY LD_PRELOAD="$LIB" "$@" RESULT=$? fi exit $RESULT # Local Variables: # mode: shell-script # End:
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
README | File | 100 B | 0644 |
|
aclocal | File | 35.93 KB | 0755 |
|
aclocal.1.gz | File | 1.18 KB | 0644 |
|
automake | File | 247.38 KB | 0755 |
|
automake.1.gz | File | 1.57 KB | 0644 |
|
awk | File | 642.65 KB | 0755 |
|
awk.1.gz | File | 28.17 KB | 0644 |
|
builtins.7.gz | File | 508 B | 0644 |
|
c++ | File | 1022.94 KB | 0755 |
|
c++.1.gz | File | 297.02 KB | 0644 |
|
c89 | File | 428 B | 0755 |
|
c89.1.gz | File | 1.33 KB | 0644 |
|
c99 | File | 454 B | 0755 |
|
c99.1.gz | File | 1.39 KB | 0644 |
|
cc | File | 1022.94 KB | 0755 |
|
cc.1.gz | File | 297.02 KB | 0644 |
|
cpp | File | 1022.94 KB | 0755 |
|
desktop-background | File | 13.66 KB | 0644 |
|
desktop-background.xml | File | 643 B | 0644 |
|
desktop-grub | File | 154.66 KB | 0644 |
|
desktop-splash | File | 309.33 KB | 0644 |
|
editor | File | 240.11 KB | 0755 |
|
editor.1.gz | File | 5.34 KB | 0644 |
|
ex | File | 2.55 MB | 0755 |
|
ex.1.gz | File | 5.29 KB | 0644 |
|
ex.fr.1.gz | File | 6.37 KB | 0644 |
|
ex.it.1.gz | File | 5.96 KB | 0644 |
|
ex.ja.1.gz | File | 5.79 KB | 0644 |
|
ex.pl.1.gz | File | 6.15 KB | 0644 |
|
ex.ru.1.gz | File | 6.96 KB | 0644 |
|
faked.1.gz | File | 1.16 KB | 0644 |
|
faked.es.1.gz | File | 1.42 KB | 0644 |
|
faked.fr.1.gz | File | 1.49 KB | 0644 |
|
faked.sv.1.gz | File | 1.32 KB | 0644 |
|
fakeroot | File | 3.76 KB | 0755 |
|
fakeroot.1.gz | File | 3.91 KB | 0644 |
|
fakeroot.es.1.gz | File | 4.38 KB | 0644 |
|
fakeroot.fr.1.gz | File | 4.59 KB | 0644 |
|
fakeroot.sv.1.gz | File | 4.26 KB | 0644 |
|
from | File | 9.99 KB | 0755 |
|
from.1.gz | File | 1.43 KB | 0644 |
|
ftp | File | 98.7 KB | 0755 |
|
ftp.1.gz | File | 9.02 KB | 0644 |
|
futurize | File | 384 B | 0755 |
|
infobrowser | File | 245.72 KB | 0755 |
|
infobrowser.1.gz | File | 1.4 KB | 0644 |
|
jsondiff | File | 1018 B | 0755 |
|
jsonpatch | File | 3.58 KB | 0755 |
|
jsonpointer | File | 1.31 KB | 0755 |
|
jsonschema | File | 398 B | 0755 |
|
locate | File | 42.08 KB | 2755 |
|
locate.1.gz | File | 2.58 KB | 0644 |
|
lzcat | File | 74.36 KB | 0755 |
|
lzcat.1.gz | File | 19.87 KB | 0644 |
|
lzcmp | File | 6.48 KB | 0755 |
|
lzcmp.1.gz | File | 664 B | 0644 |
|
lzdiff | File | 6.48 KB | 0755 |
|
lzdiff.1.gz | File | 664 B | 0644 |
|
lzegrep | File | 5.76 KB | 0755 |
|
lzegrep.1.gz | File | 700 B | 0644 |
|
lzfgrep | File | 5.76 KB | 0755 |
|
lzfgrep.1.gz | File | 700 B | 0644 |
|
lzgrep | File | 5.76 KB | 0755 |
|
lzgrep.1.gz | File | 700 B | 0644 |
|
lzless | File | 1.76 KB | 0755 |
|
lzless.1.gz | File | 743 B | 0644 |
|
lzma | File | 74.36 KB | 0755 |
|
lzma.1.gz | File | 19.87 KB | 0644 |
|
lzmore | File | 2.11 KB | 0755 |
|
lzmore.1.gz | File | 636 B | 0644 |
|
mt | File | 78.63 KB | 0755 |
|
mt.1.gz | File | 1.98 KB | 0644 |
|
my.cnf | File | 1.28 KB | 0644 |
|
nawk | File | 642.65 KB | 0755 |
|
nawk.1.gz | File | 28.17 KB | 0644 |
|
nc | File | 34.48 KB | 0755 |
|
nc.1.gz | File | 6.12 KB | 0644 |
|
netcat | File | 34.48 KB | 0755 |
|
netcat.1.gz | File | 6.12 KB | 0644 |
|
netrc.5.gz | File | 2.04 KB | 0644 |
|
newt-palette | File | 160 B | 0644 |
|
pager | File | 166.76 KB | 0755 |
|
pager.1.gz | File | 20.01 KB | 0644 |
|
pasteurize | File | 388 B | 0755 |
|
pbr | File | 152 B | 0755 |
|
pftp | File | 98.7 KB | 0755 |
|
pftp.1.gz | File | 9.02 KB | 0644 |
|
phar | File | 14.47 KB | 0755 |
|
phar.1.gz | File | 2.74 KB | 0644 |
|
phar.phar | File | 14.47 KB | 0755 |
|
phar.phar.1.gz | File | 36 B | 0644 |
|
php | File | 4.68 MB | 0755 |
|
php.1.gz | File | 3.54 KB | 0644 |
|
pico | File | 240.11 KB | 0755 |
|
pico.1.gz | File | 5.34 KB | 0644 |
|
pinentry | File | 62.49 KB | 0755 |
|
pinentry.1.gz | File | 1.38 KB | 0644 |
|
rcp | File | 98.14 KB | 0755 |
|
rcp.1.gz | File | 2.35 KB | 0644 |
|
rlogin | File | 710.79 KB | 0755 |
|
rlogin.1.gz | File | 14.25 KB | 0644 |
|
rmt | File | 58.39 KB | 0755 |
|
rmt.8.gz | File | 2.34 KB | 0644 |
|
rsh | File | 710.79 KB | 0755 |
|
rsh.1.gz | File | 14.25 KB | 0644 |
|
rview | File | 2.55 MB | 0755 |
|
rvim | File | 2.55 MB | 0755 |
|
shimx64.efi.signed | File | 937.96 KB | 0644 |
|
telnet | File | 108.42 KB | 0755 |
|
telnet.1.gz | File | 8.8 KB | 0644 |
|
text.plymouth | File | 205 B | 0644 |
|
traceroute6 | File | 18.02 KB | 4755 |
|
traceroute6.8.gz | File | 925 B | 0644 |
|
unlzma | File | 74.36 KB | 0755 |
|
unlzma.1.gz | File | 19.87 KB | 0644 |
|
updatedb | File | 46.08 KB | 0755 |
|
updatedb.8.gz | File | 2.08 KB | 0644 |
|
vi | File | 2.55 MB | 0755 |
|
vi.1.gz | File | 5.29 KB | 0644 |
|
vi.fr.1.gz | File | 6.37 KB | 0644 |
|
vi.it.1.gz | File | 5.96 KB | 0644 |
|
vi.ja.1.gz | File | 5.79 KB | 0644 |
|
vi.pl.1.gz | File | 6.15 KB | 0644 |
|
vi.ru.1.gz | File | 6.96 KB | 0644 |
|
view | File | 2.55 MB | 0755 |
|
view.1.gz | File | 5.29 KB | 0644 |
|
view.fr.1.gz | File | 6.37 KB | 0644 |
|
view.it.1.gz | File | 5.96 KB | 0644 |
|
view.ja.1.gz | File | 5.79 KB | 0644 |
|
view.pl.1.gz | File | 6.15 KB | 0644 |
|
view.ru.1.gz | File | 6.96 KB | 0644 |
|
vim | File | 2.55 MB | 0755 |
|
vimdiff | File | 2.55 MB | 0755 |
|
vtrgb | File | 158 B | 0644 |
|
w | File | 18.07 KB | 0755 |
|
w.1.gz | File | 1.25 KB | 0644 |
|
write | File | 13.99 KB | 2755 |
|
write.1.gz | File | 1.8 KB | 0644 |
|
x-cursor-theme | File | 30 B | 0644 |
|
x-session-manager | File | 2.9 KB | 0755 |
|
x-session-manager.1.gz | File | 582 B | 0644 |
|
x-terminal-emulator | File | 2.36 KB | 0755 |
|
x-terminal-emulator.1.gz | File | 1.2 KB | 0644 |
|
x-window-manager | File | 382.26 KB | 0755 |
|
x-window-manager.1.gz | File | 698 B | 0644 |
|