1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
|
.\" Process this file with
.\" groff -man -Tascii foo.1
.\"
.\" "verbatim" environment (from strace.1)
.de CW
.sp
.nf
.ft CW
..
.de CE
.ft
.fi
.sp
..
.\"
.TH fakeroot 1 "22 November 2015" "Debian Project" "Debian manual"
.\" Manpage by J.H.M. Dassen <jdassen@debian.org>,
.\" Clint Adams <clint@debian.org>
.\" and Andrew Shadura <andrewsh@debian.org>
.SH NAME
fakeroot \- run a command in an environment faking root privileges for file
manipulation
.SH SYNOPSIS
.B fakeroot
.B [\-i|\-s
.IB local-state-dir ]
.B [\-h|\-\-help ]
.B [\-v|\-\-version ]
.BI [\-\-]
.BI [command]
.SH DESCRIPTION
.B fakeroot
runs a command in an environment wherein it appears to have root privileges
for file manipulation. This is useful for allowing users to create file system
images, archives and packages (tar, ar, .deb etc.) with files in them
with root permissions/ownership. Without
.B fakeroot
one would need to have root privileges to create the constituent files of
the archives with the correct permissions and ownership, and then pack them
up, or one would have to construct the archives directly, without using the
archiver.
This version of
.B fakeroot
uses pseudo(1) to replace the file manipulation library functions (chmod(2),
stat(2) etc.) by ones that simulate the effect the real library
functions would have had, had the user really been root.
.SH OPTIONS
.TP
.BI \-l \ arg\fR,\ \fB\-\-lib\ \fIarg
Does nothing, accepted for compatibility only.
.TP
.BI \-\-faked \ arg
Does nothing, accepted for compatibility only.
.TP
.BI [\-\-] \ command
Any command you want to be ran as fakeroot. Use \(oq\-\-\(cq if in the command
you have other options that may confuse fakeroot's option parsing.
.TP
.BI \-s \ local-state-dir
Keep the
.I pseudo
state directory on exit. This directory holds the
.I pseudo
database files and log files. See the
.I pseudo
documentation on the details on how this directory can be reused.
.TP
.BI \-i \ local-state-dir
Load a
.I pseudo
environment previously saved using \-s from the specified directory.
Note that this does not implicitly save the direcotry, use \-s instead for
that behaviour. Using the same file for both \-i and \-s in a single
.BR fakeroot
invocation is safe.
.TP
.BR \-u ,
.BR \-\-unknown\-is\-real
Does nothing, accepted for compatibility only.
.TP
.BI \-b \ fd
Does nothing, accepted for compatibility only.
.TP
.BI \-h
Display help.
.TP
.BI \-v
Display version.
.SH EXAMPLES
Here is an example session with
.BR fakeroot .
Notice that inside the fake root environment file manipulation that
requires root privileges succeeds, but is not really happening.
.CW
$ whoami
joost
$ fakeroot /bin/bash
# whoami
root
# mknod hda3 b 3 1
# ls \-ld hda3
brw\-r\-\-r\-\- 1 root root 3, 1 Jul 2 22:58 hda3
# chown joost:root hda3
# ls \-ld hda3
brw\-r\-\-r\-\- 1 joost root 3, 1 Jul 2 22:58 hda3
# ls \-ld /
drwxr\-xr\-x 20 root root 1024 Jun 17 21:50 /
# chown joost:users /
# chmod a+w /
# ls \-ld /
drwxrwxrwx 20 joost users 1024 Jun 17 21:50 /
# exit
$ ls \-ld /
drwxr\-xr\-x 20 root root 1024 Jun 17 21:50 //
$ ls \-ld hda3
\-rw\-r\-\-r\-\- 1 joost users 0 Jul 2 22:58 hda3
.CE
Only the effects that user
.B joost
could do anyway happen for real.
.B fakeroot
was specifically written to enable users to create Debian GNU/Linux
packages (in the
.B deb(5)
format) without giving them root privileges.
This can be done by commands like
.B dpkg-buildpackage \-rfakeroot
or
.B debuild \-rfakeroot
(actually, \-rfakeroot is default in debuild nowadays, so you don't
need that argument).
.SH SECURITY ASPECTS
.B fakeroot
is a regular, non-setuid program. It does not enhance a user's
privileges, or decrease the system's security.
.SH BUGS
See
.B pseudo(1)
for the details on the bugs of the underlying fakeroot implementation.
.SH COPYING
.B fakeroot
wrapper for
.B pseudo
is distributed under the GNU General Public License version 3.0 or later.
.B pseudo
itself is distributed under the GNU Lesser General Public License version
2.1 or later.
.SH AUTHORS
The original
.B fakeroot
manual page has mostly been written by J.H.M. Dassen
.RI <jdassen@debian.org>
with rather a lot modifications and additions by joost and Clint.
It was later modified by Andrew Shadura for this fakeroot wrapper for
.BR pseudo .
.SH "SEE ALSO"
.BR pseudo (1),
.BR fakeroot (1),
.BR dpkg\-buildpackage (1),
.BR debuild (1)
|