Skip to content

Install-DbaFirstResponderKit - Use the declared variable name when cloning the certificate to master - #10669

Open
andreasjordan wants to merge 1 commit into
developmentfrom
fix-installdbafirstresponderkit-signing-case
Open

Install-DbaFirstResponderKit - Use the declared variable name when cloning the certificate to master#10669
andreasjordan wants to merge 1 commit into
developmentfrom
fix-installdbafirstresponderkit-signing-case

Conversation

@andreasjordan

Copy link
Copy Markdown
Collaborator

Problem

On a case-sensitive instance, Install-DbaFirstResponderKit -PublicExecute into a user database warns Certificate signing failed ... Must declare the scalar variable "@SQL", and public never gets the promised EXECUTE permissions.

Mechanism

The batch that clones the signing certificate into master declares @sql and then runs EXEC(@SQL). Variable names follow the instance collation, so a case-sensitive server does not know @SQL. Case-insensitive instances - which is what CI has - never notice.

What changed

EXEC(@sql). One character. A scan over every @variable in public/ and private/ for names that appear in more than one casing within one file found no other site.

Tests

  • CI has no case-sensitive instance, so the regression proof is the existing context "Testing certificate signing in user database" on a case-sensitive lab instance (SQL Server 2025, SQL_Latin1_General_CP1_CS_AS): red on the old code exactly as reported above, green with the fix. Full Install-DbaFirstResponderKit.Tests.ps1 green through the testing-dbatools harness.

created by Claude and reviewed by Andreas Jordan

🤖 Generated with Claude Code

…oning the certificate to master

The certificate-cloning batch declares @SQL but executes EXEC(@SQL). On a case-sensitive
instance the server rejects that with "Must declare the scalar variable @SQL", so signing
fails and PublicExecute never grants public the permissions it promised.

(do Install-DbaFirstResponderKit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant