copyright licensing software
Can one take BSD licensed code and distribute it under GPL?
<p>Prompted by <a href="https://opensource.stackexchange.com/questions/304/can-i-take-bsd-licensed-code-and-distribute-it-under-gpl">https://opensource.stackexchange.com/questions/304/can-i-take-bsd-licensed-code-and-distribute-it-under-gpl</a>.</p>

<p>The OP asks:</p>

<blockquote>
  <p><strong>Can I take code which is licensed under a permissive open source license (like the BSD license) and distribute it under a copyleft free software license (like the GPL)?</strong></p>
</blockquote>

<p>Specifically, quoting the following from <a href="http://en.wikipedia.org/w/index.php?title=Berkeley_Software_Distribution&amp;oldid=664036786" rel="noreferrer">Wikipedia</a>:</p>

<blockquote>
  <p>In addition, the permissive nature of the BSD license has allowed many other operating systems, both free and proprietary, to incorporate BSD code. For example, Microsoft Windows has used BSD-derived code in its implementation of TCP/IP and bundles recompiled versions of BSD's command-line networking tools since Windows 2000. Also Darwin, the system on which Apple's Mac OS X is built, is a derivative of 4.4BSD-Lite2 and FreeBSD. Various commercial Unix operating systems, such as Solaris, also contain varying amounts of BSD code.</p>
</blockquote>

<p>And <a href="http://undeadly.org/cgi?action=article&amp;sid=20070913014315" rel="noreferrer">OpenBSD Journal</a>:</p>

<blockquote>
  <p>KernelTrap has an interesting article in which Theo de Raadt discusses the legal implications of the recent relicensing of OpenBSD's BSD licensed Atheros driver under the GPL. De Raadt says, "it has been like pulling teeth since (most) Linux wireless guys and the SFLC do not wish to admit fault. I think that the Linux wireless guys should really think hard about this problem, how they look, and the legal risks they place upon the future of their source code bodies." He stressed that the theory that BSD code can simply be relicensed to the GPL without making significant changes to the code is false, adding, "'in their zeal to get the code under their own license, some of these Linux wireless developers have broken copyright law repeatedly. But to even get to the point where they broke copyright law, they had to bypass a whole series of ethical considerations too."</p>
</blockquote>

<p>Specifically at stake is the question of whether or not is it legal to take a file or files licensed under a BSD licence, affix a GPL header at the top of such files without making any other changes to the content, place the GPL licence in the root and mention it in README, and distribute the results.</p>

<p>If such licence amendment to include GPL (in addition to the BSD licence) is not legal, then why Microsoft's and Apple's practice is.</p>

<h1>Yes, you can.</h1>

<p>To be precise, I claim that one can take BSD-licensed code and distribute it under the combined terms of <em>both</em> the BSD <em>and</em> the GPL licences.</p>

<p>We know that, if I receive someone else's code under a BSD licence, I may redistribute it to you under those same terms.  This is common practice, and not (I hope) in any way contentious.</p>

<p>We also know that I may not redistribute it to you without the conditions that the BSD licence imposes; that is, I may not place <em>less</em> onerous conditions on you than BSD requires (that is, requiring the inclusion of the original copyright notice, the disclaimer, this list of conditions, and a prohibition on claiming the original author's endorsement on any modified version).</p>

<p>So the question becomes whether I can distribute that code <strong>whilst adding more onerous terms than the BSD licence itself imposes</strong>.</p>

<p>It is clear that I can.  As the question notes, Microsoft is known to have taken code which it received under a BSD licence and used it in proprietary products.  These come with very onerous conditions on the the use, modification, and redistribution of the derived code (usually, they permit one instance of it to be run, and no modifications nor redistributions of any kind).</p>

<p>For clarity: if I were to seek from Microsoft permission to modify and/or redistribute the derived code, and they were to grant it, they would not be able to free me from the BSD requirements as they applied to the derived code; I would still need to comply with those.  But they are perfectly capable of applying new, onerous requirements of their own.</p>

<p>The GPL imposes conditions on redistribution that are more onerous than BSD's, but less onerous than those of most proprietary licences.</p>

<p>I am therefore perfectly entitled to receive code under a BSD licence, and - with or without making modifications of my own - redistribute it, adding in the GPL's requirements, if I choose to.</p>

<p>If I haven't modified the code, those added requirements are probably pointless; if you don't wish to be bound by them, you will go and get the code from the original author, who presumably will happily distribute it to you under the BSD licence.</p>

<p>But if I <em>have</em> modified the code, and you wish to use those modifications, then you <strong>will</strong> need to abide by the requirements of <strong>both</strong> the BSD <strong>and</strong> the GPL licences, since <em>both</em> will apply to this new, combined work (the original code + my changes).</p>

<h2><strong>No, you cannot.</strong></h2>

<p>A licence is a way for a copyright holder to grant certain rights to others that are otherwise reserved.  You don't own any copyrights to any stuff you just download from the internet, unless someone specifically transfers their copyright to you (e.g., what IEEE requires for scientific papers in order to publish them -- the authors must assign their copyright to IEEE).</p>

<p>If you make sufficient changes to the code, then you <em>might</em> be able to choose a different licence for your changes.  But should you?  The issue with the BSD/Linux controversy in regards to Atheros comes down to the ethical considerations -- the GPL advocates claim that BSD licence allows companies to not release the source code (even though a lot of companies do, since it's cheaper that way, and a lot of diffs get incorporated into all BSDs that originate from these companies like Netflix, Apple and even Oracle), yet instead of playing nice with the BSD guys themselves, Linux guys do the exact opposite than what all of those commercial companies are actually doing -- they (re)licence their changes to GPL, making sure that all such changes are forever barred from going back to the BSD projects.  (Specifically, the conflict was fuelled by the fact that such re-licensing has occurred when only trivial and non-copyrightable changes have been performed on the existing code, yet copyright claims were nonetheless made and asserted under the GPL.)</p>

<p>Yes you can.</p>
<p>The Free Software Foundation website lists licenses that are compatible with their GPL 3.0 license.  Included in the compatible licenses are the 3-Clause BSD (but not the original BSD), as well as Apache 2.0, Artistic License 2.0, and Creative Commons Zero (CC0).</p>
<p>Linkage: <a href="https://www.gnu.org/licenses/license-list.en.html" rel="nofollow noreferrer">https://www.gnu.org/licenses/license-list.en.html</a></p>
<p>Their License FAQ defines what they mean by &quot;compatible:&quot;</p>
<p><a href="https://www.gnu.org/licenses/gpl-faq.html#WhatDoesCompatMean" rel="nofollow noreferrer">https://www.gnu.org/licenses/gpl-faq.html#WhatDoesCompatMean</a></p>
<blockquote>
<p><strong>What does it mean to say a license is “compatible with the GPL?” (#WhatDoesCompatMean)</strong></p>
<p>It means that the other license and the GNU GPL are compatible; you can combine code released under the other license with code released under the GNU GPL in one larger program.</p>
<p>All GNU GPL versions permit such combinations privately; they also permit distribution of such combinations provided the combination is released under the same GNU GPL version. The other license is compatible with the GPL if it permits this too.</p>
<p>GPLv3 is compatible with more licenses than GPLv2: it allows you to make combinations with code that has specific kinds of additional requirements that are not in GPLv3 itself. Section 7 has more information about this, including the list of additional requirements that are permitted.</p>
</blockquote>
<p>The FSF further <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0-faq.en.html#WhatDoesCompatMean" rel="nofollow noreferrer">defines &quot;compatible&quot; later in this part of their FAQ.</a></p>
<blockquote>
<p><strong>What does it mean to say a license is “compatible with the GPL”.</strong>
It means that the other license and the GNU GPL are compatible; you can combine code released under the other license with code released under the GNU GPL in one larger program.</p>
<p>The GPL permits such a combination provided it is released under the GNU GPL. The other license is compatible with the GPL if it permits this too.</p>
</blockquote>
<p>So mixing code with different licenses is permitted if the licenses are &quot;compatible&quot;, and release under GPL is required for code which contains GPL code.  I think that covers the case where you want to include BDS/public domain code in a GPL work.</p>
<p>There's some other stuff in that FAQ related to public domain.  For example they claim all code written by the government employees is public domain, which is compatible with the GPL, so government employees can release their work under GPL too (they claim).</p>
<p>Interestingly, a related question is also answered in their FAQ:</p>
<p><a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0-faq.en.html#TOCCombinePublicDomainWithGPL" rel="nofollow noreferrer">If a program combines public-domain code with GPL-covered code, can I take the public-domain part and use it as public domain code?</a></p>
<blockquote>
<p>You can do that, if you can figure out which part is the public domain part and separate it from the rest. If code was put in the public domain by its developer, it is in the public domain no matter where it has been</p>
</blockquote>
<p>Again this supports the idea that mixing GPL code and public domain code is allowed.</p>

<p><strong>Sort of</strong></p>

<p>The common way to mark a file as covered by GPL is to add text like this (from <a href="https://www.gnu.org/licenses/gpl.html" rel="nofollow">https://www.gnu.org/licenses/gpl.html</a>):</p>

<pre><code>&lt;one line to give the program's name and a brief idea of what it does.&gt;
Copyright (C) &lt;year&gt;  &lt;name of author&gt;
</code></pre>

<p>You cannot lawfully make a false claim of copyright on a work that you haven't authored/modified. So exclude that and continue with,</p>

<pre><code>This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
</code></pre>

<p>This is a true statement, if something is BSD-licensed then you <em>can</em> redistribute and/or modify it under the terms of the GPL. That fact is what makes the BSD license compatible with the GPL.</p>

<p>So you can say this, but in doing so you very much haven't said that the recipient <em>can't</em> redistribute and/or modify it under the terms of the BSD license. Which (under the BSD terms) must also remain attached to the source which (under the GPL terms) distributors must make available. So you're unlikely to give anyone who looks closely, the impression that they cannot distribute it under the BSD terms unless you do something dishonest (such as making it unclear what parts of the file the BSD terms relate to, when in the original it was clear). And if they choose to distribute it under the BSD terms then they can of course first remove your added GPL rubric since the BSD license doesn't mention that GPL rubric or require it to be retained.</p>

<p>It might not be completely clear to them that they can do all this, unless they have separately obtained a copy of the original BSD-licensed code to check that they really aren't including any changes made by you (which in fact they aren't, since you didn't make any). Again, if you've made it clear what the extent is of the BSD license then they will know this, and if you haven't then they might not.</p>

<p>I don't know how difficult you can make it to figure out what the BSD license applies to, before you're at risk of being held in breach of the BSD license. Confusion as to the scope of a license can happen by accident, but it's between you, your lawyer, and the court, what happens if you do it on purpose in order to "trick" people into thinking they have to abide by GPL when they don't.</p>

<p>What de Raadt is objecting to is what he refers to as "relicensing". The point of legal contention (I think) is whether recipients of BSD code can make trivial changes, claim copyright on the result, and then forbid the trivially-changed version from being distributed under the BSD license. Fortunately that's not the question you asked, because I don't know the answer to it ;-) I think de Raadt also objects ethically to any misdirection as to the applicability of the BSD license, and I can't tell whether he objects legally to misdirection.</p>

<p>You cannot, because every kind of use is prohibited by Copyright law unless there is an explicit permission for the specific use case.</p>

<p>The BSD license permits to re-publish source and binary versions of the code and permits changes. This makes it very universally usable.</p>

<p>The BSD license however does not give permission to re-license or sub-license, so the final user always gets his permissions directly from the original author that did not give a written permission for such a change.</p>

<p>As there is neither a permission to change license nor a permission to re-license/sub-license, there is even no implicit permission for changing the license.</p>

<p>The BSD license would allow you to add code and do this under a different license. You however need to clearly mark such additions in a way that allows to identify the code under a different license.</p>

<p>Given that the GPL only permits to put a whole <code>work</code> under GPL, it is the GPL that disallows even marked pieces of code to appear in a BSD licensed work.</p>

<p>The phrase &quot;take BSD-license code and distribute it under GPL&quot; is ambiguous. If one interprets it as &quot;swapping the license from BSD to GPL with your name attached as its licenser, even if no code has been changed&quot;, it makes little sense, and it's likely invalid.</p>
<p>However, according to the legal experts at Software Freedom Law Center: If one makes a copyrightable change to the original software, or if one incorporates 2-clause or 3-clause BSD-licensed code (4-clause is GPL-incompatible due to the &quot;advertising clause&quot;) into another copyrightable software - then yes. In these cases, the end result can be redistributed under GPL as a whole.</p>
<p>But it's worth noting that it's a result caused by the additional changes under GPL, and it's not a property of the original code under BSD. The copyright status of the end result would be a combination of &quot;unmodified parts are still licensed under BSD by its original authors, and the modified parts are licensed under GPL by the new authors.&quot;</p>
<p>Since this is the opinion held by Eben Moglen and Mishi Choudhary, I'd consider it highly trustworthy (Eben Moglen was the lawyer-in-chief at FSF).</p>
<p>In the article <a href="https://softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html" rel="nofollow noreferrer">Maintaining Permissive-Licensed Files in a GPL-Licensed Project: Guidelines for Developers</a>, Software Freedom Law Center also gives explicit instructions for redistributing BSD-licensed code under GPL.</p>
<h2>Including unmodified permissive-licensed files</h2>
<p>First, SFLC states that, if the original work is not modified, its rights are reserved solely to its original copyright holders, and the original BSD-license must be preserved and followed exactly.</p>
<blockquote>
<p>The simplest case of notice preservation is unmodified incorporation of a permissive-licensed file from an external project into a GPL’d project without making changes to the code in the file itself. Here the developer should simply leave the file with all notices intact. If the external project uses the single COPYRIGHT file method, the developer should copy the names of all the copyright holders from that file and place them, along with any copyright, permission, and warranty disclaimer notices required by the permissive license, at the top of the incorporated source file. This may require the developer to list a large number of copyright holders, but it is always best to err on the side of inclusion of each person who might have a copyright claim.</p>
<p>The top of the incorpoated file should look something like this:</p>
<pre><code>/* Copyright (c) YEARS_LIST, Permissive Project Contributor1   
** Copyright (c) YEARS_LIST, Permissive Project Contributor2   
** ...  
**  
** Permission to use, copy, modify, and/or distribute this software for  
** any purpose with or without fee is hereby granted, provided that the  
** above copyright notice and this permission notice appear in all copies.  
**  
** THE SOFTWARE IS PROVIDED &quot;AS IS&quot; AND THE AUTHOR DISCLAIMS ALL  
** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED  
** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR  
** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES  
** OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,  
** WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,  
** ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS  
** SOFTWARE.  
*/
</code></pre>
</blockquote>
<h2>Adding GPL’d modifications to permissive-licensed files</h2>
<p>If copyrightable modifications have been made to the original BSD-licensed code, these modifications can be licensed under GPL. In this sense, end result would be covered by GPL as a whole.</p>
<p>But the BSD-license in the unmodified part of the code is still under its original license, thus the original license must still be preserved and followed exactly. The modified end result under GPL is a superset of the original in the sense of both its code and its license.</p>
<blockquote>
<p>A more complicated case occurs when a developer makes copyrightable
changes to a permissive-licensed file that the developer is
incorporating into a GPL’d program. Developers in this situation
typically apply the GPL to their modifications. (However, it is
possible for the developer instead to contribute new code under
permissive terms, such as the permissive license that governs the
unmodified file. We discuss that case in § 2.3.)</p>
<p>Even though the permissive license of the external project grants
legal permission to incorporate code from that project into a GPL’d
project, the developer of the GPL’d project must nonetheless comply
with the notice preservation requirement in the permissive license. In
a project that uses the file-by-file method, a developer who makes
copyrightable modifications to a permissive-licensed file should place
a new copyright notice and permission notice above the existing one
and should make clear that the developer has modified the file. The
top of the file will then appear as follows:</p>
<pre><code>/*  
 * Copyright (c) 2007  GPL Project Developer Who Made Changes   
 *  
 *  This file is free software: you may copy, redistribute and/or modify it  
 *  under the terms of the GNU General Public License as published by the  
 *  Free Software Foundation, either version 2 of the License, or (at your  
 *  option) any later version.  
 *  
 *  This file is distributed in the hope that it will be useful, but  
 *  WITHOUT ANY WARRANTY; without even the implied warranty of  
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  
 *  General Public License for more details.  
 *  
 *  You should have received a copy of the GNU General Public License  
 *  along with this program.  If not, see .  
 *  
 * This file incorporates work covered by the following copyright and  
 * permission notice:  
 *  
 *     Copyright (c) YEARS_LIST, Permissive Contributor1   
 *     Copyright (c) YEARS_LIST, Permissive Contributor2   
 *  
 *     Permission to use, copy, modify, and/or distribute this software  
 *     for any purpose with or without fee is hereby granted, provided  
 *     that the above copyright notice and this permission notice appear  
 *     in all copies.  
 *  
 *     THE SOFTWARE IS PROVIDED &quot;AS IS&quot; AND THE AUTHOR DISCLAIMS ALL  
 *     WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED  
 *     WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE  
 *     AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR  
 *     CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS  
 *     OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,  
 *     NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN  
 *     CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  
 */
</code></pre>
<p>It is very important that the developer preserve the entire copyright
notice, permission notice, and warranty disclaimer as they appeared in
the original code, as required by the permissive license. We sometimes
see GPL notices mixed in with permissive license notices—a confusing
practice that obscures both the provenance of the code and the precise
permissions that were granted by the various copyright holders listed
in the notices.</p>
</blockquote>
