Set and reset umask before mode changing operations.