.de CW .sp .nf .ie \n(.g .ft CR .el .ft CW .. .\" Process this file with .\" groff -man -Tascii foo.1 .\" .\" "verbatim" environment (from strace.1) .de CE .ft .fi .sp .. .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH fakeroot 1 2024\-12\-19 "Projet Debian" "Manuel de Debian" .\" Manpage by J.H.M. Dassen .\" and Clint Adams .SH NOM fakeroot \- lance une commande dans un environnement simulant les privilèges du superutilisateur pour la manipulation des fichiers. .SH SYNOPSIS \fBfakeroot\fP [\fB\-l\fP|\fB\-\-lib\fP \fIlibrary\fP] [\fB\-\-faked\fP \fIfaked\-binary\fP] [\fB\-i\fP \fIload\-file\fP] [\fB\-s\fP \fIsave\-file\fP] [\fB\-u\fP|\fB\-\-unknown\-is\-real\fP] [\fB\-b\fP|\fB\-\-fd\-base\fP] [\fB\-h\fP|\fB\-\-help\fP] [\fB\-v\fP|\fB\-\-version\fP] [\fB\-\-\fP] [\fIcommand\fP] .SH DESCRIPTION \fBfakeroot\fP lance une commande dans un environnement dans lequel cette commande obtient les droits de l'administrateur pour manipuler des fichiers. C'est pratique pour permettre aux utilisateurs de créer des archives (tar, ar, .deb, etc.) qui contiennent des fichiers avec les privilèges et appartenances du superutilisateur. Sans \fBfakeroot\fP, il faudrait posséder les droits du superutilisateur pour donner les droits et appartenances convenables aux fichiers constituant l'archive, puis de les assembler\ ; ou bien, il faudrait construire directement l'archive, sans utiliser le programme d'archivage. \fBfakeroot\fP works by replacing 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. These wrapper functions are in a shared library \fB/usr/lib/*/libfakeroot\-*.so\fP or similar location on your platform. The shared object is loaded through the \fBLD_PRELOAD\fP mechanism of the dynamic loader. (See \fBld.so\fP(8)) Si vous désirez construire des paquets avec \fBfakeroot\fP, veuillez essayer de construire d'abord le paquet fakeroot\ : l'étape «\ debian/rules build\ » réalise quelques tests (principalement pour les bogues des vieilles versions de fakeroot). Si ces tests échouent (si vous avez par exemple certains programmes en libc5 sur votre système), la construction d'autres paquets avec fakeroot échouera certainement aussi, mais de façon parfois plus subtile. Also, note that it's best not to do the building of the binaries themselves under fakeroot. Especially configure and friends don't like it when the system suddenly behaves differently from what they expect (or, they randomly unset some environment variables, some of which fakeroot needs). .SH OPTIONS .TP \fB\-l\fP \fIbibliothèque\fP, \fB\-\-lib\fP \fIbibliothèque\fP Spécifie une autre bibliothèque de substitution (wrapper library). .TP \fB\-\-faked\fP\fI\ binaire\fP Spécifie l'utilisation d'une autre bibliothèque que faked. .TP \fB[\-\-]\fP\fI\ commande\fP Any command you want to be run as fakeroot. Use \(oq\-\-\(cq if in the command you have other options that may confuse fakeroot's option parsing. .TP \fB\-s\fP\fI\ fichier\-de\-sauvegarde\fP Enregistre l'environnement de fakeroot dans fichier\-de\-sauvegarde en quittant. Ce fichier pourra servir plus tard à restaurer cette configuration grâce à l'option \-i. Toutefois, cette option échouera et fakeroot se comportera bizarrement sauf si vous laissez les fichiers manipulés par fakeroot intacts quand vous êtes en dehors de cet environnement. Malgré cette restriction, cela peut être utile. Par exemple, cela peut servir avec rsync(1) pour sauvegarder et restaurer toute une arborescence de répertoires avec les informations de propriétaire, groupe et périphérique sans avoir à être superutilisateur. Voir \fI/usr/share/doc/fakeroot/README.saving\fP pour plus d'informations. .TP \fB\-i\fP\fI\ fichier\-de\-chargement\fP Recharge à partir de fichier\-de\-chargement un environnement fakeroot préalablement sauvegardé en utilisant l'option \-s. Notez que cela ne sauvegardera pas automatiquement la configuration, vous devez repréciser \-s dans ce but. L'utilisation du même nom de fichier pour \-i et \-s dans une seule commande \fBfakeroot\fP ne pose pas de problème. .TP \fB\-u\fP, \fB\-\-unknown\-is\-real\fP Utilise le véritable propriétaire des fichiers auparavant inconnus de fakeroot, plutôt que de considérer qu'ils appartiennent à root:root. .TP \fB\-b\fP\fI\ fd\fP Définit la valeur de base du descripteur de fichier (en mode TCP uniquement). Fd sera la plus petite valeur du descripteur de fichier utilisé pour les connexions TCP. Ce réglage peut être très pratique pour gérer les descripteurs de fichiers utilisés par les programmes qui fonctionnent sous fakeroot. .TP \fB\-h\fP Affiche l'aide. .TP \fB\-v\fP Affiche la version. .SH EXEMPLES Voici un exemple d'utilisation de \fBfakeroot\fP. Notez bien qu'à l'intérieur de l'environnement fakeroot, les manipulations de fichiers qui requièrent les privilèges du superutilisateur ont lieu, mais uniquement virtuellement. .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 Seule l'opération que l'utilisateur \fBjoost\fP pouvait réaliser a réellement aboutie. \fBfakeroot\fP was specifically written to enable users to create Debian GNU/Linux packages (in the \fBdeb\fP(5) format) without giving them root privileges. This can be done by commands like \fBdpkg\-buildpackage \-rfakeroot\fP or \fBdebuild \-rfakeroot\fP (actually, \-rfakeroot is default in debuild nowadays, so you don't need that argument). .SH "ASPECTS DE SÉCURITÉ" \fBfakeroot\fP est un programme normal, sans privilèges spéciaux. Il n'augmente pas les privilèges de l'utilisateur et n'altère pas la sécurité du système. .SH FICHIERS \fI/usr/lib/*/libfakeroot\-*.so\fP The shared library containing the wrapper functions. .SH ENVIRONNEMENT .IP \fBFAKEROOTKEY\fP The key used to communicate with the fakeroot daemon. Any program started with the right \fBLD_PRELOAD\fP and a \fBFAKEROOTKEY\fP of a running daemon will automatically connect to that daemon, and have the same "fake" view of the file system's permissions/ownerships (assuming the daemon and connecting program were started by the same user). .IP \fBLD_LIBRARY_PATH\fP .IP \fBLD_PRELOAD\fP fakeroot is implemented by wrapping system calls. This is accomplished by setting LD_LIBRARY_PATH=/usr/lib/fakeroot and LD_PRELOAD=libfakeroot.so.0. That library is loaded before the system's C library, and so most of the library functions are intercepted by it. If you need to set either \fBLD_LIBRARY_PATH\fP or \fBLD_PRELOAD\fP from within a fakeroot environment, it should be set relative to the given paths, as in \fBLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/foo/bar/\fP .SH LIMITES .IP "\fBVersions des bibliothèques\fP" Toute commande exécutée sous \fBfakeroot\fP devra être liée à la même version de la bibliothèque C que \fBfakeroot\fP lui\-même. .IP \fBopen()/create()\fP fakeroot n'encapsule pas open(), create(), etc. Donc si l'utilisateur \fBjoost\fP tape soit .CW touch foo fakeroot ls \-al foo .CE soit .CW fakeroot touch foo ls \-al foo .CE fakeroot has no way of knowing that in the first case, the owner of foo really should be \fBjoost\fP while the second case it should have been \fBroot\fP. For the Debian packaging, defaulting to giving all "unknown" files uid=gid=0, is always OK. The real way around this is to wrap \fBopen()\fP and \fBcreate()\fP, but that creates other problems, as demonstrated by the libtricks package. This package wrapped many more functions, and tried to do a lot more than \fBfakeroot .\fP It turned out that a minor upgrade of libc (from one where the \fBstat\fP() function didn't use \fBopen\fP() to one with a \fBstat\fP() function that did (in some cases) use \fBopen\fP() ), would cause unexplainable segfaults (that is, the libc6 \fBstat\fP() called the wrapped \fBopen\fP() , which would then call the libc6 \fBstat\fP() , etc). Fixing them wasn't all that easy, but once fixed, it was just a matter of time before another function started to use open(), never mind trying to port it to a different operating system. Thus I decided to keep the number of functions wrapped by fakeroot as small as possible, to limit the likelihood of \(oqcollisions\(cq. .IP "GNU configure (and other such programs)" En pratique, fakeroot modifie le comportement du système. Les programmes qui testent le système (tel que configure du GNU) peuvent être troublés par cela (ou, s'ils ne le sont pas, ils risquent de solliciter fakeroot à un point tel que celui\-ci risque lui\-même de s'y perdre). Il est donc préférable de ne pas lancer «\ configure\ » dans un environnement fakeroot. Comme configure doit être lancé par la cible build de debian/rules, l'utilisation de «\ dpkg\-buildpackage \-rfakeroot\ » gère correctement ce problème. .SH BOGUES open() n'est pas simulé. Ce n'est pas si grave que cela, mais si un programme invoque open("file", O_WRONLY, 000), écrit dans ce fichier «\ file\ », le ferme, puis réessaye ensuite de l'ouvrir en lecture, alors cette tentative échouera, car les droits du fichier seront 000. Le bogue, c'est que si root fait cette opération, alors open() fonctionne, puisque les droits des fichiers ne sont pas du tout vérifiés pour root. Il a été choisi de ne pas simuler open(), car open() est utilisé par nombre d'autres fonctions de la libc (dont certaines qui sont déjà simulées par fakeroot), ce qui créerait des boucles (ou pourrait en créer quand l'implémentation des diverses fonctions de la libc change). .SH COPIES \fBfakeroot\fP est distribué sous la licence GNU General Public License. (GPL 2.0 ou supérieure). .SH AUTEURS .TP Joost Witteveen <\fIjoostje@debian.org\fP> .TP Clint Adams <\fIclint@debian.org\fP> .TP Timo Savola .SH TRADUCTION Sylvain Cherrier . .SH "PAGE DE MANUEL" mostly by J.H.M. Dassen \fB<\fP\fIjdassen@debian.org\fP\fB>\fP with rather a lot of modsifications and additions by joost and Clint. .SH "VOIR AUSSI" \fBdebuild\fP(1), \fBdpkg\-buildpackage\fP(1), \fBfaked\fP(1), \fB/usr/share/doc/fakeroot/DEBUG\fP