Skip to content

Commit

Permalink
cert-show: writable files does not mean dirs
Browse files Browse the repository at this point in the history
ipalib.util.check_writable_file didn't check whether the argument
is an actual file which is now fixed.

https://pagure.io/freeipa/issue/6883

Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
  • Loading branch information
stlaz authored and Tomas Krizek committed May 10, 2017
1 parent 6c061b6 commit 33b3d7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ipalib/util.py
Expand Up @@ -170,7 +170,7 @@ def check_writable_file(filename):
if filename is None:
raise errors.FileError(reason=_('Filename is empty'))
try:
if os.path.exists(filename):
if os.path.isfile(filename):
if not os.access(filename, os.W_OK):
raise errors.FileError(reason=_('Permission denied: %(file)s') % dict(file=filename))
else:
Expand Down

0 comments on commit 33b3d7a

Please sign in to comment.