Le lundi 25 août 2008 à 03:15 +0200, Denys Vlasenko a écrit :
> On Sunday 24 August 2008 21:31, gb wrote:
> > hello
> > 
> > In mdev.conf there are three space-separated fields 
> > - a regex,
> > - a numeric colon-separated uid:gid pair, 
> 
> Not true about "numeric". This is the code:
> 
>                 /* 2nd field: uid:gid - device ownership */
>                 {
>                         struct passwd *pass;
>                         struct group *grp;
>                         char *str_uid = tokens[1];
>                         char *str_gid = strchrnul(str_uid, ':');
> 
>                         if (*str_gid)
>                                 *str_gid++ = '\0';
>                         /* Parse UID */
>                         pass = getpwnam(str_uid);
>                         if (pass)
>                                 uid = pass->pw_uid;
>                         else
>                                 uid = strtoul(str_uid, NULL, 10);
>                         /* Parse GID */
>                         grp = getgrnam(str_gid);
>                         if (grp)
>                                 gid = grp->gr_gid;
>                         else
>                                 gid = strtoul(str_gid, NULL, 10);
>                 }
> 
> It does allow USER:GROUP syntax where either can be a user/group name,
> not numeric ID.
> --
> vda
> 

thank a lot for the aswer.

If i understand i can do something like this in mdev.conf : 

console root:tty @ echo "création de $MDEV"
hdb root:disk @ ln -s $MDEV cdrom

The fonction getgrnam(str_gid) seems to look in /etc/group file (i found
information in manpage)

so my questions become : 

Where find the association between gid and name in /etc/group ?
Can i do what i want ? 
for example in /etc/group change tty:x:5 by terminal:x:5 ?

Again Thank for take time to answer me. (if you understand my poor
engish)



_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to