Fixed leak of a file descriptor Resolves: #304761
This commit is contained in:
parent
a3d7f9299c
commit
20bfb3174a
32
acpid-1.0.6-fd.patch
Normal file
32
acpid-1.0.6-fd.patch
Normal file
@ -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') {
|
||||||
|
|
10
acpid.init
10
acpid.init
@ -10,10 +10,10 @@
|
|||||||
|
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: acpid
|
# Provides: acpid
|
||||||
# Required-Start: $syslog
|
# Required-Start: $syslog $local_fs
|
||||||
# Required-Stop: $syslog
|
# Required-Stop: $syslog $local_fs
|
||||||
# Default-Start: 3 4 5
|
# Default-Start: 2 3 4 5
|
||||||
# Default-Stop: 0 1 2 6
|
# Default-Stop: 0 1 6
|
||||||
# Short-Description: start and stop acpid
|
# Short-Description: start and stop acpid
|
||||||
# Description: Listen and dispatch ACPI events from the kernel
|
# Description: Listen and dispatch ACPI events from the kernel
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
@ -35,7 +35,7 @@ start() {
|
|||||||
fi
|
fi
|
||||||
# Check for kernel support
|
# Check for kernel support
|
||||||
if [ ! -f /proc/acpi/event ]; then
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Check if it is already running
|
# Check if it is already running
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Summary: ACPI Event Daemon
|
Summary: ACPI Event Daemon
|
||||||
Name: acpid
|
Name: acpid
|
||||||
Version: 1.0.6
|
Version: 1.0.6
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
License: GPL
|
License: GPL
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
Source: http://prdownloads.sourceforge.net/acpid/acpid-%{version}.tar.gz
|
Source: http://prdownloads.sourceforge.net/acpid/acpid-%{version}.tar.gz
|
||||||
@ -11,6 +11,7 @@ Source3: acpid.video.conf
|
|||||||
Source4: acpid.power.conf
|
Source4: acpid.power.conf
|
||||||
Patch1: acpid-1.0.6-makefile.patch
|
Patch1: acpid-1.0.6-makefile.patch
|
||||||
Patch2: acpid-1.0.6-return.patch
|
Patch2: acpid-1.0.6-return.patch
|
||||||
|
Patch3: acpid-1.0.6-fd.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
ExclusiveArch: ia64 x86_64 %{ix86}
|
ExclusiveArch: ia64 x86_64 %{ix86}
|
||||||
URL: http://acpid.sourceforge.net/
|
URL: http://acpid.sourceforge.net/
|
||||||
@ -27,6 +28,7 @@ acpid is a daemon that dispatches ACPI events to user-space programs.
|
|||||||
%setup -q
|
%setup -q
|
||||||
%patch1 -p1 -b .makefile
|
%patch1 -p1 -b .makefile
|
||||||
%patch2 -p1 -b .return
|
%patch2 -p1 -b .return
|
||||||
|
%patch3 -p1 -b .fd
|
||||||
|
|
||||||
%build
|
%build
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
@ -85,6 +87,10 @@ if [ "$1" -ge "1" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Sep 26 2007 Zdenek Prikryl <zprikryl@redhat.com> - 1.0.6-2.fc8
|
||||||
|
- Fixed leak of a file descriptor
|
||||||
|
- Resolves: #304761
|
||||||
|
|
||||||
* Tue Aug 07 2007 Zdenek Prikryl <zprikryl@redhat.com> - 1.0.6-1.fc8
|
* Tue Aug 07 2007 Zdenek Prikryl <zprikryl@redhat.com> - 1.0.6-1.fc8
|
||||||
- Updated to version 1.0.6
|
- Updated to version 1.0.6
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user