Vodz' last_patch57:
Hi, Erik. my_getpw(uid/gid) and applets used it have problem: if username for uid not found, applets can`t detect it (but code pessent). Also "%8ld " format is bad: spaces not required (applets have self format or spec format (tar applet) and overflow for "id" applet...) This problem also pressent in stable version. Patch for unstable in attach. --w vodz
This commit is contained in:
@ -27,15 +27,17 @@
|
||||
|
||||
|
||||
/* gets a groupname given a gid */
|
||||
void my_getgrgid(char *group, long gid)
|
||||
char * my_getgrgid(char *group, long gid)
|
||||
{
|
||||
struct group *mygroup;
|
||||
|
||||
mygroup = getgrgid(gid);
|
||||
if (mygroup==NULL)
|
||||
sprintf(group, "%-8ld ", (long)gid);
|
||||
else
|
||||
strcpy(group, mygroup->gr_name);
|
||||
if (mygroup==NULL) {
|
||||
sprintf(group, "%ld", gid);
|
||||
return NULL;
|
||||
} else {
|
||||
return strcpy(group, mygroup->gr_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user