From 7b786ed486d590281b0ebec2cf7ab30348989ace Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Wed, 20 May 2015 11:13:40 +0200 Subject: [PATCH] when the password label matches the message, set no message --- src/worker-auth.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/worker-auth.c b/src/worker-auth.c index a241fd21..cd593202 100644 --- a/src/worker-auth.c +++ b/src/worker-auth.c @@ -1,5 +1,6 @@ /* - * Copyright (C) 2013, 2014 Nikos Mavrogiannopoulos + * Copyright (C) 2013, 2014, 2015 Nikos Mavrogiannopoulos + * Copyright (C) 2015 Red Hat, Inc. * * This file is part of ocserv. * @@ -74,8 +75,9 @@ static const char oc_login_msg_end[] = static const char login_msg_user[] = "\n"; +#define DEFAULT_PASSWD_LABEL "Password:" #define LOGIN_MSG_PASSWORD \ - "\n" + "\n" #define LOGIN_MSG_PASSWORD_CTR \ "\n" @@ -225,7 +227,7 @@ int get_auth_handler2(worker_st * ws, unsigned http_ver, const char *pmsg, unsig if (ws->auth_state == S_AUTH_REQ) { /* only ask password */ - if (pmsg == NULL) + if (pmsg == NULL || strncasecmp(pmsg, DEFAULT_PASSWD_LABEL, sizeof(DEFAULT_PASSWD_LABEL)-1) == 0) pmsg = "Please enter your password"; ret = str_append_printf(&str, login_msg_start, pmsg);