use fchmod(2) instead of chmod(2). it is less racy, and we just opened the descriptor. ok naddy@ stsp@