get file permissions right
Some work in progress, I don't remember what