nss_wrapper: add support for loading nss_winbind.so via WINBIND_SO_PATH env.
authorGünther Deschner <gd@samba.org>
Thu, 4 Jun 2009 10:26:55 +0000 (12:26 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 5 Jun 2009 23:01:25 +0000 (01:01 +0200)
Guenther

lib/nss_wrapper/nss_wrapper.c

index 4f98b6809619cf308424aebcb3f6f1c19a57d031..73ca6eb3a5e00c3dc999c1b37ef8383c7125ba84 100644 (file)
@@ -480,6 +480,8 @@ static bool nwrap_module_init(const char *name,
 
 static void nwrap_backend_init(struct nwrap_main *r)
 {
+       const char *winbind_so_path = getenv("NSS_WRAPPER_WINBIND_SO_PATH");
+
        r->num_backends = 0;
        r->backends = NULL;
 
@@ -490,6 +492,16 @@ static void nwrap_backend_init(struct nwrap_main *r)
                             __location__));
                return;
        }
+
+       if (winbind_so_path && strlen(winbind_so_path)) {
+               if (!nwrap_module_init("winbind", &nwrap_module_ops, winbind_so_path,
+                                      &r->num_backends,
+                                      &r->backends)) {
+                       NWRAP_ERROR(("%s: failed to initialize 'winbind' backend\n",
+                                    __location__));
+                       return;
+               }
+       }
 }
 
 static void nwrap_init(void)