7

I'm planning on running an executable as a child process in my program (e.g. using Ruby's popen or C's exec() family of functions). However, the executable I'm planning on running is licensed through the GPL.

The GPL, as I understand it, requires that all linked code to GPL licensed code needs to also be GPL.

But there's also an "arm's length" exception, discussed in the FAQ:

However, in many cases you can distribute the GPL-covered software alongside your proprietary system. To do this validly, you must make sure that the free and non-free programs communicate at arms length, that they are not combined in a way that would make them effectively a single program.

Would runnning an executable as a child process be part of this exception, or would it still be considered "linking" for the purposes of the license?

If it is considered "linking", how does it differ from running program, like Nmap, from the a command line?

  • 2
    think this covers it http://programmers.stackexchange.com/questions/50118/avoid-gpl-violation-by-moving-library-out-of-process – jk. Aug 22 '11 at 10:56
  • It doesn't seem to cover my question, which is someone trying to get around the GPL by not linking, but using a server. In my case, I can't link(AFAIK) because Nmap is a program not a library, and using popen is like using C's exec functions. It spawns a new process, but is a child process of my program that uses pipes for IO between parent and child. I would ship my program without Nmap, and the end-user would have to install it himself. I haven't decided on what license, but am leaning towards a open license of some sort, but if legally permissible I might need to dual-license. – Steven Williams Aug 22 '11 at 18:00
  • @Steven thanks for clarifying your question. I've revised it a little more to focus on the specific use-case rather than a blind reading of the license, to try to keep it on-topic for Programmers. –  Aug 22 '11 at 18:42

4 Answers4

10

I think this quote from the section on plugins might lead you in the right direction.

If the program uses fork and exec to invoke plug-ins, then the plug-ins are separate programs, so the license for the main program makes no requirements for them. So you can use the GPL for a plug-in, and there are no special requirements.

sylvanaar
  • 2,295
  • 1
  • 19
  • 26
4

You are going to have a hard time getting a good answer to this question. The issue is that the correct answer to your question relies on a complicated legal question for which there is as yet no answer.

I am not a lawyer, but I'll tell you my own position, for what that's worth. Linking, because it does not involve a creative process, cannot create a new work for copyright purposes. Linking is legally like stapling. Linking two works together is just like stapling two DVDs together. The output is, legally, the same as the input. It is the two works.

So if your work was not a derivative work before you linked it, it is not a derivative work after you linked it. The GPL requires source code of distributed works be distributed. So the question is whether the work whose source code you don't want to distribute is a derivative work. Since linking can't change this, the question comes down to whether the work was a derivative work before you linked it.

Legally, with only a few exceptions by statute that don't apply here, a work is a derivative work if it contains significant protectable expression taken from the other work. Note that functional elements are not protectable expression, only creative elements are.

So the answer to your question is: If your code contains sufficient protecable expression taken from a work covered by the GPL to make it a derivative work of that work, then yes. Otherwise, no.

David Schwartz
  • 4,676
  • 22
  • 26
  • After linking, the executable is a derivative work (same as translating a book to another language). GPL requires all source code to derivative works be made available. This is not ambiguous. There is also more to linking that your stapling analogy suggests, but that doesn't matter unless we get into dynamic linking. – phkahler Aug 22 '11 at 14:37
  • I don't think that in this case, any linking occurs. – Steven Williams Aug 22 '11 at 17:31
  • @phkahler: Not true about dynamic linking. Right, you mention that. But it isn't clear if David meant static or dynamic linking either. – Zan Lynx Aug 22 '11 at 18:45
  • Linking cannot make a derivative work. Under copyright law, a derivative work is a type of new work, and a new work can only be produced by a creative process. If linking could make a derivative work, then the linker would be entitled to copyright, since it had made the work. That's absurd. Linking is legally equivalent to stapling -- it's a non-creative process that simply aggregates two works. If your work wasn't derivative before you linked it, it can't be derivative after. Only a creative process can create a new work, derivative or not. – David Schwartz Aug 22 '11 at 18:53
  • 1
    @David Schwartz: Repeating your idiosyncratic view in a comment doesn't make it mainstream. I've read a good deal about software and copyrights, and your opinion took me totally by surprise. You're welcome to your own opinion, of course, but from about the middle of your second paragraph on you were giving what looks awfully like legal advice, speaking very definitely about the law. Since you are not a lawyer, you're almost certainly not qualified to establish novel legal theories and rely on them. – David Thornley Aug 22 '11 at 19:36
  • using the compiler directive "#include xxx.h" is equivalent to copy and paste a header file into the one that includes it. Your code is not even able to compile without that, and it's implementation is dependent on the things included. This argument is true of dynamic linking as well. – phkahler Aug 22 '11 at 19:53
  • @David Thornley: Can you find me *any* citation to a lawyer who takes the position that linking can create a derivative work, assuming that none of the works linked were derivative works? It is not idiosyncratic, it is the majority view -- it's just seldom expressed clearly in that way. (Other than the few specific exceptions created by statute. Linking is not an exception since no statute mentions it.) – David Schwartz Aug 22 '11 at 21:00
  • @David Schwartz: Your idea that you can't create a derived work by a purely mechanical process is clearly wrong: moldmaking is mechanical and uncreative, but embedding a mold from a copyrighted piece of sculpture in your work makes it derivative. Also, even if you had provided citations to show that it's the majority view among lawyers (whatever that means exactly) you should not lay down the law like you did. Lawyers writing on this topic are careful to say that you can't completely rely on what they say. – David Thornley Aug 22 '11 at 21:05
  • @David Thornley: It doesn't make it derivative. If I glue a DVD of The Phantom Menace to my painting, the painting is not a derivative work of The Phantom Menace, it it simply an aggregate work. A derivative work can only be created by creative combination (other than the exceptions created by statute) and the copyright in the derivative work belongs to the creative combiner. Non-creative molding can create an aggregate work but not a derivative work. A derivative work is a type of new work and only a process that can create a new work can create a derivative work. – David Schwartz Aug 22 '11 at 21:15
  • @David Schwartz: I didn't find that rule in http://www.copyright.gov/circs/circ14.pdf; do you have a reference to it in Title 17 of the US Code? Given that you are making authoritative-sounding statements, it would seem that you should be able to. – David Thornley Aug 23 '11 at 02:48
  • 17 USC 101 and 103(b) make clear that a 'derivative work' must be a 'work'. A 'work' can only be created by a creative process. No automated process (other than the specific exceptions by statute) can create a new 'work'. A photocopy of a painting (assuming no creative effort in the photocopying) is not a derivative work of the painting, it's a copy. (There's some conflict among the circuits on the details, but in any event, it doesn't matter. There's never been a holding that a machine can create a derivative work, other than the exceptions by statute.) Who would be entitled to the copyright? – David Schwartz Aug 23 '11 at 06:00
  • @David Schwartz: linking is not like stapling a CD to a painting. It's more like writing a new story set in the Star Wars universe using all the same characters and plot elements like "the force" and light sabers. See my comment about #include. – phkahler Aug 23 '11 at 14:33
  • No, because writing a new story is a creative process that entitles the person who wrote the new story to copyright. Such a new story is a new work (a new derivative work). Linking is not a creative process. It doesn't entitle the person who did the linking to copyright. It doesn't create a new work. Linking is purely functional. – David Schwartz Aug 23 '11 at 22:21
  • If one were to take a piece of clear acetate and paint a person on it such that if overlaid on a copyrighted photograph the person on the acetate would replace the one in the photo, I wouldn't consider the acetate painting to be a derived work of the photograph (since the only aspect of the photograph it incorporates would be the location of the subject, which is not copyrightable). Overlaying the acetate on the photograph and rephotographing it would be by your standards a "non-creative" process. Nonetheless, I would posit that the resulting picture would be a derivative work. – supercat Oct 06 '12 at 23:12
  • 1
    I would suggest that a derivative work is one which combines a copyrighted holder's work with someone else's in such a fashion that they cannot be completely separated. In the earlier scenario, when the painting and the photo are on separate media, they are readily separable. The act of photographing them together may not entail creativity, but it replaces the separable representations with an inseparable one. Likewise, when static linking, if function `Foo` in one module calls `Bar` in another, to which copyright holder should the target address of the "call" be attributed? – supercat Oct 06 '12 at 23:22
  • @supercat: The rephotographed overlay would not be a derivative work, it would simply be a non-creative combination of the two works that made it up. If it's a new work, and a new derivative work must be a new work, who holds copyright to it? Since the only process used to make it was, by stipulation, non-creative, it can't be a new work. If it's not a new work, it can't be a new derivative work. – David Schwartz Oct 07 '12 at 00:38
  • @supercat: Your suggestion is not unreasonable if the law had been structured that way, it's just not correct under the law, and would lead to nonsensical results with the way the law is actually structured. A derivative work can only be created where there wasn't one before if a new work is created. And, other than the statutory exceptions, a new work can only be created by a creative process. Your proposed definitions would lead to absurd results -- new works created without creative input with no way to decide who holds copyright on the new elements because there aren't any. – David Schwartz Oct 07 '12 at 00:40
  • @DavidSchwartz: I don't see the ambiguity. Bob publishes a copyrighted photograph. Joe paints an overlay (which he hangs in his apartment with the photograph) and Fred wishes to distribute pictures that composite the two. Such pictures can only be distributed on terms mutually agreeable to both Bob and Joe. If Fred's photography of the composite adds additional creative input (tweaking lighting, color balance, or whatever), he could demand that Bob and Joe either agree to his terms or find someone else to make a composite picture, but... – supercat Oct 07 '12 at 04:25
  • ...Bob and Joe would likely be far more interested in each other's demands than in Fred's (unless Fred somehow adds substantial creative input, finding someone else to composite the photo shouldn't be hard). The key point is that the composite photograph would intermix material from the two copyright holders in a way that was not readily separable. If Joe sold acetate copies of his painting, and Fred bought those along with retail prints of Bob's photo, I don't think he'd need anyone's consent to pair the acetates with the photos and sell framed sets. But in that scenario, ... – supercat Oct 07 '12 at 04:33
  • ...each artist would be responsible for the reproduction of his own portion of the work. The issue with a derived work is that enough rights are licensed to one person (who may or may not be the holder of one of the original components) to allow that one person to copy everybody's portions together. – supercat Oct 07 '12 at 04:35
  • @supercat: I agree with everything you just said. The point is, the composite photograph is not a new work for copyright purposes, since it contains no new copyrightable elements, so it cannot be a derivative work. It contains copyrightable elements from both works, so permission from the copyright holders of both works would be needed to distributed it. But it's not a derivative work since it's not a work at all. A "derivative work" must first be a work, and combining two works "mechanically" does not create a new work (with few exceptions). Only a creative process can create a new work. – David Schwartz Oct 07 '12 at 05:48
  • @DavidSchwartz: How does copyright law handle situations in which a creative process has demonstrably occurred at a time distinctly before a work placed in tangible form? The creative process in the above scenario would have occurred when Joe was painting, but the composite would not exist as a single fused item until it was photographed together. Suppose a musician gave a performance before 50,000 people and nobody recorded it, but many concertgoers left humming a new melody the performer had improvised for the first time and some rushed to transcribe it. The performer transcribed it... – supercat Oct 08 '12 at 14:41
  • ...an hour or two later, but it some of the concertgoers could show they transcribed it first. What would be the copyright status, if everyone was willing to stipulate that the melody had never been thought of by anyone (except perhaps the performer) prior to the performance? If nobody had ever transcribed the work, it obviously wouldn't exist for copyright purposes, so in some sense the transcription brings it into existence, but in another sense the transcription is merely taking something which is ephemeral, *but which exists*, and making it concrete. – supercat Oct 08 '12 at 14:48
  • @supercat: I remember reading a law review article on this, but I can't remember the details. It definitely doesn't change the basic rule that some creative act is needed to produce a new work, even a new derivative work (other than the specific exceptions created by statute). – David Schwartz Oct 08 '12 at 15:04
1

This is generally considered to be okay, as long as the child process is a sensible program in its own right.

Ultimately, the question is, is the owner of the GPL'd code going to sue you, and can he convince a judge that the processes are "combined in a way that would make them effectively a single program." If the child process is a tool that can be used on its own, and you are invoking that tool, you should be fine.

Sean McMillan
  • 5,075
  • 25
  • 26
0

Lets compare the strings "running an executable as a child process" and "linking a library". One starts with the letter "r" the other with the letter "l". Therefore it is not the same!

ThomasX
  • 19
  • 2