Misc fixes to get winbindd working. We can now do a 'getent passwd'
[jra/samba/.git] / source3 / nsswitch / winbindd.c
index 9d315a0811df9348051100cbd13bf0a8c7b42146..9dd995b4aee61709d3250106c243b333978dba13 100644 (file)
@@ -644,6 +644,13 @@ int main(int argc, char **argv)
        BOOL interactive = False;
        int opt, new_debuglevel = -1;
 
+       /* Must be root */
+
+       if(geteuid() != (uid_t)0) {
+               fprintf(stderr, "Must have effective user id of zero.\n");
+               exit(1);
+       }
+
        /* Set environment variable so we don't recursively call ourselves.
           This may also be useful interactively. */
        SETENV(WINBINDD_DONT_ENV, "1", 1);