apply patch from v3-0-ctdb to special case root in libnss_winbind
authorAndrew Tridgell <tridge@samba.org>
Mon, 21 Apr 2008 16:41:32 +0000 (18:41 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 19 Mar 2009 22:20:27 +0000 (23:20 +0100)
This is needed to ensure the administrator can login to a node even
when ctdbd and winbindd are stuck

source/nsswitch/winbind_nss_linux.c

index c11c18759e65cb4526c6dd32c2ac24322637312a..21c4a7242739b75aeebfb2ceee6859f74b8e96b6 100644 (file)
@@ -1034,6 +1034,14 @@ _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start,
                user, group);
 #endif
 
+       if (strcmp(user, "root") == 0) {
+               /* as a special case, don't return groups for
+                  'root'. This ensures that no matter what state
+                  winbind is in, we can still ssh into the host as
+                  root. */
+               return NSS_STATUS_NOTFOUND;
+       }
+
 #if HAVE_PTHREAD
        pthread_mutex_lock(&winbind_nss_mutex);
 #endif