aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_motd
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_motd')
-rw-r--r--modules/pam_motd/.cvsignore8
-rw-r--r--modules/pam_motd/Makefile.am31
-rw-r--r--modules/pam_motd/README.xml41
-rw-r--r--modules/pam_motd/pam_motd.8.xml114
-rw-r--r--modules/pam_motd/pam_motd.c130
-rwxr-xr-xmodules/pam_motd/tst-pam_motd2
6 files changed, 0 insertions, 326 deletions
diff --git a/modules/pam_motd/.cvsignore b/modules/pam_motd/.cvsignore
deleted file mode 100644
index f36d06fa..00000000
--- a/modules/pam_motd/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-*.la
-*.lo
-.deps
-.libs
-Makefile
-Makefile.in
-README
-pam_motd.8
diff --git a/modules/pam_motd/Makefile.am b/modules/pam_motd/Makefile.am
deleted file mode 100644
index 872e5d37..00000000
--- a/modules/pam_motd/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Copyright (c) 2005, 2006 Thorsten Kukuk <kukuk@suse.de>
-#
-
-CLEANFILES = *~
-
-EXTRA_DIST = README $(MANS) $(XMLS) tst-pam_motd
-
-man_MANS = pam_motd.8
-XMLS = README.xml pam_motd.8.xml
-
-TESTS = tst-pam_motd
-
-securelibdir = $(SECUREDIR)
-secureconfdir = $(SCONFIGDIR)
-
-AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include
-AM_LDFLAGS = -no-undefined -avoid-version -module
-if HAVE_VERSIONING
- AM_LDFLAGS += -Wl,--version-script=$(srcdir)/../modules.map
-endif
-
-securelib_LTLIBRARIES = pam_motd.la
-pam_motd_la_LIBADD = -L$(top_builddir)/libpam -lpam
-
-if ENABLE_REGENERATE_MAN
-noinst_DATA = README
-README: pam_motd.8.xml
--include $(top_srcdir)/Make.xml.rules
-endif
-
diff --git a/modules/pam_motd/README.xml b/modules/pam_motd/README.xml
deleted file mode 100644
index 779e4d17..00000000
--- a/modules/pam_motd/README.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding='UTF-8'?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
-"http://www.docbook.org/xml/4.3/docbookx.dtd"
-[
-<!--
-<!ENTITY pamaccess SYSTEM "pam_motd.8.xml">
--->
-]>
-
-<article>
-
- <articleinfo>
-
- <title>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- href="pam_motd.8.xml" xpointer='xpointer(//refnamediv[@id = "pam_motd-name"]/*)'/>
- </title>
-
- </articleinfo>
-
- <section>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- href="pam_motd.8.xml" xpointer='xpointer(//refsect1[@id = "pam_motd-description"]/*)'/>
- </section>
-
- <section>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- href="pam_motd.8.xml" xpointer='xpointer(//refsect1[@id = "pam_motd-options"]/*)'/>
- </section>
-
- <section>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- href="pam_motd.8.xml" xpointer='xpointer(//refsect1[@id = "pam_motd-examples"]/*)'/>
- </section>
-
- <section>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- href="pam_motd.8.xml" xpointer='xpointer(//refsect1[@id = "pam_motd-author"]/*)'/>
- </section>
-
-</article>
diff --git a/modules/pam_motd/pam_motd.8.xml b/modules/pam_motd/pam_motd.8.xml
deleted file mode 100644
index 7bd6798c..00000000
--- a/modules/pam_motd/pam_motd.8.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version="1.0" encoding='UTF-8'?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
-
-<refentry id="pam_motd">
-
- <refmeta>
- <refentrytitle>pam_motd</refentrytitle>
- <manvolnum>8</manvolnum>
- <refmiscinfo class="sectdesc">Linux-PAM Manual</refmiscinfo>
- </refmeta>
-
- <refnamediv id="pam_motd-name">
- <refname>pam_motd</refname>
- <refpurpose>Display the motd file</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis id="pam_motd-cmdsynopsis">
- <command>pam_motd.so</command>
- <arg choice="opt">
- motd=<replaceable>/path/filename</replaceable>
- </arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="pam_motd-description">
-
- <title>DESCRIPTION</title>
-
- <para>
- pam_motd is a PAM module that can be used to display
- arbitrary motd (message of the day) files after a succesful
- login. By default the <filename>/etc/motd</filename> file is
- shown. The message size is limited to 64KB.
- </para>
-
- </refsect1>
-
- <refsect1 id="pam_motd-options">
-
- <title>OPTIONS</title>
- <variablelist>
- <varlistentry>
- <term>
- <option>motd=<replaceable>/path/filename</replaceable></option>
- </term>
- <listitem>
- <para>
- The <filename>/path/filename</filename> file is displayed
- as message of the day.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
-
- <refsect1 id="pam_motd-services">
- <title>MODULE SERVICES PROVIDED</title>
- <para>
- Only the <option>session</option> service is supported.
- </para>
- </refsect1>
-
- <refsect1 id='pam_motd-return_values'>
- <title>RETURN VALUES</title>
- <variablelist>
- <varlistentry>
- <term>PAM_IGNORE</term>
- <listitem>
- <para>
- This is the only return value of this module.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
-
- <refsect1 id='pam_motd-examples'>
- <title>EXAMPLES</title>
- <para>
- The suggested usage for <filename>/etc/pam.d/login</filename> is:
- <programlisting>
-session optional pam_motd.so motd=/etc/motd
- </programlisting>
- </para>
- </refsect1>
-
- <refsect1 id='pam_motd-see_also'>
- <title>SEE ALSO</title>
- <para>
- <citerefentry>
- <refentrytitle>motd</refentrytitle><manvolnum>5</manvolnum>
- </citerefentry>,
- <citerefentry>
- <refentrytitle>pam.conf</refentrytitle><manvolnum>5</manvolnum>
- </citerefentry>,
- <citerefentry>
- <refentrytitle>pam.d</refentrytitle><manvolnum>8</manvolnum>
- </citerefentry>,
- <citerefentry>
- <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
- </citerefentry>
- </para>
- </refsect1>
-
- <refsect1 id='pam_motd-author'>
- <title>AUTHOR</title>
- <para>
- pam_motd was written by Ben Collins &lt;bcollins@debian.org&gt;.
- </para>
- </refsect1>
-
-</refentry>
diff --git a/modules/pam_motd/pam_motd.c b/modules/pam_motd/pam_motd.c
deleted file mode 100644
index ff9b1690..00000000
--- a/modules/pam_motd/pam_motd.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/* pam_motd module */
-
-/*
- * Modified for pam_motd by Ben Collins <bcollins@debian.org>
- *
- * Based off of:
- * $Id$
- *
- * Written by Michael K. Johnson <johnsonm@redhat.com> 1996/10/24
- *
- */
-
-#include "config.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <pwd.h>
-#include <syslog.h>
-
-#include <security/_pam_macros.h>
-#include <security/pam_ext.h>
-/*
- * here, we make a definition for the externally accessible function
- * in this file (this definition is required for static a module
- * but strongly encouraged generally) it is used to instruct the
- * modules include file to define the function prototypes.
- */
-
-#define PAM_SM_SESSION
-#define DEFAULT_MOTD "/etc/motd"
-
-#include <security/pam_modules.h>
-#include <security/pam_modutil.h>
-
-/* --- session management functions (only) --- */
-
-PAM_EXTERN int
-pam_sm_close_session (pam_handle_t *pamh UNUSED, int flags UNUSED,
- int argc UNUSED, const char **argv UNUSED)
-{
- return PAM_IGNORE;
-}
-
-static char default_motd[] = DEFAULT_MOTD;
-
-PAM_EXTERN
-int pam_sm_open_session(pam_handle_t *pamh, int flags,
- int argc, const char **argv)
-{
- int retval = PAM_IGNORE;
- int fd;
- const char *motd_path = NULL;
- char *mtmp = NULL;
-
- if (flags & PAM_SILENT) {
- return retval;
- }
-
- for (; argc-- > 0; ++argv) {
- if (!strncmp(*argv,"motd=",5)) {
-
- motd_path = 5 + *argv;
- if (*motd_path != '\0') {
- D(("set motd path: %s", motd_path));
- } else {
- motd_path = NULL;
- pam_syslog(pamh, LOG_ERR,
- "motd= specification missing argument - ignored");
- }
- }
- else
- pam_syslog(pamh, LOG_ERR, "unknown option: %s", *argv);
- }
-
- if (motd_path == NULL)
- motd_path = default_motd;
-
- while ((fd = open(motd_path, O_RDONLY, 0)) >= 0) {
- struct stat st;
-
- /* fill in message buffer with contents of motd */
- if ((fstat(fd, &st) < 0) || !st.st_size || st.st_size > 0x10000)
- break;
-
- if (!(mtmp = malloc(st.st_size+1)))
- break;
-
- if (pam_modutil_read(fd, mtmp, st.st_size) != st.st_size)
- break;
-
- if (mtmp[st.st_size-1] == '\n')
- mtmp[st.st_size-1] = '\0';
- else
- mtmp[st.st_size] = '\0';
-
- pam_info (pamh, "%s", mtmp);
- break;
- }
-
- _pam_drop (mtmp);
-
- if (fd >= 0)
- close(fd);
-
- return retval;
-}
-
-
-#ifdef PAM_STATIC
-
-/* static module data */
-
-struct pam_module _pam_motd_modstruct = {
- "pam_motd",
- NULL,
- NULL,
- NULL,
- pam_sm_open_session,
- pam_sm_close_session,
- NULL,
-};
-
-#endif
-
-/* end of module definition */
diff --git a/modules/pam_motd/tst-pam_motd b/modules/pam_motd/tst-pam_motd
deleted file mode 100755
index 155e2304..00000000
--- a/modules/pam_motd/tst-pam_motd
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-../../tests/tst-dlopen .libs/pam_motd.so