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

scripts/dpkg-divert.pl: only allow absolute filenames
main/configure.c: add -N option to diff invocation

Wichert Akkerman лет назад: 25
Родитель
Сommit
23ff7a9ac4
4 измененных файлов с 10 добавлено и 1 удалено
  1. 5 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 1 1
      main/configure.c
  4. 2 0
      scripts/dpkg-divert.pl

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+Sun Jan 21 20:09:36 SGT 2001 Wichert Akkerman <wakkerma@debian.org>
+
+  * scripts/dpkg-divert.pl: only allow absolute filenames
+  * main/configure.c: add -N option to diff invocation
+
 Mon Jan 15 07:27:10 CET 2001 peter karlsson <peterk@debian.org>
 
   * po/sv.po: Updated Swedish translation.

+ 2 - 0
debian/changelog

@@ -10,6 +10,8 @@ dpkg (1.9.0) unstable; urgency=low
   * remove --import option from dpkg-statoverride, Closes: Bug#81358
   * Replace nfmalloc implementation with obstack. Added obstack.[ch] to
     optlib, for non-GNU systems.
+  * dpkg-divert only allows absolute filenames now. Closes: Bug#82419
+  * Handle diffs from non-existing files to existing files. Closes: Bug#82708
 
  -- Wichert Akkerman <wakkerma@debian.org>  UNRELEASED
 

+ 1 - 1
main/configure.c

@@ -316,7 +316,7 @@ void deferred_configure(struct pkginfo *pkg) {
 	      char cmdbuf[1024];
 	      p= getenv(PAGERENV);
 	      if (!p || !*p) p= DEFAULTPAGER;
-	      sprintf(cmdbuf, "diff -u %.250s %.250s | %.250s", cdr.buf, cdr2.buf, p);
+	      sprintf(cmdbuf, "diff -Nu %.250s %.250s | %.250s", cdr.buf, cdr2.buf, p);
               s= getenv(SHELLENV);
               if (!s || !*s) s= DEFAULTSHELL;
 	      execlp(s,s,"-c", cmdbuf, NULL);

+ 2 - 0
scripts/dpkg-divert.pl

@@ -117,9 +117,11 @@ close(O);
 if ($mode eq 'add') {
     @ARGV == 1 || &badusage("--add needs a single argument");
     $file= $ARGV[0];
+    $file =~ m#^/# || &badusage("filename \"$file\" is not absolute");
     $file =~ m/\n/ && &badusage("file may not contain newlines");
 	-d $file && &badusage("Cannot divert directories");
     $divertto= "$file.distrib" unless defined($divertto);
+    $divertto =~ m#^/# || &badusage("filename \"$divertto\" is not absolute");
     $package= ':' unless defined($package);
     for ($i=0; $i<=$#contest; $i++) {
         if ($contest[$i] eq $file || $altname[$i] eq $file ||