Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Report an error when chdir is failing with ssh protocol
Baptiste Daroussin committed 10 years ago
commit 517e1a9cb1d75ba33e93e0dc0891cf9e1aa62969
parent df7ebf99074265aa2c152b7349493300c2e2a666
1 file changed +5 -1
modified libpkg/ssh.c
@@ -138,7 +138,11 @@ pkg_sshserve(int fd)
#else
		if (restricted != NULL) {
#endif
-
			chdir(restricted);
+
			if (chdir(restricted)) {
+
				printf("ko: chdir failed (%s)\n", restricted);
+
				continue;
+
			}
+

			if (realpath(file, fpath) == NULL ||
			    realpath(restricted, rpath) == NULL ||
			    strncmp(fpath, rpath, strlen(rpath)) != 0) {