-
Notifications
You must be signed in to change notification settings - Fork 2
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
Curious about how does balena etcher get permission to unmount disks? #78
Comments
OK so I'm a dummy, I thought I remembered that Etcher worked in Linux without asking for admin password but now I am starting to learn, it looks like on linux it spawns a privileged process: and I am suspicious that this is related: https://github.com/balena-io/etcher/blob/master/afterPack.js |
This looks related, how it reaches inside the AppImage on linux to spawn a sub-process https://github.com/balena-io/etcher/blob/master/lib/gui/app/modules/image-writer.ts#L95
|
Here is the rest of the story, how it spawns a privileged sub process differently depending on the OS: https://github.com/balena-io/etcher/blob/master/lib/gui/app/modules/image-writer.ts#L216 https://github.com/balena-io/etcher/blob/master/lib/shared/permissions.ts#L154 |
Hello, forgive my ignorance as I am primarily a web developer and not as familiar with Node.js C++ modules. However I believe that really these things should be documented for "the rest of us".
I am developing an application using https://github.com/balena-io-modules/etcher-sdk
when I run
and my code runs
then I see in the log
and
onFail()
gets called with"Unmount failed"
. This seems weird to me because according to the C code it should return "Unmount failed, access denied" when its a permissions issue: https://github.com/balena-io-modules/mountutils/blob/master/src/worker-unmount.cpp#L28I am curious how does this work in production for balena etcher? currently I am just debugging on linux but of course I want this to work cross platform later on... how to get permission to unmount disks should be documented on https://github.com/balena-io-modules/etcher-sdk or https://github.com/balena-io-modules/mountutils!
is something like CAP_NET but for unmounting disks in linux ? (a way to allow a process to unmount disks even though its not running as root) or a way to trigger a "please enter your admin password to elevate privilege" prompt for a process ??
The text was updated successfully, but these errors were encountered: