Imported Upstream version 1.8.4p4
[debian/sudo] / plugins / sudoers / auth / rfc1938.c
index fe5b28f372c4dd8223eb5180b445c065235eac3b..f4ed7c0f6de2ff9b11af2cec93d35279ca8d1052 100644 (file)
 #include "sudo_auth.h"
 
 int
-rfc1938_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
+sudo_rfc1938_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
 {
     char challenge[256];
     static char *orig_prompt = NULL, *new_prompt = NULL;
     static int op_len, np_size;
     static struct RFC1938 rfc1938;
+    debug_decl(sudo_rfc1938_setup, SUDO_DEBUG_AUTH)
 
     /* Stash a pointer to the rfc1938 struct if we have not initialized */
     if (!auth->data)
@@ -101,9 +102,9 @@ rfc1938_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
     if (rfc1938challenge(&rfc1938, pw->pw_name, challenge, sizeof(challenge))) {
        if (IS_ONEANDONLY(auth)) {
            warningx(_("you do not exist in the %s database"), auth->name);
-           return AUTH_FATAL;
+           debug_return_int(AUTH_FATAL);
        } else {
-           return AUTH_FAILURE;
+           debug_return_int(AUTH_FAILURE);
        }
     }
 
@@ -120,15 +121,16 @@ rfc1938_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
            orig_prompt, challenge);
 
     *promptp = new_prompt;
-    return AUTH_SUCCESS;
+    debug_return_int(AUTH_SUCCESS);
 }
 
 int
-rfc1938_verify(struct passwd *pw, char *pass, sudo_auth *auth)
+sudo_rfc1938_verify(struct passwd *pw, char *pass, sudo_auth *auth)
 {
+    debug_decl(sudo_rfc1938_verify, SUDO_DEBUG_AUTH)
 
     if (rfc1938verify((struct RFC1938 *) auth->data, pass) == 0)
-       return AUTH_SUCCESS;
+       debug_return_int(AUTH_SUCCESS);
     else
-       return AUTH_FAILURE;
+       debug_return_int(AUTH_FAILURE);
 }