In the book, Sergey says they simply rip the FOSS license off the header and replace it with a Goldman proprietary license. It's implied that the legality of this is a grey area.
Ripping software licenses of from software is extremely unlikely to be a grey area. The license is what gives a person permission, and if they remove it, so goes the permission. I would compare it to a person boarding a train, and then imminently throwing away the ticket.