From 1ccbfa88b1defffa6cd4b533bcc97f737162afee Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 17 Jan 2011 11:52:40 +1100 Subject: - (djm) [regress/agent-getpeereid.sh] leave stdout attached when running ssh-add to avoid $SUDO failures on Linux --- regress/agent-getpeereid.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'regress/agent-getpeereid.sh') diff --git a/regress/agent-getpeereid.sh b/regress/agent-getpeereid.sh index 5d7f73291..22276a29d 100644 --- a/regress/agent-getpeereid.sh +++ b/regress/agent-getpeereid.sh @@ -34,7 +34,7 @@ else fail "ssh-add failed with $r != 1" fi - < /dev/null ${SUDO} -S -u ${UNPRIV} ssh-add -l > /dev/null 2>&1 + < /dev/null ${SUDO} -S -u ${UNPRIV} ssh-add -l 2>/dev/null r=$? if [ $r -lt 2 ]; then fail "ssh-add did not fail for ${UNPRIV}: $r < 2" -- cgit v1.2.3 From 58497780ab22d56ac5216c71f5a20efc1e39ce2e Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 17 Jan 2011 16:17:09 +1100 Subject: - (djm) [configure.ac regress/agent-getpeereid.sh regress/multiplex.sh] [regress/sftp-glob.sh regress/test-exec.sh] Rework how feature tests are disabled on platforms that do not support them; add a "config_defined()" shell function that greps for defines in config.h and use them to decide on feature tests. Convert a couple of existing grep's over config.h to use the new function Add a define "FILESYSTEM_NO_BACKSLASH" for filesystem that can't represent backslash characters in filenames, enable it for Cygwin and use it to turn of tests for quotes backslashes in sftp-glob.sh. based on discussion with vinschen AT redhat.com and dtucker@; ok dtucker@ --- ChangeLog | 10 ++++++++++ configure.ac | 5 +++-- regress/agent-getpeereid.sh | 5 +---- regress/multiplex.sh | 3 +-- regress/sftp-glob.sh | 23 +++++++++++++++-------- regress/test-exec.sh | 11 +++++++++++ 6 files changed, 41 insertions(+), 16 deletions(-) (limited to 'regress/agent-getpeereid.sh') diff --git a/ChangeLog b/ChangeLog index e64a550f1..c6c6cb955 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,16 @@ - (dtucker) [openbsd-compat/port-linux.c] Bug #1838: Add support for the new Linux OOM-killer magic values that changed in 2.6.36 kernels, with fallback to the old values. Feedback from vapier at gentoo org and djm, ok djm. + - (djm) [configure.ac regress/agent-getpeereid.sh regress/multiplex.sh] + [regress/sftp-glob.sh regress/test-exec.sh] Rework how feature tests are + disabled on platforms that do not support them; add a "config_defined()" + shell function that greps for defines in config.h and use them to decide + on feature tests. + Convert a couple of existing grep's over config.h to use the new function + Add a define "FILESYSTEM_NO_BACKSLASH" for filesystem that can't represent + backslash characters in filenames, enable it for Cygwin and use it to turn + of tests for quotes backslashes in sftp-glob.sh. + based on discussion with vinschen AT redhat.com and dtucker@; ok dtucker@ 20110116 - (dtucker) [Makefile.in configure.ac regress/kextype.sh] Skip sha256-based diff --git a/configure.ac b/configure.ac index 1817dd909..02e8423c0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.465 2011/01/16 07:28:12 dtucker Exp $ +# $Id: configure.ac,v 1.466 2011/01/17 05:17:09 djm Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.465 $) +AC_REVISION($Revision: 1.466 $) AC_CONFIG_SRCDIR([ssh.c]) # local macros @@ -483,6 +483,7 @@ int main(void) { exit(0); } [Define if your platform needs to skip post auth file descriptor passing]) AC_DEFINE(SSH_IOBUFSZ, 65535, [Windows is sensitive to read buffer size]) + AC_DEFINE(FILESYSTEM_NO_BACKSLASH, 1, [File names may not contain backslash characters]) ;; *-*-dgux*) AC_DEFINE(IP_TOS_IS_BROKEN, 1, diff --git a/regress/agent-getpeereid.sh b/regress/agent-getpeereid.sh index 22276a29d..f5f5ba55a 100644 --- a/regress/agent-getpeereid.sh +++ b/regress/agent-getpeereid.sh @@ -7,10 +7,7 @@ UNPRIV=nobody ASOCK=${OBJ}/agent SSH_AUTH_SOCK=/nonexistent -if grep "#undef.*HAVE_GETPEEREID" ${BUILDDIR}/config.h >/dev/null 2>&1 && \ - grep "#undef.*HAVE_GETPEERUCRED" ${BUILDDIR}/config.h >/dev/null && \ - grep "#undef.*HAVE_SO_PEERCRED" ${BUILDDIR}/config.h >/dev/null -then +if ! config_defined HAVE_GETPEEREID HAVE_GETPEERUCRED HAVE_SO_PEERCRED ; then echo "skipped (not supported on this platform)" exit 0 fi diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 8a98a6e54..b94cdf02f 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -5,8 +5,7 @@ CTL=/tmp/openssh.regress.ctl-sock.$$ tid="connection multiplexing" -if grep "#define.*DISABLE_FD_PASSING" ${BUILDDIR}/config.h >/dev/null 2>&1 -then +if config_defined DISABLE_FD_PASSING ; then echo "skipped (not supported on this platform)" exit 0 fi diff --git a/regress/sftp-glob.sh b/regress/sftp-glob.sh index 72bb17d75..8d4df2c98 100644 --- a/regress/sftp-glob.sh +++ b/regress/sftp-glob.sh @@ -3,11 +3,18 @@ tid="sftp glob" +config_defined FILESYSTEM_NO_BACKSLASH && nobs="not supported on this platform" + sftp_ls() { target=$1 errtag=$2 expected=$3 unexpected=$4 + skip=$5 + if test "x$skip" != "x" ; then + verbose "$tid: $errtag (skipped: $skip)" + return + fi verbose "$tid: $errtag" printf "ls -l %s" "${target}" | \ ${SFTP} -b - -D ${SFTPSERVER} 2>/dev/null | \ @@ -44,8 +51,8 @@ SPACE="${DIR}/g-q space" rm -rf ${BASE} mkdir -p ${DIR} -touch "${DATA}" "${GLOB1}" "${GLOB2}" "${QUOTE}" -touch "${QSLASH}" "${ESLASH}" "${SLASH}" "${SPACE}" +touch "${DATA}" "${GLOB1}" "${GLOB2}" "${QUOTE}" "${SPACE}" +test "x$nobs" = "x" && touch "${QSLASH}" "${ESLASH}" "${SLASH}" # target message expected unexpected sftp_ls "${DIR}/fil*" "file glob" "${DATA}" "" @@ -55,14 +62,14 @@ sftp_ls "${DIR}/g-wild\*" "escaped glob" "g-wild*" "g-wildx" sftp_ls "${DIR}/g-quote\\\"" "escaped quote" "g-quote\"" "" sftp_ls "\"${DIR}/g-quote\\\"\"" "quoted quote" "g-quote\"" "" sftp_ls "'${DIR}/g-quote\"'" "single-quoted quote" "g-quote\"" "" -sftp_ls "${DIR}/g-sl\\\\ash" "escaped slash" "g-sl\\ash" "" -sftp_ls "'${DIR}/g-sl\\\\ash'" "quoted slash" "g-sl\\ash" "" -sftp_ls "${DIR}/g-slash\\\\" "escaped slash at EOL" "g-slash\\" "" -sftp_ls "'${DIR}/g-slash\\\\'" "quoted slash at EOL" "g-slash\\" "" -sftp_ls "${DIR}/g-qs\\\\\\\"" "escaped slash+quote" "g-qs\\\"" "" -sftp_ls "'${DIR}/g-qs\\\\\"'" "quoted slash+quote" "g-qs\\\"" "" sftp_ls "${DIR}/g-q\\ space" "escaped space" "g-q space" "" sftp_ls "'${DIR}/g-q space'" "quoted space" "g-q space" "" +sftp_ls "${DIR}/g-sl\\\\ash" "escaped slash" "g-sl\\ash" "" "$nobs" +sftp_ls "'${DIR}/g-sl\\\\ash'" "quoted slash" "g-sl\\ash" "" "$nobs" +sftp_ls "${DIR}/g-slash\\\\" "escaped slash at EOL" "g-slash\\" "" "$nobs" +sftp_ls "'${DIR}/g-slash\\\\'" "quoted slash at EOL" "g-slash\\" "" "$nobs" +sftp_ls "${DIR}/g-qs\\\\\\\"" "escaped slash+quote" "g-qs\\\"" "" "$nobs" +sftp_ls "'${DIR}/g-qs\\\\\"'" "quoted slash+quote" "g-qs\\\"" "" "$nobs" rm -rf ${BASE} diff --git a/regress/test-exec.sh b/regress/test-exec.sh index b64dcdbcf..5c56aefff 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh @@ -221,6 +221,17 @@ fatal () exit $RESULT } +# Check whether preprocessor symbols are defined in config.h. +config_defined () +{ + str=$1 + while test "x$2" != "x" ; do + str="$str|$2" + shift + done + egrep "^#define.*($str)" ${BUILDDIR}/config.h >/dev/null 2>&1 +} + RESULT=0 PIDFILE=$OBJ/pidfile -- cgit v1.2.3 From 6dfcd34042197e904a6c92e277d6b60a58e7a90a Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Sun, 16 Jan 2011 22:53:56 -0800 Subject: - (tim) [regress/agent-getpeereid.sh] shell portability fix. --- ChangeLog | 1 + regress/agent-getpeereid.sh | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'regress/agent-getpeereid.sh') diff --git a/ChangeLog b/ChangeLog index c6c6cb955..b8c334ab0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ backslash characters in filenames, enable it for Cygwin and use it to turn of tests for quotes backslashes in sftp-glob.sh. based on discussion with vinschen AT redhat.com and dtucker@; ok dtucker@ + - (tim) [regress/agent-getpeereid.sh] shell portability fix. 20110116 - (dtucker) [Makefile.in configure.ac regress/kextype.sh] Skip sha256-based diff --git a/regress/agent-getpeereid.sh b/regress/agent-getpeereid.sh index f5f5ba55a..faf654c04 100644 --- a/regress/agent-getpeereid.sh +++ b/regress/agent-getpeereid.sh @@ -7,7 +7,9 @@ UNPRIV=nobody ASOCK=${OBJ}/agent SSH_AUTH_SOCK=/nonexistent -if ! config_defined HAVE_GETPEEREID HAVE_GETPEERUCRED HAVE_SO_PEERCRED ; then +if config_defined HAVE_GETPEEREID HAVE_GETPEERUCRED HAVE_SO_PEERCRED ; then + : +else echo "skipped (not supported on this platform)" exit 0 fi -- cgit v1.2.3