aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/pam
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2010-07-01 20:37:54 -0700
committerKhem Raj <raj.khem@gmail.com>2010-07-01 20:37:54 -0700
commitf29ba5a65d5f6eedc0e1f6a12371184134e1b878 (patch)
tree419a942048c718d36cacd931aa220b73288d9d32 /recipes/pam
parent6bca18ac19bd7fcb69ce45c01ee75019f404af7d (diff)
downloadopenembedded-f29ba5a65d5f6eedc0e1f6a12371184134e1b878.tar.gz
libpam-1.1.1: Dont use innetgr on uclibc as its not there.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes/pam')
-rw-r--r--recipes/pam/libpam-1.1.1/pam-no-innetgr.patch95
-rw-r--r--recipes/pam/libpam_1.1.1.bb3
2 files changed, 97 insertions, 1 deletions
diff --git a/recipes/pam/libpam-1.1.1/pam-no-innetgr.patch b/recipes/pam/libpam-1.1.1/pam-no-innetgr.patch
new file mode 100644
index 0000000000..67e28ffd9d
--- /dev/null
+++ b/recipes/pam/libpam-1.1.1/pam-no-innetgr.patch
@@ -0,0 +1,95 @@
+innetgr may not be there so make sure that when innetgr is not present
+then we inform about it and not use it.
+
+-Khem
+Index: Linux-PAM-1.1.1/modules/pam_group/pam_group.c
+===================================================================
+--- Linux-PAM-1.1.1.orig/modules/pam_group/pam_group.c 2010-07-01 19:23:08.885170000 -0700
++++ Linux-PAM-1.1.1/modules/pam_group/pam_group.c 2010-07-01 19:27:05.475170000 -0700
+@@ -659,9 +659,13 @@ static int check_account(pam_handle_t *p
+ }
+ /* 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_group 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 */
+Index: Linux-PAM-1.1.1/modules/pam_time/pam_time.c
+===================================================================
+--- Linux-PAM-1.1.1.orig/modules/pam_time/pam_time.c 2010-07-01 19:29:46.145170000 -0700
++++ Linux-PAM-1.1.1/modules/pam_time/pam_time.c 2010-07-01 19:32:42.215170002 -0700
+@@ -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 */
+Index: Linux-PAM-1.1.1/modules/pam_succeed_if/pam_succeed_if.c
+===================================================================
+--- Linux-PAM-1.1.1.orig/modules/pam_succeed_if/pam_succeed_if.c 2010-07-01 19:41:38.305170002 -0700
++++ Linux-PAM-1.1.1/modules/pam_succeed_if/pam_succeed_if.c 2010-07-01 19:52:08.955170002 -0700
+@@ -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;
diff --git a/recipes/pam/libpam_1.1.1.bb b/recipes/pam/libpam_1.1.1.bb
index 10fd7423c9..cf1dfda478 100644
--- a/recipes/pam/libpam_1.1.1.bb
+++ b/recipes/pam/libpam_1.1.1.bb
@@ -15,7 +15,7 @@ DEPENDS = "flex flex-native"
# PAM is not a lot of use without configuration files and the plugins
RRECOMMENDS_${PN} = "libpam-meta libpam-base-files"
-PR = "r0"
+PR = "r1"
# The project is actually called Linux-PAM but that gives
# a bad OE package name because of the upper case characters
@@ -30,6 +30,7 @@ SRC_URI = "${KERNELORG_MIRROR}/pub/linux/libs/pam/library/${p}.tar.bz2 \
UCLIBC_PATCHES = " file://Linux-PAM-1.1.0-uclibc.patch \
file://disable_modules_uclibc.patch \
+ file://pam-no-innetgr.patch \
"
SRC_URI_append_linux-uclibc = ${UCLIBC_PATCHES}