mirror of https://github.com/wolfSSL/wolfssh.git
The default SCP receive callback keeps its destination per session, the base path plus each directory entered, in place of the process working directory that every session of a threaded server shares. With openat() it holds that directory open, reaches it and everything created below it with O_NOFOLLOW, and confirms a reopened parent is the one entered. - port.h gains WOPENAT, WMKDIRAT, WOLFSSH_O_SEARCH with a search check as chdir() made, and WOLFSSH_HAVE_DIRFD, which sizes WOLFSSH so it keys only on configure's openat() probe; WOLFSSH_NO_DIRFD opts out - ports without them open by the full path after a wIsDirNoFollow() screen of the base and of each directory entered; a refused base frees the receive path - the receive path is capped at DEFAULT_SCP_FILE_NAME_SZ like the send side's; futimes() stands in for futimens() on hosts with openat() but not futimens(), such as macOS before 10.13 - unit: ScpRecvCallback_SessionPath walks down and back with the working directory untouched, then has the tree moved out from under it; a linked base and a file-named directory are refused - scp.test: a planted symlink at the destination name keeps its target; scp-test.yml also builds and tests the fallback Issue: F-14758, F-13998 |
||
|---|---|---|
| .. | ||
| actions/install-apt-deps | ||
| ci-deps | ||
| scripts | ||
| workflows | ||