[tor-commits] [torsocks/master] execve: only include xattr.h for Linux

dgoulet at torproject.org dgoulet at torproject.org
Tue Oct 18 14:38:35 UTC 2016


commit d13977e5a4b5666eaae23deb4ffdfa313da7c078
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Tue Oct 18 10:38:28 2016 -0400

    execve: only include xattr.h for Linux
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/lib/execve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/execve.c b/src/lib/execve.c
index ec3d12c..3504b9b 100644
--- a/src/lib/execve.c
+++ b/src/lib/execve.c
@@ -16,7 +16,6 @@
  */
 
 #include <sys/types.h>
-#include <sys/xattr.h>
 #include <sys/stat.h>
 
 #include "torsocks.h"
@@ -43,6 +42,7 @@ check_cap_suid(const char *filename)
 
 /* Capabilities as such are just on Linux. */
 #ifdef __linux__
+#include <sys/xattr.h>
 	static const char *sec_cap = "security.capability";
 	ssize_t len = getxattr(filename, sec_cap, NULL, 0);
 	if (len > 0) {



More information about the tor-commits mailing list