Skip to content

Commit e098595

Browse files
sswamy48millert
authored andcommitted
Minor changes fixes for printing error messages.
1 parent 8ae2c37 commit e098595

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

plugins/sudoers/auth/aix_auth.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ sudo_aix_verify(const struct sudoers_context *ctx, struct passwd *pw,
229229
const char *prompt, sudo_auth *auth, struct sudo_conv_callback *callback)
230230
{
231231
char *pass, *message = NULL, *restrict_msg = NULL;
232-
int result = 1, reenter = 0, restrict_result = -1, pwdexp_msg = 0;
232+
int result = 1, reenter = 0, restrict_result = -1, restrict_warn = 0;
233+
int pwdexp_msg = 0;
233234
int ret = AUTH_SUCCESS;
234235
void *login_state = NULL;
235236
debug_decl(sudo_aix_verify, SUDOERS_DEBUG_AUTH);
@@ -254,8 +255,10 @@ sudo_aix_verify(const struct sudoers_context *ctx, struct passwd *pw,
254255
sudo_conv(1, &msg, &repl, NULL);
255256
free(restrict_msg);
256257
restrict_msg = NULL;
258+
restrict_warn = 1;
257259
}
258-
sudo_warn("loginrestrictionsx");
260+
if (!restrict_warn)
261+
sudo_warn("loginrestrictionsx");
259262
debug_return_int(AUTH_ERROR);
260263
}
261264

@@ -268,8 +271,6 @@ sudo_aix_verify(const struct sudoers_context *ctx, struct passwd *pw,
268271
result = authenticatex(pw->pw_name, pass, &reenter, &message, &login_state);
269272
freezero(pass, strlen(pass));
270273
prompt = message;
271-
if (!reenter && !result && message)
272-
sudo_printf(SUDO_CONV_ERROR_MSG, "%s ", message);
273274
} while (reenter);
274275

275276
if (result != 0) {

0 commit comments

Comments
 (0)