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
/
pam-module.c
diff --git
a/src/pam-module.c
b/src/pam-module.c
index dfeab97f53b7752a060a1f5dff20da0247c5d24f..a3ce2468d57ed6e1861121988b59b2c0e4d26f03 100644
(file)
--- 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) {
* it probably contains a uid of the host system. */
if (read_one_line_file("/proc/self/loginuid", &s) >= 0) {
- ui
nt32_t u
;
+ ui
d_t uid
;
- r =
safe_atou32(s, &u
);
+ r =
parse_uid(s, &uid
);
free(s);
free(s);
- if (r >= 0 && u
!= (uint32_t) -1 && u > 0
) {
+ if (r >= 0 && u
id != (uint32_t) -1
) {
have_loginuid = true;
have_loginuid = true;
- pw = pam_modutil_getpwuid(handle, u);
+ pw = pam_modutil_getpwuid(handle, u
id
);
}
}
}
}
}
}
@@
-239,10
+239,10
@@
static bool check_user_lists(
}
STRV_FOREACH(l, kill_exclude_users) {
}
STRV_FOREACH(l, kill_exclude_users) {
- ui
nt32_t id
;
+ ui
d_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))
return false;
if (name && streq(name, *l))
@@
-253,10
+253,10
@@
static bool check_user_lists(
return true;
STRV_FOREACH(l, kill_only_users) {
return true;
STRV_FOREACH(l, kill_only_users) {
- ui
nt32_t id
;
+ ui
d_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))
return true;
if (name && streq(name, *l))