Index: src/include/plibc.h =================================================================== --- src/include/plibc.h (revision 13056) +++ src/include/plibc.h (working copy) @@ -463,8 +463,8 @@ #ifndef WINDOWS #define DIR_SEPARATOR '/' #define DIR_SEPARATOR_STR "/" - #define PATH_SEPARATOR ';' - #define PATH_SEPARATOR_STR ";" + #define PATH_SEPARATOR ':' + #define PATH_SEPARATOR_STR ":" #define NEWLINE "\n" #ifdef ENABLE_NLS @@ -556,8 +556,8 @@ #else #define DIR_SEPARATOR '\\' #define DIR_SEPARATOR_STR "\\" - #define PATH_SEPARATOR ':' - #define PATH_SEPARATOR_STR ":" + #define PATH_SEPARATOR ';' + #define PATH_SEPARATOR_STR ";" #define NEWLINE "\r\n" #ifdef ENABLE_NLS Index: src/transport/plugin_transport_udp.c =================================================================== --- src/transport/plugin_transport_udp.c (revision 13056) +++ src/transport/plugin_transport_udp.c (working copy) @@ -1999,7 +1999,7 @@ buf = GNUNET_malloc (strlen (path) + 20); pos = path; - while (NULL != (end = strchr (pos, ':'))) + while (NULL != (end = strchr (pos, PATH_SEPARATOR))) { *end = '\0'; sprintf (buf, "%s/%s", pos, binary); @@ -2033,8 +2033,18 @@ { struct stat statbuf; char *p; +#ifdef MINGW + SOCKET rawsock; +#endif +#ifdef MINGW + char *binaryexe; + GNUNET_asprintf (&binaryexe, "%s.exe", binary); + p = get_path_from_PATH (binaryexe); + free (binaryexe); +#else p = get_path_from_PATH (binary); +#endif if (p == NULL) return GNUNET_NO; if (0 != STAT (p, &statbuf)) @@ -2043,10 +2053,22 @@ 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) + { + DWORD err = GetLastError (); + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "socket (AF_INET, SOCK_RAW, IPPROTO_ICMP) have failed! GLE = %d\n", err); + return GNUNET_NO; /* not running as administrator */ + } + closesocket (rawsock); + return GNUNET_YES; +#endif } /** Index: src/transport/test_transport_api.c =================================================================== --- src/transport/test_transport_api.c (revision 13056) +++ src/transport/test_transport_api.c (working copy) @@ -470,7 +470,7 @@ buf = GNUNET_malloc (strlen (path) + 20); pos = path; - while (NULL != (end = strchr (pos, ':'))) + while (NULL != (end = strchr (pos, PATH_SEPARATOR))) { *end = '\0'; sprintf (buf, "%s/%s", pos, "gnunet-nat-server"); Index: src/transport/plugin_transport_tcp.c =================================================================== --- src/transport/plugin_transport_tcp.c (revision 13056) +++ src/transport/plugin_transport_tcp.c (working copy) @@ -2238,28 +2238,36 @@ p = getenv ("PATH"); if (p == NULL) + { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "PATH is NULL, returning.\n"); return NULL; + } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "PATH is `%s', PATH_SEPARATOR is '%c'\n", p, PATH_SEPARATOR); path = GNUNET_strdup (p); /* because we write on it */ buf = GNUNET_malloc (strlen (path) + 20); pos = path; - while (NULL != (end = strchr (pos, ':'))) + while (NULL != (end = strchr (pos, PATH_SEPARATOR))) { *end = '\0'; sprintf (buf, "%s/%s", pos, binary); if (GNUNET_DISK_file_test (buf) == GNUNET_YES) { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Check for `%s' have succeeded.\n", buf); GNUNET_free (path); return buf; } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Check for `%s' have failed.\n", buf); pos = end + 1; } sprintf (buf, "%s/%s", pos, binary); if (GNUNET_DISK_file_test (buf) == GNUNET_YES) { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Check for `%s' have succeeded.\n", buf); GNUNET_free (path); return buf; } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Check for `%s' have failed.\n", buf); GNUNET_free (buf); GNUNET_free (path); return NULL; @@ -2281,11 +2289,22 @@ SOCKET rawsock; #endif +#ifdef MINGW + char *binaryexe; + GNUNET_asprintf (&binaryexe, "%s.exe", binary); + p = get_path_from_PATH (binaryexe); + free (binaryexe); +#else p = get_path_from_PATH (binary); +#endif if (p == NULL) + { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "get_path_from_PATH (%s) have failed!\n", binary); return GNUNET_NO; + } if (0 != STAT (p, &statbuf)) { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "STAT (%s, &statbuf) have failed!\n", p); GNUNET_free (p); return GNUNET_SYSERR; } @@ -2298,7 +2317,11 @@ #else rawsock = socket (AF_INET, SOCK_RAW, IPPROTO_ICMP); if (INVALID_SOCKET == rawsock) + { + DWORD err = GetLastError (); + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "socket (AF_INET, SOCK_RAW, IPPROTO_ICMP) have failed! GLE = %d\n", err); return GNUNET_NO; /* not running as administrator */ + } closesocket (rawsock); return GNUNET_YES; #endif Index: src/monkey/gdbmi_connect.c =================================================================== --- src/monkey/gdbmi_connect.c (revision 13056) +++ src/monkey/gdbmi_connect.c (working copy) @@ -626,7 +626,7 @@ if (!path) return NULL; pt=strdup(path); - r=strtok(pt,":"); + r=strtok(pt,PATH_SEPARATOR_STR); while (r) { strcpy(test,r); @@ -637,7 +637,7 @@ free(pt); return strdup(test); } - r=strtok(NULL,":"); + r=strtok(NULL,PATH_SEPARATOR_STR); } free(pt); return NULL; Index: src/vpn/gnunet-vpn-pretty-print.c =================================================================== --- src/vpn/gnunet-vpn-pretty-print.c (revision 13051) +++ src/vpn/gnunet-vpn-pretty-print.c (working copy) @@ -4,7 +4,7 @@ #include #include #ifndef _WIN32 - #include +#include #else #include #endif Index: src/util/os_installation.c =================================================================== --- src/util/os_installation.c (revision 13056) +++ src/util/os_installation.c (working copy) @@ -209,7 +209,7 @@ buf = GNUNET_malloc (strlen (path) + 20); pos = path; - while (NULL != (end = strchr (pos, ':'))) + while (NULL != (end = strchr (pos, PATH_SEPARATOR))) { *end = '\0'; sprintf (buf, "%s/%s", pos, "gnunet-arm");