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

PgServer fails to start unless user is an Administrator #2

Merged
merged 1 commit into from
Aug 29, 2018

Conversation

kjbartel
Copy link
Contributor

  • Observe the setting of _addLocalUserAccessPermission in the constructor.
  • Change to using DirectorySecurity for querying and setting permissions.
  • Do not set access rule if already have access.

@mysticmind
Copy link
Owner

mysticmind commented Aug 28, 2018

@kjbartel the fix is to simply do the below and no other changes are required

if (_addLocalUserAccessPermission)
{
    AddLocalUserAccessPermission();
}

Also note that the AppVeyor CI tests have failed for your changes.

@kjbartel
Copy link
Contributor Author

Hi,
Yeah fair enough we could just do that. I noticed that it failed. I have no idea what appveyor does to make this even an issue. The funny thing is that it fails on our CI (teamcity) because the agent isn't an admin but has all the permissions required to write to the directory and PostgreSQL is quite happy to run. How does it even create directories if it then doesn't have access to those directories? Very strange.

It's fine to just add the check. It seems to be just a hack to get AppVeyor to work and shouldn't be needed anywhere else.

@mysticmind
Copy link
Owner

mysticmind commented Aug 29, 2018

@kjbartel If you read through the README, I had faced this issue when trying to setup AppVeyor CI and had added this logic albeit with a bug i.e. not checking the flag but by default running the AddLocalUserAccessPermission logic. The logic itself is pretty generic and not anything specific to Appveyor. Could you please share the exception you get on your end on TeamCity CI?

I went ahead and merged the PR, will release a version to Nuget shortly.

@mysticmind
Copy link
Owner

v1.1.10 available in NuGet

@kjbartel
Copy link
Contributor Author

Thanks for that.

On a TeamCity agent the error message was "The system cannot find the path specified." i.e. icacls.exe is not in the PATH for the user used for building. That is why I went the route of using the built-in .Net methods for doing this rather than using the Windows command. Obviously this didn't work for AppVeyor though as I can only assume the implementation I had didn't check recursively.

Users also had problems if they were not an Admin user as icalcs requires Administrator privileges.

@mysticmind
Copy link
Owner

@kjbartel Which Windows OS does the TeamCity run on?

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.

None yet

2 participants