Test them seperately:
(program_filemode & S_ISUID) && !(program_filemode & S_IXGRP)
And yes, I've tested it myself first :-)
The simple rule is to use & (bit-wise AND) to test bits, | (bit-wise OR)
to set bits, and ~ (bit-wise complement) to invert bit masks (ie. to
apply the test/set to all the bits except the ones you specified).
Cheers,
--
Dennis Clark dbugger@nospam.progsoc.uts.edu.au PGP/MIME spoken here
-------------------------------------------------------------------------------
All language designers are arrogant. Goes with the territory... :-)
--Larry Wall in <1991Jul13.010945.19157@nospam.netlabs.com
--
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@nospam.progsoc.uts.edu.au.
If you are having trouble, ask owner-progsoc@nospam.progsoc.uts.edu.au for help.
This list is archived at <http://www.progsoc.uts.edu.au/lists/progsoc/>