diff options
Diffstat (limited to 'nss')
-rw-r--r-- | nss/nss_files/files-netgrp.c | 34 | ||||
-rw-r--r-- | nss/nss_files/files-parse.c | 2 |
2 files changed, 31 insertions, 5 deletions
diff --git a/nss/nss_files/files-netgrp.c b/nss/nss_files/files-netgrp.c index 8af55f209f..c653825c78 100644 --- a/nss/nss_files/files-netgrp.c +++ b/nss/nss_files/files-netgrp.c @@ -193,7 +193,31 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *result, ++cp; if (*cp != '(') - return first ? NSS_STATUS_NOTFOUND : NSS_STATUS_RETURN; + { + /* We have a list of other netgroups. */ + char *name = cp; + + while (*cp != '\0' && ! isspace (*cp)) + ++cp; + + if (name != cp) + { + /* It is another netgroup name. */ + int last = *cp == '\0'; + + result->type = group_val; + result->val.group = name; + *cp = '\0'; + if (! last) + ++cp; + *cursor = cp; + first = 0; + + return NSS_STATUS_SUCCESS; + } + + return first ? NSS_STATUS_NOTFOUND : NSS_STATUS_RETURN; + } /* Match host name. */ host = ++cp; @@ -225,15 +249,17 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *result, else { memcpy (buffer, host, cp - host); + result->type = triple_val; buffer[(user - host) - 1] = '\0'; - result->host = *host == ',' ? NULL : buffer; + result->val.triple.host = *host == ',' ? NULL : buffer; buffer[(domain - host) - 1] = '\0'; - result->user = *user == ',' ? NULL : buffer + (user - host); + result->val.triple.user = *user == ',' ? NULL : buffer + (user - host); buffer[(cp - host) - 1] = '\0'; - result->domain = *domain == ')' ? NULL : buffer + (domain - host); + result->val.triple.domain = + *domain == ')' ? NULL : buffer + (domain - host); status = NSS_STATUS_SUCCESS; diff --git a/nss/nss_files/files-parse.c b/nss/nss_files/files-parse.c index 9cfa579ea4..6bebfa287c 100644 --- a/nss/nss_files/files-parse.c +++ b/nss/nss_files/files-parse.c @@ -219,6 +219,7 @@ parse_list (char *line, struct parser_data *data, int datalen) return list; } +#endif /* TRAILING_LIST_MEMBER */ #endif /* EXTERN_PARSER */ @@ -234,7 +235,6 @@ parse_list (char *line, struct parser_data *data, int datalen) break; \ } -#endif /* This is defined by db-*.c to include "../nss_db/db-XXX.c" instead. */ #ifndef GENERIC |