More updates for Windows - many thanks to apachelounge.com for these.

This commit is contained in:
b1v1r
2009-09-20 03:08:45 +00:00
parent a6710d0dd0
commit cb03e372da
2 changed files with 20 additions and 4 deletions

View File

@@ -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;

View File

@@ -27,12 +27,28 @@
#include <apr_lib.h>
/* 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++;
}