summaryrefslogtreecommitdiff
path: root/src/pam-module.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/pam-module.c
parent034a2a52ac0ec83e0229941d635d310b23eb04df (diff)
util: user parse_uid() wherever applicable
Diffstat (limited to 'src/pam-module.c')
-rw-r--r--src/pam-module.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/pam-module.c b/src/pam-module.c
index dfeab97f53..a3ce2468d5 100644
--- a/src/pam-module.c
+++ b/src/pam-module.c
@@ -180,14 +180,14 @@ static int get_user_data(
* it probably contains a uid of the host system. */
if (read_one_line_file("/proc/self/loginuid", &s) >= 0) {
- uint32_t u;
+ uid_t uid;
- r = safe_atou32(s, &u);
+ r = parse_uid(s, &uid);
free(s);
- if (r >= 0 && u != (uint32_t) -1 && u > 0) {
+ if (r >= 0 && uid != (uint32_t) -1) {
have_loginuid = true;
- pw = pam_modutil_getpwuid(handle, u);
+ pw = pam_modutil_getpwuid(handle, uid);
}
}
}
@@ -239,10 +239,10 @@ static bool check_user_lists(
}
STRV_FOREACH(l, kill_exclude_users) {
- uint32_t id;
+ uid_t u;
- if (safe_atou32(*l, &id) >= 0)
- if ((uid_t) id == uid)
+ if (parse_uid(*l, &u) >= 0)
+ if (u == uid)
return false;
if (name && streq(name, *l))
@@ -253,10 +253,10 @@ static bool check_user_lists(
return true;
STRV_FOREACH(l, kill_only_users) {
- uint32_t id;
+ uid_t u;
- if (safe_atou32(*l, &id) >= 0)
- if ((uid_t) id == uid)
+ if (parse_uid(*l, &u) >= 0)
+ if (u == uid)
return true;
if (name && streq(name, *l))