From 532493467fa751edb12dc06b5e12c72d5d9baeef Mon Sep 17 00:00:00 2001 From: Romain Naour Date: Tue, 17 Jan 2017 22:55:53 +0100 Subject: [PATCH] libcap: Change the 'len' parameter type to 'size_t' See gperf 3.1 ChangeLog: * The 'len' parameter of the hash function and of the lookup function is now of type 'size_t' instead of 'unsigned int'. This makes it safe to call these functions with strings of length > 4 GB, on 64-bit machines. Fixes: http://autobuild.buildroot.net/results/a2d/a2da03b1a586fcfb0c7f9146aaf24bfab2e885b0 Signed-off-by: Romain Naour --- libcap/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcap/Makefile b/libcap/Makefile index d189777..40cbc30 100644 --- a/libcap/Makefile +++ b/libcap/Makefile @@ -22,7 +22,7 @@ all: $(MINLIBNAME) $(STALIBNAME) libcap.pc ifeq ($(BUILD_GPERF),yes) USE_GPERF_OUTPUT = $(GPERF_OUTPUT) -INCLUDE_GPERF_OUTPUT = -include $(GPERF_OUTPUT) +INCLUDE_GPERF_OUTPUT = -include string.h -include $(GPERF_OUTPUT) endif libcap.pc: libcap.pc.in @@ -41,7 +41,7 @@ cap_names.h: _makenames ./_makenames > cap_names.h $(GPERF_OUTPUT): cap_names.list.h - perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@ + perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, size_t);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@ cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h @echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h" -- 2.9.3