Kai
Posts: 7
Joined: Fri Oct 02, 2020 10:02 am

Database created without privileges

Hi,

in our setup we allow the users to use a trusted connection to perform the database operations. Now using this, we have one user which actually has no rights to create databases on the database server, but the setup finishes successfully, also creating the database.

Our predefined connection settings look like in the attachment.

Is there anything that we do or understand wrong about how the sql connections are handled?
Attachments
SetupSQL.png
SetupSQL.png (20.24 KiB) Viewed 3030 times
Catalin
Posts: 6584
Joined: Wed Jun 13, 2018 7:49 am

Re: Database created without privileges

Hello,

Just to make sure I fully understand your scenario:

You are launching the setup from a user account that does not have permissions, with the "Trusted Connection" option enabled and the database is still created regardless?

When the "Trusted Connection" option is used, it is the logged-on user information that is used.

After the setup is installed, could you please open "Microsoft SQL Server Management Studio" --> "Databases" --> right click on the created database --> "Properties" and check its' owner? Is the owner of the database the current logged on user? If so, could you please double check to make sure the user does indeed not have the required permissions?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Kai
Posts: 7
Joined: Fri Oct 02, 2020 10:02 am

Re: Database created without privileges

Hello Catalin,

yes, that is exactly our scenario.

I double checked now, and the owner is indeed the user in question.

I checked user's privilige directly on the database server by simply executing a 'CREATE DATABASE' statement, and it tells me:
"CREATE DATABASE permission denied in database 'master'."

Kind regards,
Kai
Kai
Posts: 7
Joined: Fri Oct 02, 2020 10:02 am

Re: Database created without privileges

Hello Catalin,

just to let you know, after some tests we found out what the issue is.

As soon as we enabled the option 'Run as administrator' under 'Install Parameters' the user could create a database despite his privileges.

This seems to be a SQL Server feature and not an Advanced Installer problem, as it is also reproducible outside of Advanced Installer if we execute SQL Management Studio with administrator rights and create a database there.
Catalin
Posts: 6584
Joined: Wed Jun 13, 2018 7:49 am

Re: Database created without privileges

Hello Kai,

First of all, thank you for your followup on this.

In fact, I have been having a look over this last night and suspected this has something to do with administrator privileges, however I was not 100% sure of it therefore I wanted to have a look over this again today.

Thank you once again for the confirmation.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”