about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nis/nis_subr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/nis/nis_subr.c b/nis/nis_subr.c
index 40c9270501..93e34f13cb 100644
--- a/nis/nis_subr.c
+++ b/nis/nis_subr.c
@@ -275,6 +275,13 @@ nis_getnames (const_nis_name name)
       cp = __strtok_r (NULL, ":", &saveptr);
     }
 
+  if (pos == 0
+      && __asprintf (&getnames[pos++], "%s%s%s%s",
+		     name, name[name_len - 1] == '.' ? "" : ".",
+		     local_domain,
+		     local_domain[local_domain_len - 1] == '.' ? "" : ".") < 0)
+    goto free_null;
+
   getnames[pos] = NULL;
 
   return getnames;