X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/59f57473ab85d3fb3354d086db2df2466c1c3896..950733c947acd50afe498e900954d911454c57e7:/test/integration/framework diff --git a/test/integration/framework b/test/integration/framework index ee976aff5..d52fcdf87 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -478,7 +478,6 @@ configdpkgnoopchroot() { #include #include #include -#include static char * chrootdir = NULL; @@ -495,16 +494,22 @@ int execvp(const char *file, char *const argv[]) { if (chrootdir == NULL || strncmp(file, "/var/lib/dpkg/", strlen("/var/lib/dpkg/")) != 0) return func_execvp(file, argv); printf("REWRITE execvp call %s into %s\n", file, chrootdir); - char newfile[PATH_MAX]; - snprintf(newfile, sizeof(newfile), "%s/%s", chrootdir, file); + char *newfile; + if (asprintf(&newfile, "%s%s", chrootdir, file) == -1) { + perror("asprintf"); + return -1; + } char const * const baseadmindir = "/var/lib/dpkg"; - char admindir[PATH_MAX]; - snprintf(admindir, sizeof(admindir), "%s/%s", chrootdir, baseadmindir); + char *admindir; + if (asprintf(&admindir, "%s%s", chrootdir, baseadmindir) == -1) { + perror("asprintf"); + return -1; + } setenv("DPKG_ADMINDIR", admindir, 1); return func_execvp(newfile, argv); } EOF - testsuccess --nomsg gcc -fPIC -shared -o noopchroot.so noopchroot.c -ldl + testsuccess --nomsg gcc -Wall -fPIC -shared -o noopchroot.so noopchroot.c -ldl } configcompression() { while [ -n "$1" ]; do