DRM in xpdf

classic Classic list List threaded Threaded
79 messages Options
1234
Reply | Threaded
Open this post in threaded view
|

DRM in xpdf

Deanna Phillips-2
There's some DRM code left in xpdf that prevents me from copying
text.

This kills it.  ok?

Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/xpdf/Makefile,v
retrieving revision 1.61
diff -u -p -r1.61 Makefile
--- Makefile 19 Apr 2008 07:38:24 -0000 1.61
+++ Makefile 24 Apr 2008 15:11:09 -0000
@@ -4,7 +4,7 @@ COMMENT-main= PDF viewer for X11
 COMMENT-utils= PDF conversion tools
 
 DISTNAME= xpdf-3.02
-PKGNAME-main= xpdf-3.02pl2p3
+PKGNAME-main= xpdf-3.02pl2p4
 PKGNAME-utils= xpdf-utils-3.02pl2p0
 CATEGORIES= textproc x11
 
Index: patches/patch-xpdf_PDFCore_cc
===================================================================
RCS file: patches/patch-xpdf_PDFCore_cc
diff -N patches/patch-xpdf_PDFCore_cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-xpdf_PDFCore_cc 24 Apr 2008 15:09:49 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+--- xpdf/PDFCore.cc.orig Thu Apr 24 11:06:47 2008
++++ xpdf/PDFCore.cc Thu Apr 24 11:08:52 2008
+@@ -1563,9 +1563,6 @@ GString *PDFCore::extractText(int pg, double xMin, dou
+   int x0, y0, x1, y1, t;
+   GString *s;
+
+-  if (!doc->okToCopy()) {
+-    return NULL;
+-  }
+   if ((page = findPage(pg))) {
+     cvtUserToDev(pg, xMin, yMin, &x0, &y0);
+     cvtUserToDev(pg, xMax, yMax, &x1, &y1);
Index: patches/patch-xpdf_XPDFCore_cc
===================================================================
RCS file: /cvs/ports/textproc/xpdf/patches/patch-xpdf_XPDFCore_cc,v
retrieving revision 1.4
diff -u -p -r1.4 patch-xpdf_XPDFCore_cc
--- patches/patch-xpdf_XPDFCore_cc 30 Mar 2007 04:09:42 -0000 1.4
+++ patches/patch-xpdf_XPDFCore_cc 24 Apr 2008 15:09:48 -0000
@@ -1,7 +1,22 @@
 $OpenBSD: patch-xpdf_XPDFCore_cc,v 1.4 2007/03/30 04:09:42 ckuethe Exp $
---- xpdf/XPDFCore.cc.orig Tue Feb 27 22:05:52 2007
-+++ xpdf/XPDFCore.cc Fri Mar 30 00:31:19 2007
-@@ -407,9 +407,6 @@ void XPDFCore::copySelection() {
+--- xpdf/XPDFCore.cc.orig Tue Feb 27 17:05:52 2007
++++ xpdf/XPDFCore.cc Thu Apr 24 11:07:18 2008
+@@ -383,13 +383,8 @@ void XPDFCore::endSelection(int wx, int wy) {
+       }
+ #ifndef NO_TEXT_SELECT
+       if (selectULX != selectLRX &&
+-  selectULY != selectLRY) {
+- if (doc->okToCopy()) {
++  selectULY != selectLRY)
+  copySelection();
+- } else {
+-  error(-1, "Copying of text from this document is not allowed.");
+- }
+-      }
+ #endif
+     }
+   }
+@@ -407,9 +402,6 @@ void XPDFCore::copySelection() {
    int pg;
    double ulx, uly, lrx, lry;
 

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Floor Terra
On Thu, 24 Apr 2008, Deanna Phillips wrote:

> There's some DRM code left in xpdf that prevents me from copying
> text.
>
> This kills it.  ok?
>
[snip]

There are similar checks to prevent printing for example. You only need
to put "return 1;" in OkToPrint()[1]. It's trivial to change the source
and recompile if you need to.

The reason those checks are in there are simple: You need to implement
these functions to comply to the PDF specs.

I've only needed a patched version of xpdf once to print some crippled
PDF. DRM is stupid, especially when you have the source. But I managed
by not using crippled PDF documents.

Floor


[1] I did not check the actual function name.

--
Floor Terra <[hidden email]>
www: http://brobding.mine.nu/

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Andrés Delfino
In reply to this post by Deanna Phillips-2
On Thu, Apr 24, 2008 at 3:42 PM, Deanna Phillips
<[hidden email]> wrote:
> There's some DRM code left in xpdf that prevents me from copying
>  text.
>
>  This kills it.  ok?

Please, don't add things like this to the ports tree. It's purpose is
to easy installation, no to add customized programs. And a flavor
wouldn't count, as a flavor is a customized _compiled_ program, not a
program + third party patches. It even makes harder to see what
patches are _needed_ to make the program install.

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Brad Smith-14
On Thursday 24 April 2008 18:41:44 Andrés wrote:

> On Thu, Apr 24, 2008 at 3:42 PM, Deanna Phillips
> <[hidden email]> wrote:
> > There's some DRM code left in xpdf that prevents me from copying
> >  text.
> >
> >  This kills it.  ok?
>
> Please, don't add things like this to the ports tree. It's purpose is
> to easy installation, no to add customized programs. And a flavor
> wouldn't count, as a flavor is a customized _compiled_ program, not a
> program + third party patches. It even makes harder to see what
> patches are _needed_ to make the program install.

You're completely and utterly wrong.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Stuart Henderson
In reply to this post by Andrés Delfino
On 2008/04/24 19:41, Andrés wrote:
> Please, don't add things like this to the ports tree. It's purpose is
> to easy installation, no to add customized programs. And a flavor
> wouldn't count, as a flavor is a customized _compiled_ program, not a
> program + third party patches. It even makes harder to see what
> patches are _needed_ to make the program install.

Shall we also remove the other customizations that fix security
problems then?

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Unix Fan
In reply to this post by Deanna Phillips-2
I'd support the removal of DRM in xpdf, it's mostly a nuisance then a feature... several programming datasheets have it enabled, it's really rather stupid to prevent user from coping the "sample" code blocks into a text editor.

Please remove stuff like that, it benefits no-one except those loonies over in the US of A.

(Apologies if this hits @misc, I'm used to torching them.)



-Nix Fan.

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Andrés Delfino
In reply to this post by Stuart Henderson
On Thu, Apr 24, 2008 at 8:33 PM, Stuart Henderson <[hidden email]> wrote:
> On 2008/04/24 19:41, Andrés wrote:
>  > Please, don't add things like this to the ports tree. It's purpose is
>  > to easy installation, no to add customized programs. And a flavor
>  > wouldn't count, as a flavor is a customized _compiled_ program, not a
>  > program + third party patches. It even makes harder to see what
>  > patches are _needed_ to make the program install.
>
>  Shall we also remove the other customizations that fix security
>  problems then?

Don't compare security/stability _fixes_ with this...

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Andrés Delfino
In reply to this post by Brad Smith-14
On Thu, Apr 24, 2008 at 7:58 PM, Brad <[hidden email]> wrote:

> On Thursday 24 April 2008 18:41:44 Andrés wrote:
>
> > On Thu, Apr 24, 2008 at 3:42 PM, Deanna Phillips
>  > <[hidden email]> wrote:
>  > > There's some DRM code left in xpdf that prevents me from copying
>  > >  text.
>  > >
>  > >  This kills it.  ok?
>  >
>  > Please, don't add things like this to the ports tree. It's purpose is
>  > to easy installation, no to add customized programs. And a flavor
>  > wouldn't count, as a flavor is a customized _compiled_ program, not a
>  > program + third party patches. It even makes harder to see what
>  > patches are _needed_ to make the program install.
>
>  You're completely and utterly wrong.

Why?

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Chris Kuethe
On Thu, Apr 24, 2008 at 4:46 PM, Andrés <[hidden email]> wrote:
>  Why?

Because ports is about getting things done, and code that gets in the
way of you getting things done must die.


--
GDB has a 'break' feature; why doesn't it have 'fix' too?

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Jim Razmus
In reply to this post by Andrés Delfino
* Andr?s <[hidden email]> [080424 19:55]:

> On Thu, Apr 24, 2008 at 8:33 PM, Stuart Henderson <[hidden email]> wrote:
> > On 2008/04/24 19:41, Andr?s wrote:
> >  > Please, don't add things like this to the ports tree. It's purpose is
> >  > to easy installation, no to add customized programs. And a flavor
> >  > wouldn't count, as a flavor is a customized _compiled_ program, not a
> >  > program + third party patches. It even makes harder to see what
> >  > patches are _needed_ to make the program install.
> >
> >  Shall we also remove the other customizations that fix security
> >  problems then?
>
> Don't compare security/stability _fixes_ with this...
>

Take a look at the dwm patches.  My personal config is in there...

Not taking sides here, just pointing out another data point.

Jim

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Johan Zandin
In reply to this post by Unix Fan
On Fri, 24 Apr 2008, Unix Fan wrote:
> I'd support the removal of DRM in xpdf, it's mostly a nuisance then a feature...

One could even classify it as a security problem (on PDF protocol level),
since the user of a PDF document is vulnerable to a denial-of-service attack
from a mischevious author. (The services to copy and/or print a particular
text can be denied without the user's consent.)

Just in case someone thinks that patches should be restricted to
security fixes...

And since the xpdf author doesn't agree that DRM is a stupid thing
to enforce (see http://www.foolabs.com/xpdf/cracking.html) it seems
hard to remove it by an upstream patch.

/Johan

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Andrés Delfino
In reply to this post by Chris Kuethe
On Thu, Apr 24, 2008 at 9:05 PM, Chris Kuethe <[hidden email]> wrote:
> On Thu, Apr 24, 2008 at 4:46 PM, Andrés <[hidden email]> wrote:
>  >  Why?
>
>  Because ports is about getting things done, and code that gets in the
>  way of you getting things done must die.

Apply your patches locally, fork it, whatever; just don't make the
port tree a place to get your favorite patches in. It is for
_installing_ stuff.

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Brad Smith-14
In reply to this post by Andrés Delfino
On Thursday 24 April 2008 19:46:04 Andrés wrote:

> On Thu, Apr 24, 2008 at 7:58 PM, Brad <[hidden email]> wrote:
> > On Thursday 24 April 2008 18:41:44 Andrés wrote:
> >
> > > On Thu, Apr 24, 2008 at 3:42 PM, Deanna Phillips
> >  > <[hidden email]> wrote:
> >  > > There's some DRM code left in xpdf that prevents me from copying
> >  > >  text.
> >  > >
> >  > >  This kills it.  ok?
> >  >
> >  > Please, don't add things like this to the ports tree. It's purpose is
> >  > to easy installation, no to add customized programs. And a flavor
> >  > wouldn't count, as a flavor is a customized _compiled_ program, not a
> >  > program + third party patches. It even makes harder to see what
> >  > patches are _needed_ to make the program install.
> >
> >  You're completely and utterly wrong.
>
> Why?

Because what you said is an assumption and is wrong.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Chris Kuethe
In reply to this post by Andrés Delfino
On Thu, Apr 24, 2008 at 5:21 PM, Andrés <[hidden email]> wrote:
>  Apply your patches locally, fork it, whatever; just don't make the
>  port tree a place to get your favorite patches in.It is for
> _installing_ stuff.

1) Too late. We already have some extra patches for various ports
because they somehow improve our workflow.
2) You're outvoted. Looks like at least brad@, cloder@, deanna@ and I
like the idea of removing code that gets in the way.
3) Don't like the way the OpenBSD ports tree works? Take your own
advice and fork it.

CK

--
GDB has a 'break' feature; why doesn't it have 'fix' too?

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Brad Smith-14
In reply to this post by Andrés Delfino
On Thursday 24 April 2008 20:21:30 Andrés wrote:

> On Thu, Apr 24, 2008 at 9:05 PM, Chris Kuethe <[hidden email]> wrote:
> > On Thu, Apr 24, 2008 at 4:46 PM, Andrés <[hidden email]> wrote:
> >  >  Why?
> >
> >  Because ports is about getting things done, and code that gets in the
> >  way of you getting things done must die.
>
> Apply your patches locally, fork it, whatever; just don't make the
> port tree a place to get your favorite patches in. It is for
> _installing_ stuff.

No, it is for installing software which allows me to get things done.
It has nothing to do with "favorite patches".

I had already ripped out this DRM bullshit 4.5 years ago thanks to
cloder@ for pointing this out by sending diffs. It seems another
check was added along the way when upgrading to newer versions.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Theo de Raadt
In reply to this post by Andrés Delfino
> On Thu, Apr 24, 2008 at 9:05 PM, Chris Kuethe <[hidden email]> wrot=
> e:
> > On Thu, Apr 24, 2008 at 4:46 PM, Andr=E9s <[hidden email]> wrote:
> >  >  Why?
> >
> >  Because ports is about getting things done, and code that gets in the
> >  way of you getting things done must die.
>
> Apply your patches locally, fork it, whatever; just don't make the
> port tree a place to get your favorite patches in. It is for
> _installing_ stuff.

Thank you very much for your opinion, but it is clear you come
with an agenda.

The OpenBSD project people do not follow the "bend to Adobe" agenda
that some xpdf people follow.

Bye bye.

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Martin Schröder
2008/4/25 Theo de Raadt <[hidden email]>:
>  Thank you very much for your opinion, but it is clear you come
>  with an agenda.
>
>  The OpenBSD project people do not follow the "bend to Adobe" agenda
>  that some xpdf people follow.

While it's always nice to blame Adobe, please first discuss those patches
upstream (i.e. with Derek and/or the poppler guys). And then consider
forking an OpenXPDF. At least make sure the original author never gets
bug reports from your Frankenstein-XPDF.

Best
   Martin

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Brad Smith-14
On Friday 25 April 2008 04:00:22 Martin Schröder wrote:

> 2008/4/25 Theo de Raadt <[hidden email]>:
> >  Thank you very much for your opinion, but it is clear you come
> >  with an agenda.
> >
> >  The OpenBSD project people do not follow the "bend to Adobe" agenda
> >  that some xpdf people follow.
>
> While it's always nice to blame Adobe, please first discuss those patches
> upstream (i.e. with Derek and/or the poppler guys). And then consider
> forking an OpenXPDF. At least make sure the original author never gets
> bug reports from your Frankenstein-XPDF.

The patches will never be accepted upstream and there is no need for a
fork at all. What bug reports? OMG! I can read the PDFs. bug bug! Get a
clue.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

Theo de Raadt
In reply to this post by Martin Schröder
> 2008/4/25 Theo de Raadt <[hidden email]>:
> >  Thank you very much for your opinion, but it is clear you come
> >  with an agenda.
> >
> >  The OpenBSD project people do not follow the "bend to Adobe" agenda
> >  that some xpdf people follow.
>
> While it's always nice to blame Adobe, please first discuss those patches
> upstream (i.e. with Derek and/or the poppler guys). And then consider
> forking an OpenXPDF. At least make sure the original author never gets
> bug reports from your Frankenstein-XPDF.

We don't have to do that.  And if you don't like what our ports people
do, you are more than welcome to not use their work.  But you are NOT
welcome to tell them what they should do.

Reply | Threaded
Open this post in threaded view
|

Re: DRM in xpdf

L. V. Lammert
In reply to this post by Andrés Delfino
On Thu, 24 Apr 2008, [ISO-8859-1] Andrés wrote:

> On Thu, Apr 24, 2008 at 3:42 PM, Deanna Phillips
> <[hidden email]> wrote:
> > There's some DRM code left in xpdf that prevents me from copying
> >  text.
> >
> >  This kills it.  ok?
>
> Please, don't add things like this to the ports tree. It's purpose is
> to easy installation, no to add customized programs. And a flavor
> wouldn't count, as a flavor is a customized _compiled_ program, not a
> program + third party patches. It even makes harder to see what
> patches are _needed_ to make the program install.
>
Please explain before shooting it down.  Removing DRM stuff is *good*, so
how does that create a 'flavor'?

        Lee

==============================================
 Leland V. Lammert            [hidden email]
  Chief Scientist        Omnitec Corporation
 Network/Internet Consultants www.omnitec.net
==============================================

1234