On Wednesday 17 September 2008 19:00:44 Vladimir Dronnikov wrote:
> AFAIKS, there IS getgrent implemented via getgrent_r(). Nevertheless,
> assume we wanna avoid it. Try
>
> parser_t *parser = config_open2(filename, fopen_or_warn);
> if (parser && pwd) {
> char *group_name;
> while (config_read(parser, &group_name, 1, 1, "#:", PARSE_NORMAL)) {
> // use group_name as needed
> // ...
> }
> config_close(parser);
> }
>
> llist_t* seems saner, but I'd suggest to develop both versions for now.
>
> BTW, why do we use getgrnam() if the names of the aux groups are
> available directly when we read a line from /etc/group?!
Because we get them cleanly packed in a char **gr_mem we can easily walk
through and
because later we need also grp->gr_gid to add it to our list and
parse_config doesn't seem to be able to return gid_t as token.
But I'm not confident in using this new api yet so i could be wrong,
but if you have some ideas.... ;-)
Ciao,
Tito
> Regards,
> --
> Vladimir
>
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox