Initial import
[samba] / debian / patches / ubuntu-winbind-panic.patch
1 Index: branches/SAMBA_3_0/source/nsswitch/winbindd_util.c
2 ===================================================================
3 --- SAMBA_3_0/source/nsswitch/winbindd_util.c   (revision 14467)
4 +++ SAMBA_3_0/source/nsswitch/winbindd_util.c   (revision 14468)
5 @@ -62,7 +62,7 @@
6         /* Initialise list */
7  
8         if (!_domain_list) 
9 -               init_domain_list();
10 +               init_domain_list(False);
11  
12         return _domain_list;
13  }
14 @@ -493,7 +493,7 @@
15  }
16  
17  /* Look up global info for the winbind daemon */
18 -void init_domain_list(void)
19 +BOOL init_domain_list(BOOL initial_start)
20  {
21         extern struct winbindd_methods cache_methods;
22         extern struct winbindd_methods passdb_methods;
23 @@ -513,7 +513,11 @@
24                 DOM_SID our_sid;
25  
26                 if (!secrets_fetch_domain_sid(lp_workgroup(), &our_sid)) {
27 -                       smb_panic("Could not fetch our SID - did we join?\n");
28 +                       if (initial_start) {
29 +                               return False;
30 +                       } else {
31 +                               smb_panic("Could not fetch our SID - did we join?\n");
32 +                       }
33                 }
34         
35                 domain = add_trusted_domain( lp_workgroup(), lp_realm(),
36 @@ -535,6 +539,8 @@
37                                             get_global_sam_sid());
38                 setup_domain_child(domain, &domain->child, NULL);
39         }
40 +
41 +       return True;
42  }
43  
44  /** 
45 Index: branches/SAMBA_3_0/source/nsswitch/winbindd.c
46 ===================================================================
47 --- SAMBA_3_0/source/nsswitch/winbindd.c        (revision 14467)
48 +++ SAMBA_3_0/source/nsswitch/winbindd.c        (revision 14468)
49 @@ -1067,7 +1067,10 @@
50  
51         netsamlogon_cache_init(); /* Non-critical */
52         
53 -       init_domain_list();
54 +       if (!init_domain_list(True)) {
55 +               DEBUG(0,("unable to initalize domain list\n"));
56 +               exit(1);
57 +       }
58  
59         init_idmap_child();
60