aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeraphim Mellos <mellos@ceid.upatras.gr>2008-06-29 18:29:42 +0300
committerSeraphim Mellos <mellos@ceid.upatras.gr>2008-06-29 19:30:41 +0300
commitd421f3d81236974dc0285ab375fcd29336c12bb3 (patch)
treefe3948aea8546969badc9c1b21264bfc3589f1d0
parentCompleted pam_permit/pam_deny (diff)
downloadopenpam-modules-d421f3d81236974dc0285ab375fcd29336c12bb3.tar.gz
openpam-modules-d421f3d81236974dc0285ab375fcd29336c12bb3.tar.bz2
openpam-modules-d421f3d81236974dc0285ab375fcd29336c12bb3.zip
Completed pam_permit/pam_deny
-rw-r--r--modules/Makefile~10
-rw-r--r--modules/pam_deny/Makefile41
-rwxr-xr-xmodules/pam_deny/pam_deny.c62
-rw-r--r--modules/pam_nologin/Makefile41
-rw-r--r--modules/pam_permit/Makefile41
-rwxr-xr-xmodules/pam_permit/pam_permit.c62
6 files changed, 257 insertions, 0 deletions
diff --git a/modules/Makefile~ b/modules/Makefile~
new file mode 100644
index 0000000..e09247c
--- /dev/null
+++ b/modules/Makefile~
@@ -0,0 +1,10 @@
+all install clean:
+ $(MAKE) -C pam_unix $@
+ $(MAKE) -C pam_securetty $@
+ $(MAKE) -C pam_nologin $@
+ $(MAKE) -C pam_shells $@
+ $(MAKE) -C pam_wheel $@
+ $(MAKE) -C pam_rootok $@
+ $(MAKE) -C pam_permit $@
+ $(MAKE) -C pam_deny $@
+
diff --git a/modules/pam_deny/Makefile b/modules/pam_deny/Makefile
new file mode 100644
index 0000000..4ebffb1
--- /dev/null
+++ b/modules/pam_deny/Makefile
@@ -0,0 +1,41 @@
+#
+## Copyright (c) 2008 by Seraphim Mellos. See LICENSE.
+#
+
+include ../../Make.defs
+
+TITLE = pam_deny
+PAM_SO_SUFFIX =
+LIBSHARED = $(TITLE).so$(PAM_SO_SUFFIX)
+SHLIBMODE = 755
+MAN8 = $(TITLE).8
+MANMODE = 644
+#SECUREDIR = /lib/security
+#MANDIR = /usr/share/man
+#DESTDIR =
+
+
+
+PROJ = $(LIBSHARED)
+OBJS = pam_deny.o
+
+all:
+ case "`uname -s`" in \
+ Linux) $(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
+ LDLIBS="$(LDLIBS)" $(PROJ);;\
+ FreeBSD) echo "Not yet supported.";;\
+ *) echo "OS not supported.";;\
+ esac
+
+$(LIBSHARED): $(OBJS)
+ $(LD) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $(LIBSHARED)
+
+.c.o:
+ $(CC) $(CFLAGS) -c $*.c
+
+
+clean:
+ $(RM) $(PROJ) *.o
+
+
+
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");
diff --git a/modules/pam_nologin/Makefile b/modules/pam_nologin/Makefile
new file mode 100644
index 0000000..981d3ae
--- /dev/null
+++ b/modules/pam_nologin/Makefile
@@ -0,0 +1,41 @@
+#
+## Copyright (c) 2008 by Seraphim Mellos. See LICENSE.
+#
+
+include ../../Make.defs
+
+TITLE = pam_nologin
+PAM_SO_SUFFIX =
+LIBSHARED = $(TITLE).so$(PAM_SO_SUFFIX)
+SHLIBMODE = 755
+MAN8 = $(TITLE).8
+MANMODE = 644
+#SECUREDIR = /lib/security
+#MANDIR = /usr/share/man
+#DESTDIR =
+
+
+
+PROJ = $(LIBSHARED)
+OBJS = pam_nologin.o
+
+all:
+ case "`uname -s`" in \
+ Linux) $(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
+ LDLIBS="$(LDLIBS)" $(PROJ);;\
+ FreeBSD) echo "Not yet supported.";;\
+ *) echo "OS not supported.";;\
+ esac
+
+$(LIBSHARED): $(OBJS)
+ $(LD) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $(LIBSHARED)
+
+.c.o:
+ $(CC) $(CFLAGS) -c $*.c
+
+
+clean:
+ $(RM) $(PROJ) *.o
+
+
+
diff --git a/modules/pam_permit/Makefile b/modules/pam_permit/Makefile
new file mode 100644
index 0000000..793e176
--- /dev/null
+++ b/modules/pam_permit/Makefile
@@ -0,0 +1,41 @@
+#
+## Copyright (c) 2008 by Seraphim Mellos. See LICENSE.
+#
+
+include ../../Make.defs
+
+TITLE = pam_permit
+PAM_SO_SUFFIX =
+LIBSHARED = $(TITLE).so$(PAM_SO_SUFFIX)
+SHLIBMODE = 755
+MAN8 = $(TITLE).8
+MANMODE = 644
+#SECUREDIR = /lib/security
+#MANDIR = /usr/share/man
+#DESTDIR =
+
+
+
+PROJ = $(LIBSHARED)
+OBJS = pam_permit.o
+
+all:
+ case "`uname -s`" in \
+ Linux) $(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
+ LDLIBS="$(LDLIBS)" $(PROJ);;\
+ FreeBSD) echo "Not yet supported.";;\
+ *) echo "OS not supported.";;\
+ esac
+
+$(LIBSHARED): $(OBJS)
+ $(LD) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $(LIBSHARED)
+
+.c.o:
+ $(CC) $(CFLAGS) -c $*.c
+
+
+clean:
+ $(RM) $(PROJ) *.o
+
+
+
diff --git a/modules/pam_permit/pam_permit.c b/modules/pam_permit/pam_permit.c
new file mode 100755
index 0000000..7df9887
--- /dev/null
+++ b/modules/pam_permit/pam_permit.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_SUCCESS);
+}
+
+PAM_EXTERN int
+pam_sm_setcred(pam_handle_t *pamh , int flags ,
+ int argc , const char *argv[] )
+{
+
+ return (PAM_SUCCESS);
+}
+
+PAM_EXTERN int
+pam_sm_acct_mgmt(pam_handle_t *pamh , int flags ,
+ int argc , const char *argv[] )
+{
+
+ return (PAM_SUCCESS);
+}
+
+PAM_EXTERN int
+pam_sm_chauthtok(pam_handle_t *pamh , int flags ,
+ int argc , const char *argv[] )
+{
+
+ return (PAM_SUCCESS);
+}
+
+PAM_EXTERN int
+pam_sm_open_session(pam_handle_t *pamh , int flags ,
+ int argc , const char *argv[] )
+{
+
+ return (PAM_SUCCESS);
+}
+
+PAM_EXTERN int
+pam_sm_close_session(pam_handle_t *pamh , int flags ,
+ int argc , const char *argv[] )
+{
+
+ return (PAM_SUCCESS);
+}
+
+PAM_MODULE_ENTRY("pam_permit");