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:
Jilles Tjoelker 2004-01-07 12:00:41 +00:00
parent 20a824b932
commit 9686e206c0
1 changed files with 2 additions and 8 deletions

View File

@ -113,10 +113,7 @@ KeyPair: KeyType '=' TYPE_VALUE {
case TYPE_SUID:
if (!myconfig->shed_user)
{
if (getpwuid($3) != NULL)
myconfig->shed_uid = $3;
else
fprintf(stderr, "%s: no such uid %lu\n", config, $3);
myconfig->shed_uid = $3;
}
break;
@ -124,10 +121,7 @@ KeyPair: KeyType '=' TYPE_VALUE {
case TYPE_SGID:
if (!myconfig->shed_group)
{
if (getgrgid($3) != NULL)
myconfig->shed_gid = $3;
else
fprintf(stderr, "%s: no such gid %lu\n", config, $3);
myconfig->shed_gid = $3;
}
break;