Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Only drop one '/' when performing checksum on symlinks
Baptiste Daroussin committed 9 years ago
commit e3ff4b7a1c7258a040f12f4268bff198004fe1e5
parent 1089b15b24fab88139d3e32e5d04867ffadb96dc
1 file changed +5 -7
modified libpkg/pkg_checksum.c
@@ -690,13 +690,11 @@ pkg_checksum_symlink_readlink(const char *linkbuf, int linklen,

	lnk = linkbuf;

-
	/* Skip heading slashes */
-
	while (*lnk == '/') {
-
		lnk++;
-
		linklen--;
-
	}
-

-
	return (pkg_checksum_data(lnk, linklen, type));
+
	/*
+
	 * It is known that \0 is added to the checksum in case the symlink
+
	 * targets an absolute path but the behaviour is kept for compat
+
	 */
+
	return (pkg_checksum_data(RELATIVE_PATH(lnk), linklen, type));
}

unsigned char *