summarylogtreecommitdiffstats
path: root/02-permissions.patch
blob: d8f6dbcef024fa791f94dd17337f805304f37917 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
diff -u -Naur xpdf-3.03-old/xpdf/PDFCore.cc xpdf-3.03-new/xpdf/PDFCore.cc
--- xpdf-3.03-old/xpdf/PDFCore.cc	2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.03-new/xpdf/PDFCore.cc	2011-08-20 13:47:13.508475137 +0200
@@ -4,6 +4,8 @@
 //
 // Copyright 2004 Glyph & Cog, LLC
 //
+// Modified for Debian by Hamish Moffatt, 18 August 2005.
+//
 //========================================================================
 
 #include <aconf.h>
@@ -1619,9 +1621,11 @@
   int x0, y0, x1, y1, t;
   GString *s;
 
+#ifdef ENFORCE_PERMISSIONS
   if (!doc->okToCopy()) {
     return NULL;
   }
+#endif
   if ((page = findPage(pg))) {
     cvtUserToDev(pg, xMin, yMin, &x0, &y0);
     cvtUserToDev(pg, xMax, yMax, &x1, &y1);
diff -u -Naur xpdf-3.03-old/xpdf/pdfimages.cc xpdf-3.03-new/xpdf/pdfimages.cc
--- xpdf-3.03-old/xpdf/pdfimages.cc	2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.03-new/xpdf/pdfimages.cc	2011-08-20 13:50:39.638162542 +0200
@@ -4,6 +4,8 @@
 //
 // Copyright 1998-2003 Glyph & Cog, LLC
 //
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
+//
 //========================================================================
 
 #include <aconf.h>
@@ -119,12 +121,14 @@
   }
 
   // check for copy permission
+#ifdef ENFORCE_PERMISSIONS
   if (!doc->okToCopy()) {
     error(errNotAllowed, -1,
 	  "Copying of images from this document is not allowed.");
     exitCode = 3;
     goto err1;
   }
+#endif
 
   // get page range
   if (firstPage < 1)
diff -u -Naur xpdf-3.03-old/xpdf/pdftops.cc xpdf-3.03-new/xpdf/pdftops.cc
--- xpdf-3.03-old/xpdf/pdftops.cc	2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.03-new/xpdf/pdftops.cc	2011-08-20 13:51:03.830253411 +0200
@@ -4,6 +4,8 @@
 //
 // Copyright 1996-2003 Glyph & Cog, LLC
 //
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
+//
 //========================================================================
 
 #include <aconf.h>
@@ -278,12 +280,14 @@
     goto err1;
   }
 
+#ifdef ENFORCE_PERMISSIONS
   // check for print permission
   if (!doc->okToPrint()) {
     error(errNotAllowed, -1, "Printing this document is not allowed.");
     exitCode = 3;
     goto err1;
   }
+#endif
 
   // construct PostScript file name
   if (argc == 3) {
diff -u -Naur xpdf-3.03-old/xpdf/pdftotext.cc xpdf-3.03-new/xpdf/pdftotext.cc
--- xpdf-3.03-old/xpdf/pdftotext.cc	2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.03-new/xpdf/pdftotext.cc	2011-08-20 13:51:24.367184150 +0200
@@ -4,6 +4,8 @@
 //
 // Copyright 1997-2003 Glyph & Cog, LLC
 //
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
+//
 //========================================================================
 
 #include <aconf.h>
@@ -168,6 +170,7 @@
     goto err2;
   }
 
+#ifdef ENFORCE_PERMISSIONS
   // check for copy permission
   if (!doc->okToCopy()) {
     error(errNotAllowed, -1,
@@ -175,6 +178,7 @@
     exitCode = 3;
     goto err2;
   }
+#endif
 
   // construct text file name
   if (argc == 3) {
diff -u -Naur xpdf-3.03-old/xpdf/XPDFCore.cc xpdf-3.03-new/xpdf/XPDFCore.cc
--- xpdf-3.03-old/xpdf/XPDFCore.cc	2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.03-new/xpdf/XPDFCore.cc	2011-08-20 13:48:54.902483779 +0200
@@ -4,6 +4,8 @@
 //
 // Copyright 2002-2003 Glyph & Cog, LLC
 //
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
+//
 //========================================================================
 
 #include <aconf.h>
@@ -384,12 +386,16 @@
 #ifndef NO_TEXT_SELECT
       if (selectULX != selectLRX &&
 	  selectULY != selectLRY) {
+#ifdef ENFORCE_PERMISSIONS
 	if (doc->okToCopy()) {
 	  copySelection();
 	} else {
 	  error(errNotAllowed, -1,
 		"Copying of text from this document is not allowed.");
 	}
+#else
+        copySelection();
+#endif
       }
 #endif
     }
@@ -408,9 +414,11 @@
   int pg;
   double ulx, uly, lrx, lry;
 
+#ifdef ENFORCE_PERMISSIONS
   if (!doc->okToCopy()) {
     return;
   }
+#endif
   if (getSelection(&pg, &ulx, &uly, &lrx, &lry)) {
     //~ for multithreading: need a mutex here
     if (currentSelection) {
diff -u -Naur xpdf-3.03-old/xpdf/XPDFViewer.cc xpdf-3.03-new/xpdf/XPDFViewer.cc
--- xpdf-3.03-old/xpdf/XPDFViewer.cc	2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.03-new/xpdf/XPDFViewer.cc	2011-08-20 13:49:52.908140863 +0200
@@ -4,6 +4,8 @@
 //
 // Copyright 2002-2003 Glyph & Cog, LLC
 //
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
+//
 //========================================================================
 
 #include <aconf.h>
@@ -3492,10 +3494,12 @@
   PSOutputDev *psOut;
 
   doc = viewer->core->getDoc();
+#ifdef ENFORCE_PERMISSIONS
   if (!doc->okToPrint()) {
     error(errNotAllowed, -1, "Printing this document is not allowed.");
     return;
   }
+#endif
 
   viewer->core->setBusyCursor(gTrue);