diff options
Diffstat (limited to 'modules/pam_motd')
-rw-r--r-- | modules/pam_motd/.cvsignore | 6 | ||||
-rw-r--r-- | modules/pam_motd/Makefile.am | 31 | ||||
-rw-r--r-- | modules/pam_motd/README | 27 | ||||
-rw-r--r-- | modules/pam_motd/README.xml | 41 | ||||
-rw-r--r-- | modules/pam_motd/pam_motd.8 | 64 | ||||
-rw-r--r-- | modules/pam_motd/pam_motd.8.xml | 114 | ||||
-rw-r--r-- | modules/pam_motd/pam_motd.c | 130 | ||||
-rwxr-xr-x | modules/pam_motd/tst-pam_motd | 2 |
8 files changed, 0 insertions, 415 deletions
diff --git a/modules/pam_motd/.cvsignore b/modules/pam_motd/.cvsignore deleted file mode 100644 index 9fb98574..00000000 --- a/modules/pam_motd/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -*.la -*.lo -.deps -.libs -Makefile -Makefile.in diff --git a/modules/pam_motd/Makefile.am b/modules/pam_motd/Makefile.am deleted file mode 100644 index d6e1bafa..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 \ - -L$(top_builddir)/libpam -lpam -if HAVE_VERSIONING - AM_LDFLAGS += -Wl,--version-script=$(srcdir)/../modules.map -endif - -securelib_LTLIBRARIES = pam_motd.la - -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 b/modules/pam_motd/README deleted file mode 100644 index 414ad6f6..00000000 --- a/modules/pam_motd/README +++ /dev/null @@ -1,27 +0,0 @@ -pam_motd — Display the motd file - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -DESCRIPTION - -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 /etc/motd file is shown. -The message size is limited to 64KB. - -OPTIONS - -motd=/path/filename - - The /path/filename file is displayed as message of the day. - -EXAMPLES - -The suggested usage for /etc/pam.d/login is: - -session optional pam_motd.so motd=/etc/motd - - -AUTHOR - -pam_motd was written by Ben Collins <bcollins@debian.org>. - 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 b/modules/pam_motd/pam_motd.8 deleted file mode 100644 index 74bfb586..00000000 --- a/modules/pam_motd/pam_motd.8 +++ /dev/null @@ -1,64 +0,0 @@ -.\" Title: pam_motd -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.71.0 <http://docbook.sf.net/> -.\" Date: 10/26/2006 -.\" Manual: Linux\-PAM Manual -.\" Source: Linux\-PAM Manual -.\" -.TH "PAM_MOTD" "8" "10/26/2006" "Linux\-PAM Manual" "Linux\-PAM Manual" -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.SH "NAME" -pam_motd \- Display the motd file -.SH "SYNOPSIS" -.HP 12 -\fBpam_motd.so\fR [motd=\fI/path/filename\fR] -.SH "DESCRIPTION" -.PP -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 -\fI/etc/motd\fR -file is shown. The message size is limited to 64KB. -.SH "OPTIONS" -.PP -\fBmotd=\fR\fB\fI/path/filename\fR\fR -.RS 3n -The -\fI/path/filename\fR -file is displayed as message of the day. -.RE -.SH "MODULE SERVICES PROVIDED" -.PP -Only the -\fBsession\fR -service is supported. -.SH "RETURN VALUES" -.PP -PAM_IGNORE -.RS 3n -This is the only return value of this module. -.RE -.SH "EXAMPLES" -.PP -The suggested usage for -\fI/etc/pam.d/login\fR -is: -.sp -.RS 3n -.nf -session optional pam_motd.so motd=/etc/motd - -.fi -.RE -.sp -.SH "SEE ALSO" -.PP - -\fBmotd\fR(5), -\fBpam.conf\fR(5), -\fBpam.d\fR(8), -\fBpam\fR(8) -.SH "AUTHOR" -.PP -pam_motd was written by Ben Collins <bcollins@debian.org>. 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 <bcollins@debian.org>. - </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 |