Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix fragile NT_VERSION detection, this also fixed version detection for abi string on DragonFly
John Marino committed 13 years ago
commit f40bb9d0e8baee8eb5f6c429363b39f83675cb66
parent 0fee099
1 file changed +3 -1
modified libpkg/pkg_elf.c
@@ -55,6 +55,8 @@
/* FFR: when we support installing a 32bit package on a 64bit host */
#define _PATH_ELF32_HINTS       "/var/run/ld-elf32.so.hints"

+
#define roundup2(x, y)	(((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
+

static int
filter_system_shlibs(const char *name, char *path, size_t pathlen)
{
@@ -571,7 +573,7 @@ pkg_get_myarch(char *dest, size_t sz)
		src += note.n_namesz + note.n_descsz;
	}
	osname = src;
-
	src += note.n_namesz;
+
	src += roundup2(note.n_namesz, 4);
	if (elfhdr.e_ident[EI_DATA] == ELFDATA2MSB)
		version = be32dec(src);
	else