summaryrefslogtreecommitdiff
path: root/modules/pam_filter
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2005-08-16 12:27:38 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2005-08-16 12:27:38 +0000
commit23624ea6f78ec8acc167a2491c00998907fc76b1 (patch)
treea57b3caee23a167d442d7d4e0419c4689dfba565 /modules/pam_filter
parent2b5457bbf7352200f7bc77795adbbcfd47550855 (diff)
Relevant BUGIDs: none
Purpose of commit: new feature Commit summary: --------------- Big "automake/autoconf/libtool" commit
Diffstat (limited to 'modules/pam_filter')
-rw-r--r--modules/pam_filter/Makefile126
-rw-r--r--modules/pam_filter/Makefile.am22
-rw-r--r--modules/pam_filter/pam_filter.c8
-rw-r--r--modules/pam_filter/pam_filter.h (renamed from modules/pam_filter/include/pam_filter.h)0
-rw-r--r--modules/pam_filter/upperLOWER/Makefile42
-rw-r--r--modules/pam_filter/upperLOWER/Makefile.am14
-rw-r--r--modules/pam_filter/upperLOWER/upperLOWER.c7
7 files changed, 43 insertions, 176 deletions
diff --git a/modules/pam_filter/Makefile b/modules/pam_filter/Makefile
deleted file mode 100644
index 48411497..00000000
--- a/modules/pam_filter/Makefile
+++ /dev/null
@@ -1,126 +0,0 @@
-#
-# $Id$
-#
-# This Makefile controls a build process of $(TITLE) module for
-# Linux-PAM. You should not modify this Makefile (unless you know
-# what you are doing!).
-#
-# Created by Andrew Morgan <morgan@linux.kernel.org> 1996/3/11
-#
-
-ifeq ($(OS),solaris)
-
-include ../dont_makefile
-
-else
-
-include ../../Make.Rules
-
-TITLE=pam_filter
-FILTERS=upperLOWER
-FILTERSDIR=$(SECUREDIR)/pam_filter
-export FILTERSDIR
-
-CFLAGS += -Iinclude
-
-LIBSRC = $(TITLE).c
-LIBOBJ = $(TITLE).o
-LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
-LIBOBJS = $(addprefix static/,$(LIBOBJ))
-
-dynamic/%.o : %.c
- $(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
-
-static/%.o : %.c
- $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
-
-ifdef DYNAMIC
-LIBSHARED = $(TITLE).so
-endif
-
-ifdef STATIC
-LIBSTATIC = lib$(TITLE).o
-endif
-
-####################### don't edit below #######################
-
-#
-# this is where we compile this module
-#
-
-all: dirs $(LIBSHARED) $(LIBSTATIC) register filters
-
-dirs:
- if [ ! -r include/security ]; then ln -sf . include/security ; fi
-ifdef DYNAMIC
- $(MKDIR) ./dynamic
-endif
-ifdef STATIC
- $(MKDIR) ./static
-endif
-
-register:
-ifdef STATIC
- ( cd .. ; ./register_static $(TITLE) $(TITLE)/$(LIBSTATIC) )
-endif
-
-filters:
- @for i in $(FILTERS) ; do \
- if [ -d $$i ]; then \
- $(MAKE) -C $$i all ; \
- fi ; \
- done
-
-
-ifdef DYNAMIC
-$(LIBOBJD): $(LIBSRC)
-endif
-
-ifdef DYNAMIC
-$(LIBSHARED): $(LIBOBJD)
- $(LD_D) -o $@ $(LIBOBJD)
-endif
-
-ifdef STATIC
-$(LIBOBJS): $(LIBSRC)
-endif
-
-ifdef STATIC
-$(LIBSTATIC): $(LIBOBJS)
- $(LD) -r -o $@ $(LIBOBJS)
-endif
-
-remove:
- rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
- rm -f $(FAKEROOT)$(INCLUDED)/pam_filter.h
- @for i in $(FILTERS) ; do \
- if [ -d $$i ]; then \
- $(MAKE) -C $$i remove ; \
- fi ; \
- done
-
-install: all
- @for i in $(FILTERS) ; do \
- if [ -d $$i ]; then \
- $(MAKE) -C $$i install ; \
- fi ; \
- done
- $(MKDIR) $(FAKEROOT)$(SECUREDIR)
-ifdef DYNAMIC
- $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
-endif
- $(MKDIR) $(FAKEROOT)$(INCLUDED)
- $(INSTALL) -m 644 include/pam_filter.h $(FAKEROOT)$(INCLUDED)
-
-clean:
- @for i in $(FILTERS) ; do \
- if [ -d $$i ]; then \
- $(MAKE) -C $$i clean ; \
- fi ; \
- done
- rm -f $(LIBSHARED) $(LIBOBJD) $(LIBOBJS) core *~
- rm -f include/security
- rm -fr dynamic static
- rm -f *.a *.o *.so *.bak
-
-endif
diff --git a/modules/pam_filter/Makefile.am b/modules/pam_filter/Makefile.am
new file mode 100644
index 00000000..9d2585a5
--- /dev/null
+++ b/modules/pam_filter/Makefile.am
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2005 Thorsten Kukuk <kukuk@suse.de>
+#
+
+SUBDIRS = upperLOWER
+
+CLEANFILES = *~
+
+EXTRA_DIST = README
+
+securelibdir = $(SECUREDIR)
+secureconfdir = $(SCONFIGDIR)
+
+AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include \
+ -I$(top_srcdir)/modules/pammodutil/include/
+AM_LDFLAGS = -avoid-version -module \
+ -L$(top_builddir)/modules/pammodutil -lpammodutil \
+ -L$(top_builddir)/libpam -lpam
+
+include_HEADERS=pam_filter.h
+
+securelib_LTLIBRARIES = pam_filter.la
diff --git a/modules/pam_filter/pam_filter.c b/modules/pam_filter/pam_filter.c
index c03126ca..b34c8419 100644
--- a/modules/pam_filter/pam_filter.c
+++ b/modules/pam_filter/pam_filter.c
@@ -31,7 +31,7 @@
#define PAM_SM_PASSWORD
#include <security/pam_modules.h>
-#include <security/pam_filter.h>
+#include "pam_filter.h"
/* ------ some tokens used for convenience throughout this file ------- */
@@ -282,8 +282,9 @@ static void free_evp(char *evp[])
free(evp);
}
-static int set_filter(pam_handle_t *pamh, int flags, int ctrl
- , const char **evp, const char *filtername)
+static int
+set_filter (pam_handle_t *pamh, int flags UNUSED, int ctrl,
+ const char **evp, const char *filtername)
{
int status=-1;
char terminal[TERMINAL_LEN];
@@ -591,6 +592,7 @@ static int set_filter(pam_handle_t *pamh, int flags, int ctrl
/* quit the parent process, returning the child's exit status */
exit(status);
+ return status; /* never reached, to make gcc happy */
}
static int set_the_terminal(pam_handle_t *pamh)
diff --git a/modules/pam_filter/include/pam_filter.h b/modules/pam_filter/pam_filter.h
index 630198ee..630198ee 100644
--- a/modules/pam_filter/include/pam_filter.h
+++ b/modules/pam_filter/pam_filter.h
diff --git a/modules/pam_filter/upperLOWER/Makefile b/modules/pam_filter/upperLOWER/Makefile
deleted file mode 100644
index 60c6d08c..00000000
--- a/modules/pam_filter/upperLOWER/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# $Id$
-#
-# This directory contains a pam_filter filter executable
-#
-# Created by Andrew Morgan <morgan@transmeta.com> 1996/3/11
-#
-
-include ../../../Make.Rules
-
-TITLE=upperLOWER
-
-#
-
-CFLAGS += -I../include -I../../pammodutil/include
-
-OBJS = $(TITLE).o
-
-LIBS += $(GLIB_LIBS) -L../../pammodutil -lpammodutil
-LDFLAGS = $(LIBS)
-
-####################### don't edit below #######################
-
-all: $(TITLE)
-
-$(TITLE): $(OBJS)
- $(CC) $(CFLAGS) -o $(TITLE) $(OBJS) $(LDFLAGS)
- $(STRIP) $(TITLE)
-
-install:
- $(MKDIR) $(FAKEROOT)$(FILTERSDIR)
- $(INSTALL) -m 511 $(TITLE) $(FAKEROOT)$(FILTERSDIR)
-
-remove:
- cd $(FAKEROOT)$(FILTERSDIR) && rm -f $(TITLE)
-
-clean:
- rm -f $(TITLE) $(OBJS) core *~
-
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
diff --git a/modules/pam_filter/upperLOWER/Makefile.am b/modules/pam_filter/upperLOWER/Makefile.am
new file mode 100644
index 00000000..88f7c2e2
--- /dev/null
+++ b/modules/pam_filter/upperLOWER/Makefile.am
@@ -0,0 +1,14 @@
+#
+# Copyright (c) 2005 Thorsten Kukuk <kukuk@suse.de>
+#
+
+CLEANFILES = *~
+
+securelibfilterdir = $(SECUREDIR)/pam_filter
+
+
+AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include \
+ -I$(top_srcdir)/modules/pammodutil/include/ -I..
+AM_LDFLAGS = -L$(top_builddir)/modules/pammodutil -lpammodutil
+
+securelibfilter_PROGRAMS = upperLOWER
diff --git a/modules/pam_filter/upperLOWER/upperLOWER.c b/modules/pam_filter/upperLOWER/upperLOWER.c
index 5aa0e2c0..3ff4b547 100644
--- a/modules/pam_filter/upperLOWER/upperLOWER.c
+++ b/modules/pam_filter/upperLOWER/upperLOWER.c
@@ -20,7 +20,7 @@
#include <sys/types.h>
#include <unistd.h>
-#include <security/pam_filter.h>
+#include "pam_filter.h"
#include <security/pam_modules.h>
#include <security/_pam_macros.h>
#include <security/_pam_modutil.h>
@@ -59,7 +59,7 @@ static void do_transpose(char *buffer,int len)
extern char **environ;
-int main(int argc, char **argv)
+int main(int argc, char **argv UNUSED)
{
char buffer[BUFSIZ];
fd_set readers;
@@ -162,6 +162,3 @@ int main(int argc, char **argv)
exit(0);
}
-
-
-