diff options
author | root <root@rshg054.dnsready.net> | 2013-06-19 01:37:15 -0700 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2013-06-19 01:37:15 -0700 |
commit | 603bdf488872afbc69493bc640aedb7548f3ed51 (patch) | |
tree | 60945d453f0d8b5f8fb9ed8cb8d4e35c5d8d5dcf /extra/libbsd | |
parent | 614d2fec699c594b1a3a25c973e0b5150302ff0e (diff) |
Wed Jun 19 01:36:52 PDT 2013
Diffstat (limited to 'extra/libbsd')
-rw-r--r-- | extra/libbsd/PKGBUILD | 18 | ||||
-rw-r--r-- | extra/libbsd/spt.patch | 50 |
2 files changed, 64 insertions, 4 deletions
diff --git a/extra/libbsd/PKGBUILD b/extra/libbsd/PKGBUILD index c2215585e..1358339c0 100644 --- a/extra/libbsd/PKGBUILD +++ b/extra/libbsd/PKGBUILD @@ -1,19 +1,29 @@ -# $Id: PKGBUILD 188599 2013-06-16 20:01:01Z eric $ +# $Id: PKGBUILD 188690 2013-06-18 01:22:22Z heftig $ # Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com> # Contributor: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> pkgname=libbsd pkgver=0.5.2 -pkgrel=1 +pkgrel=2 pkgdesc="Provides useful functions commonly found on BSD systems like strlcpy()" arch=('i686' 'x86_64') url="http://libbsd.freedesktop.org" license=('custom') depends=('glibc') options=('!libtool') -source=(http://libbsd.freedesktop.org/releases/$pkgname-$pkgver.tar.xz{,.asc}) +source=(http://libbsd.freedesktop.org/releases/$pkgname-$pkgver.tar.xz{,.asc} + spt.patch) md5sums=('be8b2e0dc4614699834c49693574fd1a' - 'SKIP') + 'SKIP' + '56236fb72c8ec6cbdbd0daa5f404bccb') + +prepare() { + cd $pkgname-$pkgver + + # Paper over a firefox crash + # http://lists.freedesktop.org/archives/libbsd/2013-June/000085.html + patch -Np1 -i ../spt.patch +} build() { cd $pkgname-$pkgver diff --git a/extra/libbsd/spt.patch b/extra/libbsd/spt.patch new file mode 100644 index 000000000..b19dc9b87 --- /dev/null +++ b/extra/libbsd/spt.patch @@ -0,0 +1,50 @@ +diff -u -r libbsd-0.5.2-orig/src/setproctitle.c libbsd-0.5.2/src/setproctitle.c +--- libbsd-0.5.2-orig/src/setproctitle.c 2013-06-08 18:26:04.000000000 +0200 ++++ libbsd-0.5.2/src/setproctitle.c 2013-06-18 02:35:59.441393418 +0200 +@@ -86,7 +86,7 @@ + if (environ != envp) + return 0; + +- /* Make a copy of the old environ array of pointers, in case ++ /* Make a deep copy of the old environ array of pointers, in case + * clearenv() or setenv() is implemented to free the internal + * environ array, because we will need to access the old environ + * contents to make the new copy. */ +@@ -94,11 +94,13 @@ + envcopy = malloc(envsize); + if (envcopy == NULL) + return errno; +- memcpy(envcopy, envp, envsize); ++ for (i = 0; envp[i]; i++) envcopy[i] = strdup(envp[i]); ++ envcopy[i] = NULL; + + error = spt_clearenv(); + if (error) { + environ = envp; ++ for(i = 0; envcopy[i]; i++) free(envcopy[i]); + free(envcopy); + return error; + } +@@ -116,18 +118,20 @@ + if (error) { + #ifdef HAVE_CLEARENV + /* Because the old environ might not be available +- * anymore we will make do with the shallow copy. */ ++ * anymore we will make do with the deep copy. */ + environ = envcopy; + #else + environ = envp; ++ for(i = 0; envcopy[i]; i++) free(envcopy[i]); + free(envcopy); + #endif + return error; + } + } + +- /* Dispose of the shallow copy, now that we've finished transfering ++ /* Dispose of the deep copy, now that we've finished transfering + * the old environment. */ ++ for(i = 0; envcopy[i]; i++) free(envcopy[i]); + free(envcopy); + + return 0; |