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
This commit is contained in:
Todd C. Miller
2013-03-27 03:41:00 -04:00
parent 64e558bcfb
commit ddc1d36a0b

View 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;
}