#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_ERR_H
-# include <err.h>
-#else
-# include "emul/err.h"
-#endif /* HAVE_ERR_H */
#include <pwd.h>
#include <auth.h>
char resp[128]; /* Response from the server */
if ((confp = cfg_read("sudo")) == (Cfg *)-1) {
- warnx("cannot read fwtk config");
+ warningx("cannot read fwtk config");
return(AUTH_FATAL);
}
if (auth_open(confp)) {
- warnx("cannot connect to authentication server");
+ warningx("cannot connect to authentication server");
return(AUTH_FATAL);
}
/* Get welcome message from auth server */
if (auth_recv(resp, sizeof(resp))) {
- warnx("lost connection to authentication server");
+ warningx("lost connection to authentication server");
return(AUTH_FATAL);
}
if (strncmp(resp, "Authsrv ready", 13) != 0) {
- warnx("authentication server error:\n%s", resp);
+ warningx("authentication server error:\n%s", resp);
return(AUTH_FATAL);
}
(void) snprintf(buf, sizeof(buf), "authorize %s 'sudo'", pw->pw_name);
restart:
if (auth_send(buf) || auth_recv(resp, sizeof(resp))) {
- warnx("lost connection to authentication server");
+ warningx("lost connection to authentication server");
return(AUTH_FATAL);
}
strlcpy(buf, "response dummy", sizeof(buf));
goto restart;
} else {
- warnx("%s", resp);
+ warningx("%s", resp);
return(AUTH_FATAL);
}
if (!pass) { /* ^C or error */
/* 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))) {
- warnx("lost connection to authentication server");
+ warningx("lost connection to authentication server");
error = AUTH_FATAL;
goto done;
}
/* Main loop prints "Permission Denied" or insult. */
if (strcmp(resp, "Permission Denied.") != 0)
- warnx("%s", resp);
+ warningx("%s", resp);
error = AUTH_FAILURE;
done:
zero_bytes(pass, strlen(pass));
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_ERR_H
-# include <err.h>
-#else
-# include "emul/err.h"
-#endif /* HAVE_ERR_H */
#include <pwd.h>
#if defined(HAVE_SKEY)
*/
if (rfc1938challenge(&rfc1938, pw->pw_name, challenge, sizeof(challenge))) {
if (IS_ONEANDONLY(auth)) {
- warnx("you do not exist in the %s database", auth->name);
+ warningx("you do not exist in the %s database", auth->name);
return(AUTH_FATAL);
} else {
return(AUTH_FAILURE);
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_ERR_H
-# include <err.h>
-#else
-# include "emul/err.h"
-#endif /* HAVE_ERR_H */
#include <pwd.h>
#include <sdi_athd.h>
strlcpy(sd->username, pw->pw_name, 32);
return(AUTH_SUCCESS);
} else {
- warnx("unable to contact the SecurID server");
+ warningx("unable to contact the SecurID server");
return(AUTH_FATAL);
}
}
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_ERR_H
-# include <err.h>
-#else
-# include "emul/err.h"
-#endif /* HAVE_ERR_H */
#include <pwd.h>
/* Needed for SecurID v5.0 Authentication on UNIX */
if (AceInitialize() != SD_FALSE)
return(AUTH_SUCCESS);
- warnx("failed to initialise the ACE API library");
+ warningx("failed to initialise the ACE API library");
return(AUTH_FATAL);
}
/* Re-initialize SecurID every time. */
if (SD_Init(sd) != ACM_OK) {
- warnx("unable to contact the SecurID server");
+ warningx("unable to contact the SecurID server");
return(AUTH_FATAL);
}
switch (retval) {
case ACE_UNDEFINED_USERNAME:
- warnx("invalid username length for SecurID");
+ warningx("invalid username length for SecurID");
return(AUTH_FATAL);
case ACE_ERR_INVALID_HANDLE:
- warnx("invalid Authentication Handle for SecurID");
+ warningx("invalid Authentication Handle for SecurID");
return(AUTH_FATAL);
case ACM_ACCESS_DENIED:
- warnx("SecurID communication failed");
+ warningx("SecurID communication failed");
return(AUTH_FATAL);
case ACM_OK:
- warnx("User ID locked for SecurID Authentication");
+ warningx("User ID locked for SecurID Authentication");
return(AUTH_SUCCESS);
}
}
/* Have ACE verify password */
switch (SD_Check(*sd, pass, pw->pw_name)) {
case ACE_UNDEFINED_PASSCODE:
- warnx("invalid passcode length for SecurID");
+ warningx("invalid passcode length for SecurID");
rval = AUTH_FATAL;
break;
case ACE_UNDEFINED_USERNAME:
- warnx("invalid username length for SecurID");
+ warningx("invalid username length for SecurID");
rval = AUTH_FATAL;
break;
case ACE_ERR_INVALID_HANDLE:
- warnx("invalid Authentication Handle for SecurID");
+ warningx("invalid Authentication Handle for SecurID");
rval = AUTH_FATAL;
case ACM_ACCESS_DENIED: