Initial import
[samba] / debian / patches / ubuntu-winbind-panic.patch
diff --git a/debian/patches/ubuntu-winbind-panic.patch b/debian/patches/ubuntu-winbind-panic.patch
new file mode 100644 (file)
index 0000000..18a75af
--- /dev/null
@@ -0,0 +1,60 @@
+Index: branches/SAMBA_3_0/source/nsswitch/winbindd_util.c
+===================================================================
+--- SAMBA_3_0/source/nsswitch/winbindd_util.c  (revision 14467)
++++ SAMBA_3_0/source/nsswitch/winbindd_util.c  (revision 14468)
+@@ -62,7 +62,7 @@
+       /* Initialise list */
+       if (!_domain_list) 
+-              init_domain_list();
++              init_domain_list(False);
+       return _domain_list;
+ }
+@@ -493,7 +493,7 @@
+ }
+ /* Look up global info for the winbind daemon */
+-void init_domain_list(void)
++BOOL init_domain_list(BOOL initial_start)
+ {
+       extern struct winbindd_methods cache_methods;
+       extern struct winbindd_methods passdb_methods;
+@@ -513,7 +513,11 @@
+               DOM_SID our_sid;
+               if (!secrets_fetch_domain_sid(lp_workgroup(), &our_sid)) {
+-                      smb_panic("Could not fetch our SID - did we join?\n");
++                      if (initial_start) {
++                              return False;
++                      } else {
++                              smb_panic("Could not fetch our SID - did we join?\n");
++                      }
+               }
+       
+               domain = add_trusted_domain( lp_workgroup(), lp_realm(),
+@@ -535,6 +539,8 @@
+                                           get_global_sam_sid());
+               setup_domain_child(domain, &domain->child, NULL);
+       }
++
++      return True;
+ }
+ /** 
+Index: branches/SAMBA_3_0/source/nsswitch/winbindd.c
+===================================================================
+--- SAMBA_3_0/source/nsswitch/winbindd.c       (revision 14467)
++++ SAMBA_3_0/source/nsswitch/winbindd.c       (revision 14468)
+@@ -1067,7 +1067,10 @@
+       netsamlogon_cache_init(); /* Non-critical */
+       
+-      init_domain_list();
++      if (!init_domain_list(True)) {
++              DEBUG(0,("unable to initalize domain list\n"));
++              exit(1);
++      }
+       init_idmap_child();