diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-09-21 07:45:55 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-09-21 07:45:55 +0000 |
commit | 566e7833745056a73548c02d14717aa02cc816b9 (patch) | |
tree | e63620ee3aa101883049907dabf805a88b5e9ca0 /src | |
parent | 7894743d41b5685e1679bd489ab6a57311c8c22b (diff) | |
download | gnunet-566e7833745056a73548c02d14717aa02cc816b9.tar.gz gnunet-566e7833745056a73548c02d14717aa02cc816b9.zip |
no SUID on W32
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 91ba644ec..47ef1a91f 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -2277,6 +2277,9 @@ check_gnunet_nat_binary(char *binary) | |||
2277 | { | 2277 | { |
2278 | struct stat statbuf; | 2278 | struct stat statbuf; |
2279 | char *p; | 2279 | char *p; |
2280 | #ifdef MINGW | ||
2281 | SOCKET rawsock; | ||
2282 | #endif | ||
2280 | 2283 | ||
2281 | p = get_path_from_PATH (binary); | 2284 | p = get_path_from_PATH (binary); |
2282 | if (p == NULL) | 2285 | if (p == NULL) |
@@ -2287,10 +2290,18 @@ check_gnunet_nat_binary(char *binary) | |||
2287 | return GNUNET_SYSERR; | 2290 | return GNUNET_SYSERR; |
2288 | } | 2291 | } |
2289 | GNUNET_free (p); | 2292 | GNUNET_free (p); |
2293 | #ifndef MINGW | ||
2290 | if ( (0 != (statbuf.st_mode & S_ISUID)) && | 2294 | if ( (0 != (statbuf.st_mode & S_ISUID)) && |
2291 | (statbuf.st_uid == 0) ) | 2295 | (statbuf.st_uid == 0) ) |
2292 | return GNUNET_YES; | 2296 | return GNUNET_YES; |
2293 | return GNUNET_NO; | 2297 | return GNUNET_NO; |
2298 | #else | ||
2299 | rawsock = socket (AF_INET, SOCK_RAW, IPPROTO_ICMP); | ||
2300 | if (INVALID_SOCKET == rawsock) | ||
2301 | return GNUNET_NO; /* not running as administrator */ | ||
2302 | closesocket (rawsock); | ||
2303 | return GNUNET_YES; | ||
2304 | #endif | ||
2294 | } | 2305 | } |
2295 | 2306 | ||
2296 | /** | 2307 | /** |