Why does a fakechroot exist?


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Why does a fakechroot exist?
# 8  
Old 07-12-2018
The process that chroot starts is a new process; it does not replace an existing process (and certainly does not replace PID 1 in the global zone).

You might be able to use chroot to start a non-global zone with an alternative root directory and have that affect all processes run in that zone, but I no longer have access to a system where I could verify whether or not that would work.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Group Doesn't Exist

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I'm able to create a group but when I'm trying to delete the group it keeps stating Group Doesn't Exist. I know... (2 Replies)
Discussion started by: GoBoyGo
2 Replies

2. Shell Programming and Scripting

Help: Backfile if backup does not exist

I am trying to work on a script that will first check to see if a backup of a file exists, and if it does it will prompt the user to ask if he/she wants it replace. Of course, if the user says no then the file should be skipped. Here is the code I have written. Does it look as if it is working... (1 Reply)
Discussion started by: xshellscriptx
1 Replies

3. UNIX for Dummies Questions & Answers

Does ${%name} exist in csh?

I have this code in tcsh and would like to know whether the syntax below will work in csh. if( "${%rsl}" == 0 ) then echo "rsl is empty" endif ---------- Post updated at 06:38 AM ---------- Previous update was at 05:53 AM ---------- It does not seem so. Perhaps the best thing is to... (2 Replies)
Discussion started by: kristinu
2 Replies

4. Shell Programming and Scripting

if pid exist ?

Hi I need help to whit a script that start a program if a nother program is started first . I thought something like this . if then start program 2 Thanks (4 Replies)
Discussion started by: pelle
4 Replies

5. Shell Programming and Scripting

Find out whether files exist.

I have the following data stored in a file. 1 /home/file13 /home/file2 2 /home/file41 /home/file654 3 /home/file61 /home/file45 4 /home/file81 /home/file43 ... I want to print the first column provided the files represented by the second and third column exist. How to do that? (3 Replies)
Discussion started by: kevintse
3 Replies

6. Shell Programming and Scripting

Group Exist Scripting

Hey People, I've got a question! How can i write a function in a script which is looking for if a group exist and if not, that the group "users" is the standard group..I know that i have to use "grep" und "if-else"..I will be very happy for answers ;) Greetz Ali (2 Replies)
Discussion started by: AliC
2 Replies

7. UNIX for Dummies Questions & Answers

testing if files exist

I am trying to test arguments to see if they are files in any directory. I have : but it's not working (7 Replies)
Discussion started by: skooly5
7 Replies

8. UNIX for Dummies Questions & Answers

su: user x does not exist

somehow my user names and groups on one of our machines are changed to numbers 700, 701, etc. thus, i can only ssh into this machine as root. is there a way to migrate the user names and groups to this machine? thanks! (3 Replies)
Discussion started by: user23
3 Replies

9. UNIX for Dummies Questions & Answers

does it exist in linux?

Is there a jumpstart equivalent tool in the linux environment? (1 Reply)
Discussion started by: pbonilla
1 Replies
Login or Register to Ask a Question
FAKEROOT-NG(1)						   Fakeroot Next Gen User Manual					    FAKEROOT-NG(1)

NAME
fakeroot-ng - run a command while making it believe it is running as root SYNOPSIS
fakeroot-ng [ -llogfile [-f] ] [ -ppersist_file ] [-d] command line DESCRIPTION
This manual page documents the fakeroot-ng command. Fakeroot-ng allows running a process without any change to the permissions, but fooling the process into thinking that it is running with root permissions. This typically involves intercepting certain system calls the process performs and manipulating their results. In order for the effect to be complete enough, previous manipulations have to be remembered, and consistent results returned. The idea behind fakroot-ng was first implemented by a tool called fakeroot(1). This tool used LD_PRELOAD of the dynamic linking to glibc in order to intercept the system calls. While this approach is very rebust and very platform independent, it does suffer in scope. In particu- lar, certain operations (mostly the open(2) system call) could not be intercepted, which caused emulating other operations (mainly the chroot(2) system call) to not be supported. Fakeroot-ng strives to fill those gaps by using a totally different technology for system call interception. Instead of using LD_PRELOAD, ptrace(2) is being used. PARAMETERS
-pstate_file Before the first process is being run, loads from state_file the information needed in order to maintain a consistent view of file permissions and owners across fakeroot-ng runs. This image is also automatically saved when the last process exists. If more then one instance of fakeroot-ng is loaded simultaneously, both with the same state_file, then the two instances will share state and their processes will see the same picture at runtime. -llog_file Causes fakeroot-ng to dump to log_file internal state and processing information. This is mostly useful for cases where fakeroot-ng fails to act as expected. -f Causes the log file to be flushed after every print. Guarantees that the important hint as to why the crash happened will be in the actual file, but has non-negligent performance effect. Only has effect if -l is specified. -d Tells fakeroot-ng not to completely daemonize itself. This is mostly useful in case of crashes that cause a core dump, as the debug- ger would normally change directory to root, which would prevent a core file from being created. -v Print out the version number and copyright info and exit without doing anything. SIGNALS
Sending the ALRM signal to the fakeroot-ng master process makes it dump to the log a complete list of all tracked processes, along with their parent and current state. This is, mostly, a debugging feature. The signal does nothing if -l is not active. ENVIRONMENT VARIABLES AND SHARED MEMORY
Some of the communication between fakeroot-ng and the program being fooled is done through a shared memory mechanism. In order to create it, fakeroot-ng creates a temporary file and maps it into memory as executable segment. Some systems have their /tmp folder mounted with the noexec flag. On those system, the mmap will fail and fakeroot-ng will not run. There are two environment variables that allow fakeroot-ng to find a folder in which the shared memory files can be created. The first is TMPDIR. If it exists, fakeroot-ng will use it to create the temporary files, rather than /tmp. The problem with using TMPDIR for creating temporary files is that fakeroot-ng is not the only one to use it. For that reason, if the environment has a variable called FAEK- ROOT_TMPDIR, its value will override that of either TMPDIR or the default /tmp directory. On Linux, it is usually entirely safe to point FAKEROOT_TMPDIR to /dev/shm, which usually lives up to expectations regarding mount mode and writability. SECURITY CONSIDERATIONS
Fakeroot-ng is a non-SUID executable, and does not modify any sensitive data. It, therefor, does not affect the overall security of the system. One may be tempted, however, to use fakeroot-ng as a security tool, for running processes with reduced privileges or inside a chroot jail. In addition to all the warnings that usually apply to using chroot jails as a security tool (in a nutshell - don't), the fol- lowing should be understood. Unlike previous implementations, fakeroot-ng uses a technology that leaves the traced process no choice regarding whether it will use fake- root-ng's "services" or not. Compiling a program statically, directly calling the kernel and manipulating ones own address space are all techniques that can be trivially used to bypass LD_PRELOAD based control over a process, and do not apply to fakeroot-ng. It is, theoreti- cally, possible to mold fakeroot-ng in such a way as to have total control over the traced process. While it is theoretically possible, it has not been done. Fakeroot-ng does assume certain "nicely behaved" assumptions about the process being traced, and a process that break those assumptions may be able to, if not totally escape then at least circumvent some of the "fake" environment imposed on it by fakeroot-ng. As such, you are strongly warned against using fakeroot-ng as a security tool. Bug reports that claim that a process can deliberatly (as opposed to inadvertly) escape fakeroot-ng's control will either be closed as "not a bug" or marked as low priority. It is possible that this policy be rethought in the future. For the time being, however, you have been warned. BUGS
Plenty of those. See the "README" file for a list of known ones. SEE ALSO
fakeroot(1), fakechroot(1), ptrace(2), ld.so(8), chroot(1) AUTHOR
Fakeroot-ng was written by Shachar Shemesh. This manual page was written by Shachar Shemesh <shachar@debian.org> PROJECT HOMEPAGE AND SUPPORT
http://sourceforge.net/projects/fakerootng Community support is available through the project's mailing list, at https://lists.sourceforge.net/lists/listinfo/fakerootng-devel. Commercial support is available through Shachar's company, Lingnu Open Source Consulting Ltd., at http://www.lingnu.com Shachar Shemesh August 20, 2008 FAKEROOT-NG(1)