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

libdpkg: Fix explicit file trigger activation

The lex parser passes a pointer to a buffer with the text, and as such
if we just keep a copy of the pointer the contents will change over the
parsing process. Instead copy the contents on trk_file_activate_start(),
and use that copy later on.

Regression introduced in commit 4ce011f68f8e499882db638c065008ce4015cd38.

Closes: #676684
Guillem Jover лет назад: 14
Родитель
Сommit
c39373bdc0
2 измененных файлов с 11 добавлено и 1 удалено
  1. 7 0
      debian/changelog
  2. 4 1
      lib/dpkg/triglib.c

+ 7 - 0
debian/changelog

@@ -1,3 +1,10 @@
+dpkg (1.16.4.1) UNRELEASED; urgency=low
+
+  * Fix explicit file trigger activation. Regression introduced in 1.16.4.
+    Closes: #676684
+
+ -- Guillem Jover <guillem@debian.org>  Fri, 08 Jun 2012 23:05:45 +0200
+
 dpkg (1.16.4) unstable; urgency=low
 
   [ Guillem Jover ]

+ 4 - 1
lib/dpkg/triglib.c

@@ -587,15 +587,18 @@ trig_path_activate_byname(const char *trig, struct pkginfo *aw)
 	trig_file_activate_parents(trig, aw);
 }
 
+static const char *trk_file_trig;
+
 static void
 trk_file_activate_start(void)
 {
+	trk_file_trig = nfstrsave(trig_activating_name);
 }
 
 static void
 trk_file_activate_awaiter(struct pkginfo *aw)
 {
-	trig_path_activate_byname(trig_activating_name, aw);
+	trig_path_activate_byname(trk_file_trig, aw);
 }
 
 static void