chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util: user parse_uid() wherever applicable
[elogind.git]
/
src
/
execute.c
diff --git
a/src/execute.c
b/src/execute.c
index 92f4eafd3570287b5e42f8e7cc4dc5ce06fd51c8..40af7d65f1864717f2ce34f72307c434256cbfd1 100644
(file)
--- a/
src/execute.c
+++ b/
src/execute.c
@@
-551,7
+551,7
@@
static int restore_confirm_stdio(const ExecContext *context,
static int get_group_creds(const char *groupname, gid_t *gid) {
struct group *g;
static int get_group_creds(const char *groupname, gid_t *gid) {
struct group *g;
-
unsigned long lu
;
+
gid_t id
;
assert(groupname);
assert(gid);
assert(groupname);
assert(gid);
@@
-564,9
+564,9
@@
static int get_group_creds(const char *groupname, gid_t *gid) {
return 0;
}
return 0;
}
- if (
safe_atolu(groupname, &lu
) >= 0) {
+ if (
parse_gid(groupname, &id
) >= 0) {
errno = 0;
errno = 0;
- g = getgrgid(
(gid_t) lu
);
+ g = getgrgid(
id
);
} else {
errno = 0;
g = getgrnam(groupname);
} else {
errno = 0;
g = getgrnam(groupname);