Rename warning/fatal -> sudo_warn/sudo_fatal to avoid namespace
pollution in libsudo_util.so.
This commit is contained in:
@@ -56,22 +56,22 @@ sudo_fwtk_init(struct passwd *pw, sudo_auth *auth)
|
||||
debug_decl(sudo_fwtk_init, SUDO_DEBUG_AUTH)
|
||||
|
||||
if ((confp = cfg_read("sudo")) == (Cfg *)-1) {
|
||||
warningx(U_("unable to read fwtk config"));
|
||||
sudo_warnx(U_("unable to read fwtk config"));
|
||||
debug_return_int(AUTH_FATAL);
|
||||
}
|
||||
|
||||
if (auth_open(confp)) {
|
||||
warningx(U_("unable to connect to authentication server"));
|
||||
sudo_warnx(U_("unable to connect to authentication server"));
|
||||
debug_return_int(AUTH_FATAL);
|
||||
}
|
||||
|
||||
/* Get welcome message from auth server */
|
||||
if (auth_recv(resp, sizeof(resp))) {
|
||||
warningx(U_("lost connection to authentication server"));
|
||||
sudo_warnx(U_("lost connection to authentication server"));
|
||||
debug_return_int(AUTH_FATAL);
|
||||
}
|
||||
if (strncmp(resp, "Authsrv ready", 13) != 0) {
|
||||
warningx(U_("authentication server error:\n%s"), resp);
|
||||
sudo_warnx(U_("authentication server error:\n%s"), resp);
|
||||
debug_return_int(AUTH_FATAL);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ sudo_fwtk_verify(struct passwd *pw, char *prompt, sudo_auth *auth)
|
||||
(void) snprintf(buf, sizeof(buf), "authorize %s 'sudo'", pw->pw_name);
|
||||
restart:
|
||||
if (auth_send(buf) || auth_recv(resp, sizeof(resp))) {
|
||||
warningx(U_("lost connection to authentication server"));
|
||||
sudo_warnx(U_("lost connection to authentication server"));
|
||||
debug_return_int(AUTH_FATAL);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ restart:
|
||||
strlcpy(buf, "response dummy", sizeof(buf));
|
||||
goto restart;
|
||||
} else {
|
||||
warningx("%s", resp);
|
||||
sudo_warnx("%s", resp);
|
||||
debug_return_int(AUTH_FATAL);
|
||||
}
|
||||
if (!pass) { /* ^C or error */
|
||||
@@ -124,7 +124,7 @@ restart:
|
||||
/* Send the user's response to the server */
|
||||
(void) snprintf(buf, sizeof(buf), "response '%s'", pass);
|
||||
if (auth_send(buf) || auth_recv(resp, sizeof(resp))) {
|
||||
warningx(U_("lost connection to authentication server"));
|
||||
sudo_warnx(U_("lost connection to authentication server"));
|
||||
error = AUTH_FATAL;
|
||||
goto done;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ restart:
|
||||
|
||||
/* Main loop prints "Permission Denied" or insult. */
|
||||
if (strcmp(resp, "Permission Denied.") != 0)
|
||||
warningx("%s", resp);
|
||||
sudo_warnx("%s", resp);
|
||||
error = AUTH_FAILURE;
|
||||
done:
|
||||
memset_s(pass, SUDO_PASS_MAX, 0, strlen(pass));
|
||||
|
@@ -100,7 +100,7 @@ sudo_rfc1938_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
|
||||
*/
|
||||
if (rfc1938challenge(&rfc1938, pw->pw_name, challenge, sizeof(challenge))) {
|
||||
if (IS_ONEANDONLY(auth)) {
|
||||
warningx(U_("you do not exist in the %s database"), auth->name);
|
||||
sudo_warnx(U_("you do not exist in the %s database"), auth->name);
|
||||
debug_return_int(AUTH_FATAL);
|
||||
} else {
|
||||
debug_return_int(AUTH_FAILURE);
|
||||
|
@@ -77,7 +77,7 @@ sudo_securid_init(struct passwd *pw, sudo_auth *auth)
|
||||
if (AceInitialize() != SD_FALSE)
|
||||
debug_return_int(AUTH_SUCCESS);
|
||||
|
||||
warningx(U_("failed to initialise the ACE API library"));
|
||||
sudo_warnx(U_("failed to initialise the ACE API library"));
|
||||
debug_return_int(AUTH_FATAL);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ sudo_securid_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
|
||||
|
||||
/* Re-initialize SecurID every time. */
|
||||
if (SD_Init(sd) != ACM_OK) {
|
||||
warningx(U_("unable to contact the SecurID server"));
|
||||
sudo_warnx(U_("unable to contact the SecurID server"));
|
||||
debug_return_int(AUTH_FATAL);
|
||||
}
|
||||
|
||||
@@ -112,23 +112,23 @@ sudo_securid_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
|
||||
|
||||
switch (retval) {
|
||||
case ACM_OK:
|
||||
warningx(U_("User ID locked for SecurID Authentication"));
|
||||
sudo_warnx(U_("User ID locked for SecurID Authentication"));
|
||||
debug_return_int(AUTH_SUCCESS);
|
||||
|
||||
case ACE_UNDEFINED_USERNAME:
|
||||
warningx(U_("invalid username length for SecurID"));
|
||||
sudo_warnx(U_("invalid username length for SecurID"));
|
||||
debug_return_int(AUTH_FATAL);
|
||||
|
||||
case ACE_ERR_INVALID_HANDLE:
|
||||
warningx(U_("invalid Authentication Handle for SecurID"));
|
||||
sudo_warnx(U_("invalid Authentication Handle for SecurID"));
|
||||
debug_return_int(AUTH_FATAL);
|
||||
|
||||
case ACM_ACCESS_DENIED:
|
||||
warningx(U_("SecurID communication failed"));
|
||||
sudo_warnx(U_("SecurID communication failed"));
|
||||
debug_return_int(AUTH_FATAL);
|
||||
|
||||
default:
|
||||
warningx(U_("unknown SecurID error"));
|
||||
sudo_warnx(U_("unknown SecurID error"));
|
||||
debug_return_int(AUTH_FATAL);
|
||||
}
|
||||
}
|
||||
@@ -162,17 +162,17 @@ sudo_securid_verify(struct passwd *pw, char *pass, sudo_auth *auth)
|
||||
break;
|
||||
|
||||
case ACE_UNDEFINED_PASSCODE:
|
||||
warningx(U_("invalid passcode length for SecurID"));
|
||||
sudo_warnx(U_("invalid passcode length for SecurID"));
|
||||
rval = AUTH_FATAL;
|
||||
break;
|
||||
|
||||
case ACE_UNDEFINED_USERNAME:
|
||||
warningx(U_("invalid username length for SecurID"));
|
||||
sudo_warnx(U_("invalid username length for SecurID"));
|
||||
rval = AUTH_FATAL;
|
||||
break;
|
||||
|
||||
case ACE_ERR_INVALID_HANDLE:
|
||||
warningx(U_("invalid Authentication Handle for SecurID"));
|
||||
sudo_warnx(U_("invalid Authentication Handle for SecurID"));
|
||||
rval = AUTH_FATAL;
|
||||
break;
|
||||
|
||||
@@ -211,7 +211,7 @@ then enter the new token code.\n", \
|
||||
break;
|
||||
|
||||
default:
|
||||
warningx(U_("unknown SecurID error"));
|
||||
sudo_warnx(U_("unknown SecurID error"));
|
||||
rval = AUTH_FATAL;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user