Hello,

I have made a patch for this functionally, beacause I need them.
Mike, Zoran whants no_fake_prompts functionally, this mean that if the
user doesn't have a key in /etc/opiekeys, the pam_opie.so returns a
error. Now, the opie returns a fake prompt.

I attached a little patch for this.


Thanks,
-- 
  _    Samoied <[EMAIL PROTECTED]>
 °v°   UIN: #106162852
/(_)\  GNU/Linux user: #263461
 ^ ^   PGP Key: 0xBFFEF97B
#! /bin/sh /usr/share/dpatch/dpatch-run
## no_fake_prompts.dpatch by  <[EMAIL PROTECTED]>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad libpam-opie-0.21/pam_opie.c 
/tmp/dpep.cWBYq8/libpam-opie-0.21/pam_opie.c
--- libpam-opie-0.21/pam_opie.c 2006-03-24 19:29:32.795171176 -0300
+++ /tmp/dpep.cWBYq8/libpam-opie-0.21/pam_opie.c        2006-03-24 
20:32:22.217131936 -0300
@@ -86,6 +86,15 @@
        char *tok;
        int knownuser;
        int retval;
+       int no_fake_prompts;
+       int i;
+
+       no_fake_prompts = 0;
+       for (i=0; i<argc; ++i) {
+               if (!strcmp("no_fake_prompts", argv[i])) {
+                       no_fake_prompts = 1;
+               }
+       }
 
        retval = pam_get_user(pamh, &username, "login: ");
        if (retval != PAM_SUCCESS)
@@ -99,6 +108,12 @@
        }
        knownuser = (retval == 0) ? 1 : 0;
 
+       /* If user dont have a opiekey, and no_fake_prompts is set,
+        * return PAM_USER_UNKNOWN
+        */
+       if ((knownuser == 0) && (no_fake_prompts == 1))
+               return PAM_USER_UNKNOWN;
+       
        /* Print challenge & get the response */
        strncpy(&challenge[strlen(challenge)], ", Response:",sizeof(challenge) 
- strlen(challenge));
        pmsg[0] = &msg[0];

Attachment: signature.asc
Description: Digital signature

Reply via email to