~ubuntu-branches/ubuntu/lucid/xpdf/lucid-updates

« back to all changes in this revision

Viewing changes to debian/patches/02_permissions.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Andy Price
  • Date: 2007-05-17 22:04:33 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517220433-gzcx2lrvllkbl7mr
Tags: 3.02-1ubuntu1
* Merge from Debian unstable (LP: #113365), remaining changes:
  - Added back 09_xpdfrc_manpage.dpatch (LP #71753)
  - Set Ubuntu maintainer

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
## DP: Remove PDF file permission checks
6
6
 
7
7
@DPATCH@
8
 
diff -urNad --exclude=CVS --exclude=.svn ./xpdf/PDFCore.cc /tmp/dpep-work.9JGuq6/xpdf-3.01/xpdf/PDFCore.cc
9
 
--- ./xpdf/PDFCore.cc   2005-08-19 17:23:25.000000000 +1000
10
 
+++ /tmp/dpep-work.9JGuq6/xpdf-3.01/xpdf/PDFCore.cc     2005-08-19 17:24:53.000000000 +1000
 
8
diff -urNad xpdf-3.02~/xpdf/PDFCore.cc xpdf-3.02/xpdf/PDFCore.cc
 
9
--- xpdf-3.02~/xpdf/PDFCore.cc  2007-02-28 09:05:52.000000000 +1100
 
10
+++ xpdf-3.02/xpdf/PDFCore.cc   2007-04-24 23:43:59.000000000 +1000
11
11
@@ -4,6 +4,8 @@
12
12
 //
13
13
 // Copyright 2004 Glyph & Cog, LLC
17
17
 //========================================================================
18
18
 
19
19
 #include <aconf.h>
20
 
@@ -1273,9 +1275,11 @@
 
20
@@ -1563,9 +1565,11 @@
21
21
   int x0, y0, x1, y1, t;
22
22
   GString *s;
23
23
 
29
29
   if ((page = findPage(pg))) {
30
30
     cvtUserToDev(pg, xMin, yMin, &x0, &y0);
31
31
     cvtUserToDev(pg, xMax, yMax, &x1, &y1);
32
 
diff -urNad --exclude=CVS --exclude=.svn ./xpdf/pdfimages.cc /tmp/dpep-work.9JGuq6/xpdf-3.01/xpdf/pdfimages.cc
33
 
--- ./xpdf/pdfimages.cc 2005-08-19 17:23:25.000000000 +1000
34
 
+++ /tmp/dpep-work.9JGuq6/xpdf-3.01/xpdf/pdfimages.cc   2005-08-19 17:24:53.000000000 +1000
 
32
diff -urNad xpdf-3.02~/xpdf/XPDFCore.cc xpdf-3.02/xpdf/XPDFCore.cc
 
33
--- xpdf-3.02~/xpdf/XPDFCore.cc 2007-02-28 09:05:52.000000000 +1100
 
34
+++ xpdf-3.02/xpdf/XPDFCore.cc  2007-04-24 23:46:39.000000000 +1000
 
35
@@ -4,6 +4,8 @@
 
36
 //
 
37
 // Copyright 2002-2003 Glyph & Cog, LLC
 
38
 //
 
39
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
 
40
+//
 
41
 //========================================================================
 
42
 
 
43
 #include <aconf.h>
 
44
@@ -384,11 +386,15 @@
 
45
 #ifndef NO_TEXT_SELECT
 
46
       if (selectULX != selectLRX &&
 
47
          selectULY != selectLRY) {
 
48
+#ifdef ENFORCE_PERMISSIONS
 
49
        if (doc->okToCopy()) {
 
50
          copySelection();
 
51
        } else {
 
52
          error(-1, "Copying of text from this document is not allowed.");
 
53
        }
 
54
+#else
 
55
+        copySelection();
 
56
+#endif
 
57
       }
 
58
 #endif
 
59
     }
 
60
@@ -407,9 +413,11 @@
 
61
   int pg;
 
62
   double ulx, uly, lrx, lry;
 
63
 
 
64
+#ifdef ENFORCE_PERMISSIONS
 
65
   if (!doc->okToCopy()) {
 
66
     return;
 
67
   }
 
68
+#endif
 
69
   if (getSelection(&pg, &ulx, &uly, &lrx, &lry)) {
 
70
     //~ for multithreading: need a mutex here
 
71
     if (currentSelection) {
 
72
diff -urNad xpdf-3.02~/xpdf/XPDFViewer.cc xpdf-3.02/xpdf/XPDFViewer.cc
 
73
--- xpdf-3.02~/xpdf/XPDFViewer.cc       2007-02-28 09:05:52.000000000 +1100
 
74
+++ xpdf-3.02/xpdf/XPDFViewer.cc        2007-04-24 23:43:59.000000000 +1000
 
75
@@ -4,6 +4,8 @@
 
76
 //
 
77
 // Copyright 2002-2003 Glyph & Cog, LLC
 
78
 //
 
79
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
 
80
+//
 
81
 //========================================================================
 
82
 
 
83
 #include <aconf.h>
 
84
@@ -3406,10 +3408,12 @@
 
85
   PSOutputDev *psOut;
 
86
 
 
87
   doc = viewer->core->getDoc();
 
88
+#ifdef ENFORCE_PERMISSIONS
 
89
   if (!doc->okToPrint()) {
 
90
     error(-1, "Printing this document is not allowed.");
 
91
     return;
 
92
   }
 
93
+#endif
 
94
 
 
95
   viewer->core->setBusyCursor(gTrue);
 
96
 
 
97
diff -urNad xpdf-3.02~/xpdf/pdfimages.cc xpdf-3.02/xpdf/pdfimages.cc
 
98
--- xpdf-3.02~/xpdf/pdfimages.cc        2007-02-28 09:05:52.000000000 +1100
 
99
+++ xpdf-3.02/xpdf/pdfimages.cc 2007-04-24 23:43:59.000000000 +1000
35
100
@@ -4,6 +4,8 @@
36
101
 //
37
102
 // Copyright 1998-2003 Glyph & Cog, LLC
55
120
 
56
121
   // get page range
57
122
   if (firstPage < 1)
58
 
diff -urNad --exclude=CVS --exclude=.svn ./xpdf/pdftops.cc /tmp/dpep-work.9JGuq6/xpdf-3.01/xpdf/pdftops.cc
59
 
--- ./xpdf/pdftops.cc   2005-08-19 17:23:25.000000000 +1000
60
 
+++ /tmp/dpep-work.9JGuq6/xpdf-3.01/xpdf/pdftops.cc     2005-08-19 17:24:53.000000000 +1000
 
123
diff -urNad xpdf-3.02~/xpdf/pdftops.cc xpdf-3.02/xpdf/pdftops.cc
 
124
--- xpdf-3.02~/xpdf/pdftops.cc  2007-02-28 09:05:52.000000000 +1100
 
125
+++ xpdf-3.02/xpdf/pdftops.cc   2007-04-24 23:43:59.000000000 +1000
61
126
@@ -4,6 +4,8 @@
62
127
 //
63
128
 // Copyright 1996-2003 Glyph & Cog, LLC
67
132
 //========================================================================
68
133
 
69
134
 #include <aconf.h>
70
 
@@ -269,12 +271,14 @@
 
135
@@ -278,12 +280,14 @@
71
136
     goto err1;
72
137
   }
73
138
 
82
147
 
83
148
   // construct PostScript file name
84
149
   if (argc == 3) {
85
 
diff -urNad --exclude=CVS --exclude=.svn ./xpdf/pdftotext.cc /tmp/dpep-work.9JGuq6/xpdf-3.01/xpdf/pdftotext.cc
86
 
--- ./xpdf/pdftotext.cc 2005-08-19 17:23:25.000000000 +1000
87
 
+++ /tmp/dpep-work.9JGuq6/xpdf-3.01/xpdf/pdftotext.cc   2005-08-19 17:24:53.000000000 +1000
 
150
diff -urNad xpdf-3.02~/xpdf/pdftotext.cc xpdf-3.02/xpdf/pdftotext.cc
 
151
--- xpdf-3.02~/xpdf/pdftotext.cc        2007-02-28 09:05:52.000000000 +1100
 
152
+++ xpdf-3.02/xpdf/pdftotext.cc 2007-04-24 23:43:59.000000000 +1000
88
153
@@ -4,6 +4,8 @@
89
154
 //
90
155
 // Copyright 1997-2003 Glyph & Cog, LLC
109
174
 
110
175
   // construct text file name
111
176
   if (argc == 3) {
112
 
diff -urNad --exclude=CVS --exclude=.svn ./xpdf/XPDFCore.cc /tmp/dpep-work.9JGuq6/xpdf-3.01/xpdf/XPDFCore.cc
113
 
--- ./xpdf/XPDFCore.cc  2005-08-19 17:23:25.000000000 +1000
114
 
+++ /tmp/dpep-work.9JGuq6/xpdf-3.01/xpdf/XPDFCore.cc    2005-08-19 17:25:02.000000000 +1000
115
 
@@ -4,6 +4,8 @@
116
 
 //
117
 
 // Copyright 2002-2003 Glyph & Cog, LLC
118
 
 //
119
 
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
120
 
+//
121
 
 //========================================================================
122
 
 
123
 
 #include <aconf.h>
124
 
@@ -377,9 +379,11 @@
125
 
   int pg;
126
 
   double ulx, uly, lrx, lry;
127
 
 
128
 
+#ifdef ENFORCE_PERMISSIONS
129
 
   if (!doc->okToCopy()) {
130
 
     return;
131
 
   }
132
 
+#endif
133
 
   if (getSelection(&pg, &ulx, &uly, &lrx, &lry)) {
134
 
     //~ for multithreading: need a mutex here
135
 
     if (currentSelection) {
136
 
@@ -1108,12 +1112,18 @@
137
 
 #ifndef NO_TEXT_SELECT
138
 
          if (core->selectULX != core->selectLRX &&
139
 
              core->selectULY != core->selectLRY) {
140
 
+#ifdef ENFORCE_PERMISSIONS
141
 
            if (core->doc->okToCopy()) {
142
 
+#endif
143
 
              core->copySelection();
144
 
+#ifdef ENFORCE_PERMISSIONS
145
 
            } else {
146
 
              error(-1, "Copying of text from this document is not allowed.");
147
 
            }
148
 
+#endif
149
 
          }
150
 
+#else
151
 
+      core->copySelection();
152
 
 #endif
153
 
        }
154
 
        if (ok && core->hyperlinksEnabled) {
155
 
diff -urNad --exclude=CVS --exclude=.svn ./xpdf/XPDFViewer.cc /tmp/dpep-work.9JGuq6/xpdf-3.01/xpdf/XPDFViewer.cc
156
 
--- ./xpdf/XPDFViewer.cc        2005-08-19 17:23:25.000000000 +1000
157
 
+++ /tmp/dpep-work.9JGuq6/xpdf-3.01/xpdf/XPDFViewer.cc  2005-08-19 17:24:53.000000000 +1000
158
 
@@ -4,6 +4,8 @@
159
 
 //
160
 
 // Copyright 2002-2003 Glyph & Cog, LLC
161
 
 //
162
 
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
163
 
+//
164
 
 //========================================================================
165
 
 
166
 
 #include <aconf.h>
167
 
@@ -2391,10 +2393,12 @@
168
 
   PSOutputDev *psOut;
169
 
 
170
 
   doc = viewer->core->getDoc();
171
 
+#ifdef ENFORCE_PERMISSIONS
172
 
   if (!doc->okToPrint()) {
173
 
     error(-1, "Printing this document is not allowed.");
174
 
     return;
175
 
   }
176
 
+#endif
177
 
 
178
 
   viewer->core->setBusyCursor(gTrue);
179