Просмотр исходного кода

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

Guillem Jover лет назад: 18
Родитель
Сommit
b6152bf172
3 измененных файлов с 7 добавлено и 1 удалено
  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>
 
 	* 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
     does not exist and the rename is thus being disabled. This also allows
     to remove bogus diversions. Closes: #476973, #469033
+  * Properly close triggers 'File' file, so it does not get leaked to childs.
 
   [ Raphael Hertzog ]
   * 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);
 	}
 
-	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) {
 		space = strchr(linebuf, ' ');
 		if (!space || linebuf[0] != '/')