Bitwise Negate 0755 into 0022. Bitwise-and your test value with 0022. If the result is not zero, then the test value has scary bits set and the permissions test should fail.
Next take your required bits 0750 (?) and bitwise and them with your test value. If the result is not 0750 then the test value has insufficient bits set and the permissions test should also fail.
Otherwise, it passes.
In reply to Re: UNIX File Permissions equal or less than conditions
by SuicideJunkie
in thread UNIX File Permissions equal or less than conditions
by Themis74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |