rpms/acpid/F-7 acpid-1.0.4-fd.patch,NONE,1.1 acpid.spec,1.19,1.20
Zdenek Prikryl (zprikryl)
fedora-extras-commits at redhat.com
Wed Sep 26 14:13:54 UTC 2007
Author: zprikryl
Update of /cvs/extras/rpms/acpid/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8782
Modified Files:
acpid.spec
Added Files:
acpid-1.0.4-fd.patch
Log Message:
Fixed leak of a file descriptor (#304761)
acpid-1.0.4-fd.patch:
--- NEW FILE acpid-1.0.4-fd.patch ---
--- 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') {
Index: acpid.spec
===================================================================
RCS file: /cvs/extras/rpms/acpid/F-7/acpid.spec,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- acpid.spec 14 Feb 2007 13:01:46 -0000 1.19
+++ acpid.spec 26 Sep 2007 14:13:22 -0000 1.20
@@ -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 @@
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 @@
%patch1 -p1 -b .makefile
%patch2 -p1 -b .warning
%patch3 -p1 -b .pie
+%patch4 -p1 -b .fd
%build
make %{?_smp_mflags}
@@ -87,6 +89,9 @@
fi
%changelog
+* Wed Sep 26 2007 Zdenek Prikryl <zprikryl at redhat.com> - 1.0.4-8.fc7
+- Fixed leak of a file descriptor (#304761)
+
* Wed Feb 14 2007 Phil Knirsch <pknirsch at redhat.com> - 1.0.4-7.fc7
- Dropped /var/log/acpid ownership as per review (225237)
More information about the fedora-extras-commits
mailing list