summaryrefslogtreecommitdiffstats
path: root/lib/root_flag.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 16:18:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 16:18:36 +0000
commit6c3ea4f47ea280811a7fe53a22f7832e4533c9ec (patch)
tree3d7ed5da23b5dbf6f9e450dfb61642832249c31e /lib/root_flag.c
parentAdding upstream version 1:4.13+dfsg1. (diff)
downloadshadow-6c3ea4f47ea280811a7fe53a22f7832e4533c9ec.tar.xz
shadow-6c3ea4f47ea280811a7fe53a22f7832e4533c9ec.zip
Adding upstream version 1:4.15.2.upstream/1%4.15.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--lib/root_flag.c (renamed from libmisc/root_flag.c)8
1 files changed, 4 insertions, 4 deletions
diff --git a/libmisc/root_flag.c b/lib/root_flag.c
index 62915b0..5572831 100644
--- a/libmisc/root_flag.c
+++ b/lib/root_flag.c
@@ -91,16 +91,16 @@ static void change_root (const char* newroot)
exit (E_BAD_ARG);
}
- if (chdir (newroot) != 0) {
+ if (chroot (newroot) != 0) {
fprintf(log_get_logfd(),
- _("%s: cannot chdir to chroot directory %s: %s\n"),
+ _("%s: unable to chroot to directory %s: %s\n"),
log_get_progname(), newroot, strerror (errno));
exit (E_BAD_ARG);
}
- if (chroot (newroot) != 0) {
+ if (chdir ("/") != 0) {
fprintf(log_get_logfd(),
- _("%s: unable to chroot to directory %s: %s\n"),
+ _("%s: cannot chdir in chroot directory %s: %s\n"),
log_get_progname(), newroot, strerror (errno));
exit (E_BAD_ARG);
}