mirror of
https://github.com/balena-io/etcher.git
synced 2025-11-23 17:16:09 +00:00
fix(sdk): Load usbboot adapter on start
Change-type: patch Changelog-entry: Load usbboot adapter on start on GNU/Linux if running as root. Signed-off-by: Alexis Svinartchouk <alexis@resin.io>
This commit is contained in:
committed by
Lorenzo Alberto Maria Ambrosi
parent
fd19af23a6
commit
26779ef1fb
@@ -70,6 +70,26 @@ exports.isElevated = () => {
|
||||
return Bluebird.resolve(process.geteuid() === UNIX_SUPERUSER_USER_ID)
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Check if the current process is running with elevated permissions
|
||||
* @function
|
||||
* @public
|
||||
*
|
||||
* @description
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*
|
||||
* @example
|
||||
* permissions.isElevatedUnixSync()
|
||||
* if (isElevated) {
|
||||
* console.log('This process has elevated permissions');
|
||||
* }
|
||||
* });
|
||||
*/
|
||||
exports.isElevatedUnixSync = () => {
|
||||
return (process.geteuid() === UNIX_SUPERUSER_USER_ID)
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get environment command prefix
|
||||
* @function
|
||||
|
||||
Reference in New Issue
Block a user