libs/libpam: update to version 1.1.3, refresh patches

git-svn-id: svn://svn.openwrt.org/openwrt/packages@24301 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
acoul 2010-12-07 14:49:19 +00:00
parent afba20eaed
commit ff88a0ab5b
3 changed files with 92 additions and 5 deletions

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libpam
PKG_VERSION:=1.1.2
PKG_VERSION:=1.1.3
PKG_RELEASE:=1
PKG_SOURCE:=Linux-PAM-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@KERNEL/linux/libs/pam/pre/library
PKG_MD5SUM:=81173dfeffe69d726081f9c5667cd3e7
PKG_SOURCE_URL:=@KERNEL/linux/libs/pam/library
PKG_MD5SUM:=6db7fcb5db6253350e3a4648ceac40e7
PKG_INSTALL:=1
PKG_FIXUP:=libtool
@ -37,7 +37,7 @@ endef
TARGET_CFLAGS += $(FPIC)
define Build/Configure
(cd $(PKG_BUILD_DIR); aclocal -I m4 && autoconf && automake)
(cd $(PKG_BUILD_DIR); autoreconf -v -f --install || exit 1)
$(call Build/Configure/Default, \
--enable-shared \
--enable-static \
@ -50,6 +50,8 @@ define Build/Configure
)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DIR) $(1)/usr/include

View File

@ -0,0 +1,85 @@
innetgr may not be there so make sure that when innetgr is not present
then we inform about it and not use it.
-Khem
--- a/modules/pam_group/pam_group.c
+++ b/modules/pam_group/pam_group.c
@@ -659,7 +659,11 @@ static int check_account(pam_handle_t *p
}
/* If buffer starts with @, we are using netgroups */
if (buffer[0] == '@')
+#ifdef HAVE_INNETGR
good &= innetgr (&buffer[1], NULL, user, NULL);
+#else
+ pam_syslog (pamh, LOG_ERR, "pam_group does not have netgroup support");
+#endif
/* otherwise, if the buffer starts with %, it's a UNIX group */
else if (buffer[0] == '%')
good &= pam_modutil_user_in_group_nam_nam(pamh, user, &buffer[1]);
--- a/modules/pam_time/pam_time.c
+++ b/modules/pam_time/pam_time.c
@@ -555,9 +555,13 @@ check_account(pam_handle_t *pamh, const
}
/* If buffer starts with @, we are using netgroups */
if (buffer[0] == '@')
- good &= innetgr (&buffer[1], NULL, user, NULL);
+#ifdef HAVE_INNETGR
+ good &= innetgr (&buffer[1], NULL, user, NULL);
+#else
+ pam_syslog (pamh, LOG_ERR, "pam_time does not have netgroup support");
+#endif
else
- good &= logic_field(pamh, user, buffer, count, is_same);
+ good &= logic_field(pamh, user, buffer, count, is_same);
D(("with user: %s", good ? "passes":"fails" ));
/* here we get the time field */
--- a/modules/pam_succeed_if/pam_succeed_if.c
+++ b/modules/pam_succeed_if/pam_succeed_if.c
@@ -231,18 +231,27 @@ evaluate_notingroup(pam_handle_t *pamh,
}
/* Return PAM_SUCCESS if the (host,user) is in the netgroup. */
static int
-evaluate_innetgr(const char *host, const char *user, const char *group)
+evaluate_innetgr(const pam_handle_t* pamh, const char *host, const char *user, const char *group)
{
+#ifdef HAVE_INNETGR
if (innetgr(group, host, user, NULL) == 1)
return PAM_SUCCESS;
+#else
+ pam_syslog (pamh, LOG_ERR, "pam_succeed_if does not have netgroup support");
+#endif
+
return PAM_AUTH_ERR;
}
/* Return PAM_SUCCESS if the (host,user) is NOT in the netgroup. */
static int
-evaluate_notinnetgr(const char *host, const char *user, const char *group)
+evaluate_notinnetgr(const pam_handle_t* pamh, const char *host, const char *user, const char *group)
{
+#ifdef HAVE_INNETGR
if (innetgr(group, host, user, NULL) == 0)
return PAM_SUCCESS;
+#else
+ pam_syslog (pamh, LOG_ERR, "pam_succeed_if does not have netgroup support");
+#endif
return PAM_AUTH_ERR;
}
@@ -361,14 +370,14 @@ evaluate(pam_handle_t *pamh, int debug,
const void *rhost;
if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS)
rhost = NULL;
- return evaluate_innetgr(rhost, user, right);
+ return evaluate_innetgr(pamh, rhost, user, right);
}
/* (Rhost, user) is not in this group. */
if (strcasecmp(qual, "notinnetgr") == 0) {
const void *rhost;
if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS)
rhost = NULL;
- return evaluate_notinnetgr(rhost, user, right);
+ return evaluate_notinnetgr(pamh, rhost, user, right);
}
/* Fail closed. */
return PAM_SERVICE_ERR;

View File

@ -23,7 +23,7 @@
examples xtests
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
@@ -249,8 +249,8 @@ top_build_prefix = @top_build_prefix@
@@ -253,8 +253,8 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = 1.9 gnu dist-bzip2 check-news