summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-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);