Let's say that program
A was made by me, with me being the sole copyright holder. If I license this program under the GPL-3.0, can I use that program in program
B that is closed source?
You can freely issue additional licenses to your own GPL software, without restriction.
Licenses can either give an exclusive or non-exclusive right. For example, an employment contract will typically give the employer exclusive rights to whatever the employee produces as part of their work. But the GPL is non-exclusive, thus allowing multiple licenses for the same material.
Dual-licensing GPL code is a common business model: the software is available as open source, but those that don't want to comply with the GPL can buy a commercial license. IIRC this was pioneered by Ghostscript, tried by MongoDB for a while, and is also used by Qt and Oracle (Java, MySQL). This works precisely because the GPL is non-exclusive, but is seen critically in the software freedom camp – the copyright holder now has an incentive to make the GPL version as cumbersome as possible to use.
To be clear, this only works when you hold the entire copyright to the software, or have suitable licenses to the other parts. That means in particular:
- You cannot use GPL libraries (as you have no right to use them under a different license).
- You cannot accept outside contributions, unless the contributors sign a Contribution Licensing Agreement (CLA) that gives you additional rights.
IANAL/TINLA: Proceed at your own risk.
Yes. According to the GPL FAQ, it states here two things:
I would like to release a program I wrote under the GNU GPL, but I would like to use the same code in nonfree programs.
To release a nonfree program is always ethically tainted, but legally there is no obstacle to your doing this. If you are the copyright holder for the code, you can release it under various different non-exclusive licenses at various times.
and also this:
Is the developer of a GPL-covered program bound by the GPL? Could the developer's actions ever be a violation of the GPL?
Strictly speaking, the GPL is a license from the developer for others to use, distribute and change the program. The developer itself is not bound by it, so no matter what the developer does, this is not a “violation” of the GPL.
This means that no matter what you do with your own GPL'ed code that you have copyright ownership of, you can never violate the GPL. But, this would be unethical, as the whole point of the GPL is free1 software.
1 Free as in free speech and not free beer. More info here
When you use any source code, no matter where from, the copyright holder can sue you for copyright infringement if you do it without their permission, or if you don’t fulfil any conditions that the copyright holder sets. That principle is the same for open source, closed source, any source. People other than the copyright holder have no standing to sue you.
If you are the sole copyright holder, nobody other than yourself can sue you. So nobody can sue you. You are free to do with your own source code whatever you like. But of course that’s only the case if you are the sole copyright holder, with no copyrightable contributions by anyone else.
The sole purpose of a copyright license is to allow certain parties (e.g. everyone, for the GPL) to not be liable for copyright infringement provided they follow the terms of the license. Only parties other than the copyright owner have copyright liability in the first place. This means that the copyright owner has no copyright liability for works they own, regardless of the content of the license they apply for others to follow.
In other words, the text of the GPL is irrelevant to your question. You can do anything you want with a work, provided you own its copyright.