This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] +groups ignored
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Thorsten Kukuk <kukuk at suse dot de>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Fri, 27 Jun 2003 13:24:44 +0200
- Subject: Re: [PATCH] +groups ignored
- References: <20030627112052.GA15915@suse.de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jun 27, 2003 at 01:20:52PM +0200, Thorsten Kukuk wrote:
> @@ -300,13 +299,15 @@
> if (result->gr_name[0] == '+' && result->gr_name[1] != '\0'
> && result->gr_name[1] != '@')
> {
> + char buf[strlen (result->gr_name)];
> enum nss_status status;
>
> /* Store the group in the blacklist for the "+" at the end of
> /etc/group */
> - blacklist_store_name (&result->gr_name[1], ent);
> + strcpy (buf, &result->gr_name[1]);
If you already compute strlen (result->gr_name), wouldn't it be better to
use it then (memcpy is faster than strcpy)?
size_t len = strlen (result->gr_name);
char buf[len];
enum nss_status status;
strcpy (buf, &result->gr_name[1], len);
Jakub