At implementation of "user" option, the function getpwuid_r()
is used for numeric user id but the variable user is char *
orginally. So to support numeric user id, it should be changed
to integer.
Change-Id: I42d6419075d8ff9f2af0e46a2d6953172b8bf980
Signed-off-by: sunm.lee <sunm.lee@samsung.com>
if (user[i])
getpwnam_r(user, &pwd, buf, sizeof(buf), &spw);
else
- getpwuid_r(user, &pwd, buf, sizeof(buf), &spw);
+ getpwuid_r((uid_t)atoi(user), &pwd, buf, sizeof(buf), &spw);
if (!spw) {
fprintf( stderr, "error! %s isn't standing for a valid user.\n", user);
if (!cont)