aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_rootok/pam_rootok.c~')
-rw-r--r--modules/pam_rootok/pam_rootok.c~31
1 files changed, 31 insertions, 0 deletions
diff --git a/modules/pam_rootok/pam_rootok.c~ b/modules/pam_rootok/pam_rootok.c~
new file mode 100644
index 0000000..9adec8c
--- /dev/null
+++ b/modules/pam_rootok/pam_rootok.c~
@@ -0,0 +1,31 @@
+#include <sys/cdefs.h>
+#include <unistd.h>
+#include <syslog.h>
+#include <stdio.h>
+
+#define PAM_SM_AUTH
+
+#include <security/pam_appl.h>
+#include <security/pam_modules.h>
+#include <security/pam_mod_misc.h>
+
+PAM_EXTERN int
+pam_sm_authenticate(pam_handle_t *pamh, int flags ,
+ int argc , const char *argv[] )
+{
+
+ if (getuid() == 0)
+ return (PAM_SUCCESS);
+
+ PAM_ERROR("User is not superuser");
+
+ return (PAM_AUTH_ERR);
+}
+
+PAM_EXTERN int
+pam_sm_setcred(pam_handle_t *pamh, int flags,
+ int argc , const char *argv[] )
+{
+
+ return (PAM_SUCCESS);
+}