LIBS=$BACKUP_LIBS
fi
+dnl hacks for pam_smack
+PKG_CHECK_MODULES([LIBSMACK], [libsmack])
+
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
modules/pam_unix/Makefile modules/pam_userdb/Makefile \
modules/pam_warn/Makefile modules/pam_wheel/Makefile \
modules/pam_xauth/Makefile doc/Makefile doc/specs/Makefile \
+ modules/pam_smack/Makefile \
doc/man/Makefile doc/sag/Makefile doc/adg/Makefile \
doc/mwg/Makefile examples/Makefile tests/Makefile \
xtests/Makefile])
pam_selinux pam_sepermit pam_shells pam_stress \
pam_succeed_if pam_tally pam_tally2 pam_time pam_timestamp \
pam_tty_audit pam_umask \
- pam_unix pam_userdb pam_warn pam_wheel pam_xauth
+ pam_unix pam_userdb pam_warn pam_wheel pam_xauth pam_smack
CLEANFILES = *~
--- /dev/null
+securelibdir = $(SECUREDIR)
+secureconfdir = $(SCONFIGDIR)
+
+AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include @LIBSMACK_CFLAGS@
+AM_LDFLAGS = -no-undefined -avoid-version -module
+if HAVE_VERSIONING
+ AM_LDFLAGS += -Wl,--version-script=$(srcdir)/../modules.map
+endif
+securelib_LTLIBRARIES = pam_smack.la
+pam_smack_la_LIBADD = $(top_builddir)/libpam/libpam.la @LIBSMACK_LIBS@
+pam_smack_la_SOURCES = pam_smack.c
--- /dev/null
+#define _GNU_SOURCE
+#include <syslog.h>
+#include <sys/smack.h>
+
+#define PAM_SM_SESSION
+#include <security/pam_modules.h>
+#include <security/pam_modutil.h>
+
+
+PAM_EXTERN int
+pam_sm_open_session (pam_handle_t *pamh,
+ int flags,
+ int argc,
+ const char **argv)
+{
+ if (smack_smackfs_path ()) {
+ int rc = smack_set_label_for_self ("User");
+ if (rc) {
+ pam_syslog (pamh, LOG_WARNING, "couldn't set label");
+ }
+ }
+
+ return PAM_SUCCESS;
+}
+
+PAM_EXTERN int
+pam_sm_close_session (pam_handle_t *pamh, int flags,
+ int argc, const char **argv)
+{
+ return PAM_IGNORE;
+}
BuildRequires: net-tools
BuildRequires: zlib-devel
BuildRequires: gettext-tools
+BuildRequires: smack-devel
BuildRequires: pkgconfig
Requires(post): /sbin/ldconfig
Requires(post): /usr/bin/install
%{_moduledir}/pam_unix_passwd.so
%{_moduledir}/pam_unix_session.so
%{_moduledir}/pam_warn.so
+%{_moduledir}/pam_smack.so
%files devel
%manifest %{name}.manifest