sftp_server.sh 1.7.4 script "error"

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
JohnMcKown
Posts: 39
Joined: Sat Nov 21, 2009 2:59 pm

sftp_server.sh 1.7.4 script "error"

Post by JohnMcKown »

OK, not an error, per se, but starting on line 62, I see:

if [[ ! ( $USE_COZ_SFTP == "true" && -x "$SFTP_SERVER" ) ]]; then
exec /usr/lib/ssh/sftp-server
exit $?
fi

isn't the "exit $?" unreachable because the preceeding "exec" command will replace the currently executing image, thus no "return" from "exec" is possible? OK, it is not going to cause a problem. I'm just a pain <grin>.
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

Right - exec won't return - unless it fails.
So, the "exit $?" only exits with an error if exec fails.
JohnMcKown
Posts: 39
Joined: Sat Nov 21, 2009 2:59 pm

Post by JohnMcKown »

Ah! It had not occurred to me that the exec might fail in this case. Now it makes sense!
Post Reply