[gdm] pam_gdm: add stub pam module



commit 714b6af29b916ac7da0cdab6f83460574ed49cf2
Author: Ray Strode <rstrode redhat com>
Date:   Mon Aug 15 13:48:00 2016 -0400

    pam_gdm: add stub pam module
    
    It doesn't do anything yet, but it will eventually get used for
    autologin purposes, and maybe other things.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769950

 Makefile.am         |    1 +
 configure.ac        |    7 ++++
 pam_gdm/Makefile.am |   37 ++++++++++++++++++++++++
 pam_gdm/pam_gdm.c   |   78 +++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 123 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index aeea8b6..fa3bdcc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,6 +6,7 @@ SUBDIRS =                       \
        daemon                  \
        libgdm                  \
        utils                   \
+       pam_gdm                 \
        po                      \
        tests                   \
        $(NULL)
diff --git a/configure.ac b/configure.ac
index 3307d80..cb3a376 100644
--- a/configure.ac
+++ b/configure.ac
@@ -221,6 +221,12 @@ AM_CONDITIONAL(ENABLE_EXHERBO_PAM_CONFIG, test x$with_default_pam_config = xexhe
 AM_CONDITIONAL(ENABLE_LFS_PAM_CONFIG, test x$with_default_pam_config = xlfs)
 AM_CONDITIONAL(ENABLE_ARCH_PAM_CONFIG, test x$with_default_pam_config = xarch)
 
+AC_CHECK_HEADERS([security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
+                 [have_pam=yes],
+                 [if test "x$have_pam" = xyes ; then
+                        AC_MSG_ERROR([PAM development files not found.])
+                 fi])
+
 AC_ARG_ENABLE(console-helper,
              AS_HELP_STRING([--enable-console-helper],
                              [Enable PAM console helper @<:@default=auto@:>@]),,
@@ -1519,6 +1525,7 @@ chooser/Makefile
 libgdm/Makefile
 libgdm/gdm.pc
 utils/Makefile
+pam_gdm/Makefile
 data/gdm.conf
 data/Makefile
 data/applications/Makefile
diff --git a/pam_gdm/Makefile.am b/pam_gdm/Makefile.am
new file mode 100644
index 0000000..5ea69d7
--- /dev/null
+++ b/pam_gdm/Makefile.am
@@ -0,0 +1,37 @@
+END_OF_LIST =
+
+AM_CPPFLAGS = \
+        -I$(srcdir)                                                     \
+        -I$(builddir)                                                   \
+        -I$(top_srcdir)                                                 \
+        -I$(top_builddir)                                               \
+        -DG_LOG_DOMAIN=\"Gdm\"                                          \
+        -DDMCONFDIR=\""$(dmconfdir)"\"                                  \
+        -DDATADIR=\""$(datadir)"\"                                      \
+        $(END_OF_LIST)
+
+pam_gdm_la_SOURCES = \
+       pam_gdm.c \
+       $(END_OF_LIST)
+
+pam_gdm_la_CFLAGS = \
+       $(PAM_CFLAGS) \
+       $(END_OF_LIST)
+
+pam_gdm_la_LDFLAGS = \
+       -module \
+       -export-dynamic \
+       -avoid-version \
+       -shared \
+       $(END_OF_LIST)
+
+pam_gdm_la_LIBADD = \
+       $(PAM_LIBS) \
+       $(END_OF_LIST)
+
+
+pam_gdm_LTLIBRARIES = \
+       pam_gdm.la \
+       $(END_OF_LIST)
+
+pam_gdmdir = $(libdir)/security
diff --git a/pam_gdm/pam_gdm.c b/pam_gdm/pam_gdm.c
new file mode 100644
index 0000000..90a0557
--- /dev/null
+++ b/pam_gdm/pam_gdm.c
@@ -0,0 +1,78 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright  (C) 2016 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+#include <security/_pam_macros.h>
+#include <security/pam_ext.h>
+#include <security/pam_misc.h>
+#include <security/pam_modules.h>
+#include <security/pam_modutil.h>
+
+int
+pam_sm_authenticate (pam_handle_t  *pamh,
+                     int            flags,
+                     int            argc,
+                     const char   **argv)
+{
+        return PAM_SUCCESS;
+}
+
+int
+pam_sm_setcred (pam_handle_t *pamh,
+                int           flags,
+                int           argc,
+                const char  **argv)
+{
+        return PAM_SUCCESS;
+}
+
+int
+pam_sm_acct_mgmt (pam_handle_t  *pamh,
+                  int            flags,
+                  int            argc,
+                  const char   **argv)
+{
+        return PAM_SUCCESS;
+}
+
+int
+pam_sm_chauthtok (pam_handle_t  *pamh,
+                  int            flags,
+                  int            argc,
+                  const char   **argv)
+{
+        return PAM_SUCCESS;
+}
+
+int
+pam_sm_open_session (pam_handle_t  *pamh,
+                     int            flags,
+                     int            argc,
+                     const char   **argv)
+{
+        return PAM_SUCCESS;
+}
+
+int
+pam_sm_close_session (pam_handle_t  *pamh,
+                      int            flags,
+                      int            argc,
+                      const char   **argv)
+{
+        return PAM_SUCCESS;
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]