This came up from an incidental issue about a month ago. I have been told that if I wish to continue being employed, I cannot post code.
This is extremely bad form on the part of your employer. Companies that implement this type of policy are shooting themselves in the foot, unfortunately they can do a lot of damage to others, including free software organizations, in the process.
I'm not a lawyer, but it seems this all pretty much comes down to the agreement that was signed. A brief reference on the issue is available here. From the part that describes what a 'Work for hire' is:
Section 101 of the U.S. copyright law defines "work for hire" as follows:
Assuming this is still relevant, Number 3 is the problem. I haven't heard of anything that specifically says employers own all the rights to all work done by professional employees by default but if the contract signed says so, there doesn't seem to be a whole lot you can do.
Excellent post though. This is an issue that has important consequences for free software and should be receiving far more attention than it has been.
Update: Here's another good article on the subject.