OBS User unknown 2007-07-04 22:32:31 +00:00 committed by Git OBS Bridge
parent 047b101259
commit 7b273780f0
10 changed files with 22 additions and 179 deletions

View File

@ -1,46 +0,0 @@
Date: Fri, 23 Sep 2005 09:40:01 -0700
From: thockin@hockin.org
To: Stefan Seyfried <seife@suse.de>
Cc: Timo Hoenig <thoenig@suse.de>, Thomas Renninger <trenn@suse.de>
Subject: Re: acpid client disconnect fix
Message-ID: <20050923164001.GA10845@hockin.org>
References: <1127469283.13743.119.camel@f100.suse.de> <20050923162037.GA9805@hockin.org> <4334293F.9050809@suse.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4334293F.9050809@suse.de>
User-Agent: Mutt/1.4.1i
Sender: <thockin@teetot.devrandom.net>
On Fri, Sep 23, 2005 at 06:11:43PM +0200, Stefan Seyfried wrote:
> thockin@hockin.org wrote:
> > On Fri, Sep 23, 2005 at 11:54:43AM +0200, Timo Hoenig wrote:
> >> Nevertheless I'm sending you a patch to close a client's fd once it
> >> disconnects. Otherwise acpid leaks one fd for each client
> >> disconnecting.
> >
> > It also seems to leak the rule structure. Woops.
>
> If you fix it, it would be nice if you pass the patch on to me :-)
Fixed in CVS. Do you think it's worth making a new (1.5?) release?
Tim
Index: event.c
===================================================================
RCS file: /cvsroot/acpid/acpid/event.c,v
retrieving revision 1.9
diff -u -u -r1.9 event.c
--- event.c 25 Oct 2004 04:24:21 -0000 1.9
+++ event.c 23 Sep 2005 16:17:15 -0000
@@ -590,6 +590,8 @@
/* closed */
acpid_log("client has disconnected\n");
delist_rule(&client_list, rule);
+ close(rule->action.fd);
+ free_rule(rule);
return -1;
}
safe_write(client, "\n", 1);

View File

@ -1,16 +0,0 @@
Subject: Fix gcc4.1 compiler warnings/errors in ud_socket.c
From: Philipp Thomas <pth@suse.de>
Signed-off-by: Stefan Seyfried <seife@suse.de>
--- ud_socket.c 2005/04/04 14:47:18 1.1
+++ ud_socket.c 2005/04/04 14:47:30
@@ -58,7 +58,7 @@
while (1) {
int newsock = 0;
struct sockaddr_un cliaddr;
- int len = sizeof(struct sockaddr_un);
+ socklen_t len = sizeof(struct sockaddr_un);
newsock = accept(listenfd, (struct sockaddr *)&cliaddr, &len);
if (newsock < 0) {

View File

@ -1,20 +0,0 @@
Ignore files ending in '~' when searching for event config files.
Fixes https://sourceforge.net/tracker/index.php?func=detail&aid=1530974&group_id=33140&atid=407341
From: Stefan Seyfried <seife@suse.de>
--- event.c
+++ event.c
@@ -121,7 +121,11 @@
if (dirent->d_name[0] == '.')
continue; /* skip dotfiles */
- len = strlen(dirent->d_name) + strlen(confdir) + 2;
+ len = strlen(dirent->d_name);
+ if (len > 0 && dirent->d_name[len - 1] == '~')
+ continue; /* skip editor backup files */
+
+ len += strlen(confdir) + 2;
file = (char *)malloc(len);
if (!file) {
acpid_log("ERR: malloc(): %s\n", strerror(errno));

View File

@ -1,63 +0,0 @@
Make acpid use syslog instead of its own logfile-writing mechanism.
From: Stefan Seyfried <seife@suse.de>
diff -ruN acpid-1.0.4~/acpid.c acpid-1.0.4/acpid.c
--- acpid-1.0.4~/acpid.c 2005-10-12 21:14:07.000000000 +0200
+++ acpid-1.0.4/acpid.c 2005-10-12 22:09:58.000000000 +0200
@@ -32,6 +32,7 @@
#include <time.h>
#include <sys/poll.h>
#include <grp.h>
+#include <sys/syslog.h>
#include "acpid.h"
#include "ud_socket.h"
@@ -405,13 +406,17 @@
"/dev/null", strerror(errno));
return -1;
}
+#ifdef USE_SYSLOG
+ openlog("[acpid]", LOG_CONS, LOG_DAEMON);
+ logfd = nullfd;
+#else
logfd = open(logfile, O_WRONLY|O_CREAT|O_APPEND);
if (logfd < 0) {
fprintf(stderr, "%s: can't open %s: %s\n", progname,
logfile, strerror(errno));
return -1;
}
-
+#endif
if (dup2(nullfd, STDIN_FILENO) != STDIN_FILENO) {
fprintf(stderr, "%s: dup2: %s\n", progname, strerror(errno));
return -1;
@@ -447,6 +452,20 @@
acpid_read_conf(confdir);
}
+#ifdef USE_SYSLOG
+int
+acpid_log(const char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ vsyslog(LOG_INFO, fmt, args);
+ va_end(args);
+
+ return 0;
+}
+
+#else
int
acpid_log(const char *fmt, ...)
{
@@ -465,6 +484,7 @@
return 0;
}
+#endif
/*
* This depends on fixes in linux ACPI after 2.4.8

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:032a95967f8dd8a227ee1771de4a2646becc4d0f1123568faeca931006ec8f5f
size 23416

View File

@ -1,14 +1,5 @@
--- acpid.c.orig 2004-10-18 00:33:51.000000000 +0200
+++ acpid.c 2005-08-02 19:22:04.000000000 +0200
@@ -61,7 +61,7 @@
main(int argc, char **argv)
{
int event_fd;
- int sock_fd;
+ int sock_fd = 0;
/* learn who we really are */
progname = (const char *)strrchr(argv[0], '/');
@@ -386,7 +386,8 @@
umask(0);
@ -30,11 +21,3 @@
DEFS = -DVERSION="\"$(VERSION)\""
all: $(PROGS)
@@ -36,6 +36,7 @@
install: $(PROGS) man
mkdir -p $(SBINDIR)
install -m 750 acpid $(SBINDIR)
+ mkdir -p $(BINDIR)
install -m 755 acpi_listen $(BINDIR)
mkdir -p $(MAN8DIR)
install -m 644 $(MAN8GZ) $(MAN8DIR)

3
acpid-1.0.6.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:aa3c42224ec702b6cdb69ca6501284cb6dacb87473a076d7337ee9635c96f160
size 24226

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Jul 3 20:03:59 CEST 2007 - seife@suse.de
- update to version 1.0.6
mostly our patches included upstream
- adjust init script to the new pcc-acpi module
-------------------------------------------------------------------
Tue Jun 19 13:46:43 CEST 2007 - thoenig@suse.de

View File

@ -1,5 +1,5 @@
#
# spec file for package acpid (Version 1.0.4)
# spec file for package acpid (Version 1.0.6)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@ -12,10 +12,10 @@
Name: acpid
URL: http://acpid.sourceforge.net/
Version: 1.0.4
Release: 81
Version: 1.0.6
Release: 1
%define acpi_version 0.09
License: GNU General Public License (GPL)
License: GPL v2 or later
Group: System/Daemons
Autoreqprov: on
PreReq: %insserv_prereq %fillup_prereq
@ -28,10 +28,6 @@ Source3: README.SuSE
Source4: ibm_acpi.modprobe
Source5: events.default
Patch1: acpi_%{acpi_version}.dif
Patch2: acpid-1.0.4-signedness.diff
Patch3: acpid-1.0.4-close-fd-on-client-disconnect.diff
Patch4: acpid-1.0.4-use-syslog.diff
Patch5: acpid-1.0.4-skip-editor-backup-files.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 x86_64 ia64
@ -57,10 +53,6 @@ Authors:
%patch1
pushd acpi-%{acpi_version}
popd
%patch2
%patch3
%patch4 -p1
%patch5
cp %{S:2} %{S:3} %{S:4} %{S:5} .
%build
@ -83,6 +75,8 @@ ln -sf /usr/share/automake*/mkinstalldirs mkinstalldirs
make prefix=%{buildroot}/usr install
install -Dm 644 acpi.1 %{buildroot}/%{_mandir}/man1/acpi.1
popd
# for the rpmlint fascists
mv samples examples
mkdir -p %{buildroot}/var/lib/acpi
# keep the logfile
install -dm 755 %buildroot%_var/log
@ -113,7 +107,7 @@ rm -f -- var/lib/acpi/*
/usr/sbin/rcacpid
/sbin/acpid
/usr/bin/acpi_listen
%doc README.SuSE README Changelog samples
%doc README.SuSE README Changelog examples
/usr/share/man/man8/acpid.8.gz
/usr/share/man/man8/acpi_listen.8.gz
/usr/bin/acpi
@ -122,6 +116,10 @@ rm -f -- var/lib/acpi/*
%dir %attr(0750, root, root) /var/lib/acpi
%changelog
* Tue Jul 03 2007 - seife@suse.de
- update to version 1.0.6
mostly our patches included upstream
- adjust init script to the new pcc-acpi module
* Tue Jun 19 2007 - thoenig@suse.de
- Add $local_fs to Required-Start (b.n.c #285472)
* Mon Jun 04 2007 - lrupp@suse.de

View File

@ -147,7 +147,7 @@ case "$1" in
continue
fi ;;
pcc_acpi)
if [ ! -r /proc/acpi/panasonic ] ; then
if [ ! -r /proc/acpi/panasonic -a ! -r /proc/acpi/pcc ] ; then
grep -wq $m /proc/modules && rmmod pcc_acpi;
continue
fi ;;