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:
@@ -28,15 +28,17 @@
|
||||
|
||||
|
||||
/* gets a username given a uid */
|
||||
void my_getpwuid(char *name, long uid)
|
||||
char * my_getpwuid(char *name, long uid)
|
||||
{
|
||||
struct passwd *myuser;
|
||||
|
||||
myuser = getpwuid(uid);
|
||||
if (myuser==NULL)
|
||||
sprintf(name, "%-8ld ", (long)uid);
|
||||
else
|
||||
strcpy(name, myuser->pw_name);
|
||||
if (myuser==NULL) {
|
||||
sprintf(name, "%ld", (long)uid);
|
||||
return NULL;
|
||||
} else {
|
||||
return strcpy(name, myuser->pw_name);
|
||||
}
|
||||
}
|
||||
|
||||
/* END CODE */
|
||||
|
||||
Reference in New Issue
Block a user