[SCM] Samba Shared Repository - branch v3-3-test updated -
release-3-2-0pre2-4952-g30a0142
Jeremy Allison
jra at samba.org
Fri Feb 13 23:09:39 GMT 2009
The branch, v3-3-test has been updated
via 30a01422a21bd54b2b3a58729fbf25ab173845e8 (commit)
from d67b92eede5e648b73aea992e009a8996705ffa0 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test
- Log -----------------------------------------------------------------
commit 30a01422a21bd54b2b3a58729fbf25ab173845e8
Author: Jeremy Allison <jra at samba.org>
Date: Fri Feb 13 15:08:57 2009 -0800
Noted by Vericode analysis. Correctly use chroot().
Jeremy.
-----------------------------------------------------------------------
Summary of changes:
source/smbd/server.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/smbd/server.c b/source/smbd/server.c
index 770de41..6edef00 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -1420,8 +1420,15 @@ extern void build_options(bool screen);
}
if (*lp_rootdir()) {
- if (sys_chroot(lp_rootdir()) == 0)
- DEBUG(2,("Changed root to %s\n", lp_rootdir()));
+ if (sys_chroot(lp_rootdir()) != 0) {
+ DEBUG(0,("Failed to change root to %s\n", lp_rootdir()));
+ exit(1);
+ }
+ if (chdir("/") == -1) {
+ DEBUG(0,("Failed to chdir to / on chroot to %s\n", lp_rootdir()));
+ exit(1);
+ }
+ DEBUG(0,("Changed root to %s\n", lp_rootdir()));
}
/* Setup oplocks */
--
Samba Shared Repository
More information about the samba-cvs
mailing list