Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Only drop one '/' when performing checksum on symlinks
Baptiste Daroussin committed 9 years ago
commit e3ff4b7a1c7258a040f12f4268bff198004fe1e5
parent 1089b15
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 *