What are squatter's rights (in the modern day)?

Disclaimer: I’m not asking for legal advice or specifics but a general understanding.

The play RENT made me wonder and now the movie does as well: what if any legal rights to squatters have in modern day (or even late 20th century) NYC? Surely they can’t have the right to live in a building indefinitely once it has a clear owner. Are their rights limited to having to receive reasonable notice to vacate or do they have a form of unwritten lease or…?

I’m not a particularly conservative person but I am a strong believer in property rights. Why should a building’s owner have to make provision for people who occupy it without permission and without charge? Does the owner have any responsibilities in the event a squatter is injured on, say, a faulty staircase that they never had permission to use in the first place?

Just curious. (In the exact case of RENT it would seem that the characters had a much better case of verbal contract, but that’s another story.)

Couple of threads:

http://boards.straightdope.com/sdmb/showthread.php?t=43678 Goodun
http://boards.straightdope.com/sdmb/showthread.php?t=11366
http://boards.straightdope.com/sdmb/showthread.php?t=307495