Licensing
Introduction
When the idea for a new piece of software strikes, licensing issues are usually the last thing you want to think about. But licensing issues can become an issue afterwards, in a way that is usually difficult to solve. So it is in the author of a projects best interest to spend a moment of consideration. This text applies to software in general.
Probably the scariest thing about software licenses are the endless paragraphs of legal text; this list attempts to keep this text as short and understandable as possible.
This page does not act as legal advice, it is only a brief overview.
Popular Licenses
GNU General Public License (GPL):
- Users have a right to receive source code, and are free to use, modify, and redistribute as long as sources remain available and everything stays under GPL. Object files linked to GPL'ed code fall under GPL too.
GNU Lesser General Public License (LGPL):
- Users have a right to receive source code, and are free to use, modify, and redistribute as long as sources remain available and everything stays under LGPL or (optionally) GPL. Object files linked to LGPL'ed code are unaffected by the LGPL, but users must be able to link themselves (i.e., distribute your non-(L)GPL'ed object files separately, not linked to the LGPL'ed code).
Berkeley Software Distribution (BSD) License:
- Users are free to use, modify, and redistribute, with or without source code, as long as the copyright notice within the BSD license remains. Note that there are two versions, slightly different in meaning.
- Copyright is waived, and no restrictions are placed on use, modification, or redistribution. In some countries public domain is not possible, even if the publisher does not live in such a country. Normally it will still grant full rights to the user (except possibly cases in which it is not possible, like for moral rights), because the intention is clear. Nevertheless one should still have a fallback clause permitting full rights to the user. The easiest way to handle using public domain is the CC0.
Custom Licenses:
- These are often rare and almost never used since they are complicated to design to make them legally functional (the GPL took years and lots of lawyers to create behind the GNU organization). However some may choose to write their own license to their own definition of "open source" or "source available" for example one may allow full commercial usage of a project but only behind the scenes and no code contained may be part of a product which is sold.
Proprietary Licenses:
- Licensed users are free to use; perhaps (depending on contract) they may modify for own use, but may not redistribute.
No License Information:
- Defaults to "all rights reserved", not open source and no one can use it.
Being Employed as Software Developer
When you are under employment contract, the code you write during office hours is usually owned by those paying your salary, unless your contract explicitly says otherwise.
In some countries[which?], a working contract could encompass all the work you do in a certain field of knowledge, as long as the contract is valid, and sometimes even beyond that. That means that, if you are hired to write code at day, the code you write after office hours at home might also be legal property of your employer, the reasoning being that, since your employer paid you for working (and gaining experience) in a certain field, that experience is paid for, and you are obliged to put that experience back into the company that paid you for it. Another line of reasoning could be that you are not allowed, in your spare time, to build a product that could become a competitor to your company's products.
This might sound strange to you, outrageous even. But you really should have a talk with your superior. At best, your superior will see that you really are a dedicated software engineer, happy about having such an enthusiastic individual under contract, and tell you to go ahead with your spare-time project. At worst, you will be told that you cannot work on that project - before you have churned out 10k lines of source code and been sued by your employer.
This is not a joke, or something to be taken lightly. You could lose your job, and a fortune in money on top of that, should your employer play it rough and sue you for breach of contract. The Free Software Foundation requires you to present papers signed by your superiors before accepting your code submissions, and they don't do so because they enjoy bureaucracy.
What this means is, unless you are certain of your legal position, consider the code you work with during office hours to be foreign source, even if you wrote it yourself. Whatever licensing information is given in the source file does apply to you, and if no licensing information is given, that means "all rights reserved", even if you are the author, because chances are you are not the copyright holder.
Merging Source Code
You are looking whether you could salvage some existing source code to insert into your own code base.
- Without License Statement - As said above, if you are employed as software developer and you do not have written proof to the contrary, you are not allowed to take code from your employer's code base, and paste it into your own project. You'll get fired and sued. Don't do it.
- You might be surprised to hear that tutorials, or code snippets posted to some forum, are copyrighted by their author unless explicitly labeled otherwise. Legally speaking, that means you must not copy them into your code either. However, this is usually as surprising to the writers as it is to the readers, and you might contact them for an individual license (see below).
- Proprietary License Statement - It is virtually never allowed to copy & paste sources that are under proprietary licenses (subject to the actual license). Usually, one won't even have access to the sources.
- Public Domain - Any person or group is always permitted to copy PD sources.
- BSD License - The BSD license requires you to preserve the copyright notice and the list of conditions that constitute the BSD license. The specific part of source code thus remains under the BSD license, whatever the license of the code it is integrated into. As long as you respect that you are free to use BSD sources in any BSD'ed or (L)GPL'ed project without further notice.
- (L)GPL projects should be aware that the piece of BSD'ed source may legally be "extracted" later on by proprietary or PD projects without infringing on the (L)GPL.
- A PD project could do similar, but that means the project is no longer PD as a whole, but PD with a BSD part - which should be pointed out in a prominent place both in source and documentation (if any) that specific segments of the code are under BSD though the rest remain PD.
- LGPL - If your own project is under LGPL or GPL, you may copy LGPL'ed sources without further notice, as the LGPL explicitly allows to "promote" sources from LGPL to GPL.
- Also see the paragraph on (L)GPL versions below.
- GPL - You cannot take GPL'ed source code and use it anywhere else but in a likewise GPL'ed project.
- Note that, while LGPL'ed code may be "promoted" to GPL, it is not allowed to do it the other way round (GPL -> LGPL).
- Also see the paragraph on (L)GPL versions below.
Separate Translation Unit / Object Code
You have a separate translation unit (i.e., a file or collection of files that corresponds to an individual object file, module, etc., or a binary object file for linking), and you want to integrate it in your project. (Usually by means of including a header file at compile time and linking the binary object when compiling your executable / library.)
- Without License Statement - If there is no license statement, one is not licensed to use or redistribute.
- Proprietary License Statement - Subject to the terms of the actual license.
- Public Domain - Free to use however is wanted.
- BSD License - One must keep the copyright notice and the list of conditions from the BSD License intact. If one ships binaries only, in the documentation; otherwise, in the source.
- LGPL - You can use LGPL'ed sources, but projects not (L)GPL'ed themselves must keep them in a separate translation unit.
- If one distributes binaries only, one must provide an unlinked version of the object code, so that others can link in a different version of the LGPL licensed objects & code. That is an explicit requirement of the LGPL.
- GPL - One can only use GPL'ed sources in a project that is itself under GPL (and any license marked as compatible on the GNU license list).
Reference / Education
The question here is whether code written using X as tutorial material is "a work derived from X" (GPL terminology), and/or "theft of intellectual property" (company lawyer terminology). This heavily depends on what code is involved, just how much of the code you've written is actually based on what you have read before, and who you ask.
- Without License Statement - One can be sued for using said code.
- Proprietary License Statement - Subject to the license used.
- Public Domain - Free to use.
- BSD License - The BSD License applies to the code itself, "with or without modification", but does not speak about getting inspired by it, making it legally safe to use.
- (L)GPL - Both the LGPL and the GPL require that any "work derived from the product" must be placed under the very same license.
- Some claim that being inspired by (L)GPL'ed code constitutes a "work derived from the product". Though no recorded lawsuit has happened over this, and according to many sources (including GNU) it means and should be applied as the code itself, not the idea behind the code.
(L)GPL versions
There is a nuance to the GPL and LGPL, as they are versioned. A copyright holder is free to specify a specific version of the (L)GPL that sources shall be licensed under, or a specific version "or any later version", or not specifying any version at all.
Take care of this when copying (L)GPL'ed code. If no version is specified, you can assume that the copyright holder didn't care, and add a version specification with or without the "or any later version" part. It also does go without saying that if the text does not state "or any later version" and is written to one version (such as the Linux kernel) it must be treated as under said version.
But if a copyright holder specified a version, you may neither add the "or any later version" if it isn't there or remove an existing one without written consent of the copyright holder.
Individual Licensing
Only generic licenses in this document are mentioned. If the licensing for a specific piece of code has issues, you can always attempt to contact the copyright holder and ask for an individual license.
For example, if you are putting together a PD library, and all you need for completion is a specific function available under BSD License only, ask the copyright holder whether you may include this one function into your project without having to bother with the BSD copyright notice / list of conditions.
Changing License
As copyright holder of a project, one is absolutely free to change the licensing of their project.
Yes, one is free to release v2.0 of a previously GPL'ed project as proprietary software, just as one is free to release a previously proprietary software under GPL. In the former case, your peers are likewise free to take version v1.9 and continue the project under GPL, as one is not allowed to retroactively change licensing.
The Contributor Trap
There is another nuance to this which is equally surprising as forum postings being "all rights reserved" or ones employer telling you "all your bases are belongs to us": The contributor trap.
Let's say one has read all the above, and suddenly decided that placing their project under the GPL wasn't that good an idea: They want to change the license. Now, if they worked on their project alone, nothing keeps them from doing so.
But, if other people contributed to their project, they might be in deep trouble, as - legally speaking, and morally speaking too - one is no longer be the sole copyright holder, and a license can only changed if all copyright holders agree.
If one wants to change the license of their project
- from GPL to anything else;
- from LGPL to anything else but GPL;
- from BSD to anything else;
- from some X to some Y;
One may not be allowed to do so even when it's ones own project.
For this reason many projects add "or any later version" to a GPL declaration, because this way it is not longer necessary that all copyright holders of the project consent to the change to a new GPL version. It is also possible to drop the older version of GPL for later versions of the software.
Footnotes
- Multi-licensing - A project may be released under multiple licenses, allowing the user to choose between the two. For example one could include two license files and a note in the README which reads "Anyone may use this code under either license."
See Also
External Links
- choosealicense.com - a site that helps you to choose an open source license