diff --git a/acpid-1.0.4-fd.patch b/acpid-1.0.4-fd.patch new file mode 100644 index 0000000..47f2821 --- /dev/null +++ b/acpid-1.0.4-fd.patch @@ -0,0 +1,39 @@ +--- acpid-1.0.4.orig/acpid.c 2007-09-24 17:05:07.000000000 -0400 ++++ acpid-1.0.4/acpid.c 2007-09-24 17:12:19.000000000 -0400 +@@ -396,13 +396,13 @@ open_logs(void) + int nullfd; + + /* set up stdout, stderr to log and stdin to /dev/null */ +- nullfd = open("/dev/null", O_RDONLY, 0640); ++ nullfd = open("/dev/null", O_RDONLY); + if (nullfd < 0) { + fprintf(stderr, "%s: can't open %s: %s\n", progname, + "/dev/null", strerror(errno)); + return -1; + } +- logfd = open(logfile, O_WRONLY|O_CREAT|O_APPEND); ++ logfd = open(logfile, O_WRONLY|O_CREAT|O_APPEND, 0640); + if (logfd < 0) { + fprintf(stderr, "%s: can't open %s: %s\n", progname, + logfile, strerror(errno)); +diff -urp acpid-1.0.4.orig/event.c acpid-1.0.4/event.c +--- acpid-1.0.4.orig/event.c 2007-09-24 17:05:07.000000000 -0400 ++++ acpid-1.0.4/event.c 2007-09-24 17:33:56.000000000 -0400 +@@ -302,6 +302,7 @@ parse_file(const char *file) + acpid_log("DBG: skipping incomplete file %s\n", file); + } + free_rule(r); ++ fclose(fp); + return NULL; + } + fclose(fp); +@@ -641,7 +642,7 @@ parse_cmd(const char *cmd, const char *e + i = 0; + + memset(buf, 0, sizeof(buf)); +- while (i < (sizeof(buf)-1)) { ++ while ((size_t)i < (sizeof(buf)-1)) { + if (*p == '%') { + p++; + if (*p == 'e') { + diff --git a/acpid.spec b/acpid.spec index b67b09e..29067e7 100644 --- a/acpid.spec +++ b/acpid.spec @@ -1,7 +1,7 @@ Summary: ACPI Event Daemon Name: acpid Version: 1.0.4 -Release: 7%{?dist} +Release: 8%{?dist} License: GPL Group: System Environment/Daemons Source: http://prdownloads.sourceforge.net/acpid/acpid-%{version}.tar.gz @@ -12,6 +12,7 @@ Source4: acpid.power.conf Patch1: acpid-1.0.3-makefile.patch Patch2: acpid-1.0.4-warning.patch Patch3: acpid-1.0.4-pie.patch +Patch4: acpid-1.0.4-fd.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) ExclusiveArch: ia64 x86_64 %{ix86} URL: http://acpid.sourceforge.net/ @@ -29,6 +30,7 @@ acpid is a daemon that dispatches ACPI events to user-space programs. %patch1 -p1 -b .makefile %patch2 -p1 -b .warning %patch3 -p1 -b .pie +%patch4 -p1 -b .fd %build make %{?_smp_mflags} @@ -87,6 +89,9 @@ if [ "$1" -ge "1" ]; then fi %changelog +* Wed Sep 26 2007 Zdenek Prikryl - 1.0.4-8.fc7 +- Fixed leak of a file descriptor (#304761) + * Wed Feb 14 2007 Phil Knirsch - 1.0.4-7.fc7 - Dropped /var/log/acpid ownership as per review (225237)