-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
unauthorized access with LiteDB[BUG] in database in mode share #1992
Comments
I'm also running into this. I'm using LiteDB to log requests in a web.api app. Strangely it only happens in an Azure App Service, and doesn't have this issue when running in IIS. Both are running .Net 4.8. LiteDB is v5.0.10. First I get UnauthorizedAccessException: 2021-04-23 00:00:11.8705|ERROR|RSSProxy.Controllers.CLSController|System.UnauthorizedAccessException: Access to the path is denied. Then I get IOException for every request thereafter: 2021-04-23 00:00:13.7924|ERROR|RSSProxy.Controllers.CLSController|System.IO.IOException: The process cannot access the file 'D:\home\data\Ad.db' because it is being used by another process. Here is the data access class. It is singleton using Ninject:
|
I just put in a PR with the fix. Can you try it: #1998 |
I was also able to work around this in an Azure App Service with my change mentioned here: #1622 (comment) |
Version
Which LiteDB LiteDB" Version="5.0.10" / Windows 10 /.NET framework 4.5 are you using. (REQUIRED)
Describe the bug
I'm not getting access to the database when the application is not an administrator , database in mode share
Code to Reproduce
private LiteDB.ConnectionString configConnection;
string strConnection = @"c:\RegStatusMonitor\RegStatusMonitor.db";
Expected behavior
record saved successfully when user is not administrator in shared mode
Screenshots/Stacktrace
Failed to Record Record - [10], [System.UnauthorizedAccessException: Access to the path 'Global \ FFBAB3EC7319D08E60E44B4EA5FA83570C27F817.Mutex' was denied. || in System.IO .__ Error.WinIOError (Int32 errorCode, String maybeFullPath) || in System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode (Object userData) || in System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup (TryCode code, CleanupCode backoutCode, Object userData) || in System.Threading.Mutex.CreateMutexWithGuaranteedCleanup (Boolean initiallyOwned, String name, Boolean & createdNew, SECURITY_ATTRIBUTES secAttrs) || in System.Threading.Mutex..ctor (Boolean initiallyOwned, String name, Boolean & createdNew, MutexSecurity mutexSecurity) || in LiteDB.SharedEngine..ctor (EngineSettings settings) || in LiteDB.ConnectionString.CreateEngine () || in LiteDB.LiteDatabase..ctor (ConnectionString connectionString, BsonMapper mapper) || in RegStatusMonitor.Status.gravaPing (Int32 codigo_status, String valor_status)]
Additional context
this is a dll component that will be accessed by several non-administrator users
The text was updated successfully, but these errors were encountered: