if the check of the pw db fails return the failed value

This commit is contained in:
Baptiste Daroussin 2015-05-10 09:11:12 +00:00
parent f116422f38
commit b1a215787d

View File

@ -110,13 +110,12 @@ pwdb(char *arg,...)
static int
pw_update(struct passwd * pwd, char const * user)
{
int rc = 0;
rc = pwdb("-C", (char *)NULL); /* Check only */
if (rc == 0) {
int pfd, tfd;
struct passwd *pw = NULL;
struct passwd *old_pw = NULL;
int rc, pfd, tfd;
if ((rc = pwdb("-C", NULL)) != 0)
return (rc);
if (pwd != NULL)
pw = pw_dup(pwd);
@ -148,7 +147,6 @@ pw_update(struct passwd * pwd, char const * user)
}
free(pw);
pw_fini();
}
return (0);
}