aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_deny/pam_deny.c')
-rwxr-xr-xmodules/pam_deny/pam_deny.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/modules/pam_deny/pam_deny.c b/modules/pam_deny/pam_deny.c
new file mode 100755
index 0000000..adccf10
--- /dev/null
+++ b/modules/pam_deny/pam_deny.c
@@ -0,0 +1,62 @@
+#define PAM_SM_AUTH
+#define PAM_SM_ACCOUNT
+#define PAM_SM_SESSION
+#define PAM_SM_PASSWORD
+
+#include <security/pam_appl.h>
+#include <security/pam_modules.h>
+
+PAM_EXTERN int
+pam_sm_authenticate(pam_handle_t *pamh, int flags ,
+ int argc , const char *argv[] )
+{
+ const char *user;
+ int pam_err;
+
+ if ((pam_err = pam_get_user(pamh, &user, NULL)) != PAM_SUCCESS)
+ return (pam_err);
+
+ return (PAM_AUTH_ERR);
+}
+
+PAM_EXTERN int
+pam_sm_setcred(pam_handle_t *pamh , int flags ,
+ int argc , const char *argv[] )
+{
+
+ return (PAM_CRED_ERR);
+}
+
+PAM_EXTERN int
+pam_sm_acct_mgmt(pam_handle_t *pamh , int flags ,
+ int argc , const char *argv[] )
+{
+
+ return (PAM_AUTH_ERR);
+}
+
+PAM_EXTERN int
+pam_sm_chauthtok(pam_handle_t *pamh , int flags ,
+ int argc , const char *argv[] )
+{
+
+ return (PAM_AUTHTOK_ERR);
+}
+
+PAM_EXTERN int
+pam_sm_open_session(pam_handle_t *pamh , int flags ,
+ int argc , const char *argv[] )
+{
+
+ return (PAM_SESSION_ERR);
+}
+
+PAM_EXTERN int
+pam_sm_close_session(pam_handle_t *pamh , int flags ,
+ int argc , const char *argv[] )
+{
+
+ return (PAM_SESSION_ERR);
+}
+
+PAM_MODULE_ENTRY("pam_deny");