Why are we using modeoct, and ignoring its leading file-type bits, instead of using permoct ?
(I note that a change I reviewed this afternoon masks out the file-type bits in permoct.)