[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changes to the filesystem while find is running - comments?
From: |
Paul Szabo |
Subject: |
Re: Changes to the filesystem while find is running - comments? |
Date: |
Tue, 23 Nov 2004 12:38:52 +1100 (EST) |
James,
>> PARENT=stat(".");
>> SUBDIR=stat("subdir");
>> chdir("subdir");
>> DOT=stat(".");
>> if (SUBDIR != DOT) {
>> Print warning message /*[1]*/
>> }
>> else {
>> Go on with find (recurse)
>> }
>> chdir("..");
>> DOT=stat(".");
>> if (PARENT != DOT) {
>> Print message
>> Exit with fatal error
>> }
>
> Certainly. In fact it's how GNU findutils is implemented, except for
> the fact that the "warning message" is a fatal error in GNU findutils
> releases up to and including 4.2.5. In later versions (we're
> currently at 4.2.7 on ftp://alpha.gnu.org/gnu/findutils) a hack was
> introduced to try to support a special case which works when we've
> traversed an automount mount point on Solaris).
So, you already do the "where did I get back to after chdir(..)" check?
> This algorithm is certainly robust, but it will never descend into an
> automount directory hierarchy. Do you think we can do better than
> that without opening the door to more exploits?
Hmm... It would not descend into just-now-changed automounts (and it may
not be able to get back out of them), but it should be able to traverse
reasonably long-lived mounts.
Cheers,
Paul Szabo - address@hidden http://www.maths.usyd.edu.au:8000/u/psz/
School of Mathematics and Statistics University of Sydney 2006 Australia
- Re: Changes to the filesystem while find is running - comments?, (continued)
- Re: Changes to the filesystem while find is running - comments?, Steve Revilak, 2004/11/23
- Re: Changes to the filesystem while find is running - comments?, Tim Nelson, 2004/11/24
- Re: Changes to the filesystem while find is running - comments?, James Youngman, 2004/11/25
- Re: Changes to the filesystem while find is running - comments?, Tim Nelson, 2004/11/25
- Re: Changes to the filesystem while find is running - comments?, James Youngman, 2004/11/26
- Re: Changes to the filesystem while find is running - comments?, Martin Buchholz, 2004/11/26
- Re: Changes to the filesystem while find is running - comments?, Tim Nelson, 2004/11/29
Re: Changes to the filesystem while find is running - comments?, Paul Szabo, 2004/11/22
Re: Changes to the filesystem while find is running - comments?,
Paul Szabo <=
Re: Changes to the filesystem while find is running - comments?, Paul Szabo, 2004/11/23
Re: Changes to the filesystem while find is running - comments?, Paul Szabo, 2004/11/23
Re: Changes to the filesystem while find is running - comments?, Paul Szabo, 2004/11/23
Re: Changes to the filesystem while find is running - comments?, Paul Szabo, 2004/11/23