“Be aware, though, that licensing terms may require you to distribute to the general public any enhancements you make.”
Well, I suppose it’s possible that there’s a licence that requires this. The most popular licences, such as the GPL and the Artistic Licence, do not stop you from doing whatever you like to the software, as long as you don’t then redistribute the modified version.
“The GPL does not require you to release your modified version. You are free to make modifications and use them privately, without ever releasing them. This applies to organizations (including companies), too; an organization can make a modified version and use it internally without ever releasing it outside the organization.
But if you release the modified version to the public in some way, the GPL requires you to make the modified source code available to the program’s users, under the GPL.”
From the Artistic Licence:
“3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following:
b) use the modified Package only within your corporation or organization.”
In both cases, the clauses that require you to distribute your modifications in source form only apply when you are redistributing the package at all. Bear in mind that most people and organisations do not redistribute the software they use; even programmers work more on in-house products than on redistributed products. These clauses only bind, and are only intended to bind, those planning to distribute modified versions of free software.
The notion that using free software causes you to lose your rights in your own code is a common one, and a commonly cited reason to avoid using free software. Whether it started as a deliberate piece of FUD, or just through people not reading licences carefully, I don’t know.