use chdir() before calling chroot()
This commit is contained in:
parent
9be164101d
commit
4e65be1211
@ -1,3 +1,10 @@
|
||||
2013-07-29 Michael Scherer <misc-guest@alioth.debian.org>
|
||||
|
||||
* libmisc/root_flag.c: use chdir() before calling chroot() to
|
||||
avoid potential security issue (see
|
||||
http://www.bpfh.net/simes/computing/chroot-break.html)
|
||||
Closes: alioth#313962
|
||||
|
||||
2013-07-29 Christian Perrier <christian@perrier.eu.org>
|
||||
|
||||
* man/useradd.xml: use "--home-dir" instead of "--home"
|
||||
|
@ -106,6 +106,14 @@ static void change_root (const char* newroot)
|
||||
Prog, newroot, strerror (errno));
|
||||
exit (E_BAD_ARG);
|
||||
}
|
||||
|
||||
if (chdir (newroot) != 0) {
|
||||
fprintf(stderr,
|
||||
_("%s: cannot chdir to chroot directory %s: %s\n"),
|
||||
Prog, newroot, strerror (errno));
|
||||
exit (E_BAD_ARG);
|
||||
}
|
||||
|
||||
if (chroot (newroot) != 0) {
|
||||
fprintf(stderr,
|
||||
_("%s: unable to chroot to directory %s: %s\n"),
|
||||
|
Loading…
Reference in New Issue
Block a user