From 3e5eb55514bd3158fce8ba58dc7bc68224dec255 Mon Sep 17 00:00:00 2001 From: Nir Bar Date: Tue, 28 May 2024 10:13:57 +0300 Subject: [PATCH] ExecOn: Allow obfuscating stdout/stderr text in the log file --- src/PanelSwCustomActions/ExecOnComponent.cpp | 71 +++++++++++++------ src/PanelSwCustomActions/ExecOnComponent.h | 4 +- src/PanelSwWixExtension/PanelSwWixCompiler.cs | 6 ++ .../Symbols/PSW_ExecOnComponent.cs | 7 ++ .../Xsd/PanelSwWixExtension.xsd | 5 ++ src/ProtoCaLib/execOnDetails.proto | 3 + src/TidyBuild.custom.props | 2 +- .../ExecOnComponentUT/ExecOnComponentUT.wxs | 6 +- .../ExecOnComponentUT/non-printable.txt | 3 +- 9 files changed, 80 insertions(+), 27 deletions(-) diff --git a/src/PanelSwCustomActions/ExecOnComponent.cpp b/src/PanelSwCustomActions/ExecOnComponent.cpp index 700acd87..888cdc6f 100644 --- a/src/PanelSwCustomActions/ExecOnComponent.cpp +++ b/src/PanelSwCustomActions/ExecOnComponent.cpp @@ -49,7 +49,7 @@ enum Flags }; extern HMODULE g_hInstCADLL; -static HRESULT ScheduleExecution(LPCWSTR szId, const CWixString& szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, CExecOnComponent::ExitCodeMap *pExitCodeMap, std::vector *pConsoleOuput, CExecOnComponent::EnvironmentMap *pEnv, int nFlags, int errorHandling, CExecOnComponent* pBeforeStop, CExecOnComponent* pAfterStop, CExecOnComponent* pBeforeStart, CExecOnComponent* pAfterStart); +static HRESULT ScheduleExecution(LPCWSTR szId, const CWixString& szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, CExecOnComponent::ExitCodeMap *pExitCodeMap, std::vector *pConsoleOuput, CExecOnComponent::EnvironmentMap *pEnv, int nFlags, int errorHandling, CExecOnComponent* pBeforeStop, CExecOnComponent* pAfterStop, CExecOnComponent* pBeforeStart, CExecOnComponent* pAfterStart, LPCWSTR szObfuscateLog); extern "C" UINT __stdcall ExecuteCommand(MSIHANDLE hInstall) { @@ -134,7 +134,7 @@ extern "C" UINT __stdcall ExecuteCommand(MSIHANDLE hInstall) ExitOnFailure(hr, "Failed to msi-format working folder"); } - hr = cad.AddExec(szCommand, (LPCWSTR)szWorkingFolder, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, flags, errorHandling); + hr = cad.AddExec(szCommand, (LPCWSTR)szWorkingFolder, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, flags, errorHandling, nullptr); ExitOnFailure(hr, "Failed to create command"); hr = cad.SetCustomActionData((LPCWSTR)szId); @@ -179,7 +179,7 @@ extern "C" UINT __stdcall ExecOnComponent(MSIHANDLE hInstall) ExitOnNull((hr == S_OK), hr, E_FAIL, "Table does not exist 'PSW_ExecOn_ConsoleOutput'. Have you authored 'PanelSw:ExecOn' entries in WiX code?"); // Execute view - hr = WcaOpenExecuteView(L"SELECT `Id`, `Component_`, `Binary_`, `Command`, `WorkingDirectory`, `Flags`, `ErrorHandling`, `User_` FROM `PSW_ExecOnComponent` ORDER BY `Order`", &hView); + hr = WcaOpenExecuteView(L"SELECT `Id`, `Component_`, `Binary_`, `Command`, `WorkingDirectory`, `Flags`, `ErrorHandling`, `User_`, `ObfuscateLog` FROM `PSW_ExecOnComponent` ORDER BY `Order`", &hView); ExitOnFailure(hr, "Failed to execute SQL query."); // Iterate records @@ -194,6 +194,7 @@ extern "C" UINT __stdcall ExecOnComponent(MSIHANDLE hInstall) CWixString userId, domain, user, password; CWixString szSubQuery; CWixString szTempFile; + CWixString szObfuscateLog; int nFlags = 0; int errorHandling = ErrorHandling::fail; WCA_TODO compAction = WCA_TODO_UNKNOWN; @@ -217,6 +218,8 @@ extern "C" UINT __stdcall ExecOnComponent(MSIHANDLE hInstall) ExitOnFailure(hr, "Failed to get ErrorHandling."); hr = WcaGetRecordString(hRecord, 8, (LPWSTR*)userId); ExitOnFailure(hr, "Failed to get User_."); + hr = WcaGetRecordFormattedString(hRecord, 9, (LPWSTR*)szObfuscateLog); + ExitOnFailure(hr, "Failed to get ObfuscateLog."); // Execute from binary if (!szBinary.IsNullOrEmpty()) @@ -398,12 +401,12 @@ extern "C" UINT __stdcall ExecOnComponent(MSIHANDLE hInstall) case WCA_TODO::WCA_TODO_INSTALL: if (nFlags & Flags::OnInstall) { - hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oDeferredBeforeStop, &oDeferredAfterStop, &oDeferredBeforeStart, &oDeferredAfterStart); + hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oDeferredBeforeStop, &oDeferredAfterStop, &oDeferredBeforeStart, &oDeferredAfterStart, (LPCWSTR)szObfuscateLog); ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId); } if (nFlags & Flags::OnInstallRollback) { - hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oRollbackBeforeStop, &oRollbackAfterStop, &oRollbackBeforeStart, &oRollbackAfterStart); + hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oRollbackBeforeStop, &oRollbackAfterStop, &oRollbackBeforeStart, &oRollbackAfterStart, (LPCWSTR)szObfuscateLog); ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId); } break; @@ -411,12 +414,12 @@ extern "C" UINT __stdcall ExecOnComponent(MSIHANDLE hInstall) case WCA_TODO::WCA_TODO_REINSTALL: if (nFlags & Flags::OnReinstall) { - hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oDeferredBeforeStop, &oDeferredAfterStop, &oDeferredBeforeStart, &oDeferredAfterStart); + hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oDeferredBeforeStop, &oDeferredAfterStop, &oDeferredBeforeStart, &oDeferredAfterStart, (LPCWSTR)szObfuscateLog); ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId); } if (nFlags & Flags::OnReinstallRollback) { - hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oRollbackBeforeStop, &oRollbackAfterStop, &oRollbackBeforeStart, &oRollbackAfterStart); + hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oRollbackBeforeStop, &oRollbackAfterStop, &oRollbackBeforeStart, &oRollbackAfterStart, (LPCWSTR)szObfuscateLog); ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId); } break; @@ -424,12 +427,12 @@ extern "C" UINT __stdcall ExecOnComponent(MSIHANDLE hInstall) case WCA_TODO::WCA_TODO_UNINSTALL: if (nFlags & Flags::OnRemove) { - hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oDeferredBeforeStop, &oDeferredAfterStop, &oDeferredBeforeStart, &oDeferredAfterStart); + hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oDeferredBeforeStop, &oDeferredAfterStop, &oDeferredBeforeStart, &oDeferredAfterStart, (LPCWSTR)szObfuscateLog); ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId); } if (nFlags & Flags::OnRemoveRollback) { - hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oRollbackBeforeStop, &oRollbackAfterStop, &oRollbackBeforeStart, &oRollbackAfterStart); + hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oRollbackBeforeStop, &oRollbackAfterStop, &oRollbackBeforeStart, &oRollbackAfterStart, (LPCWSTR)szObfuscateLog); ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId); } break; @@ -484,32 +487,32 @@ extern "C" UINT __stdcall ExecOnComponent(MSIHANDLE hInstall) return WcaFinalize(er); } -HRESULT ScheduleExecution(LPCWSTR szId, const CWixString &szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, CExecOnComponent::ExitCodeMap* pExitCodeMap, std::vector* pConsoleOuput, CExecOnComponent::EnvironmentMap* pEnv, int nFlags, int errorHandling, CExecOnComponent* pBeforeStop, CExecOnComponent* pAfterStop, CExecOnComponent* pBeforeStart, CExecOnComponent* pAfterStart) +HRESULT ScheduleExecution(LPCWSTR szId, const CWixString& szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, CExecOnComponent::ExitCodeMap* pExitCodeMap, std::vector* pConsoleOuput, CExecOnComponent::EnvironmentMap* pEnv, int nFlags, int errorHandling, CExecOnComponent* pBeforeStop, CExecOnComponent* pAfterStop, CExecOnComponent* pBeforeStart, CExecOnComponent* pAfterStart, LPCWSTR szObfuscateLog) { HRESULT hr = S_OK; if (nFlags & Flags::BeforeStopServices) { CDeferredActionBase::LogUnformatted(LOGLEVEL::LOGMSG_STANDARD, false, L"Will execute command '%ls' before StopServices", szCommand.Obfuscated()); - hr = pBeforeStop->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling); + hr = pBeforeStop->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling, szObfuscateLog); ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId); } if (nFlags & Flags::AfterStopServices) { CDeferredActionBase::LogUnformatted(LOGLEVEL::LOGMSG_STANDARD, false, L"Will execute command '%ls' after StopServices", szCommand.Obfuscated()); - hr = pAfterStop->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling); + hr = pAfterStop->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling, szObfuscateLog); ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId); } if (nFlags & Flags::BeforeStartServices) { CDeferredActionBase::LogUnformatted(LOGLEVEL::LOGMSG_STANDARD, false, L"Will execute command '%ls' before StartServices", szCommand.Obfuscated()); - hr = pBeforeStart->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling); + hr = pBeforeStart->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling, szObfuscateLog); ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId); } if (nFlags & Flags::AfterStartServices) { CDeferredActionBase::LogUnformatted(LOGLEVEL::LOGMSG_STANDARD, false, L"Will execute command '%ls' after StartServices", szCommand.Obfuscated()); - hr = pAfterStart->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling); + hr = pAfterStart->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling, szObfuscateLog); ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId); } @@ -524,7 +527,7 @@ CExecOnComponent::CExecOnComponent() , _stdoutPrompter((DWORD)PSW_MSI_MESSAGES::PSW_MSI_MESSAGES_EXEC_ON_CONSOLE_ERROR) { } -HRESULT CExecOnComponent::AddExec(const CWixString &szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, ExitCodeMap* pExitCodeMap, vector* pConsoleOuput, EnvironmentMap* pEnv, int nFlags, ErrorHandling errorHandling) +HRESULT CExecOnComponent::AddExec(const CWixString& szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, ExitCodeMap* pExitCodeMap, vector* pConsoleOuput, EnvironmentMap* pEnv, int nFlags, ErrorHandling errorHandling, LPCWSTR szObfuscateLog) { HRESULT hr = S_OK; ::com::panelsw::ca::Command* pCmd = nullptr; @@ -544,6 +547,10 @@ HRESULT CExecOnComponent::AddExec(const CWixString &szCommand, LPCWSTR szWorking { pDetails->set_workingdirectory(szWorkingDirectory, WSTR_BYTE_SIZE(szWorkingDirectory)); } + if (szObfuscateLog && *szObfuscateLog) + { + pDetails->set_obfuscatelog(szObfuscateLog, WSTR_BYTE_SIZE(szObfuscateLog)); + } pDetails->set_async(nFlags & Flags::ASync); pDetails->set_impersonate(nFlags & Flags::Impersonate); pDetails->set_errorhandling(errorHandling); @@ -624,6 +631,7 @@ HRESULT CExecOnComponent::ExecuteOne(const com::panelsw::ca::ExecOnDetails& deta LPCWSTR szDomain = nullptr; LPCWSTR szUser = nullptr; LPCWSTR szPassword = nullptr; + LPCWSTR szObfuscateLog = nullptr; CWixString szLog; HANDLE hStdOut = INVALID_HANDLE_VALUE; HANDLE hProc = NULL; @@ -651,6 +659,10 @@ HRESULT CExecOnComponent::ExecuteOne(const com::panelsw::ca::ExecOnDetails& deta { szPassword = (LPCWSTR)(LPVOID)details.password().data(); } + if (details.obfuscatelog().size() > 0) + { + szObfuscateLog = (LPCWSTR)(LPVOID)details.obfuscatelog().data(); + } _errorPrompter.SetErrorHandling((PSW_ERROR_HANDLING)details.errorhandling()); _alwaysPrompter.SetErrorHandling((PSW_ERROR_HANDLING)details.errorhandling()); @@ -681,7 +693,7 @@ HRESULT CExecOnComponent::ExecuteOne(const com::panelsw::ca::ExecOnDetails& deta if (SUCCEEDED(hr)) { - LogProcessOutput(hProc, hStdOut, ((details.consoleouputremap_size() > 0) || (details.errorhandling() == ErrorHandling::promptAlways)) ? (LPWSTR*)szLog : nullptr); + LogProcessOutput(hProc, hStdOut, szObfuscateLog, ((details.consoleouputremap_size() > 0) || (details.errorhandling() == ErrorHandling::promptAlways)) ? (LPWSTR*)szLog : nullptr); hr = ProcWaitForCompletion(hProc, INFINITE, &exitCode); if (SUCCEEDED(hr)) @@ -740,7 +752,7 @@ HRESULT CExecOnComponent::ExecuteOne(const com::panelsw::ca::ExecOnDetails& deta return hr; } -HRESULT CExecOnComponent::LogProcessOutput(HANDLE hProcess, HANDLE hStdErrOut, LPWSTR* pszText /* Need to detect whether this is unicode or multibyte */) +HRESULT CExecOnComponent::LogProcessOutput(HANDLE hProcess, HANDLE hStdErrOut, LPCWSTR szObfuscateLog, LPWSTR* pszText /* Need to detect whether this is unicode or multibyte */) { DWORD dwBufferSize = 0; DWORD dwBytes = 0; @@ -847,7 +859,18 @@ HRESULT CExecOnComponent::LogProcessOutput(HANDLE hProcess, HANDLE hStdErrOut, L } while (szLogEnd && *szLogEnd) { - LogUnformatted(LOGLEVEL::LOGMSG_STANDARD, true, L"%.*ls", (szLogEnd - (szLog + dwLogStart)), szLog + dwLogStart); + CWixString szLogLine; + + hr = szLogLine.Format(L"%.*ls", (szLogEnd - (szLog + dwLogStart)), szLog + dwLogStart); + ExitOnFailure(hr, "Failed to format log line"); + + if (szObfuscateLog && *szObfuscateLog && szLogLine.StrLen()) + { + hr = szLogLine.ReplaceAll(szObfuscateLog, L"******"); + ExitOnFailure(hr, "Failed to obfuscate log line"); + } + + LogUnformatted(LOGLEVEL::LOGMSG_STANDARD, true, L"%ls", (LPCWSTR)szLogLine); // Go past \n or \r\n if ((szLogEnd[0] == L'\r') && (szLogEnd[1] == L'\n')) @@ -887,7 +910,15 @@ HRESULT CExecOnComponent::LogProcessOutput(HANDLE hProcess, HANDLE hStdErrOut, L // Print any text that didn't end with a new line if (szLog && (szLog[dwLogStart] != NULL)) { - LogUnformatted(LOGMSG_STANDARD, true, L"%ls", szLog + dwLogStart); + CWixString szLogLine(szLog + dwLogStart); + + if (szObfuscateLog && *szObfuscateLog && szLogLine.StrLen()) + { + hr = szLogLine.ReplaceAll(szObfuscateLog, L"******"); + ExitOnFailure(hr, "Failed to obfuscate log line"); + } + + LogUnformatted(LOGMSG_STANDARD, true, L"%ls", (LPCWSTR)szLogLine); } // Return full log to the caller @@ -1111,7 +1142,7 @@ HRESULT CExecOnComponent::LaunchProcess(IMPERSONATION_CONTEXT* pctxImpersonation } bRes = ::CreateProcessAsUserW(pctxImpersonation->hUserToken, nullptr, szCommand, nullptr, nullptr, TRUE, ::GetPriorityClass(::GetCurrentProcess()) | CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT, (LPVOID)rgszEnvironment, szWorkingDirectory, &si, &pi); - ExitOnNullWithLastError(bRes, hr, "Failed to create process"); + ExitOnNullWithLastError(bRes, hr, "Failed to create impersonated process"); } else { diff --git a/src/PanelSwCustomActions/ExecOnComponent.h b/src/PanelSwCustomActions/ExecOnComponent.h index ad74a26e..16a52464 100644 --- a/src/PanelSwCustomActions/ExecOnComponent.h +++ b/src/PanelSwCustomActions/ExecOnComponent.h @@ -16,7 +16,7 @@ class CExecOnComponent : CExecOnComponent(); - HRESULT AddExec(const CWixString &szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, ExitCodeMap *pExitCodeMap, std::vector *pConsoleOuput, EnvironmentMap *pEnv, int nFlags, com::panelsw::ca::ErrorHandling errorHandling); + HRESULT AddExec(const CWixString &szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, ExitCodeMap *pExitCodeMap, std::vector *pConsoleOuput, EnvironmentMap *pEnv, int nFlags, com::panelsw::ca::ErrorHandling errorHandling, LPCWSTR szObfuscateLog); protected: @@ -47,7 +47,7 @@ class CExecOnComponent : HRESULT SetEnvironment(CWixString *pszEnvironmentMultiSz, const ::google::protobuf::Map &customEnv); - HRESULT LogProcessOutput(HANDLE hProc, HANDLE hStdErrOut, LPWSTR *pszText); + HRESULT LogProcessOutput(HANDLE hProc, HANDLE hStdErrOut, LPCWSTR szObfuscateLog, LPWSTR *pszText); HRESULT LaunchProcess(IMPERSONATION_CONTEXT* pctxImpersonation, LPWSTR szCommand, LPCWSTR szWorkingDirectory, LPCWSTR rgszEnvironment, HANDLE* phProcess, HANDLE* phStdOut); diff --git a/src/PanelSwWixExtension/PanelSwWixCompiler.cs b/src/PanelSwWixExtension/PanelSwWixCompiler.cs index a6ad9199..fa4fc8c1 100644 --- a/src/PanelSwWixExtension/PanelSwWixCompiler.cs +++ b/src/PanelSwWixExtension/PanelSwWixCompiler.cs @@ -2404,6 +2404,7 @@ private void ParseExecOnComponentElement(IntermediateSection section, XElement e string binary = null; string command = null; string workDir = null; + string obfuscateLog = null; ExecOnComponentFlags flags = ExecOnComponentFlags.None; ErrorHandling errorHandling = ErrorHandling.fail; int order = 1000000000 + sourceLineNumbers.LineNumber ?? 0; @@ -2426,6 +2427,10 @@ private void ParseExecOnComponentElement(IntermediateSection section, XElement e workDir = ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); break; + case "ObfuscateLog": + obfuscateLog = ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Order": order = ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, -1000000000, 1000000000); if (order < 0) @@ -2583,6 +2588,7 @@ private void ParseExecOnComponentElement(IntermediateSection section, XElement e row.ErrorHandling = (int)errorHandling; row.Order = order; row.User_ = user; + row.ObfuscateLog = obfuscateLog; } // ExitCode mapping diff --git a/src/PanelSwWixExtension/Symbols/PSW_ExecOnComponent.cs b/src/PanelSwWixExtension/Symbols/PSW_ExecOnComponent.cs index 82958998..f1a35c94 100644 --- a/src/PanelSwWixExtension/Symbols/PSW_ExecOnComponent.cs +++ b/src/PanelSwWixExtension/Symbols/PSW_ExecOnComponent.cs @@ -28,6 +28,7 @@ public static IEnumerable ColumnDefinitions new ColumnDefinition(nameof(ErrorHandling), ColumnType.Number, 2, false, false, ColumnCategory.Integer, minValue: 0, maxValue: 3), new ColumnDefinition(nameof(Order), ColumnType.Number, 4, false, false, ColumnCategory.Integer, minValue: 0, maxValue: int.MaxValue), new ColumnDefinition(nameof(User_), ColumnType.String, 72, false, true, ColumnCategory.Identifier, modularizeType: ColumnModularizeType.Column, keyTable: "Wix4User", keyColumn: 1), + new ColumnDefinition(nameof(ObfuscateLog), ColumnType.Localized, 0, false, true, ColumnCategory.Formatted, modularizeType: ColumnModularizeType.Property), }; } } @@ -85,5 +86,11 @@ public string User_ get => Fields[7].AsString(); set => this.Set(7, value); } + + public string ObfuscateLog + { + get => Fields[8].AsString(); + set => this.Set(8, value); + } } } diff --git a/src/PanelSwWixExtension/Xsd/PanelSwWixExtension.xsd b/src/PanelSwWixExtension/Xsd/PanelSwWixExtension.xsd index 32a37bf8..d98e97f3 100644 --- a/src/PanelSwWixExtension/Xsd/PanelSwWixExtension.xsd +++ b/src/PanelSwWixExtension/Xsd/PanelSwWixExtension.xsd @@ -1297,6 +1297,11 @@ Note that build-time resolution may be harmed by this process. For example, MsiA + + + + + diff --git a/src/ProtoCaLib/execOnDetails.proto b/src/ProtoCaLib/execOnDetails.proto index dea4fb5c..37b96544 100644 --- a/src/ProtoCaLib/execOnDetails.proto +++ b/src/ProtoCaLib/execOnDetails.proto @@ -33,4 +33,7 @@ message ExecOnDetails{ // Impersonate current user bool impersonate = 12; + + // Text to obfuscate in the log file + bytes obfuscateLog = 13; } diff --git a/src/TidyBuild.custom.props b/src/TidyBuild.custom.props index d4451833..5b6ea4d5 100644 --- a/src/TidyBuild.custom.props +++ b/src/TidyBuild.custom.props @@ -2,7 +2,7 @@ - 5.0.3 + 5.1.0 $(FullVersion).$(GITHUB_RUN_NUMBER) PanelSwWixExtension Panel::Software diff --git a/src/UnitTests/ExecOnComponentUT/ExecOnComponentUT.wxs b/src/UnitTests/ExecOnComponentUT/ExecOnComponentUT.wxs index 36c05d67..e239ab72 100644 --- a/src/UnitTests/ExecOnComponentUT/ExecOnComponentUT.wxs +++ b/src/UnitTests/ExecOnComponentUT/ExecOnComponentUT.wxs @@ -25,18 +25,18 @@ - + - + - + diff --git a/src/UnitTests/ExecOnComponentUT/non-printable.txt b/src/UnitTests/ExecOnComponentUT/non-printable.txt index 25980ebe..8612119b 100644 --- a/src/UnitTests/ExecOnComponentUT/non-printable.txt +++ b/src/UnitTests/ExecOnComponentUT/non-printable.txt @@ -97,4 +97,5 @@ Running handlers: Running handlers complete [2022-04-19T18:24:17+03:00] ERROR: Exception handlers complete Chef Client failed. 10 resources updated in 11 minutes 02 seconds -אבדגהוזחט \ No newline at end of file +אבדגהוזחט +aerobase \ No newline at end of file