summaryrefslogtreecommitdiff
path: root/modules/pam_access
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_access
parent2b5457bbf7352200f7bc77795adbbcfd47550855 (diff)
Relevant BUGIDs: none
Purpose of commit: new feature Commit summary: --------------- Big "automake/autoconf/libtool" commit
Diffstat (limited to 'modules/pam_access')
-rw-r--r--modules/pam_access/Makefile24
-rw-r--r--modules/pam_access/Makefile.am21
-rw-r--r--modules/pam_access/pam_access.c23
3 files changed, 30 insertions, 38 deletions
diff --git a/modules/pam_access/Makefile b/modules/pam_access/Makefile
deleted file mode 100644
index 87b2b3e6..00000000
--- a/modules/pam_access/Makefile
+++ /dev/null
@@ -1,24 +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!).
-#
-
-include ../../Make.Rules
-
-TITLE=pam_access
-LOCAL_CONFILE=./access.conf
-INSTALLED_CONFILE=$(SCONFIGD)/access.conf
-ifeq ($(HAVE_LIBNSL),yes)
-MODULE_SIMPLE_EXTRALIBS=-lnsl
-endif
-
-DEFS=-DDEFAULT_CONF_FILE=\"$(INSTALLED_CONFILE)\"
-CFLAGS += $(DEFS)
-
-MODULE_SIMPLE_INSTALL=bash -f ../install_conf "$(FAKEROOT)" "$(SCONFIGD)" "$(INSTALLED_CONFILE)" "$(TITLE)" "$(LOCAL_CONFILE)"
-MODULE_SIMPLE_REMOVE=rm -f $(FAKEROOT)$(INSTALLED_CONFILE)
-MODULE_SIMPLE_CLEAN=rm -f ./.ignore_age
-
-include ../Simple.Rules
diff --git a/modules/pam_access/Makefile.am b/modules/pam_access/Makefile.am
new file mode 100644
index 00000000..9d7327de
--- /dev/null
+++ b/modules/pam_access/Makefile.am
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2005 Thorsten Kukuk <kukuk@suse.de>
+#
+
+CLEANFILES = *~
+
+EXTRA_DIST = README access.conf
+
+securelibdir = $(SECUREDIR)
+secureconfdir = $(SCONFIGDIR)
+
+AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include \
+ -I$(top_srcdir)/modules/pammodutil/include/ \
+ -DPAM_ACCESS_CONFIG=\"$(SCONFIGDIR)/access.conf\"
+AM_LDFLAGS = -avoid-version -module \
+ -L$(top_builddir)/modules/pammodutil -lpammodutil \
+ -L$(top_builddir)/libpam -lpam @LIBNSL@
+
+securelib_LTLIBRARIES = pam_access.la
+
+secureconf_DATA = access.conf
diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c
index d35cf043..793332fb 100644
--- a/modules/pam_access/pam_access.c
+++ b/modules/pam_access/pam_access.c
@@ -77,12 +77,6 @@
#define MAXHOSTNAMELEN 256
#endif
-#ifdef DEFAULT_CONF_FILE
-# define PAM_ACCESS_CONFIG DEFAULT_CONF_FILE
-#else
-# define PAM_ACCESS_CONFIG "/etc/security/access.conf"
-#endif
-
/* Delimiters for fields and for lists of users, ttys or hosts. */
static const char *fs = ":"; /* field separator */
@@ -160,7 +154,7 @@ static int list_match (pam_handle_t *, char *, struct login_info *,
match_func *);
static int user_match (pam_handle_t *, char *, struct login_info *);
static int from_match (pam_handle_t *, char *, struct login_info *);
-static int string_match (pam_handle_t *, const char *, const char *);
+static int string_match (const char *, const char *);
/* login_access - match username/group and host/tty with access control file */
@@ -303,7 +297,7 @@ static int user_match(pam_handle_t *pamh, char *tok, struct login_info *item)
return (user_match (pamh, tok, item) && from_match (pamh, at + 1, &fake_item));
} else if (tok[0] == '@') /* netgroup */
return (netgroup_match(tok + 1, (char *) 0, string));
- else if (string_match (pamh, tok, string)) /* ALL or exact match */
+ else if (string_match (tok, string)) /* ALL or exact match */
return YES;
else if (_pammodutil_user_in_group_nam_nam (pamh, item->user->pw_name, tok))
/* try group membership */
@@ -315,7 +309,7 @@ static int user_match(pam_handle_t *pamh, char *tok, struct login_info *item)
/* from_match - match a host or tty against a list of tokens */
static int
-from_match (pam_handle_t *pamh, char *tok, struct login_info *item)
+from_match (pam_handle_t *pamh UNUSED, char *tok, struct login_info *item)
{
const char *string = item->from;
int tok_len;
@@ -332,7 +326,7 @@ from_match (pam_handle_t *pamh, char *tok, struct login_info *item)
if (tok[0] == '@') { /* netgroup */
return (netgroup_match(tok + 1, string, (char *) 0));
- } else if (string_match (pamh, tok, string)) /* ALL or exact match */
+ } else if (string_match (tok, string)) /* ALL or exact match */
return YES;
else if (tok[0] == '.') { /* domain: match last fields */
if ((str_len = strlen(string)) > (tok_len = strlen(tok))
@@ -367,7 +361,7 @@ from_match (pam_handle_t *pamh, char *tok, struct login_info *item)
r = snprintf(hn, sizeof(hn), "%u.%u.%u.%u.",
(unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1],
(unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
- if (r < 0 || r >= sizeof(hn))
+ if (r < 0 || r >= (int)sizeof(hn))
return (NO);
if (!strncmp(tok, hn, tok_len))
return (YES);
@@ -379,7 +373,7 @@ from_match (pam_handle_t *pamh, char *tok, struct login_info *item)
/* string_match - match a string against one token */
static int
-string_match (pam_handle_t *pamh, const char *tok, const char *string)
+string_match (const char *tok, const char *string)
{
/*
@@ -397,8 +391,9 @@ string_match (pam_handle_t *pamh, const char *tok, const char *string)
/* --- public account management functions --- */
-PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh,int flags,int argc
- ,const char **argv)
+PAM_EXTERN int
+pam_sm_acct_mgmt (pam_handle_t *pamh, int flags UNUSED,
+ int argc, const char **argv)
{
struct login_info loginfo;
const char *user=NULL;