[Yum-devel] Current dir read/write check in yummain

James Antill james at fedoraproject.org
Tue Sep 27 20:11:02 UTC 2011


On Tue, 2011-09-27 at 22:52 +0300, Ville Skyttä wrote:
> Hello,
> 
> Regarding https://bugzilla.redhat.com/show_bug.cgi?id=698795 there's
> commit d54a9385 in git.  However, open(".") does not result in
> errno.EACCES if the dir is not writable, it does for me only if it's not
> readable or not executable.  Also, at least for me it'll always throw
> some kind of an IOError when given a dir, so the "else" block is luckily
> never executed -- "luckily" because it uses close(f) when it probably
> should be using f.close().
> 
> See attached patch.  It just fixes the comment and the log entry to
> match what it actually seems to be doing, and fixes the else block.  If
> the intent is to actually check for writability of cwd, I suppose
> something different than open(".") is needed.  Thoughts?

 Pretty sure we just need read access, as rpm doesn't need to alter the
current dir. it needs to open() it so it can fchdir() back to it AIUI.
 ACK.



More information about the Yum-devel mailing list