passwd: fix bug: we are trying to update shadow even if user's record is in passwd!

getspnam is guilty, it lies that user record exists in shadow.
This commit is contained in:
Denis Vlasenko
2007-07-27 11:22:34 +00:00
parent 3734b946bf
commit 1d10aaf116
2 changed files with 19 additions and 9 deletions

View File

@@ -482,10 +482,10 @@ int get_uidgid(struct bb_uidgid_t*, const char*, int numeric_ok);
/* chown-like handling of "user[:[group]" */
void parse_chown_usergroup_or_die(struct bb_uidgid_t *u, char *user_group);
/* bb_getpwuid, bb_getgrgid:
bb_getXXXid(buf, bufsz, id) - copy user/group name or id
as a string to buf, return user/group name or NULL
bb_getXXXid(NULL, 0, id) - return user/group name or NULL
bb_getXXXid(NULL, -1, id) - return user/group name or exit
* bb_getXXXid(buf, bufsz, id) - copy user/group name or id
* as a string to buf, return user/group name or NULL
* bb_getXXXid(NULL, 0, id) - return user/group name or NULL
* bb_getXXXid(NULL, -1, id) - return user/group name or exit
*/
char *bb_getpwuid(char *name, int bufsize, long uid);
char *bb_getgrgid(char *group, int bufsize, long gid);