Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Restore the fix partially.
Vsevolod Stakhov committed 11 years ago
commit 3b35075a2032b6f7eb21a7bb64fde67961c9c703
parent 378aaac
1 file changed +2 -4
modified libpkg/ssh.c
@@ -134,8 +134,6 @@ pkg_sshserve(int fd)
#else
		if (restricted != NULL) {
#endif
-
			chdir(restricted);
-

			if (realpath(file, fpath) == NULL ||
					strncmp(file, restricted, strlen(restricted)) != 0) {
				printf("ko: file not found\n");
@@ -143,7 +141,7 @@ pkg_sshserve(int fd)
			}
		}

-
		if (fstatat(fd, fpath, &st, 0) == -1) {
+
		if (fstatat(fd, file, &st, 0) == -1) {
			pkg_debug(1, "SSH server> fstatat failed");
			printf("ko: file not found\n");
			continue;
@@ -159,7 +157,7 @@ pkg_sshserve(int fd)
			continue;
		}

-
		if ((ffd = openat(fd, fpath, O_RDONLY)) == -1) {
+
		if ((ffd = openat(fd, file, O_RDONLY)) == -1) {
			printf("ko: file not found\n");
			continue;
		}