From: Wichert Akkerman Date: Mon, 22 Jan 2001 22:24:22 +0000 (+0000) Subject: scripts/dpkg-divert.pl: only allow absolute filenames X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23ff7a9ac469b98b7e7a5720d17a26d8f60c4ac9;p=dpkg scripts/dpkg-divert.pl: only allow absolute filenames main/configure.c: add -N option to diff invocation --- diff --git a/ChangeLog b/ChangeLog index b652833f..c2722aca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Jan 21 20:09:36 SGT 2001 Wichert Akkerman + + * 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 * po/sv.po: Updated Swedish translation. diff --git a/debian/changelog b/debian/changelog index c9927c4f..a5f65bb9 100644 --- a/debian/changelog +++ b/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 UNRELEASED diff --git a/main/configure.c b/main/configure.c index af1fd59c..2b83eb69 100644 --- a/main/configure.c +++ b/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); diff --git a/scripts/dpkg-divert.pl b/scripts/dpkg-divert.pl index 310b8675..03c591c9 100755 --- a/scripts/dpkg-divert.pl +++ b/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 ||