|
@ -1513,12 +1513,11 @@ static uid_t uid_by_name(const char* name) { |
|
|
struct passwd pwd; |
|
|
struct passwd pwd; |
|
|
struct passwd* pp; |
|
|
struct passwd* pp; |
|
|
char buf[8192]; |
|
|
char buf[8192]; |
|
|
int rc; |
|
|
|
|
|
|
|
|
|
|
|
errno = 0; |
|
|
errno = 0; |
|
|
pp = NULL; |
|
|
pp = NULL; |
|
|
|
|
|
|
|
|
if ((rc = getpwnam_r(name, &pwd, buf, sizeof(buf), &pp)) == 0 && pp != NULL) { |
|
|
if (getpwnam_r(name, &pwd, buf, sizeof(buf), &pp) == 0 && pp != NULL) { |
|
|
return pp->pw_uid; |
|
|
return pp->pw_uid; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1551,12 +1550,11 @@ static gid_t gid_by_name(const char* name) { |
|
|
struct group pwd; |
|
|
struct group pwd; |
|
|
struct group* pp; |
|
|
struct group* pp; |
|
|
char buf[8192]; |
|
|
char buf[8192]; |
|
|
int rc; |
|
|
|
|
|
|
|
|
|
|
|
errno = 0; |
|
|
errno = 0; |
|
|
pp = NULL; |
|
|
pp = NULL; |
|
|
|
|
|
|
|
|
if ((rc = getgrnam_r(name, &pwd, buf, sizeof(buf), &pp)) == 0 && pp != NULL) { |
|
|
if (getgrnam_r(name, &pwd, buf, sizeof(buf), &pp) == 0 && pp != NULL) { |
|
|
return pp->gr_gid; |
|
|
return pp->gr_gid; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|