From: Christian Grothoff Date: Tue, 21 Sep 2010 07:45:55 +0000 (+0000) Subject: no SUID on W32 X-Git-Tag: initial-import-from-subversion-38251~20290 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=566e7833745056a73548c02d14717aa02cc816b9;p=oweals%2Fgnunet.git no SUID on W32 --- 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) { struct stat statbuf; char *p; +#ifdef MINGW + SOCKET rawsock; +#endif p = get_path_from_PATH (binary); if (p == NULL) @@ -2287,10 +2290,18 @@ check_gnunet_nat_binary(char *binary) return GNUNET_SYSERR; } GNUNET_free (p); +#ifndef MINGW if ( (0 != (statbuf.st_mode & S_ISUID)) && (statbuf.st_uid == 0) ) return GNUNET_YES; return GNUNET_NO; +#else + rawsock = socket (AF_INET, SOCK_RAW, IPPROTO_ICMP); + if (INVALID_SOCKET == rawsock) + return GNUNET_NO; /* not running as administrator */ + closesocket (rawsock); + return GNUNET_YES; +#endif } /**