Making sure written files are only executable when they should be