Re: [4/5] Add option for hardlinkable cache of extracted blobs
- From
- Paul Jackson <pj@sgi.com>
- Date
- Apr 17, 2005, 19:25 UTC
- Message-ID
- <20050417122517.4b12faea.pj@sgi.com>
- In-Reply-To
- <20050417174736.GA1461@pasky.ji.cz>
Petr wrote:
> BTW, I'd just use access(F_OK) instead of stat() it I don't care about
That's a bad habit to get into.
access(2) checks with the process's real uid and gid, rather than with the effective ids as is done when actually attempting an operation. This is to allow set-UID programs to easily determine the invoking user's authority.
Using access(2) when it shouldn't be used is a common source of bugs.
I recommend _only_ using it when you require exactly the above real vs. effective id behaviour.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@engr.sgi.com> 1.650.933.1373, 1.925.600.0401