mdev.conf
Denys Vlasenko
vda.linux at googlemail.com
Mon Aug 25 01:15:04 UTC 2008
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
More information about the busybox
mailing list