]> granicus.if.org Git - sudo/commitdiff
RHEL (and perhaps other Linux distros) use the string "(none)"
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 27 Mar 2013 07:41:00 +0000 (03:41 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 27 Mar 2013 07:41:00 +0000 (03:41 -0400)
instead of an empty string when there is no actual NIS-style domain
name.  Bug #596

plugins/sudoers/match.c

index bab290db0393f4a37e987f4f9bf432814cf54200..7ecefa7f97d942da969992c9c83fa5745f910ed5 100644 (file)
@@ -789,7 +789,8 @@ netgr_matches(char *netgr, char *lhost, char *shost, char *user)
     /* get the domain name (if any) */
     if (!initialized) {
        domain = (char *) emalloc(HOST_NAME_MAX + 1);
-       if (getdomainname(domain, HOST_NAME_MAX + 1) == -1 || *domain == '\0') {
+       if (getdomainname(domain, HOST_NAME_MAX + 1) == -1 || *domain == '\0' ||
+           strcmp(domain, "(none)") == 0) {
            efree(domain);
            domain = NULL;
        }