summaryrefslogtreecommitdiff
path: root/src/tmpfiles.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-07-23 00:47:17 +0200
committerLennart Poettering <lennart@poettering.net>2011-07-23 00:47:17 +0200
commitddd88763921a1534081ed28e36f6712a85449005 (patch)
treef027ce791a7525a75acb5381f97a81279d42ede4 /src/tmpfiles.c
parent034a2a52ac0ec83e0229941d635d310b23eb04df (diff)
util: user parse_uid() wherever applicable
Diffstat (limited to 'src/tmpfiles.c')
-rw-r--r--src/tmpfiles.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tmpfiles.c b/src/tmpfiles.c
index feb2a21463..a1b2f8b1d2 100644
--- a/src/tmpfiles.c
+++ b/src/tmpfiles.c
@@ -757,13 +757,13 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
}
if (user && !streq(user, "-")) {
- unsigned long lu;
+ uid_t uid;
struct passwd *p;
if (streq(user, "root") || streq(user, "0"))
i->uid = 0;
- else if (safe_atolu(user, &lu) >= 0)
- i->uid = (uid_t) lu;
+ else if (parse_uid(user, &uid) >= 0)
+ i->uid = uid;
else if ((p = getpwnam(user)))
i->uid = p->pw_uid;
else {
@@ -776,13 +776,13 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
}
if (group && !streq(group, "-")) {
- unsigned long lu;
+ gid_t gid;
struct group *g;
if (streq(group, "root") || streq(group, "0"))
i->gid = 0;
- else if (safe_atolu(group, &lu) >= 0)
- i->gid = (gid_t) lu;
+ else if (parse_gid(group, &gid) >= 0)
+ i->gid = gid;
else if ((g = getgrnam(group)))
i->gid = g->gr_gid;
else {