Just to let you all know:
If you're getting the problem where connecting to a server gives you the error message
"Failed to connect to the server java.net.SocketException: Permission denied: connect"
Just re-download the client from minecraft.net and it should fix the problem for you.
Noticed this with a few people so far, so thought I'd post it here in case anyone else gets this