findutils-patches
[Top][All Lists]
Advanced

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

Re: [Findutils-patches] [PATCH] Fix Savannah bug #15384, find misbehaves


From: James Youngman
Subject: Re: [Findutils-patches] [PATCH] Fix Savannah bug #15384, find misbehaves when parent directory is not readable. 2007-12-02 James Youngman <address@hidden>
Date: Tue, 4 Dec 2007 01:23:15 +0000

I opted for a more conservative approach by applying this additional patch also:

2007-12-04  James Youngman  <address@hidden>

        * find/find.c (safely_chdir): When O_NOFOLLOW is available, fall
        through to using safely_chdir_lstat only when
        safely_chdir_nofollow returns SafeChdirFailDestUnreadable.
---
 find/find.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/find/find.c b/find/find.c
index 6a3976a..1688cf7 100644
--- a/find/find.c
+++ b/find/find.c
@@ -882,8 +882,18 @@ safely_chdir(const char *dest,
     {
       result = safely_chdir_nofollow(dest, direction, statbuf_dest,
                                     symlink_follow_option, did_stat);
-      if (SafeChdirOK == result)
-       return result;
+      if (SafeChdirFailDestUnreadable != result)
+       {
+         return result;
+       }
+      else
+       {
+         /* Savannah bug #15384: fall through to use safely_chdir_lstat
+          * if the directory is not readable.
+          */
+         /* Do nothing. */
+       }
+
     }
   /* Even if O_NOFOLLOW is available, we may need to use the alternative
    * method, since parent of the start point may be executable but not
-- 
1.5.3.6




reply via email to

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