5

I've seen several statements that the zlib license is compatible with the GPL. But this does not seem to be correct. The zlib license contains the following clause:

"Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software."

For a license to be GPL compatible, it must not contain any restrictions on modifications that are not also found in the GPL. But the GPL has no restriction on modification that is analogous to the first part of this clause.

The GPL contains the following clause (5a in 3.0):

"a) The work must carry prominent notices stating that you modified it, and giving a relevant date."

But this is a restriction on distribution. You could comply with this term by never distributing your modified code or by adding such notices prior to distribution. But this would violate the zlib license.

So how is the zlib license GPL compatible when it contains a restriction on modification that is not like any restriction found in the GPL and the presence of additional restrictions is what makes a license not GPL compatible?

David Schwartz
  • 600
  • 2
  • 10
  • "You could comply with this term by never distributing your modified code or by adding such notices prior to distribution. But this would violate the zlib license." - Which one of those would violate the license? "Not distributing your code" or "adding such notices"? Also could you explain how you believe it violates the license? I don't quite see how adding a notice according to GPL requirements would violate the zlib license. – Brandin Dec 02 '22 at 10:37

2 Answers2

4

I don't see an issue, as the preservation (and introduction) of legal markings on modified forms, and a prohibition against misrepresentation, are permissible requirements to add to a GPL distribution, per GPLv3 7(b) and (c):

Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
[...]
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or

Note these Section 7 restrictions do not necessarily activate on distribution. A license term that applies only to private modification still fits within the definitions set forth in Section 7. I expect the allowances for additional restrictions are written in this broad way precisely to allow terms like the second term of the zlib license.

  • Suppose Alice writes a zlib-licensed work.
  • Then Bob modifies that work, and releases it under the GPL. This is allowed because his GPL-licensed + zlib-licensed distribution has only extended normal GPL requirements by making GPL-permissible 7(b/c) restrictions.
    • This is exactly how the addition-restrictions mechanism is intended to work, by allowing broad GPL compatibility with miscellaneous harmless (but technically restrictive) terms in other licenses.
  • Then Charlie makes further modifications to Bob's work. According to your reasonable, scrupulous read of the zlib license, Charlie must maintain modification notices at all times, even prior to distribution, per zlib requirements. Bob's GPL+zlib grant allows Alice to require this, and Bob's GPL terms allow this as an acceptable Section-7 restriction. Charlie (optionally) releases modified versions in the same way as Bob.
apsillers
  • 35,995
  • 4
  • 94
  • 131
1

The GPL License does not care what you do at home, you don't need to comply to the rules as long as you don't distribute any code.

There is no difference between the impact of Restriction 2 of the ZLIB License and Section 5.a) in GPLv3 at the point of time when the software is distributed. Therefore the difference in the wording is no obstacle in GPL-compatibility.

Martin_in_AUT
  • 7,205
  • 10
  • 37
  • I agree with everything except your last sentence. It follows from everything else that it is an obstacle. The GPL doesn't impose any restrictions on what you do if you don't distribute. The zlib license does. There is a difference in impact before the code is distributed. Therefore, relative to the GPL, the zlib license has an additional restriction. Why doesn't that make it GPL-incompatible? – David Schwartz Dec 02 '22 at 08:06
  • You seem to be confusing 'license compatibility' with 'permission to re-license'. In case of a re-licensing your concern would be an issue, however the ZLIB License contains the language "This notice may not be removed or altered from any source distribution." which effectively prevents re-licensing. – Martin_in_AUT Dec 02 '22 at 08:19
  • @DavidSchwartz It's probably helpful to remember that such licenses are basically only relevant when you distribute the work. The reason is because without the license, to redistribute the work would be a copyright violation. This is why a license can't impose requirements on you if what you're doing does not involve possible copyright infringement. Making private changes in your own home, for example, could never be copyright infringement, so you don't need a license for that. GPL goes above and beyond by giving explicit permissions to do those things, but in general that's not required. – Brandin Dec 02 '22 at 20:25
  • @Brandin What if you need to modify the work after having distributed it? – David Schwartz Dec 05 '22 at 04:50
  • @DavidSchwartz I would view those as two distinct acts of distribution. On Monday, if I give you the unmodified GPL/zlib work, then that act of distribution seems to be OK, no violations for distributing verbatim copies. On Tuesday, if I modify the work, and then I add notices as required by both licenses, and then redistribute the modified version to you, then this is a separate act of distribution that also seems to be OK to me by my reading of the licenses, as long as the changes are "clearly marked as such" (GPL) and not "misrepresent[ed] as being the original software" (zlib). – Brandin Dec 05 '22 at 05:38
  • @Brandin The problem is if I don't distribute on Tuesday but just modify without distrubuting. I have to comply with the zlib license or I cannot justify my distribution on Monday. And I didn't distribute on Tuesday, only modified. – David Schwartz Dec 05 '22 at 07:25
  • @DavidSchwartz Which condition of zlib (there are 3 condition) do you think would be violated by that? – Brandin Dec 05 '22 at 08:00
  • @Brandin "Altered source versions must be plainly marked as such" You can be subject to that clause because you distributed in the past and violate that clause without distributing in the future. Say, for example, you distribute an unmodified version and then modify one of those copies without marking it as altered but don't distribute the altered version. The GPL allows this, the zlib license does not. (Of course, this is kind of academic because the accepted answer explains the GPL permits this through a special carve out.) – David Schwartz Dec 05 '22 at 08:24
  • @DavidSchwartz I suppose it's more of a theoretical issue or a legal issue, but in copyright law, as long as your copy is a legal one, there is no obligation to comply with the license before you distribute it. As long as you bring your altered source version into compliance by "plainly marking it as such" before you do any distribution, then copyright law should be satisfied that you've complied with the license. The fact that there is some moment of time where there's a copy on your hard disk (not distributed) that is not "plainly marked as such" should not be a legal problem in my opinion. – Brandin Dec 05 '22 at 08:30
  • @Brandin You misunderstand the issue. The problem is the distribution. If you were charged with violating copyright because of the distribution, your only defense would be that you had a license. But the subsequent modification without distribution is prohibited by the license. it's very hard for you to argue that you have a license that authorizes your distribution when you violated the terms of that license. Say you continue to distribute the unmodified version while still violating the terms of the license with the undistributed version. How do you have a license to distribute? – David Schwartz Dec 05 '22 at 08:32