From 2dbe60a5c8d806758609cc499ddbd68437f1fbcc Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 13 Oct 2011 21:55:56 +0200 Subject: make it for uClibc usable --- package/pam/Makefile | 2 + package/pam/patches/patch-configure | 11 +++ .../patches/patch-modules_pam_group_pam_group_c | 12 +++ .../patch-modules_pam_succeed_if_pam_succeed_if_c | 52 ++++++++++ .../pam/patches/patch-modules_pam_time_pam_time_c | 13 +++ .../patches/patch-modules_pam_timestamp_hmacfile | 107 +++++++++++++++++++++ 6 files changed, 197 insertions(+) create mode 100644 package/pam/patches/patch-configure create mode 100644 package/pam/patches/patch-modules_pam_group_pam_group_c create mode 100644 package/pam/patches/patch-modules_pam_succeed_if_pam_succeed_if_c create mode 100644 package/pam/patches/patch-modules_pam_time_pam_time_c create mode 100644 package/pam/patches/patch-modules_pam_timestamp_hmacfile (limited to 'package') diff --git a/package/pam/Makefile b/package/pam/Makefile index a9381495e..4fb90e26a 100644 --- a/package/pam/Makefile +++ b/package/pam/Makefile @@ -19,6 +19,8 @@ include $(TOPDIR)/mk/package.mk $(eval $(call PKG_template,PAM,pam,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) +XAKE_FLAGS+= GCC_HONOUR_COPTS=s + pam-install: $(INSTALL_DIR) $(IDIR_PAM)/etc/security $(CP) $(WRKINST)/etc/security/* $(IDIR_PAM)/etc/security diff --git a/package/pam/patches/patch-configure b/package/pam/patches/patch-configure new file mode 100644 index 000000000..728ff6492 --- /dev/null +++ b/package/pam/patches/patch-configure @@ -0,0 +1,11 @@ +--- Linux-PAM-1.1.4.orig/configure 2011-06-24 12:48:18.000000000 +0200 ++++ Linux-PAM-1.1.4/configure 2011-10-12 14:51:42.323559002 +0200 +@@ -2766,8 +2766,6 @@ then + if test ${libdir} = '${exec_prefix}/lib' + then + case "`uname -m`" in +- x86_64|ppc64|s390x|sparc64) +- libdir="/lib64" ;; + *) + libdir="/lib" ;; + esac diff --git a/package/pam/patches/patch-modules_pam_group_pam_group_c b/package/pam/patches/patch-modules_pam_group_pam_group_c new file mode 100644 index 000000000..40c1897d2 --- /dev/null +++ b/package/pam/patches/patch-modules_pam_group_pam_group_c @@ -0,0 +1,12 @@ +--- Linux-PAM-1.1.4.orig/modules/pam_group/pam_group.c 2011-06-21 11:04:56.000000000 +0200 ++++ Linux-PAM-1.1.4/modules/pam_group/pam_group.c 2011-10-12 14:31:55.693559001 +0200 +@@ -656,7 +656,8 @@ 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); ++ pam_syslog(pamh, LOG_ERR, "%s: no netgroup supported by C library", PAM_GROUP_CONF); ++ //good &= innetgr (&buffer[1], NULL, user, NULL); + /* 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]); diff --git a/package/pam/patches/patch-modules_pam_succeed_if_pam_succeed_if_c b/package/pam/patches/patch-modules_pam_succeed_if_pam_succeed_if_c new file mode 100644 index 000000000..5bb75c711 --- /dev/null +++ b/package/pam/patches/patch-modules_pam_succeed_if_pam_succeed_if_c @@ -0,0 +1,52 @@ +--- Linux-PAM-1.1.4.orig/modules/pam_succeed_if/pam_succeed_if.c 2011-06-21 11:04:56.000000000 +0200 ++++ Linux-PAM-1.1.4/modules/pam_succeed_if/pam_succeed_if.c 2011-10-12 14:36:33.843559001 +0200 +@@ -230,6 +230,7 @@ evaluate_notingroup(pam_handle_t *pamh, + return PAM_AUTH_ERR; + } + /* Return PAM_SUCCESS if the (host,user) is in the netgroup. */ ++/* + static int + evaluate_innetgr(const char *host, const char *user, const char *group) + { +@@ -237,7 +238,9 @@ evaluate_innetgr(const char *host, const + return PAM_SUCCESS; + 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) + { +@@ -245,6 +248,7 @@ evaluate_notinnetgr(const char *host, co + return PAM_SUCCESS; + return PAM_AUTH_ERR; + } ++*/ + + /* Match a triple. */ + static int +@@ -357,19 +361,23 @@ evaluate(pam_handle_t *pamh, int debug, + return evaluate_notingroup(pamh, user, right); + } + /* (Rhost, user) is in this netgroup. */ ++ /* + if (strcasecmp(qual, "innetgr") == 0) { + const void *rhost; + if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS) + rhost = NULL; + return evaluate_innetgr(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); + } ++ */ + /* Fail closed. */ + return PAM_SERVICE_ERR; + } diff --git a/package/pam/patches/patch-modules_pam_time_pam_time_c b/package/pam/patches/patch-modules_pam_time_pam_time_c new file mode 100644 index 000000000..e57094beb --- /dev/null +++ b/package/pam/patches/patch-modules_pam_time_pam_time_c @@ -0,0 +1,13 @@ +--- Linux-PAM-1.1.4.orig/modules/pam_time/pam_time.c 2011-06-21 11:04:56.000000000 +0200 ++++ Linux-PAM-1.1.4/modules/pam_time/pam_time.c 2011-10-12 14:43:20.673559001 +0200 +@@ -555,7 +555,9 @@ 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); ++ //good &= innetgr (&buffer[1], NULL, user, NULL); ++ pam_syslog(pamh, LOG_ERR, ++ "%s: no netgroup support in C library", PAM_TIME_CONF); + else + good &= logic_field(pamh, user, buffer, count, is_same); + D(("with user: %s", good ? "passes":"fails" )); diff --git a/package/pam/patches/patch-modules_pam_timestamp_hmacfile b/package/pam/patches/patch-modules_pam_timestamp_hmacfile new file mode 100644 index 000000000..6826e3493 --- /dev/null +++ b/package/pam/patches/patch-modules_pam_timestamp_hmacfile @@ -0,0 +1,107 @@ +--- Linux-PAM-1.1.4.orig/modules/pam_timestamp/hmacfile 2011-06-21 11:37:55.000000000 +0200 ++++ Linux-PAM-1.1.4/modules/pam_timestamp/hmacfile 2011-10-12 14:45:28.323559001 +0200 +@@ -1,4 +1,4 @@ +-#! /bin/sh ++#! /bin/bash + + # hmacfile - temporary wrapper script for .libs/hmacfile + # Generated by ltmain.sh (GNU libtool) 2.2.6 +@@ -11,7 +11,7 @@ + + # Sed substitution that helps us do robust quoting. It backslashifies + # metacharacters that are still active within double-quoted strings. +-Xsed='/bin/sed -e 1s/^X//' ++Xsed='/home/wbx/adk/perf/scripts/sed -e 1s/^X//' + sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + + # Be Bourne compatible +@@ -32,13 +32,13 @@ DUALCASE=1; export DUALCASE # for MKS sh + # if CDPATH is set. + (unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +-relink_command="" ++relink_command="(cd /home/wbx/adk/perf/build_pcengines-alix1c_i586_uclibc/w-pam-1.1.4-1/Linux-PAM-1.1.4/modules/pam_timestamp; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=/home/wbx/adk/perf/scripts:/home/wbx/adk/perf/bin/tools:/home/wbx/adk/perf/host_i586_uclibc/bin:/home/wbx/adk/perf/host_i586_uclibc/usr/bin:/home/wbx/adk/perf/target_i586_uclibc/scripts:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games; export PATH; /home/wbx/adk/perf/host_i586_uclibc/bin/i586-openadk-linux-uclibc-gcc -I../../libpam/include -I../../libpamc/include -march=geode -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/home/wbx/adk/perf/target_i586_uclibc/usr/lib -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -o \$progdir/\$file hmacfile.o hmacsha1.o sha1.o -L/home/wbx/adk/perf/target_i586_uclibc/lib -L/home/wbx/adk/perf/target_i586_uclibc/usr/lib -L/home/wbx/adk/perf/build_pcengines-alix1c_i586_uclibc/w-pam-1.1.4-1/Linux-PAM-1.1.4/libpam /home/wbx/adk/perf/build_pcengines-alix1c_i586_uclibc/w-pam-1.1.4-1/Linux-PAM-1.1.4/libpam/.libs/libpam.so -ldl -Wl,-rpath -Wl,/home/wbx/adk/perf/build_pcengines-alix1c_i586_uclibc/w-pam-1.1.4-1/Linux-PAM-1.1.4/libpam/.libs -Wl,-rpath -Wl,/lib64)" + + # This environment variable determines our operation mode. + if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then + # install mode needs the following variables: + generated_by_libtool_version='2.2.6' +- notinst_deplibs=' /data/git/Linux-PAM/libpam/libpam.la' ++ notinst_deplibs=' /home/wbx/adk/perf/build_pcengines-alix1c_i586_uclibc/w-pam-1.1.4-1/Linux-PAM-1.1.4/libpam/libpam.la' + else + # When we are sourced in execute mode, $file and $ECHO are already set. + if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then +@@ -53,7 +53,7 @@ else + : + else + # Restart under the correct shell, and then maybe $ECHO will work. +- exec /bin/sh "$0" --no-reexec ${1+"$@"} ++ exec /bin/bash "$0" --no-reexec ${1+"$@"} + fi + fi + +@@ -62,7 +62,7 @@ else + test "x$thisdir" = "x$file" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. +- file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'` ++ file=`ls -ld "$file" | /home/wbx/adk/perf/scripts/sed -n 's/.*-> //p'` + while test -n "$file"; do + destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` + +@@ -75,7 +75,7 @@ else + fi + + file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'` +- file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'` ++ file=`ls -ld "$thisdir/$file" | /home/wbx/adk/perf/scripts/sed -n 's/.*-> //p'` + done + + +@@ -98,20 +98,38 @@ else + absdir=`cd "$thisdir" && pwd` + test -n "$absdir" && thisdir="$absdir" + +- program='hmacfile' ++ program=lt-'hmacfile' + progdir="$thisdir/.libs" + ++ if test ! -f "$progdir/$program" || ++ { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /home/wbx/adk/perf/scripts/sed 1q`; \ ++ test "X$file" != "X$progdir/$program"; }; then + +- if test -f "$progdir/$program"; then +- # Add our own library path to LD_LIBRARY_PATH +- LD_LIBRARY_PATH="/data/git/Linux-PAM/libpam/.libs:$LD_LIBRARY_PATH" ++ file="$$-$program" + +- # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH +- # The second colon is a workaround for a bug in BeOS R4 sed +- LD_LIBRARY_PATH=`$ECHO "X$LD_LIBRARY_PATH" | $Xsed -e 's/::*$//'` ++ if test ! -d "$progdir"; then ++ mkdir "$progdir" ++ else ++ rm -f "$progdir/$file" ++ fi + +- export LD_LIBRARY_PATH ++ # relink executable if necessary ++ if test -n "$relink_command"; then ++ if relink_command_output=`eval $relink_command 2>&1`; then : ++ else ++ echo "$relink_command_output" >&2 ++ rm -f "$progdir/$file" ++ exit 1 ++ fi ++ fi ++ ++ mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null || ++ { rm -f "$progdir/$program"; ++ mv -f "$progdir/$file" "$progdir/$program"; } ++ rm -f "$progdir/$file" ++ fi + ++ if test -f "$progdir/$program"; then + if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then + # Run the actual program with our arguments. + -- cgit v1.2.3