Imagine that an unfaithful (or maybe careless) employee at Microsoft managed to sneak in three lines of GPL code into a the core of a distribution of Windows. Wouldn't this mean that Microsoft would need to publish all their source code under GPL as well? Or could they just rewrite the three lines once they are notified about the issue?Shouldn't Microsoft be scared to death about this?EditIn the comments below, Kenneth states that it has actually happened, so I would be most intereted in any references. I also do not understand how this question could get closed.
What would happen if a bit of GPL code sneaked into the Windows source code?
gpl
As old as the GNU GPL is, I'm amazed at how broadly it is still misunderstood. Three lines of code is not going to make a difference. I could write a simple for() loop with three lines of code and you'd probably spot it in hundreds of code bases. Your question is valid, but the example is rather trivial.If Microsoft accidentally linked against a GPL'ed (note, I said GPL, not LGPL) library, there would be an issue because they would have created a combined work. Microsoft could come into compliance by either:Releasing the source code and build scripts to the executable or dynamic object that linked against the covered library, orStop using the libraryYour last question was the most interesting part, and yes all software companies should be diligent about monitoring what gets checked into their code base. Some companies even appoint 'compliance officers' to ensure that their use of free/open source code is in accordance with the license. One of the benefits of version control is to be able to monitor this.If you have proprietary code, in an ideal world, you use open stuff that is under the least restrictive licenses such as the two / three clause BSD, MIT or similar.IANAL, but I work closely with one. Part of my job is to ensure my company remains compliant, it's my ultimate call on what third party stuff we use. 