freeipa/ipaclient
Rob Crittenden a9bb811296 Check for file permissions after the ca/cert-show is complete
The commands ca-show and cert-show provide the ability to direct
the certificate output to a file. If the requested object was
not present then this resulted in a zero-length file.

This is because the check to determine if the file was writable,
by opening it, was done prior to the operation to retrieve
the entry.

So move the check after the data retrieval.

Also convert cert-show to be more consistent with ca-show.

I considered cleaning up the empty file afterward but IMHO we
shouldn't touch the file until we're ready to write. This
costs an API roundtrip but its a small price to pay for
potentially protecting existing data.

Fixes: https://pagure.io/freeipa/issue/9562

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2024-04-02 23:06:43 +02:00
..
install Move ipalib.install.kinit to ipalib 2024-03-27 18:07:17 +01:00
plugins Check for file permissions after the ca/cert-show is complete 2024-04-02 23:06:43 +02:00
remote_plugins pylint: fix errors 2024-01-09 08:40:47 +01:00
__init__.py Split ipa-client/ into ipaclient/ (Python library) and client/ (C, scripts) 2016-01-27 12:09:02 +01:00
__main__.py Use entry_points for ipa CLI 2017-04-11 13:29:50 +02:00
discovery.py Unify access to FQDN 2020-10-26 17:11:19 +11:00
frontend.py pylint: remove unneeded disable=unused-private-member 2023-01-10 08:30:58 +01:00
Makefile.am Build: Makefiles for Python packages 2016-11-09 13:08:32 +01:00
setup.cfg Port all setup.py to setuptools 2016-10-20 18:43:37 +02:00
setup.py Remove support for csrgen 2021-01-21 13:51:45 +01:00