Avoid assignment in comparisons.
This commit is contained in:
parent
641d73ab83
commit
b58df6280d
@ -12,6 +12,7 @@
|
|||||||
* src/gpasswd.c: New functions: check_perms(), get_group(),
|
* src/gpasswd.c: New functions: check_perms(), get_group(),
|
||||||
change_passwd(), check_flags(). Split out of main() to simplify main().
|
change_passwd(), check_flags(). Split out of main() to simplify main().
|
||||||
* src/gpasswd.c: Avoid implicit brackets.
|
* src/gpasswd.c: Avoid implicit brackets.
|
||||||
|
* src/gpasswd.c: Avoid assignment in comparisons.
|
||||||
|
|
||||||
2007-12-27 Nicolas François <nicolas.francois@centraliens.net>
|
2007-12-27 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
@ -161,7 +161,8 @@ static int check_list (const char *users)
|
|||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
for (start = users; start && *start; start = end) {
|
for (start = users; start && *start; start = end) {
|
||||||
if ((end = strchr (start, ','))) {
|
end = strchr (start, ',');
|
||||||
|
if (NULL != end) {
|
||||||
len = end - start;
|
len = end - start;
|
||||||
end++;
|
end++;
|
||||||
} else {
|
} else {
|
||||||
@ -517,7 +518,8 @@ static void get_group (struct group *gr)
|
|||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(tmpgr = gr_locate (group))) {
|
tmpgr = gr_locate (group);
|
||||||
|
if (NULL == tmpgr) {
|
||||||
fprintf (stderr, _("unknown group: %s\n"), group);
|
fprintf (stderr, _("unknown group: %s\n"), group);
|
||||||
#ifdef WITH_AUDIT
|
#ifdef WITH_AUDIT
|
||||||
audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
|
audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
|
||||||
@ -551,7 +553,8 @@ static void get_group (struct group *gr)
|
|||||||
#endif
|
#endif
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
if ((tmpsg = sgr_locate (group))) {
|
tmpsg = sgr_locate (group);
|
||||||
|
if (NULL != tmpsg) {
|
||||||
*sg = *tmpsg;
|
*sg = *tmpsg;
|
||||||
sg->sg_name = xstrdup (tmpsg->sg_name);
|
sg->sg_name = xstrdup (tmpsg->sg_name);
|
||||||
sg->sg_passwd = xstrdup (tmpsg->sg_passwd);
|
sg->sg_passwd = xstrdup (tmpsg->sg_passwd);
|
||||||
@ -616,13 +619,15 @@ static void change_passwd (struct group *gr)
|
|||||||
printf (_("Changing the password for group %s\n"), group);
|
printf (_("Changing the password for group %s\n"), group);
|
||||||
|
|
||||||
for (retries = 0; retries < RETRIES; retries++) {
|
for (retries = 0; retries < RETRIES; retries++) {
|
||||||
if (!(cp = getpass (_("New Password: ")))) {
|
cp = getpass (_("New Password: "));
|
||||||
|
if (NULL == cp) {
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
STRFCPY (pass, cp);
|
STRFCPY (pass, cp);
|
||||||
strzero (cp);
|
strzero (cp);
|
||||||
if (!(cp = getpass (_("Re-enter new password: ")))) {
|
cp = getpass (_("Re-enter new password: "));
|
||||||
|
if (NULL == cp) {
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user