[tor-commits] [torsocks/master] Ignore stderr for getcap command
dgoulet at torproject.org
dgoulet at torproject.org
Fri Feb 24 16:11:24 UTC 2017
commit 6228eabd72eda576403bf6f199881a6d39c1148e
Author: David Goulet <dgoulet at ev0ke.net>
Date: Fri Feb 24 10:47:33 2017 -0500
Ignore stderr for getcap command
On a filesystem not supporting capabilities, an error is thrown out on
stderr which is undesirable and confusing for the user.
This commit throws stderr to /dev/null. The point of this getcap is to
actually see if any capabilities are enabled or none. In the context of
an error, there are none.
Fixes #21088
Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
src/bin/torsocks.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bin/torsocks.in b/src/bin/torsocks.in
index d8522e2..552a516 100644
--- a/src/bin/torsocks.in
+++ b/src/bin/torsocks.in
@@ -144,7 +144,7 @@ torify_app ()
# This must be before torifying because getcap uses cap_get_file(3)
# via syscall(2) which breaks torsocks.
if [ -n "$getcap" ]; then
- caps=`$getcap $app_path`
+ caps=`$getcap $app_path 2>/dev/null`
fi
# Check if Apple's System Integrity Protection is enabled if the user is
More information about the tor-commits
mailing list