[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

... oops .. [pam_listfile patch that compiles]



Sorry for that.  This patch seems to compile.

Andrew :*)

Index: pam_listfile.c
===================================================================
RCS file: /var/proj/cvsroot/pam/Linux-PAM/modules/pam_listfile/pam_listfile.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 pam_listfile.c
--- pam_listfile.c      1998/07/12 05:17:16     1.1.1.1
+++ pam_listfile.c      1998/07/12 07:41:49
@@ -4,27 +4,12 @@
  * $Log: pam_listfile.c,v $
  * Revision 1.1.1.1  1998/07/12 05:17:16  morgan
  * Linux PAM sources pre-0.66
- *
- * Revision 1.6  1997/04/05 06:38:35  morgan
- * reformat mostly
- *
- * Revision 1.5  1997/02/15 17:29:41  morgan
- * removed fixed length buffer in logging
- *
- * Revision 1.4  1997/01/04 20:32:10  morgan
- * ammendments for pam_listfile handling
- *
- * Revision 1.3  1996/11/10 21:02:08  morgan
- * compiles with .53
- *
- * Revision 1.2  1996/09/05 06:22:58  morgan
- * Michael's patches
- *
  */
 
 /*
- * by Elliot Lee <sopwith@redhat.com>, Red Hat Software.
- * July 25, 1996.
+ * by Elliot Lee <sopwith@redhat.com>, Red Hat Software. July 25, 1996.
+ * log refused access error christopher mccrory <chrismcc@netus.com> 1998/7/11
+ *
  * This code shamelessly ripped from the pam_rootok module.
  */
 
@@ -397,19 +382,23 @@
     }
     fclose(inf);
     free(ifname);
-    if(retval) {
+    if((sense && retval == PAM_AUTH_ERR)
+       || (!sense && retval == PAM_SUCCESS)) {
 #ifdef DEBUG
-       syslog(LOG_INFO,"Returning %d, retval = %d",
-              sense?PAM_AUTH_ERR:PAM_SUCCESS, retval);
+       syslog(LOG_INFO,"Returning PAM_SUCCESS, retval = %d", retval);
 #endif
-       return sense?PAM_SUCCESS:PAM_AUTH_ERR;
+       return PAM_SUCCESS;
     }
     else {
+       const char *service, *user_name;
 #ifdef DEBUG
-       syslog(LOG_INFO,"Returning %d, retval = %d",
-              sense?PAM_SUCCESS:PAM_AUTH_ERR, retval);
+       syslog(LOG_INFO,"Returning PAM_AUTH_ERR, retval = %d", retval);
 #endif
-       return sense?PAM_AUTH_ERR:PAM_SUCCESS;
+       (void) pam_get_item(pamh, PAM_SERVICE, (const void **)&service);
+       (void) pam_get_user(pamh, &user_name, NULL);
+       _pam_log(LOG_ALERT, "Refused user %s for service %s",
+                user_name, service);
+       return PAM_AUTH_ERR;
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []