diff options
author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/glibc/glibc-2.3.2/nss_compat-shadow.patch | |
parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) | |
download | openembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/glibc/glibc-2.3.2/nss_compat-shadow.patch')
-rw-r--r-- | recipes/glibc/glibc-2.3.2/nss_compat-shadow.patch | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/recipes/glibc/glibc-2.3.2/nss_compat-shadow.patch b/recipes/glibc/glibc-2.3.2/nss_compat-shadow.patch new file mode 100644 index 0000000000..1fc774aadb --- /dev/null +++ b/recipes/glibc/glibc-2.3.2/nss_compat-shadow.patch @@ -0,0 +1,128 @@ +--- nis/nss_compat/compat-spwd.c ++++ nis/nss_compat/compat-spwd.c 2003/09/01 15:14:14 +@@ -435,7 +435,7 @@ + copy_spwd_changes (result, &pwd, p, plen); + give_spwd_free (&pwd); + /* We found the entry. */ +- return NSS_STATUS_RETURN; ++ return NSS_STATUS_SUCCESS; + } + + static enum nss_status +@@ -539,13 +539,16 @@ + if (result->sp_namp[0] == '+' && result->sp_namp[1] != '\0' + && result->sp_namp[1] != '@') + { ++ size_t len = strlen (result->sp_namp); ++ char buf[len]; + enum nss_status status; + + /* Store the User in the blacklist for the "+" at the end of + /etc/passwd */ +- blacklist_store_name (&result->sp_namp[1], ent); ++ memcpy (buf, &result->sp_namp[1], len); + status = getspnam_plususer (&result->sp_namp[1], result, ent, + buffer, buflen, errnop); ++ blacklist_store_name (buf, ent); + + if (status == NSS_STATUS_SUCCESS) /* We found the entry. */ + break; +@@ -653,6 +656,9 @@ + return NSS_STATUS_TRYAGAIN; + } + ++ /* Terminate the line for any case. */ ++ buffer[buflen - 1] = '\0'; ++ + /* Skip leading blanks. */ + while (isspace (*p)) + ++p; +@@ -686,21 +692,8 @@ + if (result->sp_namp[0] == '-' && result->sp_namp[1] == '@' + && result->sp_namp[2] != '\0') + { +- /* XXX Do not use fixed length buffers. */ +- char buf2[1024]; +- char *user, *host, *domain; +- struct __netgrent netgrdata; +- +- bzero (&netgrdata, sizeof (struct __netgrent)); +- __internal_setnetgrent (&result->sp_namp[2], &netgrdata); +- while (__internal_getnetgrent_r (&host, &user, &domain, &netgrdata, +- buf2, sizeof (buf2), errnop)) +- { +- if (user != NULL && user[0] != '-') +- if (strcmp (user, name) == 0) +- return NSS_STATUS_NOTFOUND; +- } +- __internal_endnetgrent (&netgrdata); ++ if (innetgr (&result->sp_namp[2], NULL, name, NULL)) ++ return NSS_STATUS_NOTFOUND; + continue; + } + +@@ -708,25 +701,18 @@ + if (result->sp_namp[0] == '+' && result->sp_namp[1] == '@' + && result->sp_namp[2] != '\0') + { +- char *buf = strdupa (&result->sp_namp[2]); +- int status; ++ enum nss_status status; + +- ent->netgroup = TRUE; +- ent->first = TRUE; +- copy_spwd_changes (&ent->pwd, result, NULL, 0); ++ if (innetgr (&result->sp_namp[2], NULL, name, NULL)) ++ { ++ status = getspnam_plususer (name, result, ent, buffer, ++ buflen, errnop); + +- do +- { +- status = getspent_next_nss_netgr (name, result, ent, buf, +- buffer, buflen, errnop); +- if (status == NSS_STATUS_RETURN) +- continue; ++ if (status == NSS_STATUS_RETURN) ++ continue; + +- if (status == NSS_STATUS_SUCCESS +- && strcmp (result->sp_namp, name) == 0) +- return NSS_STATUS_SUCCESS; +- } +- while (status == NSS_STATUS_SUCCESS); ++ return status; ++ } + continue; + } + +@@ -767,10 +753,12 @@ + status = getspnam_plususer (name, result, ent, + buffer, buflen, errnop); + +- if (status == NSS_STATUS_RETURN) /* We couldn't parse the entry */ +- return NSS_STATUS_NOTFOUND; +- else +- return status; ++ if (status == NSS_STATUS_SUCCESS) /* We found the entry. */ ++ break; ++ else if (status == NSS_STATUS_RETURN) /* We couldn't parse the entry */ ++ return NSS_STATUS_NOTFOUND; ++ else ++ return status; + } + } + return NSS_STATUS_SUCCESS; +@@ -796,10 +784,8 @@ + + result = internal_setspent (&ent, 0); + +- if (result != NSS_STATUS_SUCCESS) +- return result; +- +- result = internal_getspnam_r (name, pwd, &ent, buffer, buflen, errnop); ++ if (result == NSS_STATUS_SUCCESS) ++ result = internal_getspnam_r (name, pwd, &ent, buffer, buflen, errnop); + + internal_endspent (&ent); + |