On Thu, Aug 8, 2019 at 1:51 PM Lassi Kortela <xxxxxx@lassi.io> wrote:
If our procedure does chmod(path, (mode & PERMBITS)) then it clears any
sticky and setuid/setgid bits on each call.

You should not, under any circumstances, change the file permissions without knowing what the values of the other three bits should be (typically all zero).  I am completely fine, if you call it with #x777 or #x600 or whatever, to clear the other three.  So let's just call chmod passing the argument directly (chmod already masks off the file-type bits) and leave it at that.

By the way, I meant to say *don't* change the procedure name.  I was brain farting that it was currently set-permission-bits.

John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
There is a Darwinian explanation for the refusal to accept Darwin.
Given the very pessimistic conclusions about moral purpose to which his
theory drives us, and given the importance of a sense of moral purpose
in helping us cope with life, a refusal to believe Darwin's theory may
have important survival value. --Ian Johnston