-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Access Permission Issues for Datastore saved files. - Electron #514
Comments
I can't see how this has anything to do with NeDB. I would suggest asking within the Electron community how others are already handling this today. |
try changing the permissions on the file
another way is to make sure you run the app as admin or with sudo. gl` |
Initially incorrect file access rights should be fixed manually. |
Indeed hard for me to see this as relating to NeDB given this is a file permission issue, likely due to config switch between Electron versions. Also not sure I see value in having NeDB manage datafile permissions vs simply the developer? |
It is insecure to manipulate file access righs AFTER creation and writing file contents. NeDB uses default NodeJS methods fs.open and fs.writeFile and asynchronous operation.
Just refer to my pull request #549 which makes possible to specify file access mode and pass it to fs.open and fs.writeFile functions making file manipulation more secure and controllable way. |
I saw the PR indeed but I still do not think permissions should be managed by NeDB - if you are worried about security to the point of wanting to mitigate the possibility of an attacker listening to FS changes I'm not sure NeDB is the right choice. Not that it has vulnerabilities that I know of, but given the intended usecase I did not put extra care on security. |
Nice to hear from you that you're not worrying about security. The simpliest way to properly handle file permissions is to pass it to NodeJS file operations via NeDB constructor. |
I am using NeDB as a local storage for my electron app. Everything works fine except when I update my app , I want the data to be saved locally . But the new version cannot access data from files written by my old version . it throws an EACCESS : permission denied Exception.
var db = new Datastore({ filename:"PATH_TO_FILE",autoload:true});
The text was updated successfully, but these errors were encountered: