client install: do not capture sudo -V stdout

ipa-client-install is checking if the sudo command is available
by calling 'sudo -V'. The call is currently using subprocess.popen
which redirects the output to the default stdout.
Use ipautil.run instead of subprocess.popen as this does not
capture stdout (the command output is just logged in the debug file).

Fixes: https://pagure.io/freeipa/issue/8767
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Florence Blanc-Renaud 2021-04-13 10:14:27 +02:00
parent 48ef179e23
commit ec8d72cf7c

View File

@ -24,7 +24,6 @@ import re
import SSSDConfig
import shutil
import socket
import subprocess
import sys
import tempfile
import textwrap
@ -2205,7 +2204,7 @@ def install_check(options):
# available.
if options.conf_sudo:
try:
subprocess.Popen(['sudo', '-V'])
ipautil.run(['sudo', '-V'])
except FileNotFoundError:
logger.info(
"The sudo binary does not seem to be present on this "