summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2010-08-09 14:49:08 +0200
committerSimo Sorce <idra@samba.org>2010-08-13 12:20:10 -0400
commite18039062c77947dd4e6d1c841a7c587a85ab8ce (patch)
tree81d6931bb77135876dc0fa99858c99b57b3822a6
parent120bd9775a286e173a22f7c90b61e107887122e4 (diff)
downloadsamba-e18039062c77947dd4e6d1c841a7c587a85ab8ce.tar.gz
samba-e18039062c77947dd4e6d1c841a7c587a85ab8ce.tar.bz2
samba-e18039062c77947dd4e6d1c841a7c587a85ab8ce.zip
s3-smbd: Cleanup the order of the init functions.
Signed-off-by: Simo Sorce <idra@samba.org>
-rw-r--r--source3/smbd/server.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 93d7861469..c41ad6fbaf 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -876,8 +876,6 @@ extern void build_options(bool screen);
setluid(0);
#endif
- sec_init();
-
set_remote_machine_name("smbd", False);
if (interactive && (DEBUGLEVEL >= 9)) {
@@ -893,9 +891,11 @@ extern void build_options(bool screen);
client problems at a later date. (tridge) */
generate_random_buffer(NULL, 0);
+ /* get initial effective uid and gid */
+ sec_init();
+
/* make absolutely sure we run as root - to handle cases where people
are crazy enough to have it setuid */
-
gain_root_privilege();
gain_root_group_privilege();
@@ -930,8 +930,6 @@ extern void build_options(bool screen);
so set our umask to 0 */
umask(0);
- init_sec_ctx();
-
reopen_logs();
DEBUG(0,("smbd version %s started.\n", samba_version_string()));
@@ -953,6 +951,9 @@ extern void build_options(bool screen);
exit(1);
}
+ /* Init the security context and global current_user */
+ init_sec_ctx();
+
if (smbd_messaging_context() == NULL)
exit(1);