maZZoo maZZoo's blog
very low frequency tech postings  -  code/more_to_the_picture.writeback
    home
    blog
    feed
    eyes
    info

    code [12]
    dect [4]
    hard [8]
    meta [5]
    security [5]

Tue, 05 Jun 2007

there's more to the picture than meets the eye
While the above statement is valid in real life, I'd disagree with it when brought in digital context.

here's a tiny patch for xpdf giving you back the descision whether to read your PDF documents on the screen or on paper.

xpdf-3.02-salvage-your-eye.patch

diff -Nur xpdf-3.02-orig/xpdf/SecurityHandler.cc xpdf-3.02/xpdf/SecurityHandler.cc
--- xpdf-3.02-orig/xpdf/SecurityHandler.cc      2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.02/xpdf/SecurityHandler.cc   2007-06-05 12:23:37.000000000 +0200
@@ -373,9 +373,6 @@
     return gFalse;
   }
   permFlags = (*xsh->authorize)(xsh->handlerData, docData, authData);
-  if (!(permFlags & xpdfPermissionOpen)) {
-    return gFalse;
-  }
   if (!(*xsh->getKey)(xsh->handlerData, docData, &key, &length, &encVersion)) {
     return gFalse;
   }
diff -Nur xpdf-3.02-orig/xpdf/XRef.cc xpdf-3.02/xpdf/XRef.cc
--- xpdf-3.02-orig/xpdf/XRef.cc 2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.02/xpdf/XRef.cc      2007-06-05 12:26:31.000000000 +0200
@@ -771,19 +771,19 @@
 }

 GBool XRef::okToPrint(GBool ignoreOwnerPW) {
-  return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permPrint);
+  return gTrue;
 }

 GBool XRef::okToChange(GBool ignoreOwnerPW) {
-  return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permChange);
+  return gTrue;
 }

 GBool XRef::okToCopy(GBool ignoreOwnerPW) {
-  return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permCopy);
+  return gTrue;
 }

 GBool XRef::okToAddNotes(GBool ignoreOwnerPW) {
-  return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permNotes);
+  return gTrue;
 }

 Object *XRef::fetch(int num, int gen, Object *obj) {

theres more to some open-source authors than others want.

0 writebacks

writebacks...

comment...

 
Name:
URL/Email: (optional)
Title: (optional)
Comments:
Save my Name and URL/Email for next time

validate HTML