summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-04-18 09:02:58 +0000
committerVolker Lendecke <vlendec@samba.org>2006-04-18 09:02:58 +0000
commitf795397e383cf8ad5c0136d033c185b9e6175b83 (patch)
tree7b80e37585662162c2824ba68d557a48dbb43383
parent596107123ea3c3ecc6465a168ddb6760941a56be (diff)
downloadsamba-f795397e383cf8ad5c0136d033c185b9e6175b83.tar.gz
r15119: Initialize our global sam sid first, quite a lot of the other initialization
routines further down depend on it. Fix bug 3696. Volker
-rw-r--r--source/smbd/server.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/source/smbd/server.c b/source/smbd/server.c
index d5a678b8508..a1466c408d2 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -912,6 +912,28 @@ void build_options(BOOL screen);
if (!message_init())
exit(1);
+ /* Initialize our global sam sid first -- quite a lot of the other
+ * initialization routines further down depend on it.
+ */
+
+ /* Initialise the password backed before the global_sam_sid
+ to ensure that we fetch from ldap before we make a domain sid up */
+
+ if(!initialize_password_db(False))
+ exit(1);
+
+ /* Fail gracefully if we can't open secrets.tdb */
+
+ if (!secrets_init()) {
+ DEBUG(0, ("ERROR: smbd can not open secrets.tdb\n"));
+ exit(1);
+ }
+
+ if(!get_global_sam_sid()) {
+ DEBUG(0,("ERROR: Samba cannot create a SAM SID.\n"));
+ exit(1);
+ }
+
if (!session_init())
exit(1);
@@ -965,17 +987,6 @@ void build_options(BOOL screen);
* everything after this point is run after the fork()
*/
- /* Initialise the password backed before the global_sam_sid
- to ensure that we fetch from ldap before we make a domain sid up */
-
- if(!initialize_password_db(False))
- exit(1);
-
- if(!get_global_sam_sid()) {
- DEBUG(0,("ERROR: Samba cannot create a SAM SID.\n"));
- exit(1);
- }
-
static_init_rpc;
init_modules();