From: Amos Jeffries Date: Thu, 2 Oct 2014 17:50:47 +0000 (-0700) Subject: Windows: add missing file permission definitions X-Git-Tag: SQUID_3_5_0_1~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=89c03bd3bc086c8b30bd52658cc1f83592975c70;p=thirdparty%2Fsquid.git Windows: add missing file permission definitions * initgroups() shim was building, but header not included correctly. * POSIX 5.6 / 6.5 Protection Bits for group access do not exist in windows MinGW. Define as 0-bits until better API is found. --- diff --git a/compat/os/mswindows.h b/compat/os/mswindows.h index dfe053b1c3..3b8f3f7cef 100644 --- a/compat/os/mswindows.h +++ b/compat/os/mswindows.h @@ -32,6 +32,8 @@ #endif #endif /* _SQUID_MINGW_ */ +#include "compat/initgroups.h" + #if HAVE_DIRECT_H #include #endif @@ -205,15 +207,33 @@ SQUIDCEXTERN int WIN32_truncate(const char *pathname, off_t length); #define S_IRWXO 007 #endif +/* There are no group protection bits like these in Windows. + * The values are used by umask() to remove permissions so + * mapping to user permission bits will break file accesses. + * Map group permissions to harmless zero instead. + */ +#ifndef S_IXGRP +#define S_IXGRP 0 +#endif +#ifndef S_IWGRP +#define S_IWGRP 0 +#endif +#ifndef S_IWOTH +#define S_IWOTH 0 +#endif +#ifndef S_IXOTH +#define S_IXOTH 0 +#endif + #if defined(_MSC_VER) #define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR) #endif -#define SIGHUP 1 /* hangup */ -#define SIGKILL 9 /* kill (cannot be caught or ignored) */ -#define SIGBUS 10 /* bus error */ -#define SIGPIPE 13 /* write on a pipe with no one to read it */ -#define SIGCHLD 20 /* to parent on child stop or exit */ +#define SIGHUP 1 /* hangup */ +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#define SIGBUS 10 /* bus error */ +#define SIGPIPE 13 /* write on a pipe with no one to read it */ +#define SIGCHLD 20 /* to parent on child stop or exit */ #define SIGUSR1 30 /* user defined signal 1 */ #define SIGUSR2 31 /* user defined signal 2 */