From 33b3d7ad7ada45edbd178fe99f1257c40f39dcaa Mon Sep 17 00:00:00 2001 From: Stanislav Laznicka Date: May 10 2017 11:16:01 +0000 Subject: cert-show: writable files does not mean dirs 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 --- diff --git a/ipalib/util.py b/ipalib/util.py index 8973a19..713fc10 100644 --- a/ipalib/util.py +++ b/ipalib/util.py @@ -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: