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

Ville Skyttä ville.skytta at iki.fi
Tue Sep 27 19:52:39 UTC 2011


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?

(In case anyone wonders, the undefined "close" was flagged by pyflakes
and I took a look at the surrounding code after fixing that; I haven't
run into an actual problem with this.)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: check-cwd.patch
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20110927/f67bc9a9/attachment.ksh>


More information about the Yum-devel mailing list