aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeraphim Mellos <mellos@ceid.upatras.gr>2008-06-16 22:57:28 +0300
committerSeraphim Mellos <mellos@ceid.upatras.gr>2008-06-22 05:59:36 +0300
commite54218e455d4c76d72d1315dfbc8d55538c3039c (patch)
tree123293a88083f199ac9025cce9237a7a12f09e88 /modules/pam_rootok/pam_rootok.c~
parentCompleted pam_rootok and pam_securetty (diff)
downloadopenpam-modules-e54218e455d4c76d72d1315dfbc8d55538c3039c.tar.gz
openpam-modules-e54218e455d4c76d72d1315dfbc8d55538c3039c.tar.bz2
openpam-modules-e54218e455d4c76d72d1315dfbc8d55538c3039c.zip
Added logging/debug msgs in pam_unix
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);
+}