| diff -up xpdf-4.00/xpdf/PDFCore.cc.permissions xpdf-4.00/xpdf/PDFCore.cc |
| diff -up xpdf-4.00/xpdf/pdfimages.cc.permissions xpdf-4.00/xpdf/pdfimages.cc |
| --- xpdf-4.00/xpdf/pdfimages.cc.permissions 2017-08-08 19:22:50.000000000 -0400 |
| +++ xpdf-4.00/xpdf/pdfimages.cc 2017-08-16 18:08:04.474032500 -0400 |
| @@ -4,6 +4,8 @@ |
| // |
| // Copyright 1998-2003 Glyph & Cog, LLC |
| // |
| +// Modified for Debian by Hamish Moffatt, 22 May 2002. |
| +// |
| //======================================================================== |
| |
| #include <aconf.h> |
| @@ -126,12 +128,14 @@ int main(int argc, char *argv[]) { |
| } |
| |
| // 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 -up xpdf-4.00/xpdf/pdftohtml.cc.permissions xpdf-4.00/xpdf/pdftohtml.cc |
| --- xpdf-4.00/xpdf/pdftohtml.cc.permissions 2017-08-16 18:10:36.656189850 -0400 |
| +++ xpdf-4.00/xpdf/pdftohtml.cc 2017-08-16 18:11:06.127445692 -0400 |
| @@ -137,6 +137,7 @@ int main(int argc, char *argv[]) { |
| goto err1; |
| } |
| |
| +#ifdef ENFORCE_PERMISSIONS |
| // check for copy permission |
| if (!doc->okToCopy()) { |
| error(errNotAllowed, -1, |
| @@ -144,6 +145,7 @@ int main(int argc, char *argv[]) { |
| exitCode = 3; |
| goto err1; |
| } |
| +#endif |
| |
| // get page range |
| if (firstPage < 1) { |
| diff -up xpdf-4.00/xpdf/pdftops.cc.permissions xpdf-4.00/xpdf/pdftops.cc |
| --- xpdf-4.00/xpdf/pdftops.cc.permissions 2017-08-08 19:22:50.000000000 -0400 |
| +++ xpdf-4.00/xpdf/pdftops.cc 2017-08-16 18:08:04.475032475 -0400 |
| @@ -4,6 +4,8 @@ |
| // |
| // Copyright 1996-2003 Glyph & Cog, LLC |
| // |
| +// Modified for Debian by Hamish Moffatt, 22 May 2002. |
| +// |
| //======================================================================== |
| |
| #include <aconf.h> |
| @@ -321,12 +323,14 @@ int main(int argc, char *argv[]) { |
| 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 -up xpdf-4.00/xpdf/pdftotext.cc.permissions xpdf-4.00/xpdf/pdftotext.cc |
| --- xpdf-4.00/xpdf/pdftotext.cc.permissions 2017-08-08 19:22:50.000000000 -0400 |
| +++ xpdf-4.00/xpdf/pdftotext.cc 2017-08-16 18:08:04.475032475 -0400 |
| @@ -4,6 +4,8 @@ |
| // |
| // Copyright 1997-2013 Glyph & Cog, LLC |
| // |
| +// Modified for Debian by Hamish Moffatt, 22 May 2002. |
| +// |
| //======================================================================== |
| |
| #include <aconf.h> |
| @@ -198,6 +200,7 @@ int main(int argc, char *argv[]) { |
| goto err2; |
| } |
| |
| +#ifdef ENFORCE_PERMISSIONS |
| // check for copy permission |
| if (!doc->okToCopy()) { |
| error(errNotAllowed, -1, |
| @@ -205,6 +208,7 @@ int main(int argc, char *argv[]) { |
| exitCode = 3; |
| goto err2; |
| } |
| +#endif |
| |
| // construct text file name |
| if (argc == 3) { |
| diff -up xpdf-4.00/xpdf-qt/QtPDFCore.cc.permissions xpdf-4.00/xpdf-qt/QtPDFCore.cc |
| --- xpdf-4.00/xpdf-qt/QtPDFCore.cc.permissions 2017-08-16 18:09:45.169489907 -0400 |
| +++ xpdf-4.00/xpdf-qt/QtPDFCore.cc 2017-08-16 18:10:14.375752439 -0400 |
| @@ -429,9 +429,11 @@ QString QtPDFCore::getSelectedTextQStrin |
| QChar c; |
| int i; |
| |
| +#ifdef ENFORCE_PERMISSIONS |
| if (!doc->okToCopy()) { |
| return ""; |
| } |
| +#endif |
| if (!(s = getSelectedText())) { |
| return ""; |
| } |
| diff -up xpdf-4.00/xpdf-qt/XpdfWidget.cc.permissions xpdf-4.00/xpdf-qt/XpdfWidget.cc |
| --- xpdf-4.00/xpdf-qt/XpdfWidget.cc.permissions 2017-08-16 18:12:40.775055809 -0400 |
| +++ xpdf-4.00/xpdf-qt/XpdfWidget.cc 2017-08-16 18:12:45.835928020 -0400 |
| @@ -1399,7 +1399,11 @@ bool XpdfWidget::okToExtractText() const |
| if (!core->getDoc()) { |
| return false; |
| } |
| +#ifdef ENFORCE_PERMISSIONS |
| return (bool)core->getDoc()->okToCopy(); |
| +#else |
| + return true; |
| +#endif |
| } catch (GMemException e) { |
| return false; |
| } |