003 File Manager
Current Path:
/usr/src/crypto/openssh/regress
usr
/
src
/
crypto
/
openssh
/
regress
/
📁
..
📄
Makefile
(6.8 KB)
📄
README.regress
(3.91 KB)
📄
addrmatch.sh
(2.06 KB)
📄
agent-getpeereid.sh
(1.13 KB)
📄
agent-pkcs11.sh
(1.86 KB)
📄
agent-ptrace.sh
(1.31 KB)
📄
agent-timeout.sh
(928 B)
📄
agent.sh
(2.96 KB)
📄
allow-deny-users.sh
(1.45 KB)
📄
authinfo.sh
(574 B)
📄
banner.sh
(1.24 KB)
📄
broken-pipe.sh
(281 B)
📄
brokenkeys.sh
(462 B)
📄
cert-file.sh
(5.25 KB)
📄
cert-hostkey.sh
(10.34 KB)
📄
cert-userkey.sh
(11.95 KB)
📄
cfginclude.sh
(4.39 KB)
📄
cfgmatch.sh
(3.5 KB)
📄
cfgmatchlisten.sh
(6.34 KB)
📄
cfgparse.sh
(2.17 KB)
📄
check-perm.c
(4.33 KB)
📄
cipher-speed.sh
(799 B)
📄
conch-ciphers.sh
(796 B)
📄
connect-privsep.sh
(1.02 KB)
📄
connect-uri.sh
(816 B)
📄
connect.sh
(222 B)
📄
dhgex.sh
(1.47 KB)
📄
dsa_ssh2.prv
(863 B)
📄
dsa_ssh2.pub
(732 B)
📄
dynamic-forward.sh
(1.48 KB)
📄
envpass.sh
(1.54 KB)
📄
exit-status.sh
(562 B)
📄
forcecommand.sh
(1.1 KB)
📄
forward-control.sh
(7.71 KB)
📄
forwarding.sh
(4.22 KB)
📄
host-expand.sh
(384 B)
📄
hostkey-agent.sh
(1.6 KB)
📄
hostkey-rotate.sh
(3.86 KB)
📄
integrity.sh
(2.33 KB)
📄
kextype.sh
(587 B)
📄
key-options.sh
(3.22 KB)
📄
keygen-change.sh
(581 B)
📄
keygen-convert.sh
(1.08 KB)
📄
keygen-knownhosts.sh
(6.42 KB)
📄
keygen-moduli.sh
(702 B)
📄
keys-command.sh
(2.39 KB)
📄
keyscan.sh
(403 B)
📄
keytype.sh
(1.84 KB)
📄
krl.sh
(6.45 KB)
📄
limit-keytype.sh
(3.65 KB)
📄
localcommand.sh
(351 B)
📄
login-timeout.sh
(588 B)
📁
misc
📄
mkdtemp.c
(1.53 KB)
📄
modpipe.c
(3.81 KB)
📄
moduli.in
(1.59 KB)
📄
multiplex.sh
(7.09 KB)
📄
multipubkey.sh
(2.31 KB)
📄
netcat.c
(39.92 KB)
📄
portnum.sh
(624 B)
📄
principals-command.sh
(5.48 KB)
📄
proto-mismatch.sh
(368 B)
📄
proto-version.sh
(527 B)
📄
proxy-connect.sh
(624 B)
📄
putty-ciphers.sh
(678 B)
📄
putty-kex.sh
(553 B)
📄
putty-transfer.sh
(1021 B)
📄
reconfigure.sh
(855 B)
📄
reexec.sh
(878 B)
📄
rekey.sh
(4.12 KB)
📄
rsa_openssh.prv
(883 B)
📄
rsa_openssh.pub
(213 B)
📄
rsa_ssh2.prv
(924 B)
📄
scp-ssh-wrapper.sh
(914 B)
📄
scp-uri.sh
(2.01 KB)
📄
scp.sh
(3.5 KB)
📄
setuid-allowed.c
(1.45 KB)
📄
sftp-badcmds.sh
(2.22 KB)
📄
sftp-batch.sh
(1.16 KB)
📄
sftp-chroot.sh
(845 B)
📄
sftp-cmds.sh
(7.29 KB)
📄
sftp-glob.sh
(2.47 KB)
📄
sftp-perm.sh
(5.23 KB)
📄
sftp-uri.sh
(1.59 KB)
📄
sftp.sh
(737 B)
📄
ssh-com-client.sh
(3.02 KB)
📄
ssh-com-keygen.sh
(1.38 KB)
📄
ssh-com-sftp.sh
(1.19 KB)
📄
ssh-com.sh
(2.71 KB)
📄
ssh2putty.sh
(693 B)
📄
sshcfgparse.sh
(3.8 KB)
📄
sshd-log-wrapper.sh
(285 B)
📄
stderr-after-eof.sh
(603 B)
📄
stderr-data.sh
(709 B)
📄
t11.ok
(51 B)
📄
t4.ok
(52 B)
📄
t5.ok
(66 B)
📄
test-exec.sh
(13.05 KB)
📄
transfer.sh
(583 B)
📄
try-ciphers.sh
(715 B)
📁
unittests
📄
valgrind-unit.sh
(610 B)
📄
yes-head.sh
(401 B)
Editing: sftp-perm.sh
# $OpenBSD: sftp-perm.sh,v 1.2 2013/10/17 22:00:18 djm Exp $ # Placed in the Public Domain. tid="sftp permissions" SERVER_LOG=${OBJ}/sftp-server.log CLIENT_LOG=${OBJ}/sftp.log TEST_SFTP_SERVER=${OBJ}/sftp-server.sh prepare_server() { printf "#!/bin/sh\nexec $SFTPSERVER -el debug3 $* 2>$SERVER_LOG\n" \ > $TEST_SFTP_SERVER chmod a+x $TEST_SFTP_SERVER } run_client() { echo "$@" | ${SFTP} -D ${TEST_SFTP_SERVER} -vvvb - >$CLIENT_LOG 2>&1 } prepare_files() { _prep="$1" rm -f ${COPY} ${COPY}.1 test -d ${COPY}.dd && { rmdir ${COPY}.dd || fatal "rmdir ${COPY}.dd"; } test -z "$_prep" && return sh -c "$_prep" || fail "preparation failed: \"$_prep\"" } postcondition() { _title="$1" _check="$2" test -z "$_check" && return ${TEST_SHELL} -c "$_check" || fail "postcondition check failed: $_title" } ro_test() { _desc=$1 _cmd="$2" _prep="$3" _expect_success_post="$4" _expect_fail_post="$5" verbose "$tid: read-only $_desc" # Plain (no options, mostly to test that _cmd is good) prepare_files "$_prep" prepare_server run_client "$_cmd" || fail "plain $_desc failed" postcondition "$_desc no-readonly" "$_expect_success_post" # Read-only enabled prepare_files "$_prep" prepare_server -R run_client "$_cmd" && fail "read-only $_desc succeeded" postcondition "$_desc readonly" "$_expect_fail_post" } perm_test() { _op=$1 _whitelist_ops=$2 _cmd="$3" _prep="$4" _expect_success_post="$5" _expect_fail_post="$6" verbose "$tid: explicit $_op" # Plain (no options, mostly to test that _cmd is good) prepare_files "$_prep" prepare_server run_client "$_cmd" || fail "plain $_op failed" postcondition "$_op no white/blacklists" "$_expect_success_post" # Whitelist prepare_files "$_prep" prepare_server -p $_op,$_whitelist_ops run_client "$_cmd" || fail "whitelisted $_op failed" postcondition "$_op whitelisted" "$_expect_success_post" # Blacklist prepare_files "$_prep" prepare_server -P $_op run_client "$_cmd" && fail "blacklisted $_op succeeded" postcondition "$_op blacklisted" "$_expect_fail_post" # Whitelist with op missing. prepare_files "$_prep" prepare_server -p $_whitelist_ops run_client "$_cmd" && fail "no whitelist $_op succeeded" postcondition "$_op not in whitelist" "$_expect_fail_post" } ro_test \ "upload" \ "put $DATA $COPY" \ "" \ "cmp $DATA $COPY" \ "test ! -f $COPY" ro_test \ "setstat" \ "chmod 0700 $COPY" \ "touch $COPY; chmod 0400 $COPY" \ "test -x $COPY" \ "test ! -x $COPY" ro_test \ "rm" \ "rm $COPY" \ "touch $COPY" \ "test ! -f $COPY" \ "test -f $COPY" ro_test \ "mkdir" \ "mkdir ${COPY}.dd" \ "" \ "test -d ${COPY}.dd" \ "test ! -d ${COPY}.dd" ro_test \ "rmdir" \ "rmdir ${COPY}.dd" \ "mkdir ${COPY}.dd" \ "test ! -d ${COPY}.dd" \ "test -d ${COPY}.dd" ro_test \ "posix-rename" \ "rename $COPY ${COPY}.1" \ "touch $COPY" \ "test -f ${COPY}.1 -a ! -f $COPY" \ "test -f $COPY -a ! -f ${COPY}.1" ro_test \ "oldrename" \ "rename -l $COPY ${COPY}.1" \ "touch $COPY" \ "test -f ${COPY}.1 -a ! -f $COPY" \ "test -f $COPY -a ! -f ${COPY}.1" ro_test \ "symlink" \ "ln -s $COPY ${COPY}.1" \ "touch $COPY" \ "test -h ${COPY}.1" \ "test ! -h ${COPY}.1" ro_test \ "hardlink" \ "ln $COPY ${COPY}.1" \ "touch $COPY" \ "test -f ${COPY}.1" \ "test ! -f ${COPY}.1" # Test explicit permissions perm_test \ "open" \ "realpath,stat,lstat,read,close" \ "get $DATA $COPY" \ "" \ "cmp $DATA $COPY" \ "! cmp $DATA $COPY 2>/dev/null" perm_test \ "read" \ "realpath,stat,lstat,open,close" \ "get $DATA $COPY" \ "" \ "cmp $DATA $COPY" \ "! cmp $DATA $COPY 2>/dev/null" perm_test \ "write" \ "realpath,stat,lstat,open,close" \ "put $DATA $COPY" \ "" \ "cmp $DATA $COPY" \ "! cmp $DATA $COPY 2>/dev/null" perm_test \ "lstat" \ "realpath,stat,open,read,close" \ "get $DATA $COPY" \ "" \ "cmp $DATA $COPY" \ "! cmp $DATA $COPY 2>/dev/null" perm_test \ "opendir" \ "realpath,readdir,stat,lstat" \ "ls -ln $OBJ" perm_test \ "readdir" \ "realpath,opendir,stat,lstat" \ "ls -ln $OBJ" perm_test \ "setstat" \ "realpath,stat,lstat" \ "chmod 0700 $COPY" \ "touch $COPY; chmod 0400 $COPY" \ "test -x $COPY" \ "test ! -x $COPY" perm_test \ "remove" \ "realpath,stat,lstat" \ "rm $COPY" \ "touch $COPY" \ "test ! -f $COPY" \ "test -f $COPY" perm_test \ "mkdir" \ "realpath,stat,lstat" \ "mkdir ${COPY}.dd" \ "" \ "test -d ${COPY}.dd" \ "test ! -d ${COPY}.dd" perm_test \ "rmdir" \ "realpath,stat,lstat" \ "rmdir ${COPY}.dd" \ "mkdir ${COPY}.dd" \ "test ! -d ${COPY}.dd" \ "test -d ${COPY}.dd" perm_test \ "posix-rename" \ "realpath,stat,lstat" \ "rename $COPY ${COPY}.1" \ "touch $COPY" \ "test -f ${COPY}.1 -a ! -f $COPY" \ "test -f $COPY -a ! -f ${COPY}.1" perm_test \ "rename" \ "realpath,stat,lstat" \ "rename -l $COPY ${COPY}.1" \ "touch $COPY" \ "test -f ${COPY}.1 -a ! -f $COPY" \ "test -f $COPY -a ! -f ${COPY}.1" perm_test \ "symlink" \ "realpath,stat,lstat" \ "ln -s $COPY ${COPY}.1" \ "touch $COPY" \ "test -h ${COPY}.1" \ "test ! -h ${COPY}.1" perm_test \ "hardlink" \ "realpath,stat,lstat" \ "ln $COPY ${COPY}.1" \ "touch $COPY" \ "test -f ${COPY}.1" \ "test ! -f ${COPY}.1" perm_test \ "statvfs" \ "realpath,stat,lstat" \ "df /" # XXX need good tests for: # fstat # fsetstat # realpath # stat # readlink # fstatvfs rm -rf ${COPY} ${COPY}.1 ${COPY}.dd
Upload File
Create Folder