diff --git a/acpid-1.0.6-fd.patch b/acpid-1.0.6-fd.patch new file mode 100644 index 0000000..e5b785d --- /dev/null +++ b/acpid-1.0.6-fd.patch @@ -0,0 +1,32 @@ +--- acpid-1.0.6.orig/acpid.c 2007-09-24 18:49:02.000000000 -0400 ++++ acpid-1.0.6/acpid.c 2007-09-24 18:52:44.000000000 -0400 +@@ -397,7 +397,7 @@ open_log(void) + int log_opts; + + /* open /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)); +diff -urp acpid-1.0.6.orig/event.c acpid-1.0.6/event.c +--- acpid-1.0.6.orig/event.c 2007-09-24 18:49:02.000000000 -0400 ++++ acpid-1.0.6/event.c 2007-09-24 18:55:10.000000000 -0400 +@@ -318,6 +318,7 @@ parse_file(const char *file) + file); + } + free_rule(r); ++ fclose(fp); + return NULL; + } + fclose(fp); +@@ -667,7 +668,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.init b/acpid.init index 32b106f..ea49092 100755 --- a/acpid.init +++ b/acpid.init @@ -10,10 +10,10 @@ ### BEGIN INIT INFO # Provides: acpid -# Required-Start: $syslog -# Required-Stop: $syslog -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 +# Required-Start: $syslog $local_fs +# Required-Stop: $syslog $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 # Short-Description: start and stop acpid # Description: Listen and dispatch ACPI events from the kernel ### END INIT INFO @@ -35,7 +35,7 @@ start() { fi # Check for kernel support if [ ! -f /proc/acpi/event ]; then - echo "$0: need ACPI support in kernel." + echo "$0: need ACPI_PROC_EVENT support in kernel." //zmena podle 260181 exit 1 fi # Check if it is already running diff --git a/acpid.spec b/acpid.spec index 7b1d4da..1779516 100644 --- a/acpid.spec +++ b/acpid.spec @@ -1,7 +1,7 @@ Summary: ACPI Event Daemon Name: acpid Version: 1.0.6 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL Group: System Environment/Daemons Source: http://prdownloads.sourceforge.net/acpid/acpid-%{version}.tar.gz @@ -11,6 +11,7 @@ Source3: acpid.video.conf Source4: acpid.power.conf Patch1: acpid-1.0.6-makefile.patch Patch2: acpid-1.0.6-return.patch +Patch3: acpid-1.0.6-fd.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) ExclusiveArch: ia64 x86_64 %{ix86} URL: http://acpid.sourceforge.net/ @@ -27,6 +28,7 @@ acpid is a daemon that dispatches ACPI events to user-space programs. %setup -q %patch1 -p1 -b .makefile %patch2 -p1 -b .return +%patch3 -p1 -b .fd %build make %{?_smp_mflags} @@ -85,6 +87,10 @@ if [ "$1" -ge "1" ]; then fi %changelog +* Wed Sep 26 2007 Zdenek Prikryl - 1.0.6-2.fc8 +- Fixed leak of a file descriptor +- Resolves: #304761 + * Tue Aug 07 2007 Zdenek Prikryl - 1.0.6-1.fc8 - Updated to version 1.0.6