summaryrefslogtreecommitdiff
path: root/lib/modechange.c
AgeCommit message (Collapse)Author
2005-10-20(mode_compile): Reject an invalid mode string thatJim Meyering
starts with an octal digit. From Andreas Gruenbacher.
2005-09-22Sync from gnulib.Paul Eggert
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-01(mode_free): Remove; all callers changed to invoke 'free'.Paul Eggert
xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed. (MODE_DONE): New constant. (struct mode_change): Remove 'next' member. (make_node_op_equals): New function; like the old one of the same name, except it allocates an array. (mode_compile, mode_create_from_ref): Use it. (mode_compile): Allocate result as an array, not a linked list. Parse octal string ourself, so that we catch mistakes like "+0". (mode_adjust): Arg is an array, not a linked list.
2005-04-28Include stat-macros.h, xalloc.h.Paul Eggert
(S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR): (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU): (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS): Remove. This is now stat-macros.h's job. (talloc): Remove. All callers replaced by xalloc, so that our invokers don't have to worry about reporting memory failures. (make_node_op_equals): Remove. (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING): New constants. (struct mode_change): Moved here from modechange.h. (mode_append_entry): Remove. (mode_compile): Remove MASKED_OPS arg, since it encouraged apps to have incorrect behavior. Use simpler algorithm for head and tail. Don't futz with umask; that's now the job of mode_adjust. Detect more invalid usages rather than having somewhat-random behavior. Don't insert an "a=" action, as that leads to incorrect behavior. (mode_compile, mode_create_from_ref): Return NULL on error instead of an enum, since now there's only one way to have an error. All callers changed. (mode_adjust): Accept new arg UMASK_VALUE, and interpret it at the correct time. Simplify calculation of "+u" and its ilk. Don't mishandle "+X". (mode_free): Remove "register" and localize decls.
2004-09-24(mode_compile): Don't decrement a pointer thatPaul Eggert
points to the start of a string, as the C Standard says the resulting behavior is undefined.
2004-07-30Update copyright.Paul Eggert
2004-07-30Include <stdbool.h>.Paul Eggert
(mode_compile): Use bool when appropriate.
2003-09-10Include <stdlib.h> unconditionally.Jim Meyering
(malloc): Remove decl.
2003-06-06Include <stddef.h>.Jim Meyering
(NULL): Don't define, since <stddef.h> does that.
2001-12-09(mode_compile): Add cast to avoid warning aboutJim Meyering
`signed and unsigned type in conditional expression'.
2001-11-19(mode_adjust): Fix error introduced on 1999-04-26Jim Meyering
that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable rather than group writable. Patch by Juan F. Codagnone.
2001-01-07normalize spelling in commentJim Meyering
2000-12-29Do not assume that mode_t uses theJim Meyering
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.
2000-10-31Remove "2000" from Copyright line, as the file hasn't beenJim Meyering
changed this year other than in the copyright notice.
2000-01-12(mode_compile): Use uintmax_t, not unsignedJim Meyering
long, to parse numeric modes. Check for any unknown bits, not just unknown bits left of the leftmost known bit.
1999-04-26(make_node_op_equals, mode_compile, mode_create_from_ref, mode_adjust):Jim Meyering
Use proper mode_t types and macros. Don't assume the traditional Unix values for mode bits. modechange.h now includes sys/types.h. Include xstrtol.h. (isodigit, oatoi): Remove. (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined. (CHMOD_MODE_BITS): New macro. (mode_compile): Convert from octal with xstrtoul, not our own routine.
1999-03-30(make_node_op_equals): New function.Jim Meyering
(mode_append_entry): Likewise. (mode_compile): When none of [ugoa] is specified in an `=OP' change mode request, insert a `=0' entry into the linked list so that all bits are cleared first. Use the new functions.
1999-03-28(mode_compile): Upon allocation failure, freeJim Meyering
everything starting with the head, not the tail.
1998-09-19Fix post-protoization typo.Jim Meyering
1998-09-09(oatoi): declare arg to be constJim Meyering
1998-09-09Protoize.Jim Meyering
1997-08-03(mode_create_from_ref): Remove dcl of unused local, I.Jim Meyering
1997-07-29(mode_create_from_ref): Don't use umask.Jim Meyering
Don't use MODE_X_IF_ANY_X.
1997-07-06(mode_create_from_ref): New function.Jim Meyering
1996-10-29.Jim Meyering
1996-09-28.Jim Meyering
1996-07-15update FSF address in copyrightJim Meyering
1996-05-16(mode_compile): Declare parameter MODE_STRING const.Jim Meyering
Remove register attribute. (mode_adjust): Likewise for CHANGES.
1994-10-02merge with 3.9hJim Meyering
1994-08-27.Jim Meyering
1994-07-01.Jim Meyering
1992-10-31Initial revisionJim Meyering