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
/
util.c
diff --git
a/src/util.c
b/src/util.c
index 2d4f2291932963fdfade7286741efe0d6d49deee..3a82ef7600f53453416eb487b076c4415c1172a4 100644
(file)
--- 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;
int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home) {
struct passwd *p;
- u
nsigned long l
u;
+ u
id_t
u;
assert(username);
assert(*username);
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;
}
return 0;
}
- if (
safe_atolu(*username, &l
u) >= 0) {
+ if (
parse_uid(*username, &
u) >= 0) {
errno = 0;
errno = 0;
- p = getpwuid(
(uid_t) l
u);
+ p = getpwuid(u);
/* If there are multiple users with the same id, make
* sure to leave $USER to the configured value instead
/* If there are multiple users with the same id, make
* sure to leave $USER to the configured value instead