Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqlServerLogin: Password test fails for nativ sql users #1048

Closed
claudiospizzi opened this issue Feb 19, 2018 · 2 comments · Fixed by #1049 or #1652
Closed

SqlServerLogin: Password test fails for nativ sql users #1048

claudiospizzi opened this issue Feb 19, 2018 · 2 comments · Fixed by #1049 or #1652
Labels
bug The issue is a bug.

Comments

@claudiospizzi
Copy link
Contributor

Details of the scenario you tried and the problem that is occurring:
I'm running a SQL Server 2016 deployed with DSC. One SqlServerLogin resource should set the SQL sa password to a desired value. Because there is a bug in the Connect-SQL helper function, the resource is not able to test a nativ sql user password. It tries to test the native sql login like a Windows login, which always fails.

The DSC configuration that is using the resource (as detailed as possible):
SqlServerLogin

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
Windows Server 2016, SQL Server 2016, SqlServerDsc 11.0.0.0

What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:
SQLPS, 1.0

Version of the DSC module you're using, or 'dev' if you're using current dev branch:
dev

@claudiospizzi
Copy link
Contributor Author

I've created a PR with an idea how to fix it.

@jhoneill
Copy link

I haven't checked your code, but I'm guessing you fixed the piece I referred to as
"[the] check is by calling Connect-SQL which does not set the $sql.connectionContext.secureLogin and so ONLY works with Windows logins, not SQL ones ."

There are two other problems in #1032 , one is that password is reset, so if DSC is creating a login which will have its password changed in the future DSC will try to force it back to the original, and second the password appears to be set to a secure string representation of the password. (at least on SQL 2012)

@johlju johlju added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Feb 20, 2018
johlju pushed a commit that referenced this issue Feb 21, 2018
- Changes to SqlServerLogin
  - Fix password test fails for nativ sql users (issue #1048).
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Mar 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug.
Projects
None yet
3 participants