samba-cvs.cvs
[Top] [All Lists]

svn commit: samba r13660 - branches/SAMBA_3_0/source/nsswitch trunk/sour

Subject: svn commit: samba r13660 - branches/SAMBA_3_0/source/nsswitch trunk/source/nsswitch
From:
Date: Thu, 23 Feb 2006 16:51:54 +0000 GMT
Author: gd
Date: 2006-02-23 16:51:53 +0000 (Thu, 23 Feb 2006)
New Revision: 13660

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13660

Log:
Attempt to better handle the failure that we cannot find our sid upon
startup; don't panic, shutdown instead.

Guenther

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_util.c
   trunk/source/nsswitch/winbindd.c
   trunk/source/nsswitch/winbindd_util.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd.c       2006-02-23 16:28:33 UTC 
(rev 13659)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd.c       2006-02-23 16:51:53 UTC 
(rev 13660)
@@ -1054,7 +1054,7 @@
        /* 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 @@
 
        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();
 

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_util.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_util.c  2006-02-23 16:28:33 UTC 
(rev 13659)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_util.c  2006-02-23 16:51:53 UTC 
(rev 13660)
@@ -61,8 +61,9 @@
 {
        /* Initialise list */
 
-       if (!_domain_list) 
-               init_domain_list();
+       if (!_domain_list && !init_domain_list()) {
+               return NULL;
+       }
 
        return _domain_list;
 }
@@ -498,7 +499,7 @@
 }
 
 /* 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 @@
                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 @@
                                            get_global_sam_sid());
                setup_domain_child(domain, &domain->child, NULL);
        }
+
+       return True;
 }
 
 /** 

Modified: trunk/source/nsswitch/winbindd.c
===================================================================
--- trunk/source/nsswitch/winbindd.c    2006-02-23 16:28:33 UTC (rev 13659)
+++ trunk/source/nsswitch/winbindd.c    2006-02-23 16:51:53 UTC (rev 13660)
@@ -1054,7 +1054,7 @@
        /* 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 @@
 
        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();
 

Modified: trunk/source/nsswitch/winbindd_util.c
===================================================================
--- trunk/source/nsswitch/winbindd_util.c       2006-02-23 16:28:33 UTC (rev 
13659)
+++ trunk/source/nsswitch/winbindd_util.c       2006-02-23 16:51:53 UTC (rev 
13660)
@@ -61,8 +61,9 @@
 {
        /* Initialise list */
 
-       if (!_domain_list) 
-               init_domain_list();
+       if (!_domain_list && !init_domain_list()) {
+               return NULL;
+       }
 
        return _domain_list;
 }
@@ -498,7 +499,7 @@
 }
 
 /* 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 @@
                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 @@
                                            get_global_sam_sid());
                setup_domain_child(domain, &domain->child, NULL);
        }
+
+       return True;
 }
 
 /** 

<Prev in Thread] Current Thread [Next in Thread>
  • svn commit: samba r13660 - branches/SAMBA_3_0/source/nsswitch trunk/source/nsswitch, gd <=