Do not assume that mode_t uses the
authorJim Meyering <jim@meyering.net>
Fri, 29 Dec 2000 10:32:09 +0000 (10:32 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 29 Dec 2000 10:32:09 +0000 (10:32 +0000)
commit43b0594f91c32af75ee466e7d653915eb778db2c
treef227717a161e3e59aef27fe2a5fd668df1d2ecbd
parent12ab8a318a50f07aa189ad9c50b6202792112a26
Do not assume that mode_t uses the
traditional octal encoding.  E.g. "chmod 1 FOO" should set
the other-execute bit of FOO even if S_IXOTH != 1.

(SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
WOTH, XOTH, ALLM): New macros.
(S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
Use them.
(S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
(S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
(mode_compile):
No need to use uintmax_t; unsigned long is long enough.
Don't bother to get suffix since we don't use it.
lib/modechange.c