Skip to content

Commit

Permalink
Improve error message when ptrace_scope is enabled
Browse files Browse the repository at this point in the history
The suggested command-line doesn't work if the user is not logged as
root.  Hence provide another that works even if logged as an ordinary
user with sudo privileges.

Signed-off-by: Giuliano Belinassi <[email protected]>
  • Loading branch information
giulianobelinassi committed Feb 5, 2025
1 parent d92addf commit a4a1f9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/ulp.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@ main(int argc, char **argv, char *envp[] __attribute__((unused)))
/* Check if command requires ptrace. */
if (requires_ptrace(arguments.command) &&
check_ptrace_scope() == false) {
WARN("System has 'ptrace_scope' enabled. Please become root or disable it"
WARN("System has 'ptrace_scope' enabled. Please become root or disable it "
"by setting:\n\n"
"$ sudo echo 0 > /proc/sys/kernel/yama/ptrace_scope\n\n"
"$ echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope\n\n"
"and try again.");
return EPERM;
}
Expand Down

0 comments on commit a4a1f9d

Please sign in to comment.