bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #38474] Unintended (?) behaviour change of -perm +mode predicate


From: Eric Blake
Subject: [bug #38474] Unintended (?) behaviour change of -perm +mode predicate
Date: Mon, 22 Apr 2013 22:03:08 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0

Follow-up Comment #9, bug #38474 (project findutils):

Paul's patch, as modified in commit 9040c5d, is not quite right.

The bool havekind variable is now useless; it is set to true by all branches
of the switch statement.  It can safely be deleted, along with a later switch
statement when havekind is still false.

The code doesn't reject -perm /+0111.  These lines:
  if (NULL == change
      || (perm_expr[0] == '+' && '0' <= perm_expr[1] && perm_expr[1] < '8'))
should probably instead be:
  if (NULL == change
      || (perm_expr[mode_start] == '+' && c_isdigit(perm_expr[mode_start +
1]))

(Note that although c_isdigit will allow '8' and '9', those bogus digits will
have already caused the 'NULL == change' branch to be true; so it is a
reasonable simplification).


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?38474>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]