Skip to contentSkip to conversation

Add package linux-pam

PATCH New Dmitry 2 participants 5 messages Aug 10, 2012 – Aug 11, 2012 1 message not in the archive

lore
Share & tools
lore

Dmitry

author
#0 lore raw

PATCH 1/1 Add package linux-pam

---
 package/Config.in                                 |    1 +
 package/linux-pam/Config.in                       |   15 ++++++++++++
 package/linux-pam/linux-pam-configure.patch       |   11 +++++++++
 package/linux-pam/linux-pam-doc-makefile-am.patch |   25 +++++++++++++++++++++
 package/linux-pam/linux-pam-group.patch           |   18 +++++++++++++++
 package/linux-pam/linux-pam-rhosts.patch          |   16 +++++++++++++
 package/linux-pam/linux-pam-succeed.patch         |   23 +++++++++++++++++++
 package/linux-pam/linux-pam-time.patch            |   18 +++++++++++++++
 package/linux-pam/linux-pam.mk                    |   21 +++++++++++++++++
 9 files changed, 148 insertions(+), 0 deletions(-)
 create mode 100644 package/linux-pam/Config.in
 create mode 100644 package/linux-pam/linux-pam-configure.patch
 create mode 100644 package/linux-pam/linux-pam-doc-makefile-am.patch
 create mode 100644 package/linux-pam/linux-pam-group.patch
 create mode 100644 package/linux-pam/linux-pam-rhosts.patch
 create mode 100644 package/linux-pam/linux-pam-succeed.patch
 create mode 100644 package/linux-pam/linux-pam-time.patch
 create mode 100644 package/linux-pam/linux-pam.mk
package/Config.in +1 -0
index f308de7..28bca5f 100644
@@ -460,6 +460,7 @@ source "package/libnspr/Config.in"
 source "package/libsigc/Config.in"
 source "package/libtpl/Config.in"
 source "package/liburcu/Config.in"
+source "package/linux-pam/Config.in"
 source "package/lttng-libust/Config.in"
 source "package/orc/Config.in"
 source "package/poco/Config.in"
package/linux-pam/Config.in new file +15 -0
new file mode 100644
index 0000000..722b875
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_LINUX_PAM
+	bool "linux-pam"
+	select BR2_PACKAGE_LIBINTL if BR2_NEEDS_GETTEXT_IF_LOCALE
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
+	select BR2_PACKAGE_FLEX
+	select BR2_PACKAGE_FLEX_LIBFL
+	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR)
+	help
+	  A Security Framework that Provides Authentication for Applications
+
+	  http://linux-pam.org
+
+comment "linux-pam requires a toolchain with WCHAR and locale support"
+	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR)
+
package/linux-pam/linux-pam-configure.patch new file +11 -0
new file mode 100644
index 0000000..26b3d4e
@@ -0,0 +1,11 @@
+--- linux-pam-1.1.4/configure.in	2011-06-24 06:46:33.000000000 -0400
++++ linux-pam-1.1.4/configure.in	2012-08-09 21:14:11.000000000 -0400
+@@ -522,7 +522,7 @@
+ AC_CHECK_FUNCS(strcspn strdup strspn strstr strtol uname)
+ AC_CHECK_FUNCS(getutent_r getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r)
+ AC_CHECK_FUNCS(getgrouplist getline getdelim)
+-AC_CHECK_FUNCS(inet_ntop inet_pton innetgr ruserok_af)
++AC_CHECK_FUNCS(inet_ntop inet_pton innetgr ruserok_af ruserok)
+ 
+ AC_CHECK_FUNCS(unshare, [UNSHARE=yes], [UNSHARE=no])
+ AM_CONDITIONAL([HAVE_UNSHARE], [test "$UNSHARE" = yes])
package/linux-pam/linux-pam-doc-makefile-am.patch new file +25 -0
new file mode 100644
index 0000000..b0f367a
@@ -0,0 +1,25 @@
+--- linux-pam-1.1.4/doc/Makefile.am	2011-06-21 05:04:56.000000000 -0400
++++ linux-pam-1.1.4/doc/Makefile.am	2012-08-09 05:59:23.000000000 -0400
+@@ -2,8 +2,6 @@
+ # Copyright (c) 2005, 2006 Thorsten Kukuk <[email protected]>
+ #
+ 
+-SUBDIRS = man specs sag adg mwg
+-
+ CLEANFILES = *~
+ 
+ dist_html_DATA = index.html
+@@ -11,12 +9,4 @@
+ #######################################################
+ 
+ releasedocs: all
+-	$(mkinstalldirs) $(top_builddir)/Linux-PAM-$(VERSION)/doc/specs
+-	cp -av specs/draft-morgan-pam-current.txt \
+-		$(top_builddir)/Linux-PAM-$(VERSION)/doc/specs/
+-	cp -av $(srcdir)/specs/rfc86.0.txt \
+-		$(top_builddir)/Linux-PAM-$(VERSION)/doc/specs/
+-	make -C sag releasedocs
+-	make -C adg releasedocs
+-	make -C mwg releasedocs
+-	
++	/bin/true
package/linux-pam/linux-pam-group.patch new file +18 -0
new file mode 100644
index 0000000..8d57adc
@@ -0,0 +1,18 @@
+--- linux-pam-1.1.4/modules/pam_group/pam_group.c	2011-06-21 05:04:56.000000000 -0400
++++ linux-pam-1.1.4/modules/pam_group/pam_group.c	2012-08-09 21:35:06.000000000 -0400
+@@ -655,8 +655,14 @@
+ 	    continue;
+ 	}
+ 	/* If buffer starts with @, we are using netgroups */
+-	if (buffer[0] == '@')
++	if (buffer[0] == '@') {
++#ifdef HAVE_INNETGR
+ 	  good &= innetgr (&buffer[1], NULL, user, NULL);
++#else
++	  good = 0;
++	  pam_syslog (pamh, LOG_ERR, "pam_group does not have netgroup support");
++#endif  /* HAVE_INNETGR */
++	}
+ 	/* 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]);
package/linux-pam/linux-pam-rhosts.patch new file +16 -0
new file mode 100644
index 0000000..fbe633f
@@ -0,0 +1,16 @@
+--- linux-pam-1.1.4/modules/pam_rhosts/pam_rhosts.c	2011-06-21 05:04:56.000000000 -0400
++++ linux-pam-1.1.4/modules/pam_rhosts/pam_rhosts.c	2012-08-09 21:19:34.000000000 -0400
+@@ -114,8 +114,12 @@
+ #ifdef HAVE_RUSEROK_AF
+     retval = ruserok_af (rhost, as_root, ruser, luser, PF_UNSPEC);
+ #else
++  #ifdef HAVE_RUSEROK
+     retval = ruserok (rhost, as_root, ruser, luser);
+-#endif
++  #else
++    retval = -1;
++  #endif  /* HAVE_RUSEROK */
++#endif  /*HAVE_RUSEROK_AF */
+     if (retval != 0) {
+       if (!opt_silent || opt_debug)
+ 	pam_syslog(pamh, LOG_WARNING, "denied access to %s@%s as %s",
package/linux-pam/linux-pam-succeed.patch new file +23 -0
new file mode 100644
index 0000000..5a49f46
@@ -0,0 +1,23 @@
+--- linux-pam-1.1.4/modules/pam_succeed_if/pam_succeed_if.c	2011-06-21 05:04:56.000000000 -0400
++++ linux-pam-1.1.4/modules/pam_succeed_if/pam_succeed_if.c	2012-08-09 21:05:02.000000000 -0400
+@@ -233,16 +233,20 @@
+ static int
+ evaluate_innetgr(const char *host, const char *user, const char *group)
+ {
++#ifdef HAVE_INNETGR
+ 	if (innetgr(group, host, user, NULL) == 1)
+ 		return PAM_SUCCESS;
++#endif /* HAVE_INNETGR */
+ 	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)
+ {
++#ifdef HAVE_INNETGR
+ 	if (innetgr(group, host, user, NULL) == 0)
+ 		return PAM_SUCCESS;
++#endif /* HAVE_INNETGR */
+ 	return PAM_AUTH_ERR;
+ }
+ 
package/linux-pam/linux-pam-time.patch new file +18 -0
new file mode 100644
index 0000000..463ec3d
@@ -0,0 +1,18 @@
+--- linux-pam-1.1.4/modules/pam_time/pam_time.c	2011-06-21 05:04:56.000000000 -0400
++++ linux-pam-1.1.4/modules/pam_time/pam_time.c	2012-08-09 21:02:29.000000000 -0400
+@@ -554,8 +554,14 @@
+ 	       continue;
+ 	  }
+ 	  /* If buffer starts with @, we are using netgroups */
+-	  if (buffer[0] == '@')
++	  if (buffer[0] == '@') {
++#ifdef HAVE_INNETGR
+ 	    good &= innetgr (&buffer[1], NULL, user, NULL);
++#else
++	    good = 0;
++	    pam_syslog (pamh, LOG_ERR, "pam_time does not have netgroup support");
++#endif /* HAVE_INNETGR */
++	  }
+ 	  else
+ 	    good &= logic_field(pamh, user, buffer, count, is_same);
+ 	  D(("with user: %s", good ? "passes":"fails" ));
package/linux-pam/linux-pam.mk new file +21 -0
new file mode 100644
index 0000000..1b98d0a
@@ -0,0 +1,21 @@
+############################################
+#
+# linux-pam
+# 
+############################################
+
+LINUX_PAM_VERSION = 1.1.4
+LINUX_PAM_SOURCE = Linux-PAM-$(LINUX_PAM_VERSION).tar.bz2
+LINUX_PAM_SITE = http://linux-pam.org/library/
+LINUX_PAM_INSTALL_STAGING = YES
+LINUX_PAM_INSTALL_TARGET = YES
+LINUX_PAM_CONF_OPT = --disable-prelude --disable-isadir --disable-nis --disable-regenerate-docu
+LINUX_PAM_CONF_OPT += --enable-securedir=/lib/security --libdir=/lib
+LINUX_PAM_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) libintl flex
+LINUX_PAM_AUTORECONF = YES
+
+define LINUX_PAM_BUILD_CMDS
+	$(MAKE) CC="$(TARGET_CC) -lintl -lfl" LD="$(TARGET_LD)" -C $(@D) all
+endef
+
+$(eval $(autotools-package))
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 1/1 Add package linux-pam

Hello Dmitry,

Le Thu, 9 Aug 2012 23:32:55 -0400,
Dmitry <[email protected]> a ?crit :

Quoted 2 lines

---

Thanks, this looks good! A few comments below.

Quoted 8 lines
 package/Config.in                                 |    1 +
 package/linux-pam/Config.in                       |   15 ++++++++++++
 package/linux-pam/linux-pam-configure.patch       |   11 +++++++++
 package/linux-pam/linux-pam-doc-makefile-am.patch |   25 +++++++++++++++++++++
 package/linux-pam/linux-pam-group.patch           |   18 +++++++++++++++
 package/linux-pam/linux-pam-rhosts.patch          |   16 +++++++++++++
 package/linux-pam/linux-pam-succeed.patch         |   23 +++++++++++++++++++
 package/linux-pam/linux-pam-time.patch            |   18 +++++++++++++++

Each of your patches should contain a header with a description + Signed-off-by line. See package/libfcgi/libfcgi-link-against-libfcgi-la.patch for example.

package/linux-pam/linux-pam.mk line 11

Quoted 13 lines

+++ b/package/linux-pam/linux-pam.mk

package/linux-pam/linux-pam.mk new file +11 -0
@@ -0,0 +1,21 @@
+############################################
+#
+# linux-pam
+# 
+############################################
+
+LINUX_PAM_VERSION = 1.1.4
+LINUX_PAM_SOURCE = Linux-PAM-$(LINUX_PAM_VERSION).tar.bz2
+LINUX_PAM_SITE = http://linux-pam.org/library/
+LINUX_PAM_INSTALL_STAGING = YES
+LINUX_PAM_INSTALL_TARGET = YES

This line is not needed, please remove.

package/linux-pam/linux-pam.mk line 13

Quoted 2 lines
package/linux-pam/linux-pam.mk new file +2 -0
+LINUX_PAM_CONF_OPT = --disable-prelude --disable-isadir --disable-nis --disable-regenerate-docu
+LINUX_PAM_CONF_OPT += --enable-securedir=/lib/security --libdir=/lib

We generally format this in a different way:

LINUX_PAM_CONF_OPT = \
	--disable-prelude \
	--disable-isadir  \
	--disable-nis     \
	--disable-regenerate-docu \
	--enable-securedir=/lib/security \
	--libdir=/lib

package/linux-pam/linux-pam.mk line 14

Quoted 1 line
package/linux-pam/linux-pam.mk new file +1 -0
+LINUX_PAM_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) libintl flex

I think libintl should be part of the $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) conditional: when building with a glibc toolchain, BR2_NEEDS_GETTEXT_IF_LOCALE will be false, because glibc has a builtin version of libintl.

package/linux-pam/linux-pam.mk line 19

Quoted 5 lines
package/linux-pam/linux-pam.mk new file +5 -0
+LINUX_PAM_AUTORECONF = YES
+
+define LINUX_PAM_BUILD_CMDS
+	$(MAKE) CC="$(TARGET_CC) -lintl -lfl" LD="$(TARGET_LD)" -C $(@D) all
+endef

Instead of overriding LINUX_PAM_BUILD_CMDS, I would recommend using:

LINUX_PAM_CONF_ENV += \
	CC="$(TARGET_CC) -lintl -lfl"

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

A message that is not in the archive (sent off-list or not yet received): CADiAo4+Ak_6ZLY0ND=ZYWz6wTsov4XnkpXvbK8ZSF-ukU7ALGw@mail.gmail.com

#3 lore raw

PATCH 1/1 Add package linux-pam

Thomas,

Quoted 5 lines · Thomas Petazzoni

Each of your patches should contain a header with a description + Signed-off-by line. See package/libfcgi/libfcgi-link-against-libfcgi-la.patch for example.

Added.

Quoted 3 lines

This line is not needed, please remove.

I removed it. However it is still there in few places:

$ grep -rl "INSTALL_TARGET = YES" package/
package/libglib2/libglib2.mk
package/libgtk2/libgtk2.mk

And surely install to target is needed for PAM (security modules)

Quoted 10 lines

We generally format this in a different way:

LINUX_PAM_CONF_OPT = \
        --disable-prelude \
        --disable-isadir  \
        --disable-nis     \
        --disable-regenerate-docu \
        --enable-securedir=/lib/security \
        --libdir=/lib

Fixed.

Quoted 4 lines

I think libintl should be part of the $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) conditional: when building with a glibc toolchain, BR2_NEEDS_GETTEXT_IF_LOCALE will be false, because glibc has a builtin version of libintl.

Fixed.

Quoted 5 lines

Instead of overriding LINUX_PAM_BUILD_CMDS, I would recommend using:

LINUX_PAM_CONF_ENV += \
        CC="$(TARGET_CC) -lintl -lfl"

This gives me configure error "compiler cannot create executables" so I left this unchanged.

Thanks.

--
Dmitry Golubovsky

Anywhere on the Web

Signature · 3 lines
Dmitry Golubovsky

Anywhere on the Web
#4 lore raw

PATCH 1/1 Add package linux-pam

In reply to a message not in the archive

Le Fri, 10 Aug 2012 06:30:49 -0400,
Dmitry Golubovsky <[email protected]> a ?crit :

Quoted 7 lines
Quoted 1 line

This line is not needed, please remove.

I removed it. However it is still there in few places:

$ grep -rl "INSTALL_TARGET = YES" package/
package/libglib2/libglib2.mk
package/libgtk2/libgtk2.mk

Patches welcome :-)

Quoted 1 line

And surely install to target is needed for PAM (security modules)

Installation to target is enabled by default. From package/pkg-generic.mk:

$(2)_INSTALL_STAGING            ?= NO
$(2)_INSTALL_IMAGES             ?= NO
$(2)_INSTALL_TARGET             ?= YES
Quoted 7 lines
Quoted 4 lines

Instead of overriding LINUX_PAM_BUILD_CMDS, I would recommend using:

LINUX_PAM_CONF_ENV += \
        CC="$(TARGET_CC) -lintl -lfl"

This gives me configure error "compiler cannot create executables" so I left this unchanged.

Try this instead:

ifeq ($(BR2_PACKAGE_LIBINTL),y)
LINUX_PAM_MAKE_OPT += LIBS=-lintl
endif

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#5 lore raw

PATCH 1/1 Add package linux-pam

Thomas,

Quoted 5 lines · Thomas Petazzoni

Try this instead:

ifeq ($(BR2_PACKAGE_LIBINTL),y)
LINUX_PAM_MAKE_OPT += LIBS=-lintl
endif

Thanks, this works.

Patch resubmitted.

Signature · 3 lines
Dmitry Golubovsky

Anywhere on the Web