diff options
author | Günther Deschner <gd@samba.org> | 2006-02-23 16:51:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:10:21 -0500 |
commit | e18349b2bb6f4df9c6d08a3d62cfbf012f7f3660 (patch) | |
tree | 2c34a52cad3c5d38842ba1b4e9a9dc4f78853bc6 | |
parent | 379bd6865f2fa46ea28024ad2bb2162ccfbb0db7 (diff) | |
download | samba-e18349b2bb6f4df9c6d08a3d62cfbf012f7f3660.tar.gz samba-e18349b2bb6f4df9c6d08a3d62cfbf012f7f3660.tar.bz2 samba-e18349b2bb6f4df9c6d08a3d62cfbf012f7f3660.zip |
r13660: Attempt to better handle the failure that we cannot find our sid upon
startup; don't panic, shutdown instead.
Guenther
(This used to be commit f209192e26c12fd48feb6195b724715fbada8b85)
-rw-r--r-- | source3/nsswitch/winbindd.c | 7 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_util.c | 12 |
2 files changed, 13 insertions, 6 deletions
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c index 8314c65c64..f9ba80e533 100644 --- a/source3/nsswitch/winbindd.c +++ b/source3/nsswitch/winbindd.c @@ -1054,7 +1054,7 @@ int main(int argc, char **argv) /* Initialise messaging system */ if (!message_init()) { - DEBUG(0, ("unable to initialise messaging system\n")); + DEBUG(0, ("unable to initialize messaging system\n")); exit(1); } @@ -1071,7 +1071,10 @@ int main(int argc, char **argv) netsamlogon_cache_init(); /* Non-critical */ - init_domain_list(); + if (!init_domain_list()) { + DEBUG(0, ("unable to initialize domain list\n")); + exit(1); + } init_idmap_child(); diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index 349ca21652..0678376e8f 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -61,8 +61,9 @@ struct winbindd_domain *domain_list(void) { /* Initialise list */ - if (!_domain_list) - init_domain_list(); + if (!_domain_list && !init_domain_list()) { + return NULL; + } return _domain_list; } @@ -498,7 +499,7 @@ enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domai } /* Look up global info for the winbind daemon */ -void init_domain_list(void) +BOOL init_domain_list(void) { extern struct winbindd_methods cache_methods; extern struct winbindd_methods passdb_methods; @@ -518,7 +519,8 @@ void init_domain_list(void) DOM_SID our_sid; if (!secrets_fetch_domain_sid(lp_workgroup(), &our_sid)) { - smb_panic("Could not fetch our SID - did we join?\n"); + DEBUG(0,("Could not fetch our SID - did we join?\n")); + return False; } domain = add_trusted_domain( lp_workgroup(), lp_realm(), @@ -540,6 +542,8 @@ void init_domain_list(void) get_global_sam_sid()); setup_domain_child(domain, &domain->child, NULL); } + + return True; } /** |