nscd does not handle "(none)" string
Tomas Sykora <[email protected]>
| Newsgroups | gmane.comp.tools.sudo.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
By default, when no domainname is set, the string "(none)" is returned by getdomainname.
nscd does not handle the "(none)" string, it's really using it to search for entries in its cache.
This domainname value is then used as the domain parameter in the triple (host,user,domain).
I wrote a patch to solve the problem:
diff -up ./plugins/sudoers/match.c.orig ./plugins/sudoers/match.c
--- ./plugins/sudoers/match.c.orig 2016-09-13 13:22:58.299760175 +0200
+++ ./plugins/sudoers/match.c 2016-09-13 13:25:29.874809099 +0200
@@ -1004,7 +1004,10 @@ sudo_getdomainname(void)
# else
rval = getdomainname(domain, host_name_max + 1);
# endif
- if (rval != -1 && domain[0] != '\0') {
+ if (strncmp (domain, "(none)", 7) == 0) {
+ free(domain);
+ domain = NULL;
+ } else if (rval != -1 && domain[0] != '\0') {
const char *cp;
for (cp = domain; *cp != '\0'; cp++) {
Is it possible to add this to upstream?
____________________________________________________________
sudo-workers mailing list <[email protected]>
For list information, options, or to unsubscribe, visit:
https://www.sudo.ws/mailman/listinfo/sudo-workers