diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-10-11 01:22:51 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-10-11 01:22:51 +0000 |
commit | ef4ae86af0e6c90d1f157b7af81b42b834286e45 (patch) | |
tree | 3dbc8d420a5ad4e74e696a0bab038a0a760ac7d2 /nis/nis_subr.c | |
parent | e2779f601298f4feffd3093f1b5ae45e49677bc4 (diff) | |
download | glibc-ef4ae86af0e6c90d1f157b7af81b42b834286e45.zip glibc-ef4ae86af0e6c90d1f157b7af81b42b834286e45.tar.gz glibc-ef4ae86af0e6c90d1f157b7af81b42b834286e45.tar.bz2 |
(nis_getnames): Make sure that we always return at least one entry consisting of the parameter concatenated with the domain.
Diffstat (limited to 'nis/nis_subr.c')
-rw-r--r-- | nis/nis_subr.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nis/nis_subr.c b/nis/nis_subr.c index 40c9270..93e34f1 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; |