From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5F5FD15808B for ; Sun, 3 Apr 2022 21:46:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1E287E0921; Sun, 3 Apr 2022 21:46:56 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 785F2E0921 for ; Sun, 3 Apr 2022 21:46:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 16DCD340F9E for ; Sun, 3 Apr 2022 21:46:54 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5503D250 for ; Sun, 3 Apr 2022 21:46:52 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1649022398.4a7e8d870f80b9d2f8a33a8c65d8c8c7db480637.zorry@gentoo> Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: patches/ X-VCS-Repository: proj/tinderbox-cluster X-VCS-Files: patches/secretstring.patch X-VCS-Directories: patches/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: 4a7e8d870f80b9d2f8a33a8c65d8c8c7db480637 X-VCS-Branch: master Date: Sun, 3 Apr 2022 21:46:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: a78dc854-50f9-40be-84bc-76e44fef6c17 X-Archives-Hash: cecd280a01d6b32afdd986cb68be5ca0 commit: 4a7e8d870f80b9d2f8a33a8c65d8c8c7db480637 Author: Magnus Granberg gentoo org> AuthorDate: Sun Apr 3 21:46:38 2022 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Sun Apr 3 21:46:38 2022 +0000 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=4a7e8d87 Add secret string remote shell command patch Signed-off-by: Magnus Granberg gentoo.org> patches/secretstring.patch | 74 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/patches/secretstring.patch b/patches/secretstring.patch new file mode 100644 index 0000000..4e0833d --- /dev/null +++ b/patches/secretstring.patch @@ -0,0 +1,74 @@ +diff --git a/master/buildbot/process/buildstep.py b/master/buildbot/process/buildstep.py +index 7ac18b086..82ff7ce07 100644 +--- a/master/buildbot/process/buildstep.py ++++ b/master/buildbot/process/buildstep.py +@@ -850,6 +850,7 @@ class ShellMixin: + 'sigtermTime', + 'initialStdin', + 'decodeRC', ++ 'SecretString', + ] + renderables = _shellMixinArgs + +diff --git a/master/buildbot/process/remotecommand.py b/master/buildbot/process/remotecommand.py +index 90ec4c44d..fb3099b28 100644 +--- a/master/buildbot/process/remotecommand.py ++++ b/master/buildbot/process/remotecommand.py +@@ -44,7 +44,7 @@ class RemoteCommand(base.RemoteCommandImpl): + + def __init__(self, remote_command, args, ignore_updates=False, + collectStdout=False, collectStderr=False, decodeRC=None, +- stdioLogName='stdio'): ++ stdioLogName='stdio', SecretString=False): + if decodeRC is None: + decodeRC = {0: SUCCESS} + self.logs = {} +@@ -70,6 +70,7 @@ class RemoteCommand(base.RemoteCommandImpl): + self.commandID = None + self.deferred = None + self.interrupted = False ++ self.SecretString = SecretString + # a lock to make sure that only one log-handling method runs at a time. + # This is really only a problem with old-style steps, which do not + # wait for the Deferred from one method before invoking the next. +@@ -275,6 +276,8 @@ class RemoteCommand(base.RemoteCommandImpl): + def cleanup(data): + if self.step is None: + return data ++ if self.SecretString and isinstance(self.SecretString, list) and len(self.SecretString) == 2: ++ data = data.replace(self.SecretString[0], '<' + self.SecretString[1] + '>') + return self.step.build.properties.cleanupTextFromSecrets(data) + + if self.debug: +@@ -358,7 +361,8 @@ class RemoteShellCommand(RemoteCommand): + collectStdout=False, collectStderr=False, + interruptSignal=None, + initialStdin=None, decodeRC=None, +- stdioLogName='stdio'): ++ stdioLogName='stdio', ++ SecretString=False): + if logfiles is None: + logfiles = {} + if decodeRC is None: +@@ -398,7 +402,8 @@ class RemoteShellCommand(RemoteCommand): + super().__init__("shell", args, collectStdout=collectStdout, + collectStderr=collectStderr, + decodeRC=decodeRC, +- stdioLogName=stdioLogName) ++ stdioLogName=stdioLogName, ++ SecretString=SecretString) + + def _start(self): + if self.args['usePTY'] is None: +diff --git a/master/buildbot/steps/shell.py b/master/buildbot/steps/shell.py +index d21ca7b9b..cf56a2802 100644 +--- a/master/buildbot/steps/shell.py ++++ b/master/buildbot/steps/shell.py +@@ -183,6 +183,7 @@ class ShellCommand(buildstep.ShellMixin, buildstep.BuildStep): + 'decodeRC', + 'stdioLogName', + 'workdir', ++ 'SecretString', + ] + buildstep.BuildStep.parms + + invalid_args = []