Skip to content

Commit 92f6d99

Browse files
authored
Add files via upload
1 parent a7e07c0 commit 92f6d99

5 files changed

Lines changed: 34 additions & 34 deletions

File tree

Build Scripts/FBConfigVar.vbs

136 Bytes
Binary file not shown.

Build Scripts/FBManageLog.vbs

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -271,27 +271,45 @@ Private Sub HideBuildPassword(strName)
271271
End Sub
272272

273273

274+
Function HidePasswords(strText)
275+
' Hide passwords in Text string
276+
Dim strLogText
277+
278+
strLogText = strText
279+
If Instr(strLogText, "ListPassword:") = 0 Then
280+
strLogText = HidePassword(strLogText, "DefaultPassword /d ")
281+
strLogText = HidePassword(strLogText, "Password")
282+
strLogText = HidePassword(strLogText, "PID")
283+
strLogText = HidePassword(strLogText, "Pwd")
284+
strLogText = HidePassword(strLogText, " -p ")
285+
End If
286+
HidePasswords = strLogText
287+
288+
End Function
289+
290+
274291
Private Function HidePassword(strText, strKeyword)
275292
' Change any passwords to ********
276-
Dim intIdx, intFound, intLen
293+
Dim intIdx, intFound, intLen, intStart
277294
Dim strLogText
278295

279296
strLogText = strText
280297
intLen = Len(strLogText)
281-
intIdx = Instr(1, strLogText, strKeyword, vbTextCompare)
282-
While intIdx > 0
298+
intStart = Instr(1, strLogText, strKeyword, vbTextCompare)
299+
While intStart > 0
283300
intFound = 0
284-
intIdx = intIdx + Len(strKeyword)
285-
While (Instr(""":=' ", Mid(strLogText, intIdx, 1)) > 0 ) And (intIdx < intLen)
301+
intStart = intStart + Len(strKeyword)
302+
intIdx = intStart
303+
While (Instr(""":=' ", Mid(strLogText, intIdx, 1)) > 0 ) And (intIdx < intLen) ' Look for start of password value
286304
intIdx = intIdx + 1
287305
intFound = 1
288306
Wend
289-
While (Instr(""",/' ", Mid(strLogText, intIdx, 1)) = 0) And (IntFound > 0)
307+
While (Instr(Chr(13) + """,/ ", Mid(strLogText, intIdx, 1)) = 0) And (IntFound <> 0)
290308
strLogText = Left(strLogText, intIdx - 1) & Chr(01) & Mid(strLogText, intIdx + 1)
291309
intIdx = intIdx + 1
292310
Wend
293-
intIdx = Instr(intIdx, strLogText, strKeyword, vbTextCompare)
294-
WEnd
311+
intStart = Instr(intStart, strLogText, strKeyword, vbTextCompare)
312+
Wend
295313
While Instr(strLogText, Chr(01) & Chr(01)) > 0
296314
strLogText = Replace(Replace(Replace(strLogText, Chr(01) & Chr(01) & Chr(01) & Chr(01), Chr(01)), Chr(01) & Chr(01) & Chr(01), Chr(01)), Chr(01) & Chr(01), Chr(01))
297315
Wend
@@ -301,23 +319,6 @@ Private Function HidePassword(strText, strKeyword)
301319
End Function
302320

303321

304-
Function HidePasswords(strText)
305-
' Hide passwords in Text string
306-
Dim strLogText
307-
308-
strLogText = strText
309-
If Instr(strLogText, "ListPassword:") = 0 Then
310-
strLogText = HidePassword(strLogText, "DefaultPassword /d ")
311-
strLogText = HidePassword(strLogText, "Password")
312-
strLogText = HidePassword(strLogText, "PID")
313-
strLogText = HidePassword(strLogText, "Pwd")
314-
strLogText = HidePassword(strLogText, " -p ")
315-
End If
316-
HidePasswords = strLogText
317-
318-
End Function
319-
320-
321322
Sub SetProcessId(strLabel, strDesc)
322323
' Save ProcessId details
323324

728 Bytes
Binary file not shown.
228 Bytes
Binary file not shown.

Build Scripts/Set-PBProcs.sql

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,14 @@ BEGIN;
100100
END;
101101

102102
PRINT 'CREATE CERTIFICATE _##PDW_SmDetachSigningCertificate##';
103-
DECLARE @certpasswordDCB nvarchar(max);
104-
SET @certpasswordDCB = QUOTENAME(N'$(strPBCertPassword)', N'''');
105-
EXECUTE(N'CREATE CERTIFICATE _##PDW_SmDetachSigningCertificate## ENCRYPTION BY PASSWORD = ' + @certpasswordDCB + N' WITH SUBJECT = ''For signing sp_pdw_sm_detach SP'';');
103+
DECLARE @certPassword nvarchar(max);
104+
SET @certPassword=QUOTENAME(N'$(strPBCertPassword)',N'''');
105+
EXECUTE(N'CREATE CERTIFICATE _##PDW_SmDetachSigningCertificate## ENCRYPTION BY PASSWORD = ' + @certPassword + N' WITH SUBJECT = ''For signing sp_pdw_sm_detach SP'';');
106106
WAITFOR DELAY '00:00:01';
107-
EXECUTE(N'ADD SIGNATURE to [sp_pdw_sm_detach] BY CERTIFICATE _##PDW_SmDetachSigningCertificate## WITH PASSWORD=' + @certpasswordDCB + N';');
107+
EXECUTE(N'ADD SIGNATURE to [sp_pdw_sm_detach] BY CERTIFICATE _##PDW_SmDetachSigningCertificate## WITH PASSWORD=' + @certPassword + N';');
108108
ALTER CERTIFICATE _##PDW_SmDetachSigningCertificate## REMOVE PRIVATE KEY;
109109
END;
110110
GO
111-
112111
DECLARE @certBinaryBytes varbinary(max);
113112
SET @certBinaryBytes = CERTENCODED(cert_id('_##PDW_SmDetachSigningCertificate##'));
114113
DECLARE @cmd nvarchar(max)
@@ -163,11 +162,11 @@ BEGIN;
163162
END;
164163

165164
PRINT 'CREATE CERTIFICATE _##PDW_PolyBaseAuthorizeSigningCertificate##';
166-
DECLARE @certpasswordDCB nvarchar(max);
167-
SET @certpasswordDCB = QUOTENAME(N'$(strPBCertPassword)', N'''');
168-
EXECUTE(N'CREATE CERTIFICATE _##PDW_PolyBaseAuthorizeSigningCertificate## ENCRYPTION BY PASSWORD = ' + @certpasswordDCB + N' WITH SUBJECT = ''For signing sp_pdw_polybase_authorize SP'';');
165+
DECLARE @certPassword nvarchar(max);
166+
SET @certPassword=QUOTENAME(N'$(strPBCertPassword)',N'''');
167+
EXECUTE(N'CREATE CERTIFICATE _##PDW_PolyBaseAuthorizeSigningCertificate## ENCRYPTION BY PASSWORD = ' + @certPassword + N' WITH SUBJECT = ''For signing sp_pdw_polybase_authorize SP'';');
169168
WAITFOR DELAY '00:00:01';
170-
EXECUTE(N'ADD SIGNATURE to [sp_pdw_polybase_authorize] BY CERTIFICATE _##PDW_PolyBaseAuthorizeSigningCertificate## WITH PASSWORD=' + @certpasswordDCB + N';');
169+
EXECUTE(N'ADD SIGNATURE to [sp_pdw_polybase_authorize] BY CERTIFICATE _##PDW_PolyBaseAuthorizeSigningCertificate## WITH PASSWORD=' + @certPassword + N';');
171170
ALTER CERTIFICATE _##PDW_PolyBaseAuthorizeSigningCertificate## REMOVE PRIVATE KEY;
172171
END;
173172
GO

0 commit comments

Comments
 (0)