Procházet zdrojové kódy

Properly close triggers 'File' file to not leak it to the childs

Guillem Jover před 18 roky
rodič
revize
b6152bf172
3 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 5 0
      ChangeLog
  2. 1 0
      debian/changelog
  3. 1 1
      lib/triglib.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-05-16  Guillem Jover  <guillem@debian.org>
+
+	* lib/triglib.c (trig_file_interests_ensure): Pass the proper mask
+	to push_cleanup to make sure pop_cleanup closes the file.
+
 2008-05-15  Guillem Jover  <guillem@debian.org>
 2008-05-15  Guillem Jover  <guillem@debian.org>
 
 
 	* scripts/dpkg-divert.pl (checkrename): Do not check the target file
 	* scripts/dpkg-divert.pl (checkrename): Do not check the target file

+ 1 - 0
debian/changelog

@@ -9,6 +9,7 @@ dpkg (1.14.20) UNRELEASED; urgency=low
   * When dpkg-divert does renames do no check the target file if the source
   * When dpkg-divert does renames do no check the target file if the source
     does not exist and the rename is thus being disabled. This also allows
     does not exist and the rename is thus being disabled. This also allows
     to remove bogus diversions. Closes: #476973, #469033
     to remove bogus diversions. Closes: #476973, #469033
+  * Properly close triggers 'File' file, so it does not get leaked to childs.
 
 
   [ Raphael Hertzog ]
   [ Raphael Hertzog ]
   * Add missing 'use File::Path' in Dpkg::Source::Package::V3::quilt.
   * Add missing 'use File::Path' in Dpkg::Source::Package::V3::quilt.

+ 1 - 1
lib/triglib.c

@@ -480,7 +480,7 @@ trig_file_interests_ensure(void)
 		        triggersfilefile);
 		        triggersfilefile);
 	}
 	}
 
 
-	push_cleanup(cu_closefile, 0, NULL, 0, 1, f);
+	push_cleanup(cu_closefile, ~0, NULL, 0, 1, f);
 	while (fgets_checked(linebuf, sizeof(linebuf), f, triggersfilefile) >= 0) {
 	while (fgets_checked(linebuf, sizeof(linebuf), f, triggersfilefile) >= 0) {
 		space = strchr(linebuf, ' ');
 		space = strchr(linebuf, ' ');
 		if (!space || linebuf[0] != '/')
 		if (!space || linebuf[0] != '/')