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

System.UnauthorizedAccessException: 'Access to the path is denied.' When Create Publisher #6

Open
cbfrank opened this issue May 16, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@cbfrank
Copy link

cbfrank commented May 16, 2021

Hi
On windows, there is System.UnauthorizedAccessException: 'Access to the path is denied.' if the publisher and subscriber are created by different accounts in different processes.
for example, a windows service process create a subscriber, later, when an user application try to create the publisher, the exception will be thrown. Can we create the memory mapped file that can be accessed by all everyone?

Thanks

@fabalo76
Copy link

fabalo76 commented Jun 3, 2021

@cbfrank . Same problem here, when running the Main application as Windows Service under LocalSystem Account. The other apps running under a normal account can't access the Queue Semaphore with Access denied error.
I made a patch to Cloudtoid.Interprocess package to make the Named Semaphore accessible to Everyone..
Check the solution here
https://github.com/fabalo76/interprocess/tree/WinSemaphoreACLs

As this is an unofficial branch (pending to merge with official branch) and only tested in Windows ,you have to install the package manually in your visual studio.
You could compile it by yourself or try my binary package
Cloudtoid.Interprocess.1.0.156.zip

Check the source code for Semaphore/Windows/SemaphoreWindows.cs
image

@cocowalla
Copy link

@fabalo76 I'm not sure giving the Everyone account full control is the best idea from a security perspective. Ideally, you'd be able to configure it, so you can grant the required access rights only for the actual accounts at either end of the pipe.

@prezaei
Copy link
Member

prezaei commented Jul 11, 2021

Hey folks, any suggestions on the best way to provide a solution here? I'd be happy to implement it.

@prezaei prezaei self-assigned this Nov 19, 2022
@prezaei prezaei added enhancement New feature or request help wanted Extra attention is needed labels Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants