mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
[BZ #9781]
* grp/compat-initgroups.c (compat_call): Switch to use malloc when the input line is too long.
This commit is contained in:
@ -1,5 +1,9 @@
|
|||||||
2009-02-06 Ulrich Drepper <drepper@redhat.com>
|
2009-02-06 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
[BZ #9781]
|
||||||
|
* grp/compat-initgroups.c (compat_call): Switch to use malloc when
|
||||||
|
the input line is too long.
|
||||||
|
|
||||||
* po/Makefile (libc.pot): Add f_print as function taking c-format
|
* po/Makefile (libc.pot): Add f_print as function taking c-format
|
||||||
parameter.
|
parameter.
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ compat_call (service_user *nip, const char *user, gid_t group, long int *start,
|
|||||||
{
|
{
|
||||||
struct group grpbuf;
|
struct group grpbuf;
|
||||||
size_t buflen = __sysconf (_SC_GETGR_R_SIZE_MAX);
|
size_t buflen = __sysconf (_SC_GETGR_R_SIZE_MAX);
|
||||||
char *tmpbuf;
|
|
||||||
enum nss_status status;
|
enum nss_status status;
|
||||||
set_function setgrent_fct;
|
set_function setgrent_fct;
|
||||||
get_function getgrent_fct;
|
get_function getgrent_fct;
|
||||||
@ -35,7 +34,9 @@ compat_call (service_user *nip, const char *user, gid_t group, long int *start,
|
|||||||
|
|
||||||
endgrent_fct = __nss_lookup_function (nip, "endgrent");
|
endgrent_fct = __nss_lookup_function (nip, "endgrent");
|
||||||
|
|
||||||
tmpbuf = __alloca (buflen);
|
char *tmpbuf = __alloca (buflen);
|
||||||
|
bool use_malloc = false;
|
||||||
|
enum nss_status result = NSS_STATUS_SUCCESS;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -43,9 +44,21 @@ compat_call (service_user *nip, const char *user, gid_t group, long int *start,
|
|||||||
(&grpbuf, tmpbuf, buflen, errnop)),
|
(&grpbuf, tmpbuf, buflen, errnop)),
|
||||||
status == NSS_STATUS_TRYAGAIN)
|
status == NSS_STATUS_TRYAGAIN)
|
||||||
&& *errnop == ERANGE)
|
&& *errnop == ERANGE)
|
||||||
|
{
|
||||||
|
if (__libc_use_alloca (buflen * 2))
|
||||||
|
tmpbuf = extend_alloca (tmpbuf, buflen, buflen * 2);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
buflen *= 2;
|
buflen *= 2;
|
||||||
tmpbuf = __alloca (buflen);
|
char *newbuf = realloc (use_malloc ? tmpbuf : NULL, buflen);
|
||||||
|
if (newbuf == NULL)
|
||||||
|
{
|
||||||
|
result = NSS_STATUS_TRYAGAIN;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
use_malloc = true;
|
||||||
|
tmpbuf = newbuf;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status != NSS_STATUS_SUCCESS)
|
if (status != NSS_STATUS_SUCCESS)
|
||||||
@ -102,8 +115,11 @@ compat_call (service_user *nip, const char *user, gid_t group, long int *start,
|
|||||||
while (status == NSS_STATUS_SUCCESS);
|
while (status == NSS_STATUS_SUCCESS);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
if (use_malloc)
|
||||||
|
free (tmpbuf);
|
||||||
|
|
||||||
if (endgrent_fct)
|
if (endgrent_fct)
|
||||||
DL_CALL_FCT (endgrent_fct, ());
|
DL_CALL_FCT (endgrent_fct, ());
|
||||||
|
|
||||||
return NSS_STATUS_SUCCESS;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2009-02-06 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
[BZ #9736]
|
||||||
|
* locales/el_CY: Fix frac_digits and int_frac_digits.
|
||||||
|
* locales/el_GR: Likewise.
|
||||||
|
Patch by Clint Adams <schizo@debian.org>.
|
||||||
|
|
||||||
2009-01-28 Ulrich Drepper <drepper@redhat.com>
|
2009-01-28 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
[BZ #9791]
|
[BZ #9791]
|
||||||
|
@ -51,8 +51,8 @@ mon_thousands_sep "<U002E>"
|
|||||||
mon_grouping 3
|
mon_grouping 3
|
||||||
positive_sign ""
|
positive_sign ""
|
||||||
negative_sign "<U002D>"
|
negative_sign "<U002D>"
|
||||||
int_frac_digits 4
|
int_frac_digits 2
|
||||||
frac_digits 4
|
frac_digits 2
|
||||||
p_cs_precedes 0
|
p_cs_precedes 0
|
||||||
p_sep_by_space 0
|
p_sep_by_space 0
|
||||||
n_cs_precedes 1
|
n_cs_precedes 1
|
||||||
|
@ -70,8 +70,8 @@ mon_thousands_sep "<U002E>"
|
|||||||
mon_grouping 3
|
mon_grouping 3
|
||||||
positive_sign ""
|
positive_sign ""
|
||||||
negative_sign "<U002D>"
|
negative_sign "<U002D>"
|
||||||
int_frac_digits 4
|
int_frac_digits 2
|
||||||
frac_digits 4
|
frac_digits 2
|
||||||
p_cs_precedes 0
|
p_cs_precedes 0
|
||||||
p_sep_by_space 0
|
p_sep_by_space 0
|
||||||
n_cs_precedes 1
|
n_cs_precedes 1
|
||||||
|
@ -96,11 +96,10 @@ __res_maybe_init (res_state resp, int preinit)
|
|||||||
{
|
{
|
||||||
if (resp->options & RES_INIT) {
|
if (resp->options & RES_INIT) {
|
||||||
if (__res_initstamp != resp->_u._ext.initstamp) {
|
if (__res_initstamp != resp->_u._ext.initstamp) {
|
||||||
if (resp->nscount > 0) {
|
if (resp->nscount > 0)
|
||||||
__res_iclose (resp, true);
|
__res_iclose (resp, true);
|
||||||
return __res_vinit (resp, 1);
|
return __res_vinit (resp, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
} else if (preinit) {
|
} else if (preinit) {
|
||||||
if (!resp->retrans)
|
if (!resp->retrans)
|
||||||
|
Reference in New Issue
Block a user