bin/sanedir: check uid and gid