This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.1
in repository 389-ds-base.
commit 3dad1f3621a0bc858db544f93656b8441d7aac82
Author: William Brown <william(a)blackhats.net.au>
AuthorDate: Mon Dec 30 14:18:16 2019 +1100
Ticket 50798 - incorrect bytes in format string
Bug Description: We did not use ensure_bytes on a command output in
format strings. Python 3 subprocess returens bytes, but format string
expects utf8
Fix Description: Wrap the values in the correct safety wrappers.
https://pagure.io/389-ds-base/issue/50798
Author: William Brown <william(a)blackhats.net.au>
Review by: mreynolds, mhonek (Thanks)
---
src/lib389/lib389/instance/remove.py | 5 ++++-
src/lib389/lib389/instance/setup.py | 5 ++++-
src/lib389/lib389/utils.py | 5 ++++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/lib389/lib389/instance/remove.py b/src/lib389/lib389/instance/remove.py
index c9a872e..41eaeb4 100644
--- a/src/lib389/lib389/instance/remove.py
+++ b/src/lib389/lib389/instance/remove.py
@@ -102,7 +102,10 @@ def remove_ds_instance(dirsrv, force=False):
result = subprocess.run(["systemctl", "disable",
"dirsrv(a){}".format(dirsrv.serverid)],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- _log.debug(f"CMD: {' '.join(result.args)} ; STDOUT: {result.stdout}
; STDERR: {result.stderr}")
+ args = ' '.join(ensure_list_str(result.args))
+ stdout = ensure_str(result.stdout)
+ stderr = ensure_str(result.stderr)
+ _log.debug(f"CMD: {args} ; STDOUT: {stdout} ; STDERR: {stderr}")
_log.debug("Removing %s" % tmpfiles_d_path)
try:
diff --git a/src/lib389/lib389/instance/setup.py b/src/lib389/lib389/instance/setup.py
index 073c7c7..ae814d1 100644
--- a/src/lib389/lib389/instance/setup.py
+++ b/src/lib389/lib389/instance/setup.py
@@ -783,7 +783,10 @@ class SetupDs(object):
# Should create the symlink we need, but without starting it.
result = subprocess.run(["systemctl", "enable",
"dirsrv@%s" % slapd['instance_name']],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- self.log.debug(f"CMD: {' '.join(result.args)} ; STDOUT:
{result.stdout} ; STDERR: {result.stderr}")
+ args = ' '.join(ensure_list_str(result.args))
+ stdout = ensure_str(result.stdout)
+ stderr = ensure_str(result.stderr)
+ self.log.debug(f"CMD: {args} ; STDOUT: {stdout} ; STDERR:
{stderr}")
# Setup tmpfiles_d
tmpfile_d = ds_paths.tmpfiles_d + "/dirsrv-" +
slapd['instance_name'] + ".conf"
diff --git a/src/lib389/lib389/utils.py b/src/lib389/lib389/utils.py
index 292d1a7..a2c1b6a 100644
--- a/src/lib389/lib389/utils.py
+++ b/src/lib389/lib389/utils.py
@@ -304,7 +304,10 @@ def selinux_label_port(port, remove_label=False):
"-p", "tcp", str(port)],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
- log.debug(f"CMD: {' '.join(result.args)} ; STDOUT:
{result.stdout} ; STDERR: {result.stderr}")
+ args = ' '.join(ensure_list_str(result.args))
+ stdout = ensure_str(result.stdout)
+ stderr = ensure_str(result.stderr)
+ log.debug(f"CMD: {args} ; STDOUT: {stdout} ; STDERR:
{stderr}")
return
except (OSError, subprocess.CalledProcessError) as e:
label_ex = e
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.