~ubuntu-branches/ubuntu/precise/a2ps/precise-security

« back to all changes in this revision

Viewing changes to debian/patches/15_psset_new_sed_fix.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2005-01-20 16:31:19 UTC
  • mfrom: (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050120163119-zp0ltsqvom6dnd39
Tags: 1:4.13b-4.3
* NMU
* Applied patches from Javier Fernandez-Sanguino Peña to fix possible
  symlink attacks due to unsafe creation of temporary directories with
  some umasks in psmandu and fixps. Closes: #286385, #286387
  (CAN-2004-1377)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh -e
 
2
## 15_psset_sed_fix.dpatch by Masayuki Hatta <mhatta@debian.org>
 
3
##
 
4
## All lines beginning with \`## DP:' are a description of the patch.
 
5
## DP: Fixes psset problem with newer sed.
 
6
 
 
7
if [ $# -ne 1 ]; then
 
8
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
 
9
    exit 1
 
10
fi
 
11
case "$1" in
 
12
        -patch) patch -f --no-backup-if-mismatch --dry-run -p1 < $0 && patch -f --no-backup-if-mismatch -p1 < $0
 
13
;;
 
14
        -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
 
15
        *)
 
16
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
 
17
                exit 1;;
 
18
esac
 
19
 
 
20
exit 0
 
21
 
 
22
diff -urN a2ps-4.13b.orig/ChangeLog a2ps-4.13b/ChangeLog
 
23
--- a2ps-4.13b.orig/ChangeLog   2004-08-17 03:33:15.000000000 +0900
 
24
+++ a2ps-4.13b/ChangeLog        2004-08-17 03:33:25.000000000 +0900
 
25
@@ -1,3 +1,8 @@
 
26
+2004-07-11  Nix  <nix@esperi.org.uk>
 
27
+
 
28
+       * contrib/psset.m4: Only escape leading spaces, not all leading
 
29
+       characters.
 
30
+
 
31
 2000-02-24  Akim Demaille  <akim@epita.fr>
 
32
 
 
33
        Release 4.13.
 
34
diff -urN a2ps-4.13b.orig/contrib/psset.in a2ps-4.13b/contrib/psset.in
 
35
--- a2ps-4.13b.orig/contrib/psset.in    2004-08-17 03:33:15.000000000 +0900
 
36
+++ a2ps-4.13b/contrib/psset.in 2004-08-17 03:33:36.000000000 +0900
 
37
@@ -221,7 +221,7 @@
 
38
 done
 
39
 
 
40
 pspagedevice="% Pagedevice definitions:
 
41
-countdictstack
 
42
+  countdictstack
 
43
 % Push our own mark, since there can be several PS marks pushed depending
 
44
 % where the failure really occured.
 
45
 /psset_mark
 
46
@@ -229,7 +229,7 @@
 
47
 } stopped
 
48
 % My cleartomark
 
49
 { /psset_mark eq { exit } if } loop
 
50
-countdictstack exch sub dup 0 gt
 
51
+  countdictstack exch sub dup 0 gt
 
52
 {
 
53
   { end } repeat
 
54
 }{
 
55
diff -urN a2ps-4.13b.orig/contrib/psset.m4 a2ps-4.13b/contrib/psset.m4
 
56
--- a2ps-4.13b.orig/contrib/psset.m4    2004-08-17 03:33:15.000000000 +0900
 
57
+++ a2ps-4.13b/contrib/psset.m4 2004-08-17 03:33:25.000000000 +0900
 
58
@@ -161,7 +161,7 @@
 
59
 # spaces with a `\' too...
 
60
 pspagedevicelen=`echo "$pspagedevice" | wc -l`
 
61
 pspagedevice=`echo "$pspagedevice" | \
 
62
- sed -e "$pspagedevicelen!s/\$/\\\\\\/;s/^/\\\\\\/"`
 
63
+ sed -e "$pspagedevicelen!s/\$/\\\\\\/;s/^ /\\\\\\ /"`
 
64
 
 
65
 case $at in
 
66
   0) # Insert last in the Setup, so that we win over other requests.
 
67