don't use default messages for first prompt - allow worker to set it

This commit is contained in:
Nikos Mavrogiannopoulos
2015-05-19 18:28:01 +02:00
parent cdd5dcd9c3
commit 2d386261ac
3 changed files with 3 additions and 4 deletions

View File

@@ -20,7 +20,6 @@
#include <config.h>
#include <auth/common.h>
const char* pass_msg_first = "Please enter your password.";
const char* pass_msg_second = "Please enter your challenge password.";
const char* pass_msg_failed = "Login failed.\nPlease enter your password.";

View File

@@ -3,7 +3,6 @@
#define MAX_PASSWORD_TRIES 3
extern const char* pass_msg_first;
extern const char* pass_msg_second;
extern const char* pass_msg_failed;

View File

@@ -197,7 +197,7 @@ static int plain_auth_init(void **ctx, void *pool, const char *username, const c
return ERR_AUTH_FAIL;
strlcpy(pctx->username, username, sizeof(pctx->username));
pctx->pass_msg = pass_msg_first;
pctx->pass_msg = NULL; /* use default */
ret = read_auth_pass(pctx);
if (ret < 0) {
@@ -272,7 +272,8 @@ static int plain_auth_msg(void *ctx, void *pool, passwd_msg_st *pst)
{
struct plain_ctx_st *pctx = ctx;
pst->msg_str = talloc_strdup(pool, pctx->pass_msg);
if (pctx->pass_msg)
pst->msg_str = talloc_strdup(pool, pctx->pass_msg);
pst->counter = 0; /* we support a single password */
/* use the default prompt */