git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a6f8e8
)
Noted by Vericode analysis. Correctly use chroot().
author
Jeremy Allison
<jra@samba.org>
Fri, 13 Feb 2009 22:59:48 +0000
(14:59 -0800)
committer
Karolin Seeger
<kseeger@samba.org>
Thu, 30 Jul 2009 07:22:12 +0000
(09:22 +0200)
Jeremy.
(cherry picked from commit
3086400b61ee3dda639c5520b539d4ff76e4d9c5
)
source/smbd/server.c
patch
|
blob
|
history
diff --git
a/source/smbd/server.c
b/source/smbd/server.c
index 2ed6792c4a956376539173531543ef0f854843c8..9f13c32b78eeae004f78e70f64a9018ba3ad0aa3 100644
(file)
--- 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 */