Skip to content

Commit

Permalink
loosen up sudo check so it allows various forms of authorize
Browse files Browse the repository at this point in the history
  • Loading branch information
jlipps committed Apr 10, 2014
1 parent 01639a7 commit 959cb6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/server/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ if (require.main === module) {
logger = logFactory.get('appium');

var appiumPermStat = fs.statSync(path.resolve(__dirname, '../../package.json'));
var launchCmd = (process.env.SUDO_COMMAND || "").toLowerCase();

if (
!isWindows &&
(!_(process.env.SUDO_UID).isUndefined() || appiumPermStat.uid !== process.getuid()) &&
!(process.env.SUDO_COMMAND || "").match(/grunt authorize/)
!launchCmd.match(/authorize/)
) {
logger.error("Appium will not work if used or installed with sudo. " +
"Please rerun/install as a non-root user. If you had to install " +
Expand Down

0 comments on commit 959cb6d

Please sign in to comment.