From c9b9f32e96faca845ca97297520698350564cd08 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 27 May 2013 14:00:24 +0200 Subject: [PATCH] xbps: merge another patch from git master to really fix xbps-create. --- ...ove-d6605e1b97-sanitize-destdir-to-r.patch | 44 +++++++++++++++++++ srcpkgs/xbps/template | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/xbps/patches/0003-xbps-create-improve-d6605e1b97-sanitize-destdir-to-r.patch diff --git a/srcpkgs/xbps/patches/0003-xbps-create-improve-d6605e1b97-sanitize-destdir-to-r.patch b/srcpkgs/xbps/patches/0003-xbps-create-improve-d6605e1b97-sanitize-destdir-to-r.patch new file mode 100644 index 00000000000..a24b81bbf3a --- /dev/null +++ b/srcpkgs/xbps/patches/0003-xbps-create-improve-d6605e1b97-sanitize-destdir-to-r.patch @@ -0,0 +1,44 @@ +From fa9d3471d921e1d49cdddeeab546d61f04bc1cf1 Mon Sep 17 00:00:00 2001 +From: Juan RP +Date: Mon, 27 May 2013 13:03:40 +0200 +Subject: [PATCH] xbps-create: improve d6605e1b97 (sanitize destdir to resolve + target files in symlinks). + +Previously in d6605e1b97 if destdir had trailing '/' the behavior +of detecting target files in symlinks was changed slightly. +--- + bin/xbps-create/main.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/bin/xbps-create/main.c b/bin/xbps-create/main.c +index 2a2373d..5d0a265 100644 +--- bin/xbps-create/main.c ++++ bin/xbps-create/main.c +@@ -178,7 +178,7 @@ ftw_cb(const char *fpath, const struct stat *sb, int type, struct FTW *ftwbuf) + { + struct xentry *xe = NULL; + const char *filep = NULL; +- char *buf, *p, *dname; ++ char *buf, *p, *p2, *dname; + ssize_t r; + + (void)ftwbuf; +@@ -237,7 +237,14 @@ ftw_cb(const char *fpath, const struct stat *sb, int type, struct FTW *ftwbuf) + */ + xe->target = strdup(buf); + } else { +- xe->target = strdup(p + strlen(destdir) - 1); ++ /* ++ * Sanitize destdir just in case. ++ */ ++ if ((p2 = realpath(destdir, NULL)) == NULL) ++ die("failed to sanitize destdir %s: %s", destdir, strerror(errno)); ++ ++ xe->target = strdup(p+strlen(p2)); ++ free(p2); + free(p); + } + } else if (strchr(buf, '/') == NULL) { +-- +1.8.3 + diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index c4885b9b7ed..2a01fbadeb1 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -1,7 +1,7 @@ # Template file for 'xbps' pkgname=xbps version=0.24 -revision=3 +revision=4 build_style=configure configure_args="--prefix=/ --exec-prefix=/usr --sbindir=/usr/sbin --enable-static --enable-debug --enable-tests"