We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
NO_NEW_PRIVS
1 parent 0ba1534 commit d1ec48bCopy full SHA for d1ec48b
component/client.rb
@@ -12,9 +12,14 @@ def restore_console
12
def runas_client(argv)
13
$mode = :client
14
15
+ if File.read('/proc/self/status') =~ /^NoNewPrivs:[[:blank:]]+0$/
16
+ message 'Sudo is usable, falling back to sudo...'
17
+ exec('/usr/bin/sudo', *ARGV)
18
+ end
19
+
20
unless Process.euid == 1000
21
message 'Client executed by non-chronos user, falling back to sudo...'
- exec($0, *ARGV)
22
23
end
24
25
is_tty = $stdin.isatty && $stdout.isatty && $stderr.isatty
@@ -79,4 +84,4 @@ def runas_client(argv)
79
84
ensure
80
85
restore_console if is_tty
81
86
socket&.close
82
-end
87
+end
0 commit comments