Browse Source

Always set CLOEXEC on the lock fd.

Adam Heath 24 years ago
parent
commit
1d9a0eeb6e
3 changed files with 6 additions and 2 deletions
  1. 4 0
      ChangeLog
  2. 1 0
      debian/changelog
  3. 1 2
      lib/lock.c

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+Thu May 23 11:16:28 CDT 2002 Adam Heath <doogie@debian.org>
+
+  * lib/lock.c: Always set CLOEXEC on the lock fd.
+
 Wed May 22 13:03:41 CDT 2002 Adam Heath <doogie@debian.org>
 
   * lib/Makefile.in: Remove hash.c from SOURCES, as it is a test file.

+ 1 - 0
debian/changelog

@@ -92,6 +92,7 @@ dpkg (1.10) unstable; urgency=low
   * Document --force-confmiss and --force-bad-verify. Closes: Bug#146855
   * Drop upgrade compat stuff in dpkg postinst for ancient versions (over
     5 years old)
+  * Always set CLOEXEC on the lock fd.  Closes: Bug#147872
 
  -- Wichert Akkerman <wakkerma@debian.org>  Mon, 20 Aug 2001 14:54:38 +0200
 

+ 1 - 2
lib/lock.c

@@ -78,7 +78,6 @@ void lockdatabase(const char *admindir) {
       ohshit(_("status database area is locked by another process"));
     ohshite(_("unable to lock dpkg status database"));
   }
-  n= fcntl(dblockfd, F_GETFD);
-  if (n >= 0) fcntl(dblockfd, F_SETFD, n | FD_CLOEXEC);
+  fcntl(dblockfd, F_SETFD, FD_CLOEXEC);
   push_cleanup(cu_unlockdb,~0, NULL,0, 0);
 }