? autom4te.cache ? config.guess ? gnulib ? gnulib.WORKING Index: AUTHORS =================================================================== RCS file: /cvsroot/findutils/findutils/AUTHORS,v retrieving revision 1.5 diff -u -r1.5 AUTHORS --- AUTHORS 2 May 2005 23:33:08 -0000 1.5 +++ AUTHORS 25 May 2005 19:55:13 -0000 @@ -21,7 +21,7 @@ Jim Meyering Tim Wood Kevin Dalley -Paul Eggert +Paul Eggert James Youngman Jay Plett Paul Sheer Index: ChangeLog =================================================================== RCS file: /cvsroot/findutils/findutils/ChangeLog,v retrieving revision 1.66 diff -u -r1.66 ChangeLog --- ChangeLog 25 May 2005 18:49:54 -0000 1.66 +++ ChangeLog 25 May 2005 19:55:15 -0000 @@ -1,3 +1,11 @@ +2005-05-23 Paul Eggert + + Adjust to recent gnulib changes. + * import-gnulib.sh: Get config.rpath from gnulib/build-aux, + not gnulib/config. + * find/parser.c (parse_perm): Ignore umask when parsing + symbolic permissions. Adjust to new modechange API. + 2005-05-16 James Youngman * find/find.c, find/parser.c, find/pred.c, find/tree.c: Index: NEWS =================================================================== RCS file: /cvsroot/findutils/findutils/NEWS,v retrieving revision 1.72 diff -u -r1.72 NEWS --- NEWS 25 May 2005 18:50:08 -0000 1.72 +++ NEWS 25 May 2005 19:55:15 -0000 @@ -1,5 +1,12 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout) * Major changes in release 4.2.21-CVS +** Functional Changes + +The GNU extension "find ... -perm +MODE" has been withdrawn because it +is incompatible with POSIX in obscure cases like "find ... -perm ++r". +Use the new syntax "find ... -perm /MODE" instead. Old usages will +still continue to work, so long as they don't conflict with POSIX. + ** Bug Fixes find /blah/blah/blah -depth -empty now works once again. Index: import-gnulib.sh =================================================================== RCS file: /cvsroot/findutils/findutils/import-gnulib.sh,v retrieving revision 1.18 diff -u -r1.18 import-gnulib.sh --- import-gnulib.sh 4 Apr 2005 21:02:01 -0000 1.18 +++ import-gnulib.sh 25 May 2005 19:55:16 -0000 @@ -1,7 +1,7 @@ #! /bin/sh # # import-gnulib.sh -- imports a copy of gnulib into findutils -# Copyright (C) 2003,2004 Free Software Foundation, Inc. +# Copyright (C) 2003,2004,2005 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -144,5 +144,5 @@ # some reason, "autoreconf -i" doesn't fetch it. for f in config.rpath do - (set -x; cp "$1"/config/"$f" . ) + (set -x; cp "$1"/build-aux/"$f" . ) done Index: doc/find.texi =================================================================== RCS file: /cvsroot/findutils/findutils/doc/find.texi,v retrieving revision 1.78 diff -u -r1.78 find.texi --- doc/find.texi 18 Apr 2005 09:03:43 -0000 1.78 +++ doc/find.texi 25 May 2005 19:55:17 -0000 @@ -907,16 +907,16 @@ If @var{mode} starts with @samp{-}, true if @emph{all} of the permissions set in @var{mode} are set for the file; permissions not set in @var{mode} are ignored. -If @var{mode} starts with @samp{+}, true if +If @var{mode} starts with @samp{/}, true if @emph{any} of the permissions set in @var{mode} are set for the file; permissions not set in @var{mode} are ignored. +This is a GNU extension. - -If you don't use the @samp{+} or @samp{-} form with a symbolic mode +If you don't use the @samp{/} or @samp{-} form with a symbolic mode string, you may have to specify a rather complex mode string. For example @samp{-perm g=w} will only match files which have mode 0020 (that is, ones for which group write permission is the only permission -set). It is more likely that you will want to use the @samp{+} or +set). It is more likely that you will want to use the @samp{/} or @samp{-} forms, for example @samp{-perm -g=w}, which matches any file with group write permission. @@ -935,19 +935,19 @@ example the executable bit). This will match a file which has mode 0777, for example. address@hidden -perm +222 address@hidden -perm /222 Match files which are writeable by somebody (their owner, or their group, or anybody else). address@hidden -perm +022 address@hidden -perm /022 Match files which are writeable by either their owner or their group. The files don't have to be writeable by both the owner and group to be matched; either will do. address@hidden -perm +g+w,o+w address@hidden -perm /g+w,o+w As above. address@hidden -perm +g=w,o=w address@hidden -perm /g=w,o=w As above @item -perm -022 @@ -1994,7 +1994,7 @@ executable. @example -find /usr/local -type f -perm +a=x | xargs file | +find /usr/local -type f -perm /a=x | xargs file | grep 'not stripped' | cut -d: -f1 @end example @@ -2037,7 +2037,7 @@ @file{ubins}. @example -find /usr/local -type f -perm +a=x \ +find /usr/local -type f -perm /a=x \ \( -execdir unstripped '@address@hidden' \; -fprint ubins -o -fprint sbins \) @end example Index: find/parser.c =================================================================== RCS file: /cvsroot/findutils/findutils/find/parser.c,v retrieving revision 1.64 diff -u -r1.64 parser.c --- find/parser.c 16 May 2005 21:14:46 -0000 1.64 +++ find/parser.c 25 May 2005 19:55:17 -0000 @@ -1,5 +1,5 @@ /* parser.c -- convert the command line args into an expression tree. - Copyright (C) 1990, 91, 92, 93, 94, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1990, 91, 92, 93, 94, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1214,7 +1214,8 @@ { mode_t perm_val; int mode_start = 0; - struct mode_change *change; + enum permissions_type kind = PERM_EXACT; + struct mode_change *change = NULL; struct predicate *our_pred; if ((argv == NULL) || (argv[*arg_ptr] == NULL)) @@ -1223,22 +1224,56 @@ switch (argv[*arg_ptr][0]) { case '-': - case '+': mode_start = 1; + kind = PERM_AT_LEAST; break; + + case '+': + change = mode_compile (argv[*arg_ptr]); + if (NULL == change) + { + /* Most likely the caller is an old script that is still + * using the obsolete GNU syntax '-perm +MODE'. This old + * syntax was withdrawn in favor of '-perm /MODE' because + * it is incompatible with POSIX in some cases, but we + * still support uses of it that are not incompatible with + * POSIX. + */ + mode_start = 1; + kind = PERM_ANY; + } + else + { + /* This is a POSIX-compatible usage */ + mode_start = 0; + kind = PERM_EXACT; + } + break; + + case '/': /* GNU extension */ + mode_start = 1; + kind = PERM_ANY; + break; + default: - /* empty */ + /* For example, '-perm 0644', which is valid and matches + * only files whose mode is exactly 0644. + * + * We do nothing here, because mode_start and kind are already + * correctly set. + */ break; } - change = mode_compile (argv[*arg_ptr] + mode_start, MODE_MASK_PLUS); - if (change == MODE_INVALID) - error (1, 0, _("invalid mode `%s'"), argv[*arg_ptr]); - else if (change == MODE_MEMORY_EXHAUSTED) - error (1, 0, _("virtual memory exhausted")); - perm_val = mode_adjust (0, change); - mode_free (change); - + if (NULL == change) + { + change = mode_compile (argv[*arg_ptr] + mode_start); + if (NULL == change) + error (1, 0, _("invalid mode `%s'"), argv[*arg_ptr]); + } + perm_val = mode_adjust (0, change, 0); + free (change); + our_pred = insert_primary (pred_perm); switch (argv[*arg_ptr][0])