[SCM] Samba Shared Repository - branch v3-0-test updated -
release-3-0-32-151-g3086400
Jeremy Allison
jra at samba.org
Fri Feb 13 23:00:46 GMT 2009
The branch, v3-0-test has been updated
via 3086400b61ee3dda639c5520b539d4ff76e4d9c5 (commit)
from 58331a118dd6a7fb56e70afe6cf93ef7cfff7e81 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-0-test
- Log -----------------------------------------------------------------
commit 3086400b61ee3dda639c5520b539d4ff76e4d9c5
Author: Jeremy Allison <jra at samba.org>
Date: Fri Feb 13 14:59:48 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 2ed6792..9f13c32 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -1101,8 +1101,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