From ddc1d36a0b75da8c7b2cb7277f4ab3ee37d2e524 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 27 Mar 2013 03:41:00 -0400 Subject: [PATCH] RHEL (and perhaps other Linux distros) use the string "(none)" instead of an empty string when there is no actual NIS-style domain name. Bug #596 --- plugins/sudoers/match.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/sudoers/match.c b/plugins/sudoers/match.c index bab290db0..7ecefa7f9 100644 --- a/plugins/sudoers/match.c +++ b/plugins/sudoers/match.c @@ -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; }