diff --git a/apache2/apache2_config.c b/apache2/apache2_config.c index bbb51366..fb9c6c7d 100644 --- a/apache2/apache2_config.c +++ b/apache2/apache2_config.c @@ -1049,7 +1049,7 @@ static const char *cmd_audit_log_dirmode(cmd_parms *cmd, void *_dcfg, const char return apr_psprintf(cmd->pool, "ModSecurity: Invalid value for SecAuditLogDirMode: %s", p1); } - dcfg->auditlog_dirperms = mode2fileperms((mode_t)mode); + dcfg->auditlog_dirperms = mode2fileperms(mode); } return NULL; @@ -1069,7 +1069,7 @@ static const char *cmd_audit_log_filemode(cmd_parms *cmd, void *_dcfg, const cha return apr_psprintf(cmd->pool, "ModSecurity: Invalid value for SecAuditLogFileMode: %s", p1); } - dcfg->auditlog_fileperms = mode2fileperms((mode_t)mode); + dcfg->auditlog_fileperms = mode2fileperms(mode); } return NULL; diff --git a/apache2/msc_util.c b/apache2/msc_util.c index df00d310..15120401 100644 --- a/apache2/msc_util.c +++ b/apache2/msc_util.c @@ -27,12 +27,28 @@ #include -/* NOTE: Be careful as these can ONLY be used on static values for X. +/** + * NOTE: Be careful as these can ONLY be used on static values for X. * (i.e. VALID_HEX(c++) will NOT work) */ #define VALID_HEX(X) (((X >= '0')&&(X <= '9')) || ((X >= 'a')&&(X <= 'f')) || ((X >= 'A')&&(X <= 'F'))) #define ISODIGIT(X) ((X >= '0')&&(X <= '7')) +#if (defined(WIN32) || defined(NETWARE)) +/** Windows does not define all the octal modes */ +#define S_IXOTH 00001 +#define S_IWOTH 00002 +#define S_IROTH 00004 +#define S_IXGRP 00010 +#define S_IWGRP 00020 +#define S_IRGRP 00040 +#define S_IXUSR 00100 +#define S_IWUSR 00200 +#define S_IRUSR 00400 +#define S_ISVTX 01000 +#define S_ISGID 02000 +#define S_ISUID 04000 +#endif /* defined(WIN32 || NETWARE) */ /** * @@ -669,7 +685,7 @@ int js_decode_nonstrict_inplace(unsigned char *input, long int input_len) { j = 2; buf[j] = '\0'; } - *d++ = strtol(buf, NULL, 8); + *d++ = (unsigned char)strtol(buf, NULL, 8); i += 1 + j; count++; }