summaryrefslogtreecommitdiff
path: root/src/util.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/util.c
parent034a2a52ac0ec83e0229941d635d310b23eb04df (diff)
util: user parse_uid() wherever applicable
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util.c b/src/util.c
index 2d4f229193..3a82ef7600 100644
--- a/src/util.c
+++ b/src/util.c
@@ -5262,7 +5262,7 @@ int socket_from_display(const char *display, char **path) {
int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home) {
struct passwd *p;
- unsigned long lu;
+ uid_t u;
assert(username);
assert(*username);
@@ -5281,9 +5281,9 @@ int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **h
return 0;
}
- if (safe_atolu(*username, &lu) >= 0) {
+ if (parse_uid(*username, &u) >= 0) {
errno = 0;
- p = getpwuid((uid_t) lu);
+ p = getpwuid(u);
/* If there are multiple users with the same id, make
* sure to leave $USER to the configured value instead