From df3c31c11c76122fe94acc5aa309aacfa8ae28fa Mon Sep 17 00:00:00 2001 From: Eric Smith Date: Sun, 7 Jul 2013 21:35:01 -0600 Subject: [PATCH] Quick and dirty patch attempting to eliminate another setproctitle() crash, bug #981799. --- libbsd-0.5.2-nosetproctitle.patch | 40 +++++++++++++++++++++++++++++++ libbsd.spec | 8 ++++++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 libbsd-0.5.2-nosetproctitle.patch diff --git a/libbsd-0.5.2-nosetproctitle.patch b/libbsd-0.5.2-nosetproctitle.patch new file mode 100644 index 0000000..46bec22 --- /dev/null +++ b/libbsd-0.5.2-nosetproctitle.patch @@ -0,0 +1,40 @@ +diff -up libbsd-0.5.2/src/setproctitle.c.nosetproctitle libbsd-0.5.2/src/setproctitle.c +--- libbsd-0.5.2/src/setproctitle.c.nosetproctitle 2013-07-07 21:26:04.407952595 -0600 ++++ libbsd-0.5.2/src/setproctitle.c 2013-07-07 21:28:56.859945939 -0600 +@@ -1,3 +1,4 @@ ++#define NO_SETPROCTITLE + /* + * Copyright © 2010 William Ahern + * Copyright © 2012-2013 Guillem Jover +@@ -156,6 +157,7 @@ spt_copyargs(int argc, char *argv[]) + static void + spt_init(int argc, char *argv[], char *envp[]) + { ++#ifdef NO_SETPROCTITLE + char *base, *end, *nul, *tmp; + int i, envc, error; + +@@ -213,6 +215,7 @@ spt_init(int argc, char *argv[], char *e + SPT.nul = nul; + SPT.base = base; + SPT.end = end; ++#endif // NO_SETPROCTITLE + } + + /* +@@ -230,6 +233,7 @@ void (*spt_init_func)(int argc, char *ar + void + setproctitle_impl(const char *fmt, ...) + { ++#ifdef NO_SETPROCTITLE + /* Use buffer in case argv[0] is passed. */ + char buf[SPT_MAXTITLE + 1]; + va_list ap; +@@ -279,6 +283,7 @@ setproctitle_impl(const char *fmt, ...) + *SPT.nul = ' '; + *++nul = '\0'; + } ++#endif // NO_SETPROCTITLE + } + __asm__(".symver setproctitle_impl,setproctitle@@LIBBSD_0.5"); + diff --git a/libbsd.spec b/libbsd.spec index 4507359..f181d29 100644 --- a/libbsd.spec +++ b/libbsd.spec @@ -1,6 +1,6 @@ Name: libbsd Version: 0.5.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library providing BSD-compatible functions for portability URL: http://libbsd.freedesktop.org/ License: BSD and ISC and Copyright only and Public Domain @@ -8,6 +8,7 @@ Group: System Environment/Libraries # BuildRoot tag necessary for EL5 only: BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) Source0: http://libbsd.freedesktop.org/releases/libbsd-%{version}.tar.xz +Patch0: libbsd-0.5.2-nosetproctitle.patch %description libbsd provides useful functions commonly found on BSD systems, and @@ -26,6 +27,7 @@ Development files for the libbsd library. %prep %setup -q +%patch0 -p1 -b .nosetproctitle %configure @@ -67,6 +69,10 @@ rm %{buildroot}%{_libdir}/%{name}.la %{_libdir}/pkgconfig/%{name}-overlay.pc %changelog +* Sun Jul 07 2013 Eric Smith - 0.5.2-3 +- Still having problems with setproctitle(), bug #981799, upstream + freedesktop.org bug #66679. Added patch to noop out setproctitle(). + * Tue Jun 11 2013 Eric Smith - 0.5.2-2 - Added check section. - Add BuildRoot for EL5.