Edit:
The following statement is my personal viewpoint only. There seems to be some legal uncertainty as to whether the suggested behaviour would be considered a good thing. I would suggest you read this related answer by Joel and the subsequent comments. Before taking any action based on this discussion. It may be better left alone.
StackOverflow is not for illegal file sharing. Flag it for moderator attention and note that the source is not legal.
Alternatively if you have appropriate edit privileges remove the link and replace with a note that the link was not legal. Perhaps replace with a link to the book on Amazon or the books website.
Remember SO is based in the US, and legality often differs between jurisdictions so don't be too harsh on the poster as they may not have been aware.