Alle venerdì 27 aprile 2012, Roland McGrath ha scritto: > > 2012-04-27 Pino Toscano <toscano.p...@tiscali.it> > > > > * sysdeps/mach/hurd/getgroups.c (__getgroups): Return -1 and set > > EINVAL for negative `n' or less than `ngids'. > > The norm is to use all caps and no quotes to mention local variable > names. You can also drop the (function) when it's the only function > in the file of the same name.
Ah ok, fixed patch attached. Where can I read about these two change log style settings (i.e. variables as all caps, and no (function) when it's the only one in a file)? I don't remember them in the official pages[1], so maybe I missed some documentation... [1] http://www.gnu.org/prep/standards/html_node/Change-Logs.html > Since I see you already have > copyright paperwork and you're doing more than just the one change, > would you like to get set up to commit yourself? Given also my contributions so far, I guess that I should better need review for now, no? -- Pino Toscano
hurd: compliance fixes for getgroups Fail with EINVAL when the requested number of groups is negative, or when it is positive but less than the actual number of groups. 2012-04-28 Pino Toscano <toscano.p...@tiscali.it> * sysdeps/mach/hurd/getgroups.c: Return -1 and set EINVAL for negative N or less than NGIDS. --- a/sysdeps/mach/hurd/getgroups.c +++ b/sysdeps/mach/hurd/getgroups.c @@ -31,6 +31,9 @@ int ngids; void *crit; + if (n < 0) + return __hurd_fail (EINVAL); + crit = _hurd_critical_section_lock (); __mutex_lock (&_hurd_id.lock); @@ -54,7 +57,7 @@ /* Now that the lock is released, we can safely copy the group set into the user's array, which might fault. */ if (ngids > n) - ngids = n; + return __hurd_fail (EINVAL); memcpy (gidset, gids, ngids * sizeof (gid_t)); } else
signature.asc
Description: This is a digitally signed message part.