From 3d64b0cc95c5957e53474c3e50f143c61a057104 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 18 Aug 2016 21:33:27 -0500 Subject: Change xgetpwnamid/xgetgrnamid to xgetuid/xgetgid returning the id number instead of a struct. This means it can return "12345" even if that user/group doesn't exist in /etc/passwd and similar. All the users were immediately dereferencing it to get pw_uid or gr_gid anyway, so just return it directly and adjust the users. This fixes things like "chown 12345:23456 filename". --- lib/lib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/lib.h') diff --git a/lib/lib.h b/lib/lib.h index 67d53035..43d6b1ff 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -153,8 +153,8 @@ struct passwd *xgetpwuid(uid_t uid); struct group *xgetgrgid(gid_t gid); struct passwd *xgetpwnam(char *name); struct group *xgetgrnam(char *name); -struct passwd *xgetpwnamid(char *user); -struct group *xgetgrnamid(char *group); +unsigned xgetuid(char *name); +unsigned xgetgid(char *name); void xsetuser(struct passwd *pwd); char *xreadlink(char *name); long xparsetime(char *arg, long units, long *fraction); -- cgit v1.2.3