Bug 35182

Summary: APMD does not set close on exec for /dev/apm*
Product: Base System Reporter: Daniel O'Connor <darius>
Component: i386Assignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.5-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Daniel O'Connor 2002-02-21 13:10:00 UTC
apmd does not set close-on-exec for its APM device file descriptors which
leads to problems trying to get the child processes to exit etc..

How-To-Repeat: Run something from apmd. Observe the child process hold an fd to APM device
nodes
Comment 1 Daniel O'Connor 2002-02-22 13:51:49 UTC
Also needs..
Index: apmd.c
===================================================================
RCS file: /usr/CVS-Repository/src/usr.sbin/apmd/apmd.c,v
retrieving revision 1.3.2.1
diff -u -r1.3.2.1 apmd.c
--- apmd.c      13 Aug 2001 17:30:30 -0000      1.3.2.1
+++ apmd.c      22 Feb 2002 13:43:37 -0000
@@ -119,6 +119,9 @@
                 goto out;
         case 0:
                 /* child process */
+               signal(SIGHUP, SIG_DFL);
+               signal(SIGCHLD, SIG_DFL);
+               signal(SIGTERM, SIG_DFL);
                 execl(_PATH_BSHELL, "sh", "-c", p->line, (char *)NULL);
                 _exit(127);
         default:

To allow children to be signalled as they expect.

---
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
   -- Andrew Tanenbaum
Comment 2 Matthew N. Dodd freebsd_committer freebsd_triage 2003-06-22 06:57:38 UTC
State Changed
From-To: open->closed

Committed in -current