You are here

Releasing source code snippets created by others under the GPL

9 posts / 0 new
Last post
rene
Offline
Last seen: 17 years 6 months ago
Joined: 2006-03-29 16:16
Releasing source code snippets created by others under the GPL

I started this topic to discuss the finer details of distributing source code under the GPL that was gathered from public sources on the internet.


Ejection Code
Submitted by John T. Haller on September 19, 2006 - 10:05pm.

Rene - Where did you get the code to programmatically eject a USB device from? The only code I could find for it was from Microsoft's Knowledgebase... which can't be incorporated into open source projects. So, I was left with a choice of closing the app... or just bringing up the USB safe eject dialog... I elected to do the latter in my menu.

rene
Offline
Last seen: 17 years 6 months ago
Joined: 2006-03-29 16:16
I got the code from The Code

I got the code from The Code Project.

The code was orignally created by Uwe Sieber.
I actually forgot to properly attribute the code to him, so I'm fixing that next in the subversion repostiory.

This code has not been explicitely placed in the public domain and therefore
copyright is by default held by Uwe Sieber.

However because this has been posted to codeproject.com the following
guideline applies:

`If you post to CodeProject then you retain copyright of your article and code.
You also give CodeProject permission to use it in a fair manner and also permit
other developers to use the sourcecode associated with your articles in their own
applications as long as they do not remove your copyright notices or try and take
credit for your work.'

I take that as being able to distribute it under the GPL also.

I'm also interested in your statement:
The only code I could find for it was from Microsoft's Knowledgebase... which can't be incorporated into open source projects
So where does it say that ? Got an url ?

John T. Haller
John T. Haller's picture
Offline
Last seen: 17 hours 1 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
We can't assume

With the open source licenses in general... and the GPL in particular, you can't assume you have permission to incorporate a piece of code if you don't know specifically how it is licensed. There are some GPL compatible free software licenses like Modified BSD (sans copyright notice requirement), X11, Python, Zope, Public Domain (no copyright), etc. There are some GPL-Incompatible Free software licenses like the original BSD license, Apache, Mozilla Public License, PHP, etc. There are also Non-Free licenses like Sun's Community License, Qmail, PINE, Microsoft's Share Source licenses, etc.

The general rule of thumb is to assume you can not incorporate the code into a GPLed project unless you specifically know that you can. You know you can if it is using one of the GPL-compatible licenses above. You also know you can if the author specifically releases all their code into the public domain (hence no copyright). In other cases, you should get specific permission from the copyright holder and make sure that they are, in fact, the copyright holder to all the code in their project (or that they have permission from all said holders). Sometimes, some "free" applications out there are using code bits taken from other sites with questionable licenses/copyrights. (Side note: In emailing El Salvador, the creator of ASuite, we discovered one of the code libraries he was using was GPL-incompatible, but he contacted the author and got permission for it to be GPLed... so it can work out).

As for the Microsoft example code, I recall from when, in years past (back in my former life working corporate), that the example code with many of Microsoft's products was licensed in a way that permitted commercial use, company use and personal use provided you adhered to certain restrictions. I also remember that many code snippets released carried a license that prohibited their inclusion in a product that competed with a Microsoft product (like Word, for example) which I always found particularly distasteful... I can understand it from a company/business perspective... but this is them putting limitations on what someone can do with Microsoft's development tools. I can't locate a license specifically for the example code in the knowledge base anywhere (and I've been looking for a while), but of the other source code licenses I've found, it doesn't look good: gotdotnet.com sample code license, asp.net sample code license, Microsoft Permissive License (Microsoft's most open license) and their other shared source licenses. Now, from my own completely un-lawyerly reading of these (i am not a lawyer, etc etc), none of them are GPL-compatible. None are even BSD-compatible. Basically, unless you can find out what the licensing terms are for the code in the Microsoft Knowledgebase, you can't relicense it under the GPL. If you want to use it in a GPLed project, you'll need to ask Microsoft. Unless someone else can find a definitve URL that tells us all what the license is.

Believe me, I wanted to use the code to eject under Windows NT/2000/XP and eject under Windows 95/98/Me, too. But without knowing the license, we can't. Sad

Sometimes, the impossible can become possible, if you're awesome!

rene
Offline
Last seen: 17 years 6 months ago
Joined: 2006-03-29 16:16
Well you obiously thought about this

I still think you're hypersensitive about this, but I'll go along with it:

Question is what's the repercussion of this.
Is it the risc someone comes crawling out of the woodwork proclaiming this program cannot be released under the GPL because it has snippets of hist code in it ?
Or are you seeing other problems ?

The short term solution I now see is that I will put all the non public domain code into a snippets libarty. It ain't that much. Then release it under a GPL-with-exception licene. I then create a specification of the functionality and then have a co-worker build it to that specification.

Man am I lucky I didn't use any GPL code or I couldn't even do that.

John T. Haller
John T. Haller's picture
Offline
Last seen: 17 hours 1 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
There are Risks

There are actual risks associated with it:

1. Without knowing the licenses of all the code snippets you use, you can't legally release it under any open source license. This means you can't host the project on SourceForge. SourceForge only allows hosting of projects, code and binaries that are released under an OSI-approved license. Anyone who wants can file a complaint and if you can't assure the licensing of all your sources as OSI-approved (along with proper attribution, license inclusion and source code availability), your project will be pulled. Someone filed a frivolous complaint against one of my SourceForge projects in the past... it was easily handled because my ducks were in a row, as it were... but if they weren't, the project would have been pulled.

2. You can be held legally responsible for unlicensed code. Especially if your project becomes successful and is used by commercial entities. For example, I've been approached by a number of USB flash drive manufacturers and distributors about including the programs and the upcoming suite on their drives. Say in that scenario, your app was included. Then, later on, the actual copyright-holder of those snippets decides he doesn't like his code used in that scenario (especially since he never, in fact, gave permission for it to be). He can go after the distributors of the apps, since they are illegally distributing his code. And guess who they'll come after. He could go after you as well, especially if you made any money from said disrtibution... even if it were only ad dollars or donations. And even if you win, the legal bills would be very hard to swallow.

So, basically, you could distribute the majority of the app under the GPL or BSD, but the secondary file with the questionable code would have to be a separate DLL that wasn't distributed by SourceForge. If you're not distributing via SourceForge, you can mix and match the code as long as the questionable stuff is kept separate. Of course, there's still the possible future legal issues.

Sometimes, the impossible can become possible, if you're awesome!

Lurking_Biohazard
Lurking_Biohazard's picture
Offline
Last seen: 6 years 2 months ago
Joined: 2006-02-18 18:06
To sum it all up...

Don't take any chances. Cover your butt.

~Lurk~

~Lurk~

John T. Haller
John T. Haller's picture
Offline
Last seen: 17 hours 1 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Code Project Rules

Also, I double-checked the code project, and their rules from the FAQ are as follows:

Can I use code snippets and programs in my own work?

You can use code snippets and source code downloads in your applications as long as

* You keep all copyright notices in the code intact.
* You do not sell or republish the code or it's associated article without the author's written agreement
* You agree the code is provided as-is without any implied or express warranty.

Some authors may also have specific restrictions on using code in commercial apps such as providing credit in documentation or sending them an email first.

As you mentioned, that first bit about notices appears to be fine (the GPL require proper attribution). And the third bit about no implied or express warranty would also appear to be ok, too (Sections 11 and 12 of the GPL have a solid no warranty clause). But that second bit about not selling or republishing would appear to be an issue. GPLed code can be freely published and the resulting binaries can be sold. BSDed code can be freely published and sold as well. Thus, I don't think you can release anything you've gotten from The Code Project as open source without permission from the copyright holder. Hopefully, it will be as simple as asking the author you mentioned, Uwe Sieber, and him saying OK. Give it a shot... it worked out for ASuite.

Sometimes, the impossible can become possible, if you're awesome!

rene
Offline
Last seen: 17 years 6 months ago
Joined: 2006-03-29 16:16
EjectDrive code

I'm having the EjectDrive code rewritten by a co-worker from a functional specification I am writing. There are other snippets that require rewriting too.

The biggest issue still preventing me from going full GPL is WTL. WTL is published on SourceForge but released under the CPL which obviously turns out not to be compatbile with the GPL.

So although I can use the ATL because it is part of what is installed with the compiler and therefore falls under the default exception for this in the GPL, I have to remove dependencies on the WTL classes in order to be GPL compatible.

It's way easier to write proprietary code.

I'm going to do this in two steps.
1. Have all snippets rewritten by a co-worker based on specification. This will be released under the GPL with exception for the WTL.
2. Remove dependencies on the WTL classes, which is going to be a bit harder. But as I am only really using it for a simple AboutBox and a popup menu, it should not be that hard to do.

John T. Haller
John T. Haller's picture
Offline
Last seen: 17 hours 1 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
On proprietary code...

"It's way easier to write proprietary code."

Yeah, it is. The main reason is because you can get away with stuff since the code is closed. Lots of closed source applications have code which they're using under a questionable license. Even the Microsoft Knowledgebase is an example... lots of applications are probably using code from there... but do we even know if that's allowed? There's no license listed anywhere. But with closed source, people just use it. The reason is usually "Who's gonna know?". And with closed source, usually no one does.

Of course, there are also lots of closed source apps that DO operate ethically and only use code they have a right to.

Sometimes, the impossible can become possible, if you're awesome!

Topic locked