diff options
Diffstat (limited to 't/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi')
6 files changed, 59 insertions, 0 deletions
diff --git a/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/build-spec/debian/rules b/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/build-spec/debian/rules new file mode 100644 index 0000000..7b55940 --- /dev/null +++ b/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/build-spec/debian/rules @@ -0,0 +1,17 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + +%: + dh $@ + +override_dh_perl: + +override_dh_builddeb: + # Work around debhelper bug (triggers useless call to ldconfig) + rm -f debian/*/DEBIAN/postinst debian/*/DEBIAN/postrm + rm -f debian/*/DEBIAN/triggers + dh_builddeb + +# errors out with: objcopy: '.../binaries-missing-depends-on-xapi.debug': No such file +override_dh_dwz: diff --git a/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/build-spec/fill-values b/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/build-spec/fill-values new file mode 100644 index 0000000..bf3682a --- /dev/null +++ b/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/build-spec/fill-values @@ -0,0 +1,4 @@ +Skeleton: upload-native +Testname: binaries-missing-depends-on-xapi +Description: Test for missing perlapi depends +Package-Architecture: any diff --git a/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/build-spec/orig/Makefile b/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/build-spec/orig/Makefile new file mode 100644 index 0000000..5c9cbaf --- /dev/null +++ b/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/build-spec/orig/Makefile @@ -0,0 +1,16 @@ +all: + gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so basic.c + +VENDORARCH := $(shell perl -MConfig -wE'say substr($$Config{vendorarch},1)') + +install: + # install it under the correct triplet directory + install -d $(DESTDIR)/$(VENDORARCH) + install -m 644 -c -s libbasic.so $(DESTDIR)/$(VENDORARCH)/libbasic.so + install -d $(DESTDIR)/usr/lib/php5 + install -m 644 -c -s libbasic.so $(DESTDIR)/usr/lib/php5/libbasic.so + +clean distclean: + rm -f libbasic.so.2 + +check test: diff --git a/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/build-spec/orig/basic.c b/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/build-spec/orig/basic.c new file mode 100644 index 0000000..27e93fc --- /dev/null +++ b/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/build-spec/orig/basic.c @@ -0,0 +1,19 @@ +#include <stdio.h> +#include <string.h> + +static void +hardening_trigger(char *p, int i, void (*f)(char *)) +{ + char test[10]; + memcpy(test, p, i); + f(test); + printf("%s", test); +} + +int +lib_interface(void) +{ + printf("Hello world!\n"); + hardening_trigger(NULL, 0, NULL); + return 0; +} diff --git a/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/eval/desc b/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/eval/desc new file mode 100644 index 0000000..1f5f111 --- /dev/null +++ b/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/eval/desc @@ -0,0 +1,2 @@ +Testname: binaries-missing-depends-on-xapi +Check: binaries/prerequisites/php diff --git a/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/eval/hints b/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/eval/hints new file mode 100644 index 0000000..0791fd8 --- /dev/null +++ b/t/recipes/checks/binaries/prerequisites/php/binaries-missing-depends-on-xapi/eval/hints @@ -0,0 +1 @@ +binaries-missing-depends-on-xapi (binary): missing-dependency-on-phpapi |