Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Report an error when chdir is failing with ssh protocol
Baptiste Daroussin committed 10 years ago
commit 517e1a9cb1d75ba33e93e0dc0891cf9e1aa62969
parent df7ebf9
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) {