Don't call getpwuid(3)/getgrgid(3) on uids/gids in the config file. The uid/gid
doesn't need to be in /etc/passwd or /etc/group anyway, and this reduces storage of sensitive information in dgamelaunch's memory space. git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@113 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
20a824b932
commit
9686e206c0
10
config.y
10
config.y
|
@ -113,10 +113,7 @@ KeyPair: KeyType '=' TYPE_VALUE {
|
||||||
case TYPE_SUID:
|
case TYPE_SUID:
|
||||||
if (!myconfig->shed_user)
|
if (!myconfig->shed_user)
|
||||||
{
|
{
|
||||||
if (getpwuid($3) != NULL)
|
myconfig->shed_uid = $3;
|
||||||
myconfig->shed_uid = $3;
|
|
||||||
else
|
|
||||||
fprintf(stderr, "%s: no such uid %lu\n", config, $3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -124,10 +121,7 @@ KeyPair: KeyType '=' TYPE_VALUE {
|
||||||
case TYPE_SGID:
|
case TYPE_SGID:
|
||||||
if (!myconfig->shed_group)
|
if (!myconfig->shed_group)
|
||||||
{
|
{
|
||||||
if (getgrgid($3) != NULL)
|
myconfig->shed_gid = $3;
|
||||||
myconfig->shed_gid = $3;
|
|
||||||
else
|
|
||||||
fprintf(stderr, "%s: no such gid %lu\n", config, $3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue