From e18039062c77947dd4e6d1c841a7c587a85ab8ce Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 9 Aug 2010 14:49:08 +0200 Subject: s3-smbd: Cleanup the order of the init functions. Signed-off-by: Simo Sorce --- source3/smbd/server.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source3/smbd/server.c') 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); -- cgit