From 68f7213a2cb1fa846d8eab215f1cde35e2abc20b Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 7 Mar 2005 18:25:53 +1100 Subject: [PATCH] - fgsch@cvs.openbsd.org 2004/12/10 01:31:30 [Makefile sftp-glob.sh] some globbing regress; prompted and ok djm@ --- ChangeLog | 4 ++-- regress/sftp-glob.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 regress/sftp-glob.sh diff --git a/ChangeLog b/ChangeLog index d7682c033..1949e264d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,7 @@ BSM audit support for the time being. ok djm@ - (dtucker) OpenBSD CVS Sync (regress/) - fgsch@cvs.openbsd.org 2004/12/10 01:31:30 - [Makefile] + [Makefile sftp-glob.sh] some globbing regress; prompted and ok djm@ 20050306 @@ -2291,4 +2291,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3695 2005/03/07 06:36:18 dtucker Exp $ +$Id: ChangeLog,v 1.3696 2005/03/07 07:25:53 dtucker Exp $ diff --git a/regress/sftp-glob.sh b/regress/sftp-glob.sh new file mode 100644 index 000000000..e238356a2 --- /dev/null +++ b/regress/sftp-glob.sh @@ -0,0 +1,28 @@ +# $OpenBSD: sftp-glob.sh,v 1.1 2004/12/10 01:31:30 fgsch Exp $ +# Placed in the Public Domain. + +tid="sftp glob" + +BASE=${OBJ}/glob +DIR=${BASE}/dir +DATA=${DIR}/file + +rm -rf ${BASE} +mkdir -p ${DIR} +touch ${DATA} + +verbose "$tid: ls file" +echo "ls -l ${DIR}/fil*" | ${SFTP} -P ${SFTPSERVER} 2>/dev/null | \ + grep ${DATA} >/dev/null 2>&1 +if [ $? -ne 0 ]; then + fail "globbed ls file failed" +fi + +verbose "$tid: ls dir" +echo "ls -l ${BASE}/d*" | ${SFTP} -P ${SFTPSERVER} 2>/dev/null | \ + grep file >/dev/null 2>&1 +if [ $? -ne 0 ]; then + fail "globbed ls dir failed" +fi + +rm -rf ${BASE}