maZZoo maZZoo's blog
very low frequency tech postings  -   06 2007
    home
    blog
    feed
    eyes
    info

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

jul 2009 (1)
jun 2009 (1)
jan 2009 (2)
dec 2008 (1)
oct 2008 (1)
jan 2008 (1)
oct 2007 (1)
jun 2007 (1)
feb 2007 (3)
jan 2007 (3)
nov 2006 (2)
aug 2006 (2)
jul 2006 (1)
may 2006 (1)
nov 2005 (2)
oct 2005 (1)
apr 2005 (2)
mar 2005 (2)
feb 2005 (1)
jan 2005 (1)
may 2004 (1)
jan 2004 (1)
apr 2003 (1)
jan 2003 (1)

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.



posted in /code  |  link  |  comments [0]   

validate HTML