[Pkg-acpi-devel] Bug#663249: acpid: fcntl(fd, F_SETFD, O_NONBLOCK) should be fcntl(fd, F_SETFL, O_NONBLOCK)
Stevie Trujillo
stevie.trujillo at gmail.com
Fri Mar 9 20:02:16 UTC 2012
Package: acpid
Version: 1:2.0.7-1squeeze3
Severity: normal
>From the Debian patch:
--- acpid-2.0.7.orig/sock.c
+++ acpid-2.0.7/sock.c
@@ -73,7 +73,7 @@
if (creds.uid != 0) {
non_root_clients++;
}
- fcntl(cli_fd, F_SETFD, FD_CLOEXEC);
+ fcntl(cli_fd, F_SETFD, O_NONBLOCK);
snprintf(buf, sizeof(buf)-1, "%d[%d:%d]",
creds.pid, creds.uid, creds.gid);
acpid_add_client(cli_fd, buf);
}
I don't think this works as expected:
F_SETF*D* doesn't know about O_NONBLOCK
F_SETF*L* does
Also, why are you removing CLOEXEC? Are the shell scripts acpid executes supposed
to know about this fd?
It is maybe wise to keep the old flags too? Something like:
int old_flags = fcntl(cli_fd, F_GETFL);
fcntl(cli_fd, F_SETFL, old_flags | O_NONBLOCK);
-- System Information:
Debian Release: 6.0.4
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages acpid depends on:
ii libc6 2.11.3-2 Embedded GNU C Library: Shared lib
ii lsb-base 3.2-23.2squeeze1 Linux Standard Base 3.2 init scrip
ii module-init-tools 3.12-2 tools for managing Linux kernel mo
Versions of packages acpid recommends:
ii acpi-support-base 0.137-5 scripts for handling base ACPI eve
acpid suggests no packages.
-- no debconf information
More information about the Pkg-acpi-devel
mailing list