From 2368b9fa17142b10d0dde735d2d27c1a98cb0713 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Mon, 3 Aug 2020 11:07:07 -0700 Subject: [PATCH] Added root check for service install/uninstall --- agents/meshinstall-linux.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/agents/meshinstall-linux.js b/agents/meshinstall-linux.js index 52308431..479133cd 100644 --- a/agents/meshinstall-linux.js +++ b/agents/meshinstall-linux.js @@ -68,6 +68,12 @@ else if ((msh.InstallFlags & 1) == 1) { buttons.unshift("Connect"); } if ((msh.InstallFlags & 2) == 2) { + if (!require('user-sessions').isRoot()) + { + console.log('\n' + "Elevated permissions is required to install/uninstall the agent."); + console.log("Please try again with sudo."); + process.exit(); + } if (s) { if (process.platform == 'darwin' || require('message-box').kdialog)