[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-3460-gc604236

Jeremy Allison jra at samba.org
Fri Feb 13 23:06:54 GMT 2009


The branch, v3-2-test has been updated
       via  c604236558b0be1b8a8539c7823e22f8e5eea55b (commit)
      from  f7dc45f72145f0bba40c4a2e1a3ac7e4a85fd9cd (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit c604236558b0be1b8a8539c7823e22f8e5eea55b
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Feb 13 15:06:13 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 34a3321..e914118 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -1379,8 +1379,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