mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
don't use default messages for first prompt - allow worker to set it
This commit is contained in:
@@ -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.";
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user