chmod follows links so don't use lstat.