diff --git a/salt/common/tools/sbin/so-status b/salt/common/tools/sbin/so-status index f604f892d..4a12d71b4 100755 --- a/salt/common/tools/sbin/so-status +++ b/salt/common/tools/sbin/so-status @@ -170,7 +170,8 @@ def main(): if "-h" in options or "--help" in options or "-?" in options: showUsage(options, None) - if os.environ["USER"] != "root": + proc = subprocess.run(['id', '-u'], stdout=subprocess.PIPE, encoding="utf-8") + if proc.stdout.strip() != "0": fail("This program must be run as root") console = Console()