mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
I am not claiming that the modules work now, but at least the parameter lists
are prepared for the updated ap_log_rerror() format. BTW: What is APLOG_NOERROR for now that we have an explicit error code? This is still WIP! git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84023 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -251,7 +251,7 @@ static int anon_authenticate_basic_user(request_rec *r)
|
|||||||
|| ((strpbrk("@", sent_pw) != NULL)
|
|| ((strpbrk("@", sent_pw) != NULL)
|
||||||
&& (strpbrk(".", sent_pw) != NULL)))) {
|
&& (strpbrk(".", sent_pw) != NULL)))) {
|
||||||
if (sec->auth_anon_logemail && ap_is_initial_req(r)) {
|
if (sec->auth_anon_logemail && ap_is_initial_req(r)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, APR_SUCCESS, r,
|
||||||
"Anonymous: Passwd <%s> Accepted",
|
"Anonymous: Passwd <%s> Accepted",
|
||||||
sent_pw ? sent_pw : "\'none\'");
|
sent_pw ? sent_pw : "\'none\'");
|
||||||
}
|
}
|
||||||
@@ -259,7 +259,7 @@ static int anon_authenticate_basic_user(request_rec *r)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (sec->auth_anon_authoritative) {
|
if (sec->auth_anon_authoritative) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, APR_SUCCESS, r,
|
||||||
"Anonymous: Authoritative, Passwd <%s> not accepted",
|
"Anonymous: Authoritative, Passwd <%s> not accepted",
|
||||||
sent_pw ? sent_pw : "\'none\'");
|
sent_pw ? sent_pw : "\'none\'");
|
||||||
return AUTH_REQUIRED;
|
return AUTH_REQUIRED;
|
||||||
|
@@ -166,7 +166,7 @@ static char *get_db_pw(request_rec *r, char *user, const char *auth_dbpwfile)
|
|||||||
#else
|
#else
|
||||||
if (!(f = dbopen(auth_dbpwfile, O_RDONLY, 0664, DB_HASH, NULL))) {
|
if (!(f = dbopen(auth_dbpwfile, O_RDONLY, 0664, DB_HASH, NULL))) {
|
||||||
#endif
|
#endif
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
"could not open db auth file: %s", auth_dbpwfile);
|
"could not open db auth file: %s", auth_dbpwfile);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -237,7 +237,7 @@ static int db_authenticate_basic_user(request_rec *r)
|
|||||||
if (!(real_pw = get_db_pw(r, r->user, sec->auth_dbpwfile))) {
|
if (!(real_pw = get_db_pw(r, r->user, sec->auth_dbpwfile))) {
|
||||||
if (!(sec->auth_dbauthoritative))
|
if (!(sec->auth_dbauthoritative))
|
||||||
return DECLINED;
|
return DECLINED;
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"DB user %s not found: %s", r->user, r->filename);
|
"DB user %s not found: %s", r->user, r->filename);
|
||||||
ap_note_basic_auth_failure(r);
|
ap_note_basic_auth_failure(r);
|
||||||
return AUTH_REQUIRED;
|
return AUTH_REQUIRED;
|
||||||
@@ -249,7 +249,7 @@ static int db_authenticate_basic_user(request_rec *r)
|
|||||||
}
|
}
|
||||||
invalid_pw = ap_validate_password(sent_pw, real_pw);
|
invalid_pw = ap_validate_password(sent_pw, real_pw);
|
||||||
if (invalid_pw != NULL) {
|
if (invalid_pw != NULL) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"DB user %s: authentication failure for \"%s\": %s",
|
"DB user %s: authentication failure for \"%s\": %s",
|
||||||
r->user, r->uri, invalid_pw);
|
r->user, r->uri, invalid_pw);
|
||||||
ap_note_basic_auth_failure(r);
|
ap_note_basic_auth_failure(r);
|
||||||
@@ -295,7 +295,7 @@ static int db_check_auth(request_rec *r)
|
|||||||
if (!(groups = get_db_grp(r, user, sec->auth_dbgrpfile))) {
|
if (!(groups = get_db_grp(r, user, sec->auth_dbgrpfile))) {
|
||||||
if (!(sec->auth_dbauthoritative))
|
if (!(sec->auth_dbauthoritative))
|
||||||
return DECLINED;
|
return DECLINED;
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"user %s not in DB group file %s: %s",
|
"user %s not in DB group file %s: %s",
|
||||||
user, sec->auth_dbgrpfile, r->filename);
|
user, sec->auth_dbgrpfile, r->filename);
|
||||||
ap_note_basic_auth_failure(r);
|
ap_note_basic_auth_failure(r);
|
||||||
@@ -311,7 +311,7 @@ static int db_check_auth(request_rec *r)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"user %s not in right group: %s", user, r->filename);
|
"user %s not in right group: %s", user, r->filename);
|
||||||
ap_note_basic_auth_failure(r);
|
ap_note_basic_auth_failure(r);
|
||||||
return AUTH_REQUIRED;
|
return AUTH_REQUIRED;
|
||||||
|
@@ -159,7 +159,7 @@ static char *get_dbm_pw(request_rec *r, char *user, char *auth_dbmpwfile)
|
|||||||
|
|
||||||
|
|
||||||
if (!(f = dbm_open(auth_dbmpwfile, O_RDONLY, 0664))) {
|
if (!(f = dbm_open(auth_dbmpwfile, O_RDONLY, 0664))) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
"could not open dbm auth file: %s", auth_dbmpwfile);
|
"could not open dbm auth file: %s", auth_dbmpwfile);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -224,7 +224,7 @@ static int dbm_authenticate_basic_user(request_rec *r)
|
|||||||
if (!(real_pw = get_dbm_pw(r, r->user, sec->auth_dbmpwfile))) {
|
if (!(real_pw = get_dbm_pw(r, r->user, sec->auth_dbmpwfile))) {
|
||||||
if (!(sec->auth_dbmauthoritative))
|
if (!(sec->auth_dbmauthoritative))
|
||||||
return DECLINED;
|
return DECLINED;
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"DBM user %s not found: %s", r->user, r->filename);
|
"DBM user %s not found: %s", r->user, r->filename);
|
||||||
ap_note_basic_auth_failure(r);
|
ap_note_basic_auth_failure(r);
|
||||||
return AUTH_REQUIRED;
|
return AUTH_REQUIRED;
|
||||||
@@ -236,7 +236,7 @@ static int dbm_authenticate_basic_user(request_rec *r)
|
|||||||
}
|
}
|
||||||
invalid_pw = ap_validate_password(sent_pw, real_pw);
|
invalid_pw = ap_validate_password(sent_pw, real_pw);
|
||||||
if (invalid_pw != NULL) {
|
if (invalid_pw != NULL) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"DBM user %s: authentication failure for \"%s\": %s",
|
"DBM user %s: authentication failure for \"%s\": %s",
|
||||||
r->user, r->uri, invalid_pw);
|
r->user, r->uri, invalid_pw);
|
||||||
ap_note_basic_auth_failure(r);
|
ap_note_basic_auth_failure(r);
|
||||||
@@ -282,7 +282,7 @@ static int dbm_check_auth(request_rec *r)
|
|||||||
if (!(groups = get_dbm_grp(r, user, sec->auth_dbmgrpfile))) {
|
if (!(groups = get_dbm_grp(r, user, sec->auth_dbmgrpfile))) {
|
||||||
if (!(sec->auth_dbmauthoritative))
|
if (!(sec->auth_dbmauthoritative))
|
||||||
return DECLINED;
|
return DECLINED;
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"user %s not in DBM group file %s: %s",
|
"user %s not in DBM group file %s: %s",
|
||||||
user, sec->auth_dbmgrpfile, r->filename);
|
user, sec->auth_dbmgrpfile, r->filename);
|
||||||
ap_note_basic_auth_failure(r);
|
ap_note_basic_auth_failure(r);
|
||||||
@@ -298,7 +298,7 @@ static int dbm_check_auth(request_rec *r)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"user %s not in right group: %s",
|
"user %s not in right group: %s",
|
||||||
user, r->filename);
|
user, r->filename);
|
||||||
ap_note_basic_auth_failure(r);
|
ap_note_basic_auth_failure(r);
|
||||||
|
@@ -690,10 +690,10 @@ static client_entry *get_client(unsigned long key, const request_rec *r)
|
|||||||
mm_unlock(client_mm);
|
mm_unlock(client_mm);
|
||||||
|
|
||||||
if (entry)
|
if (entry)
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, r,
|
||||||
"get_client(): client %lu found", key);
|
"get_client(): client %lu found", key);
|
||||||
else
|
else
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, r,
|
||||||
"get_client(): client %lu not found", key);
|
"get_client(): client %lu not found", key);
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
@@ -1015,7 +1015,7 @@ static client_entry *gen_client(const request_rec *r)
|
|||||||
mm_unlock(opaque_mm);
|
mm_unlock(opaque_mm);
|
||||||
|
|
||||||
if (!(entry = add_client(op, &new, r->server))) {
|
if (!(entry = add_client(op, &new, r->server))) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
|
||||||
"Digest: failed to allocate client entry - ignoring "
|
"Digest: failed to allocate client entry - ignoring "
|
||||||
"client");
|
"client");
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -1277,7 +1277,7 @@ static const char *get_hash(request_rec *r, const char *user,
|
|||||||
char *w, *x;
|
char *w, *x;
|
||||||
|
|
||||||
if (!(f = ap_pcfg_openfile(r->pool, auth_pwfile))) {
|
if (!(f = ap_pcfg_openfile(r->pool, auth_pwfile))) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
"Digest: Could not open password file: %s", auth_pwfile);
|
"Digest: Could not open password file: %s", auth_pwfile);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1308,7 +1308,7 @@ static int check_nc(const request_rec *r, const digest_header_rec *resp,
|
|||||||
|
|
||||||
nc = strtol(snc, &endptr, 16);
|
nc = strtol(snc, &endptr, 16);
|
||||||
if (endptr < (snc+strlen(snc)) && !ap_isspace(*endptr)) {
|
if (endptr < (snc+strlen(snc)) && !ap_isspace(*endptr)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: invalid nc %s received - not a number", snc);
|
"Digest: invalid nc %s received - not a number", snc);
|
||||||
return !OK;
|
return !OK;
|
||||||
}
|
}
|
||||||
@@ -1317,7 +1317,7 @@ static int check_nc(const request_rec *r, const digest_header_rec *resp,
|
|||||||
return !OK;
|
return !OK;
|
||||||
|
|
||||||
if (nc != resp->client->nonce_count) {
|
if (nc != resp->client->nonce_count) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, r,
|
||||||
"nonce-count check failed: %lu != %lu", nc,
|
"nonce-count check failed: %lu != %lu", nc,
|
||||||
resp->client->nonce_count);
|
resp->client->nonce_count);
|
||||||
return !OK;
|
return !OK;
|
||||||
@@ -1335,7 +1335,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp,
|
|||||||
char tmp, hash[NONCE_HASH_LEN+1];
|
char tmp, hash[NONCE_HASH_LEN+1];
|
||||||
|
|
||||||
if (strlen(resp->nonce) != NONCE_LEN) {
|
if (strlen(resp->nonce) != NONCE_LEN) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: invalid nonce %s received - length is not %d",
|
"Digest: invalid nonce %s received - length is not %d",
|
||||||
resp->nonce, NONCE_LEN);
|
resp->nonce, NONCE_LEN);
|
||||||
note_digest_auth_failure(r, conf, resp, 1);
|
note_digest_auth_failure(r, conf, resp, 1);
|
||||||
@@ -1350,7 +1350,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp,
|
|||||||
resp->nonce_time = nonce_time.time;
|
resp->nonce_time = nonce_time.time;
|
||||||
|
|
||||||
if (strcmp(hash, resp->nonce+NONCE_TIME_LEN)) {
|
if (strcmp(hash, resp->nonce+NONCE_TIME_LEN)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: invalid nonce %s received - hash is not %s",
|
"Digest: invalid nonce %s received - hash is not %s",
|
||||||
resp->nonce, hash);
|
resp->nonce, hash);
|
||||||
note_digest_auth_failure(r, conf, resp, 1);
|
note_digest_auth_failure(r, conf, resp, 1);
|
||||||
@@ -1359,7 +1359,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp,
|
|||||||
|
|
||||||
dt = difftime(r->request_time, nonce_time.time);
|
dt = difftime(r->request_time, nonce_time.time);
|
||||||
if (conf->nonce_lifetime > 0 && dt < 0) {
|
if (conf->nonce_lifetime > 0 && dt < 0) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: invalid nonce %s received - user attempted "
|
"Digest: invalid nonce %s received - user attempted "
|
||||||
"time travel", resp->nonce);
|
"time travel", resp->nonce);
|
||||||
note_digest_auth_failure(r, conf, resp, 1);
|
note_digest_auth_failure(r, conf, resp, 1);
|
||||||
@@ -1368,7 +1368,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp,
|
|||||||
|
|
||||||
if (conf->nonce_lifetime > 0) {
|
if (conf->nonce_lifetime > 0) {
|
||||||
if (dt > conf->nonce_lifetime) {
|
if (dt > conf->nonce_lifetime) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0,r,
|
||||||
"Digest: user %s: nonce expired - sending new nonce",
|
"Digest: user %s: nonce expired - sending new nonce",
|
||||||
r->connection->user);
|
r->connection->user);
|
||||||
note_digest_auth_failure(r, conf, resp, 1);
|
note_digest_auth_failure(r, conf, resp, 1);
|
||||||
@@ -1377,7 +1377,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp,
|
|||||||
}
|
}
|
||||||
else if (conf->nonce_lifetime == 0 && resp->client) {
|
else if (conf->nonce_lifetime == 0 && resp->client) {
|
||||||
if (memcmp(resp->client->last_nonce, resp->nonce, NONCE_LEN)) {
|
if (memcmp(resp->client->last_nonce, resp->nonce, NONCE_LEN)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r,
|
||||||
"Digest: user %s: one-time-nonce mismatch - sending "
|
"Digest: user %s: one-time-nonce mismatch - sending "
|
||||||
"new nonce", r->connection->user);
|
"new nonce", r->connection->user);
|
||||||
note_digest_auth_failure(r, conf, resp, 1);
|
note_digest_auth_failure(r, conf, resp, 1);
|
||||||
@@ -1462,7 +1462,7 @@ static int authenticate_digest_user(request_rec *r)
|
|||||||
return DECLINED;
|
return DECLINED;
|
||||||
|
|
||||||
if (!ap_auth_name(r)) {
|
if (!ap_auth_name(r)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: need AuthName: %s", r->uri);
|
"Digest: need AuthName: %s", r->uri);
|
||||||
return SERVER_ERROR;
|
return SERVER_ERROR;
|
||||||
}
|
}
|
||||||
@@ -1488,11 +1488,11 @@ static int authenticate_digest_user(request_rec *r)
|
|||||||
|
|
||||||
if (resp->auth_hdr_sts != VALID) {
|
if (resp->auth_hdr_sts != VALID) {
|
||||||
if (resp->auth_hdr_sts == NOT_DIGEST)
|
if (resp->auth_hdr_sts == NOT_DIGEST)
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: client used wrong authentication scheme "
|
"Digest: client used wrong authentication scheme "
|
||||||
"`%s': %s", resp->scheme, r->uri);
|
"`%s': %s", resp->scheme, r->uri);
|
||||||
else if (resp->auth_hdr_sts == INVALID)
|
else if (resp->auth_hdr_sts == INVALID)
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: missing user, realm, nonce, uri, or digest "
|
"Digest: missing user, realm, nonce, uri, or digest "
|
||||||
"in authorization header: %s", r->uri);
|
"in authorization header: %s", r->uri);
|
||||||
/* else (resp->auth_hdr_sts == NO_HEADER) */
|
/* else (resp->auth_hdr_sts == NO_HEADER) */
|
||||||
@@ -1519,7 +1519,7 @@ static int authenticate_digest_user(request_rec *r)
|
|||||||
&& (!d_uri.query || !r_uri->query
|
&& (!d_uri.query || !r_uri->query
|
||||||
|| strcmp(d_uri.query, r_uri->query)))
|
|| strcmp(d_uri.query, r_uri->query)))
|
||||||
) {
|
) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: uri mismatch - <%s> does not match "
|
"Digest: uri mismatch - <%s> does not match "
|
||||||
"request-uri <%s>", resp->uri,
|
"request-uri <%s>", resp->uri,
|
||||||
ap_unparse_uri_components(r->pool, r_uri, 0));
|
ap_unparse_uri_components(r->pool, r_uri, 0));
|
||||||
@@ -1528,7 +1528,7 @@ static int authenticate_digest_user(request_rec *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (resp->opaque && resp->opaque_num == 0) {
|
if (resp->opaque && resp->opaque_num == 0) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: received invalid opaque - got `%s'",
|
"Digest: received invalid opaque - got `%s'",
|
||||||
resp->opaque);
|
resp->opaque);
|
||||||
note_digest_auth_failure(r, conf, resp, 0);
|
note_digest_auth_failure(r, conf, resp, 0);
|
||||||
@@ -1536,7 +1536,7 @@ static int authenticate_digest_user(request_rec *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(resp->realm, conf->realm)) {
|
if (strcmp(resp->realm, conf->realm)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: realm mismatch - got `%s' but expected `%s'",
|
"Digest: realm mismatch - got `%s' but expected `%s'",
|
||||||
resp->realm, conf->realm);
|
resp->realm, conf->realm);
|
||||||
note_digest_auth_failure(r, conf, resp, 0);
|
note_digest_auth_failure(r, conf, resp, 0);
|
||||||
@@ -1546,7 +1546,7 @@ static int authenticate_digest_user(request_rec *r)
|
|||||||
if (resp->algorithm != NULL
|
if (resp->algorithm != NULL
|
||||||
&& strcasecmp(resp->algorithm, "MD5")
|
&& strcasecmp(resp->algorithm, "MD5")
|
||||||
&& strcasecmp(resp->algorithm, "MD5-sess")) {
|
&& strcasecmp(resp->algorithm, "MD5-sess")) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: unknown algorithm `%s' received: %s",
|
"Digest: unknown algorithm `%s' received: %s",
|
||||||
resp->algorithm, r->uri);
|
resp->algorithm, r->uri);
|
||||||
note_digest_auth_failure(r, conf, resp, 0);
|
note_digest_auth_failure(r, conf, resp, 0);
|
||||||
@@ -1557,7 +1557,7 @@ static int authenticate_digest_user(request_rec *r)
|
|||||||
return DECLINED;
|
return DECLINED;
|
||||||
|
|
||||||
if (!(conf->ha1 = get_hash(r, conn->user, conf->realm, conf->pwfile))) {
|
if (!(conf->ha1 = get_hash(r, conn->user, conf->realm, conf->pwfile))) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: user `%s' in realm `%s' not found: %s",
|
"Digest: user `%s' in realm `%s' not found: %s",
|
||||||
conn->user, conf->realm, r->uri);
|
conn->user, conf->realm, r->uri);
|
||||||
note_digest_auth_failure(r, conf, resp, 0);
|
note_digest_auth_failure(r, conf, resp, 0);
|
||||||
@@ -1567,7 +1567,7 @@ static int authenticate_digest_user(request_rec *r)
|
|||||||
if (resp->message_qop == NULL) {
|
if (resp->message_qop == NULL) {
|
||||||
/* old (rfc-2069) style digest */
|
/* old (rfc-2069) style digest */
|
||||||
if (strcmp(resp->digest, old_digest(r, resp, conf->ha1))) {
|
if (strcmp(resp->digest, old_digest(r, resp, conf->ha1))) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: user %s: password mismatch: %s", conn->user,
|
"Digest: user %s: password mismatch: %s", conn->user,
|
||||||
r->uri);
|
r->uri);
|
||||||
note_digest_auth_failure(r, conf, resp, 0);
|
note_digest_auth_failure(r, conf, resp, 0);
|
||||||
@@ -1586,7 +1586,7 @@ static int authenticate_digest_user(request_rec *r)
|
|||||||
if (!match
|
if (!match
|
||||||
&& !(conf->qop_list[0] == NULL
|
&& !(conf->qop_list[0] == NULL
|
||||||
&& !strcasecmp(resp->message_qop, "auth"))) {
|
&& !strcasecmp(resp->message_qop, "auth"))) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: invalid qop `%s' received: %s",
|
"Digest: invalid qop `%s' received: %s",
|
||||||
resp->message_qop, r->uri);
|
resp->message_qop, r->uri);
|
||||||
note_digest_auth_failure(r, conf, resp, 0);
|
note_digest_auth_failure(r, conf, resp, 0);
|
||||||
@@ -1594,7 +1594,7 @@ static int authenticate_digest_user(request_rec *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(resp->digest, new_digest(r, resp, conf))) {
|
if (strcmp(resp->digest, new_digest(r, resp, conf))) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: user %s: password mismatch: %s", conn->user,
|
"Digest: user %s: password mismatch: %s", conn->user,
|
||||||
r->uri);
|
r->uri);
|
||||||
note_digest_auth_failure(r, conf, resp, 0);
|
note_digest_auth_failure(r, conf, resp, 0);
|
||||||
@@ -1625,17 +1625,18 @@ static table *groups_for_user(request_rec *r, const char *user,
|
|||||||
{
|
{
|
||||||
configfile_t *f;
|
configfile_t *f;
|
||||||
table *grps = ap_make_table(r->pool, 15);
|
table *grps = ap_make_table(r->pool, 15);
|
||||||
pool *sp;
|
ap_context_t *sp;
|
||||||
char l[MAX_STRING_LEN];
|
char l[MAX_STRING_LEN];
|
||||||
const char *group_name, *ll, *w;
|
const char *group_name, *ll, *w;
|
||||||
|
|
||||||
if (!(f = ap_pcfg_openfile(r->pool, grpfile))) {
|
if (!(f = ap_pcfg_openfile(r->pool, grpfile))) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
"Digest: Could not open group file: %s", grpfile);
|
"Digest: Could not open group file: %s", grpfile);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
sp = ap_make_sub_pool(r->pool);
|
if (ap_create_context(&sp, r->pool) != APR_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
while (!(ap_cfg_getline(l, MAX_STRING_LEN, f))) {
|
while (!(ap_cfg_getline(l, MAX_STRING_LEN, f))) {
|
||||||
if ((l[0] == '#') || (!l[0]))
|
if ((l[0] == '#') || (!l[0]))
|
||||||
@@ -1718,7 +1719,7 @@ static int digest_check_auth(request_rec *r)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: access to %s failed, reason: unknown require "
|
"Digest: access to %s failed, reason: unknown require "
|
||||||
"directive \"%s\"", r->uri, reqs[x].requirement);
|
"directive \"%s\"", r->uri, reqs[x].requirement);
|
||||||
return DECLINED;
|
return DECLINED;
|
||||||
@@ -1728,7 +1729,7 @@ static int digest_check_auth(request_rec *r)
|
|||||||
if (!method_restricted)
|
if (!method_restricted)
|
||||||
return OK;
|
return OK;
|
||||||
|
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Digest: access to %s failed, reason: user %s not allowed access",
|
"Digest: access to %s failed, reason: user %s not allowed access",
|
||||||
r->uri, user);
|
r->uri, user);
|
||||||
|
|
||||||
|
@@ -518,7 +518,7 @@ static void parse_string(request_rec *r, const char *in, char *out,
|
|||||||
in = strchr(in, '}');
|
in = strchr(in, '}');
|
||||||
if (in == NULL) {
|
if (in == NULL) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR,
|
||||||
r, "Missing '}' on variable \"%s\"",
|
0, r, "Missing '}' on variable \"%s\"",
|
||||||
expansion);
|
expansion);
|
||||||
*next = '\0';
|
*next = '\0';
|
||||||
return;
|
return;
|
||||||
@@ -740,7 +740,7 @@ static int handle_include(FILE *in, request_rec *r, const char *error, int noexe
|
|||||||
ap_chdir_file(r->filename);
|
ap_chdir_file(r->filename);
|
||||||
if (error_fmt) {
|
if (error_fmt) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR,
|
||||||
r, error_fmt, tag_val, r->filename);
|
0, r, error_fmt, tag_val, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -755,7 +755,7 @@ static int handle_include(FILE *in, request_rec *r, const char *error, int noexe
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"unknown parameter \"%s\" to tag include in %s",
|
"unknown parameter \"%s\" to tag include in %s",
|
||||||
tag, r->filename);
|
tag, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -863,7 +863,7 @@ static int include_cmd(char *s, request_rec *r)
|
|||||||
|
|
||||||
if (!ap_bspawn_child(r->pool, include_cmd_child, &arg,
|
if (!ap_bspawn_child(r->pool, include_cmd_child, &arg,
|
||||||
kill_after_timeout, NULL, &script_in, NULL)) {
|
kill_after_timeout, NULL, &script_in, NULL)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
"couldn't spawn include command");
|
"couldn't spawn include command");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -887,7 +887,7 @@ static int handle_exec(FILE *in, request_rec *r, const char *error)
|
|||||||
if (!strcmp(tag, "cmd")) {
|
if (!strcmp(tag, "cmd")) {
|
||||||
parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 1);
|
parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 1);
|
||||||
if (include_cmd(parsed_string, r) == -1) {
|
if (include_cmd(parsed_string, r) == -1) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"execution failure for parameter \"%s\" "
|
"execution failure for parameter \"%s\" "
|
||||||
"to tag exec in file %s",
|
"to tag exec in file %s",
|
||||||
tag, r->filename);
|
tag, r->filename);
|
||||||
@@ -899,7 +899,7 @@ static int handle_exec(FILE *in, request_rec *r, const char *error)
|
|||||||
else if (!strcmp(tag, "cgi")) {
|
else if (!strcmp(tag, "cgi")) {
|
||||||
parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0);
|
parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0);
|
||||||
if (include_cgi(parsed_string, r) == -1) {
|
if (include_cgi(parsed_string, r) == -1) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"invalid CGI ref \"%s\" in %s", tag_val, file);
|
"invalid CGI ref \"%s\" in %s", tag_val, file);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
}
|
}
|
||||||
@@ -909,7 +909,7 @@ static int handle_exec(FILE *in, request_rec *r, const char *error)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"unknown parameter \"%s\" to tag exec in %s",
|
"unknown parameter \"%s\" to tag exec in %s",
|
||||||
tag, file);
|
tag, file);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -941,7 +941,7 @@ static int handle_echo(FILE *in, request_rec *r, const char *error)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"unknown parameter \"%s\" to tag echo in %s",
|
"unknown parameter \"%s\" to tag echo in %s",
|
||||||
tag, r->filename);
|
tag, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -959,7 +959,7 @@ static int handle_perl(FILE *in, request_rec *r, const char *error)
|
|||||||
AV *av = newAV();
|
AV *av = newAV();
|
||||||
|
|
||||||
if (ap_allow_options(r) & OPT_INCNOEXEC) {
|
if (ap_allow_options(r) & OPT_INCNOEXEC) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"#perl SSI disallowed by IncludesNoExec in %s",
|
"#perl SSI disallowed by IncludesNoExec in %s",
|
||||||
r->filename);
|
r->filename);
|
||||||
return DECLINED;
|
return DECLINED;
|
||||||
@@ -1027,7 +1027,7 @@ static int handle_config(FILE *in, request_rec *r, char *error, char *tf,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"unknown parameter \"%s\" to tag config in %s",
|
"unknown parameter \"%s\" to tag config in %s",
|
||||||
tag, r->filename);
|
tag, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1069,7 +1069,7 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
|
|||||||
|
|
||||||
if (error_fmt) {
|
if (error_fmt) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r, error_fmt, to_send, r->filename);
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, error_fmt, to_send, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1087,7 +1087,7 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"unable to get information about \"%s\" "
|
"unable to get information about \"%s\" "
|
||||||
"in parsed file %s",
|
"in parsed file %s",
|
||||||
tag_val, r->filename);
|
tag_val, r->filename);
|
||||||
@@ -1097,7 +1097,7 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"unknown parameter \"%s\" to tag %s in %s",
|
"unknown parameter \"%s\" to tag %s in %s",
|
||||||
tag, directive, r->filename);
|
tag, directive, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1176,7 +1176,7 @@ static int re_check(request_rec *r, char *string, char *rexp)
|
|||||||
|
|
||||||
compiled = ap_pregcomp(r->pool, rexp, REG_EXTENDED | REG_NOSUB);
|
compiled = ap_pregcomp(r->pool, rexp, REG_EXTENDED | REG_NOSUB);
|
||||||
if (compiled == NULL) {
|
if (compiled == NULL) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"unable to compile pattern \"%s\"", rexp);
|
"unable to compile pattern \"%s\"", rexp);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -1374,7 +1374,8 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
root = current = (struct parse_node *) NULL;
|
root = current = (struct parse_node *) NULL;
|
||||||
expr_pool = ap_make_sub_pool(r->pool);
|
if (ap_create_context(&expr_pool, r->pool) != APR_SUCCESS)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* Create Parse Tree */
|
/* Create Parse Tree */
|
||||||
while (1) {
|
while (1) {
|
||||||
@@ -1421,7 +1422,7 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
current = current->right = new;
|
current = current->right = new;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Invalid expression \"%s\" in file %s",
|
"Invalid expression \"%s\" in file %s",
|
||||||
expr, r->filename);
|
expr, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1435,7 +1436,7 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
ap_rputs(" Token: and/or\n", r);
|
ap_rputs(" Token: and/or\n", r);
|
||||||
#endif
|
#endif
|
||||||
if (current == (struct parse_node *) NULL) {
|
if (current == (struct parse_node *) NULL) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Invalid expression \"%s\" in file %s",
|
"Invalid expression \"%s\" in file %s",
|
||||||
expr, r->filename);
|
expr, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1460,7 +1461,7 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
case token_lbrace:
|
case token_lbrace:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Invalid expression \"%s\" in file %s",
|
"Invalid expression \"%s\" in file %s",
|
||||||
expr, r->filename);
|
expr, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1505,7 +1506,7 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
case token_lt:
|
case token_lt:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Invalid expression \"%s\" in file %s",
|
"Invalid expression \"%s\" in file %s",
|
||||||
expr, r->filename);
|
expr, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1537,7 +1538,7 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
ap_rputs(" Token: eq/ne/ge/gt/le/lt\n", r);
|
ap_rputs(" Token: eq/ne/ge/gt/le/lt\n", r);
|
||||||
#endif
|
#endif
|
||||||
if (current == (struct parse_node *) NULL) {
|
if (current == (struct parse_node *) NULL) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Invalid expression \"%s\" in file %s",
|
"Invalid expression \"%s\" in file %s",
|
||||||
expr, r->filename);
|
expr, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1562,7 +1563,7 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
case token_le:
|
case token_le:
|
||||||
case token_lt:
|
case token_lt:
|
||||||
default:
|
default:
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Invalid expression \"%s\" in file %s",
|
"Invalid expression \"%s\" in file %s",
|
||||||
expr, r->filename);
|
expr, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1596,7 +1597,7 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
current = current->parent;
|
current = current->parent;
|
||||||
}
|
}
|
||||||
if (current == (struct parse_node *) NULL) {
|
if (current == (struct parse_node *) NULL) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Unmatched ')' in \"%s\" in file %s",
|
"Unmatched ')' in \"%s\" in file %s",
|
||||||
expr, r->filename);
|
expr, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1629,7 +1630,7 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
case token_string:
|
case token_string:
|
||||||
case token_group:
|
case token_group:
|
||||||
default:
|
default:
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Invalid expression \"%s\" in file %s",
|
"Invalid expression \"%s\" in file %s",
|
||||||
expr, r->filename);
|
expr, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1677,7 +1678,7 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
#endif
|
#endif
|
||||||
if (current->left == (struct parse_node *) NULL ||
|
if (current->left == (struct parse_node *) NULL ||
|
||||||
current->right == (struct parse_node *) NULL) {
|
current->right == (struct parse_node *) NULL) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Invalid expression \"%s\" in file %s",
|
"Invalid expression \"%s\" in file %s",
|
||||||
expr, r->filename);
|
expr, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1742,7 +1743,7 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
(current->right == (struct parse_node *) NULL) ||
|
(current->right == (struct parse_node *) NULL) ||
|
||||||
(current->left->token.type != token_string) ||
|
(current->left->token.type != token_string) ||
|
||||||
(current->right->token.type != token_string)) {
|
(current->right->token.type != token_string)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Invalid expression \"%s\" in file %s",
|
"Invalid expression \"%s\" in file %s",
|
||||||
expr, r->filename);
|
expr, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1763,7 +1764,7 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
current->right->token.value[len - 1] = '\0';
|
current->right->token.value[len - 1] = '\0';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Invalid rexp \"%s\" in file %s",
|
"Invalid rexp \"%s\" in file %s",
|
||||||
current->right->token.value, r->filename);
|
current->right->token.value, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1807,7 +1808,7 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
(current->right == (struct parse_node *) NULL) ||
|
(current->right == (struct parse_node *) NULL) ||
|
||||||
(current->left->token.type != token_string) ||
|
(current->left->token.type != token_string) ||
|
||||||
(current->right->token.type != token_string)) {
|
(current->right->token.type != token_string)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Invalid expression \"%s\" in file %s",
|
"Invalid expression \"%s\" in file %s",
|
||||||
expr, r->filename);
|
expr, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1890,21 +1891,21 @@ static int parse_expr(request_rec *r, const char *expr, const char *error)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case token_lbrace:
|
case token_lbrace:
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Unmatched '(' in \"%s\" in file %s",
|
"Unmatched '(' in \"%s\" in file %s",
|
||||||
expr, r->filename);
|
expr, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
goto RETURN;
|
goto RETURN;
|
||||||
|
|
||||||
case token_rbrace:
|
case token_rbrace:
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Unmatched ')' in \"%s\" in file %s",
|
"Unmatched ')' in \"%s\" in file %s",
|
||||||
expr, r->filename);
|
expr, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
goto RETURN;
|
goto RETURN;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"bad token type");
|
"bad token type");
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
goto RETURN;
|
goto RETURN;
|
||||||
@@ -1932,7 +1933,7 @@ static int handle_if(FILE *in, request_rec *r, const char *error,
|
|||||||
}
|
}
|
||||||
else if (!strcmp(tag, "done")) {
|
else if (!strcmp(tag, "done")) {
|
||||||
if (expr == NULL) {
|
if (expr == NULL) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"missing expr in if statement: %s",
|
"missing expr in if statement: %s",
|
||||||
r->filename);
|
r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1952,7 +1953,7 @@ static int handle_if(FILE *in, request_rec *r, const char *error,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"unknown parameter \"%s\" to tag if in %s",
|
"unknown parameter \"%s\" to tag if in %s",
|
||||||
tag, r->filename);
|
tag, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -1983,7 +1984,7 @@ static int handle_elif(FILE *in, request_rec *r, const char *error,
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
if (expr == NULL) {
|
if (expr == NULL) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"missing expr in elif statement: %s",
|
"missing expr in elif statement: %s",
|
||||||
r->filename);
|
r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -2003,7 +2004,7 @@ static int handle_elif(FILE *in, request_rec *r, const char *error,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"unknown parameter \"%s\" to tag if in %s",
|
"unknown parameter \"%s\" to tag if in %s",
|
||||||
tag, r->filename);
|
tag, r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -2029,7 +2030,7 @@ static int handle_else(FILE *in, request_rec *r, const char *error,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"else directive does not take tags in %s",
|
"else directive does not take tags in %s",
|
||||||
r->filename);
|
r->filename);
|
||||||
if (*printing) {
|
if (*printing) {
|
||||||
@@ -2057,7 +2058,7 @@ static int handle_endif(FILE *in, request_rec *r, const char *error,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"endif directive does not take tags in %s",
|
"endif directive does not take tags in %s",
|
||||||
r->filename);
|
r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -2085,7 +2086,7 @@ static int handle_set(FILE *in, request_rec *r, const char *error)
|
|||||||
}
|
}
|
||||||
else if (!strcmp(tag, "value")) {
|
else if (!strcmp(tag, "value")) {
|
||||||
if (var == (char *) NULL) {
|
if (var == (char *) NULL) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"variable must precede value in set directive in %s",
|
"variable must precede value in set directive in %s",
|
||||||
r->filename);
|
r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -2095,7 +2096,7 @@ static int handle_set(FILE *in, request_rec *r, const char *error)
|
|||||||
ap_table_setn(r->subprocess_env, var, ap_pstrdup(r->pool, parsed_string));
|
ap_table_setn(r->subprocess_env, var, ap_pstrdup(r->pool, parsed_string));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Invalid tag for set directive in %s", r->filename);
|
"Invalid tag for set directive in %s", r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
return -1;
|
return -1;
|
||||||
@@ -2121,7 +2122,7 @@ static int handle_printenv(FILE *in, request_rec *r, const char *error)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"printenv directive does not take tags in %s",
|
"printenv directive does not take tags in %s",
|
||||||
r->filename);
|
r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -2166,7 +2167,7 @@ static void send_parsed_content(FILE *f, request_rec *r)
|
|||||||
while (1) {
|
while (1) {
|
||||||
if (!find_string(f, STARTING_SEQUENCE, r, printing)) {
|
if (!find_string(f, STARTING_SEQUENCE, r, printing)) {
|
||||||
if (get_directive(f, directive, sizeof(directive), r->pool)) {
|
if (get_directive(f, directive, sizeof(directive), r->pool)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"mod_include: error reading directive in %s",
|
"mod_include: error reading directive in %s",
|
||||||
r->filename);
|
r->filename);
|
||||||
ap_rputs(error, r);
|
ap_rputs(error, r);
|
||||||
@@ -2212,7 +2213,7 @@ static void send_parsed_content(FILE *f, request_rec *r)
|
|||||||
}
|
}
|
||||||
if (!strcmp(directive, "exec")) {
|
if (!strcmp(directive, "exec")) {
|
||||||
if (noexec) {
|
if (noexec) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"exec used but not allowed in %s",
|
"exec used but not allowed in %s",
|
||||||
r->filename);
|
r->filename);
|
||||||
if (printing) {
|
if (printing) {
|
||||||
@@ -2251,7 +2252,7 @@ static void send_parsed_content(FILE *f, request_rec *r)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else {
|
else {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"unknown directive \"%s\" "
|
"unknown directive \"%s\" "
|
||||||
"in parsed doc %s",
|
"in parsed doc %s",
|
||||||
directive, r->filename);
|
directive, r->filename);
|
||||||
@@ -2261,7 +2262,7 @@ static void send_parsed_content(FILE *f, request_rec *r)
|
|||||||
ret = find_string(f, ENDING_SEQUENCE, r, 0);
|
ret = find_string(f, ENDING_SEQUENCE, r, 0);
|
||||||
}
|
}
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"premature EOF in parsed file %s",
|
"premature EOF in parsed file %s",
|
||||||
r->filename);
|
r->filename);
|
||||||
return;
|
return;
|
||||||
@@ -2333,7 +2334,7 @@ static int send_parsed_file(request_rec *r)
|
|||||||
return DECLINED;
|
return DECLINED;
|
||||||
}
|
}
|
||||||
if (r->finfo.st_mode == 0) {
|
if (r->finfo.st_mode == 0) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"File does not exist: %s",
|
"File does not exist: %s",
|
||||||
(r->path_info
|
(r->path_info
|
||||||
? ap_pstrcat(r->pool, r->filename, r->path_info, NULL)
|
? ap_pstrcat(r->pool, r->filename, r->path_info, NULL)
|
||||||
@@ -2342,7 +2343,7 @@ static int send_parsed_file(request_rec *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(f = ap_pfopen(r->pool, r->filename, "r"))) {
|
if (!(f = ap_pfopen(r->pool, r->filename, "r"))) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
"file permissions deny server access: %s", r->filename);
|
"file permissions deny server access: %s", r->filename);
|
||||||
return HTTP_FORBIDDEN;
|
return HTTP_FORBIDDEN;
|
||||||
}
|
}
|
||||||
|
@@ -171,7 +171,7 @@ static info_cfg_lines *mod_info_load_config(ap_context_t *p, const char *filenam
|
|||||||
|
|
||||||
fp = ap_pcfg_openfile(p, filename);
|
fp = ap_pcfg_openfile(p, filename);
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_WARNING, r,
|
ap_log_rerror(APLOG_MARK, APLOG_WARNING, errno, r,
|
||||||
"mod_info: couldn't open config file %s",
|
"mod_info: couldn't open config file %s",
|
||||||
filename);
|
filename);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@@ -1100,7 +1100,7 @@ static int hook_uri2file(request_rec *r)
|
|||||||
* we can actually use it!
|
* we can actually use it!
|
||||||
*/
|
*/
|
||||||
if (!proxy_available) {
|
if (!proxy_available) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"attempt to make remote request from mod_rewrite "
|
"attempt to make remote request from mod_rewrite "
|
||||||
"without proxy enabled: %s", r->filename);
|
"without proxy enabled: %s", r->filename);
|
||||||
return FORBIDDEN;
|
return FORBIDDEN;
|
||||||
@@ -1337,7 +1337,7 @@ static int hook_fixup(request_rec *r)
|
|||||||
*/
|
*/
|
||||||
if (!(ap_allow_options(r) & (OPT_SYM_LINKS | OPT_SYM_OWNER))) {
|
if (!(ap_allow_options(r) & (OPT_SYM_LINKS | OPT_SYM_OWNER))) {
|
||||||
/* FollowSymLinks is mandatory! */
|
/* FollowSymLinks is mandatory! */
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"Options FollowSymLinks or SymLinksIfOwnerMatch is off "
|
"Options FollowSymLinks or SymLinksIfOwnerMatch is off "
|
||||||
"which implies that RewriteRule directive is forbidden: "
|
"which implies that RewriteRule directive is forbidden: "
|
||||||
"%s", r->filename);
|
"%s", r->filename);
|
||||||
@@ -2618,7 +2618,7 @@ static void expand_map_lookups(request_rec *r, char *uri, int uri_len)
|
|||||||
n = strlen(cpT);
|
n = strlen(cpT);
|
||||||
if (cpO + n >= newuri + sizeof(newuri)) {
|
if (cpO + n >= newuri + sizeof(newuri)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR,
|
||||||
r, "insufficient space in "
|
0, r, "insufficient space in "
|
||||||
"expand_map_lookups, aborting");
|
"expand_map_lookups, aborting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2629,7 +2629,7 @@ static void expand_map_lookups(request_rec *r, char *uri, int uri_len)
|
|||||||
n = strlen(defaultvalue);
|
n = strlen(defaultvalue);
|
||||||
if (cpO + n >= newuri + sizeof(newuri)) {
|
if (cpO + n >= newuri + sizeof(newuri)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR,
|
||||||
r, "insufficient space in "
|
0, r, "insufficient space in "
|
||||||
"expand_map_lookups, aborting");
|
"expand_map_lookups, aborting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2644,7 +2644,7 @@ static void expand_map_lookups(request_rec *r, char *uri, int uri_len)
|
|||||||
n = cpT-cpI;
|
n = cpT-cpI;
|
||||||
if (cpO + n >= newuri + sizeof(newuri)) {
|
if (cpO + n >= newuri + sizeof(newuri)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR,
|
||||||
r, "insufficient space in "
|
0, r, "insufficient space in "
|
||||||
"expand_map_lookups, aborting");
|
"expand_map_lookups, aborting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2694,7 +2694,7 @@ static char *lookup_map(request_rec *r, char *name, char *key)
|
|||||||
if (strcmp(s->name, name) == 0) {
|
if (strcmp(s->name, name) == 0) {
|
||||||
if (s->type == MAPTYPE_TXT) {
|
if (s->type == MAPTYPE_TXT) {
|
||||||
if (stat(s->checkfile, &st) == -1) {
|
if (stat(s->checkfile, &st) == -1) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
|
||||||
"mod_rewrite: can't access text RewriteMap "
|
"mod_rewrite: can't access text RewriteMap "
|
||||||
"file %s", s->checkfile);
|
"file %s", s->checkfile);
|
||||||
rewritelog(r, 1, "can't open RewriteMap file, "
|
rewritelog(r, 1, "can't open RewriteMap file, "
|
||||||
@@ -2731,7 +2731,7 @@ static char *lookup_map(request_rec *r, char *name, char *key)
|
|||||||
else if (s->type == MAPTYPE_DBM) {
|
else if (s->type == MAPTYPE_DBM) {
|
||||||
#ifndef NO_DBM_REWRITEMAP
|
#ifndef NO_DBM_REWRITEMAP
|
||||||
if (stat(s->checkfile, &st) == -1) {
|
if (stat(s->checkfile, &st) == -1) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
"mod_rewrite: can't access DBM RewriteMap "
|
"mod_rewrite: can't access DBM RewriteMap "
|
||||||
"file %s", s->checkfile);
|
"file %s", s->checkfile);
|
||||||
rewritelog(r, 1, "can't open DBM RewriteMap file, "
|
rewritelog(r, 1, "can't open DBM RewriteMap file, "
|
||||||
@@ -2793,7 +2793,7 @@ static char *lookup_map(request_rec *r, char *name, char *key)
|
|||||||
}
|
}
|
||||||
else if (s->type == MAPTYPE_RND) {
|
else if (s->type == MAPTYPE_RND) {
|
||||||
if (stat(s->checkfile, &st) == -1) {
|
if (stat(s->checkfile, &st) == -1) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
"mod_rewrite: can't access text RewriteMap "
|
"mod_rewrite: can't access text RewriteMap "
|
||||||
"file %s", s->checkfile);
|
"file %s", s->checkfile);
|
||||||
rewritelog(r, 1, "can't open RewriteMap file, "
|
rewritelog(r, 1, "can't open RewriteMap file, "
|
||||||
@@ -3791,7 +3791,8 @@ static cache *init_cache(ap_context_t *p)
|
|||||||
cache *c;
|
cache *c;
|
||||||
|
|
||||||
c = (cache *)ap_palloc(p, sizeof(cache));
|
c = (cache *)ap_palloc(p, sizeof(cache));
|
||||||
c->pool = ap_make_sub_pool(p);
|
if (ap_create_context(&c->pool, p) != APR_SUCCESS)
|
||||||
|
return NULL;
|
||||||
c->lists = ap_make_array(c->pool, 2, sizeof(cachelist));
|
c->lists = ap_make_array(c->pool, 2, sizeof(cachelist));
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
@@ -4193,7 +4194,7 @@ static void fd_lock(request_rec *r, int fd)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
"mod_rewrite: failed to lock file descriptor");
|
"mod_rewrite: failed to lock file descriptor");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@@ -4223,7 +4224,7 @@ static void fd_unlock(request_rec *r, int fd)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
"mod_rewrite: failed to unlock file descriptor");
|
"mod_rewrite: failed to unlock file descriptor");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@@ -256,7 +256,7 @@ static int scan_meta_file(request_rec *r, FILE *f)
|
|||||||
/* if we see a bogus header don't ignore it. Shout and scream */
|
/* if we see a bogus header don't ignore it. Shout and scream */
|
||||||
|
|
||||||
if (!(l = strchr(w, ':'))) {
|
if (!(l = strchr(w, ':'))) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"malformed header in meta file: %s", r->filename);
|
"malformed header in meta file: %s", r->filename);
|
||||||
return SERVER_ERROR;
|
return SERVER_ERROR;
|
||||||
}
|
}
|
||||||
@@ -330,7 +330,7 @@ static int add_cern_meta_data(request_rec *r)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* no last slash, buh?! */
|
/* no last slash, buh?! */
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"internal error in mod_cern_meta: %s", r->filename);
|
"internal error in mod_cern_meta: %s", r->filename);
|
||||||
/* should really barf, but hey, let's be friends... */
|
/* should really barf, but hey, let's be friends... */
|
||||||
return DECLINED;
|
return DECLINED;
|
||||||
@@ -359,7 +359,7 @@ static int add_cern_meta_data(request_rec *r)
|
|||||||
if (errno == ENOENT) {
|
if (errno == ENOENT) {
|
||||||
return DECLINED;
|
return DECLINED;
|
||||||
}
|
}
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
|
||||||
"meta file permissions deny server access: %s", metafilename);
|
"meta file permissions deny server access: %s", metafilename);
|
||||||
return FORBIDDEN;
|
return FORBIDDEN;
|
||||||
};
|
};
|
||||||
|
@@ -415,7 +415,7 @@ static int add_expires(request_rec *r)
|
|||||||
|
|
||||||
conf = (expires_dir_config *) ap_get_module_config(r->per_dir_config, &expires_module);
|
conf = (expires_dir_config *) ap_get_module_config(r->per_dir_config, &expires_module);
|
||||||
if (conf == NULL) {
|
if (conf == NULL) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"internal error: %s", r->filename);
|
"internal error: %s", r->filename);
|
||||||
return SERVER_ERROR;
|
return SERVER_ERROR;
|
||||||
};
|
};
|
||||||
@@ -471,7 +471,7 @@ static int add_expires(request_rec *r)
|
|||||||
/* expecting the add_* routines to be case-hardened this
|
/* expecting the add_* routines to be case-hardened this
|
||||||
* is just a reminder that module is beta
|
* is just a reminder that module is beta
|
||||||
*/
|
*/
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
|
||||||
"internal error: bad expires code: %s", r->filename);
|
"internal error: bad expires code: %s", r->filename);
|
||||||
return SERVER_ERROR;
|
return SERVER_ERROR;
|
||||||
};
|
};
|
||||||
|
@@ -677,7 +677,7 @@ static char *rsl_strdup(request_rec *r, int start_frag, int start_pos, int len)
|
|||||||
/* clean up and return */
|
/* clean up and return */
|
||||||
result[res_pos] = 0;
|
result[res_pos] = 0;
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
MODNAME ": rsl_strdup() %d chars: %s", res_pos - 1, result);
|
MODNAME ": rsl_strdup() %d chars: %s", res_pos - 1, result);
|
||||||
#endif
|
#endif
|
||||||
return result;
|
return result;
|
||||||
@@ -749,7 +749,7 @@ static int magic_rsl_to_request(request_rec *r)
|
|||||||
else {
|
else {
|
||||||
/* should not be possible */
|
/* should not be possible */
|
||||||
/* abandon malfunctioning module */
|
/* abandon malfunctioning module */
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, 0, r,
|
||||||
MODNAME ": bad state %d (ws)", state);
|
MODNAME ": bad state %d (ws)", state);
|
||||||
return DECLINED;
|
return DECLINED;
|
||||||
}
|
}
|
||||||
@@ -793,7 +793,7 @@ static int magic_rsl_to_request(request_rec *r)
|
|||||||
else {
|
else {
|
||||||
/* should not be possible */
|
/* should not be possible */
|
||||||
/* abandon malfunctioning module */
|
/* abandon malfunctioning module */
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, 0, r,
|
||||||
MODNAME ": bad state %d (ns)", state);
|
MODNAME ": bad state %d (ns)", state);
|
||||||
return DECLINED;
|
return DECLINED;
|
||||||
}
|
}
|
||||||
@@ -868,7 +868,7 @@ static int magic_process(request_rec *r)
|
|||||||
|
|
||||||
if ((fd = ap_popenf(r->pool, r->filename, O_RDONLY, 0)) < 0) {
|
if ((fd = ap_popenf(r->pool, r->filename, O_RDONLY, 0)) < 0) {
|
||||||
/* We can't open it, but we were able to stat it. */
|
/* We can't open it, but we were able to stat it. */
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
|
||||||
MODNAME ": can't read `%s'", r->filename);
|
MODNAME ": can't read `%s'", r->filename);
|
||||||
/* let some other handler decide what the problem is */
|
/* let some other handler decide what the problem is */
|
||||||
return DECLINED;
|
return DECLINED;
|
||||||
@@ -878,7 +878,7 @@ static int magic_process(request_rec *r)
|
|||||||
* try looking at the first HOWMANY bytes
|
* try looking at the first HOWMANY bytes
|
||||||
*/
|
*/
|
||||||
if ((nbytes = read(fd, (char *) buf, sizeof(buf) - 1)) == -1) {
|
if ((nbytes = read(fd, (char *) buf, sizeof(buf) - 1)) == -1) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
MODNAME ": read failed: %s", r->filename);
|
MODNAME ": read failed: %s", r->filename);
|
||||||
return HTTP_INTERNAL_SERVER_ERROR;
|
return HTTP_INTERNAL_SERVER_ERROR;
|
||||||
}
|
}
|
||||||
@@ -1481,7 +1481,7 @@ static int fsmagic(request_rec *r, const char *fn)
|
|||||||
/* We used stat(), the only possible reason for this is that the
|
/* We used stat(), the only possible reason for this is that the
|
||||||
* symlink is broken.
|
* symlink is broken.
|
||||||
*/
|
*/
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, 0, r,
|
||||||
MODNAME ": broken symlink (%s)", fn);
|
MODNAME ": broken symlink (%s)", fn);
|
||||||
return HTTP_INTERNAL_SERVER_ERROR;
|
return HTTP_INTERNAL_SERVER_ERROR;
|
||||||
#endif
|
#endif
|
||||||
@@ -1495,7 +1495,7 @@ static int fsmagic(request_rec *r, const char *fn)
|
|||||||
case S_IFREG:
|
case S_IFREG:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, 0, r,
|
||||||
MODNAME ": invalid mode 0%o.", (unsigned int)r->finfo.st_mode);
|
MODNAME ": invalid mode 0%o.", (unsigned int)r->finfo.st_mode);
|
||||||
return HTTP_INTERNAL_SERVER_ERROR;
|
return HTTP_INTERNAL_SERVER_ERROR;
|
||||||
}
|
}
|
||||||
@@ -1562,7 +1562,7 @@ static int match(request_rec *r, unsigned char *s, int nbytes)
|
|||||||
struct magic *m;
|
struct magic *m;
|
||||||
|
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
MODNAME ": match conf=%x file=%s m=%s m->next=%s last=%s",
|
MODNAME ": match conf=%x file=%s m=%s m->next=%s last=%s",
|
||||||
conf,
|
conf,
|
||||||
conf->magicfile ? conf->magicfile : "NULL",
|
conf->magicfile ? conf->magicfile : "NULL",
|
||||||
@@ -1577,7 +1577,7 @@ static int match(request_rec *r, unsigned char *s, int nbytes)
|
|||||||
ap_isprint((((unsigned long) m) >> 16) & 255) &&
|
ap_isprint((((unsigned long) m) >> 16) & 255) &&
|
||||||
ap_isprint((((unsigned long) m) >> 8) & 255) &&
|
ap_isprint((((unsigned long) m) >> 8) & 255) &&
|
||||||
ap_isprint(((unsigned long) m) & 255)) {
|
ap_isprint(((unsigned long) m) & 255)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
MODNAME ": match: POINTER CLOBBERED! "
|
MODNAME ": match: POINTER CLOBBERED! "
|
||||||
"m=\"%c%c%c%c\"",
|
"m=\"%c%c%c%c\"",
|
||||||
(((unsigned long) m) >> 24) & 255,
|
(((unsigned long) m) >> 24) & 255,
|
||||||
@@ -1592,7 +1592,7 @@ static int match(request_rec *r, unsigned char *s, int nbytes)
|
|||||||
for (m = conf->magic; m; m = m->next) {
|
for (m = conf->magic; m; m = m->next) {
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
rule_counter++;
|
rule_counter++;
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
MODNAME ": line=%d desc=%s", m->lineno, m->desc);
|
MODNAME ": line=%d desc=%s", m->lineno, m->desc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1612,7 +1612,7 @@ static int match(request_rec *r, unsigned char *s, int nbytes)
|
|||||||
while (m_cont && (m_cont->cont_level != 0)) {
|
while (m_cont && (m_cont->cont_level != 0)) {
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
rule_counter++;
|
rule_counter++;
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
MODNAME ": line=%d mc=%x mc->next=%x cont=%d desc=%s",
|
MODNAME ": line=%d mc=%x mc->next=%x cont=%d desc=%s",
|
||||||
m_cont->lineno, m_cont,
|
m_cont->lineno, m_cont,
|
||||||
m_cont->next, m_cont->cont_level,
|
m_cont->next, m_cont->cont_level,
|
||||||
@@ -1631,7 +1631,7 @@ static int match(request_rec *r, unsigned char *s, int nbytes)
|
|||||||
/* if we get here, the main entry rule was a match */
|
/* if we get here, the main entry rule was a match */
|
||||||
/* this will be the last run through the loop */
|
/* this will be the last run through the loop */
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
MODNAME ": rule matched, line=%d type=%d %s",
|
MODNAME ": rule matched, line=%d type=%d %s",
|
||||||
m->lineno, m->type,
|
m->lineno, m->type,
|
||||||
(m->type == STRING) ? m->value.s : "");
|
(m->type == STRING) ? m->value.s : "");
|
||||||
@@ -1655,7 +1655,7 @@ static int match(request_rec *r, unsigned char *s, int nbytes)
|
|||||||
m = m->next;
|
m = m->next;
|
||||||
while (m && (m->cont_level != 0)) {
|
while (m && (m->cont_level != 0)) {
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
MODNAME ": match line=%d cont=%d type=%d %s",
|
MODNAME ": match line=%d cont=%d type=%d %s",
|
||||||
m->lineno, m->cont_level, m->type,
|
m->lineno, m->cont_level, m->type,
|
||||||
(m->type == STRING) ? m->value.s : "");
|
(m->type == STRING) ? m->value.s : "");
|
||||||
@@ -1699,13 +1699,13 @@ static int match(request_rec *r, unsigned char *s, int nbytes)
|
|||||||
m = m->next;
|
m = m->next;
|
||||||
}
|
}
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
MODNAME ": matched after %d rules", rule_counter);
|
MODNAME ": matched after %d rules", rule_counter);
|
||||||
#endif
|
#endif
|
||||||
return 1; /* all through */
|
return 1; /* all through */
|
||||||
}
|
}
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
MODNAME ": failed after %d rules", rule_counter);
|
MODNAME ": failed after %d rules", rule_counter);
|
||||||
#endif
|
#endif
|
||||||
return 0; /* no match at all */
|
return 0; /* no match at all */
|
||||||
@@ -1752,7 +1752,7 @@ static void mprint(request_rec *r, union VALUETYPE *p, struct magic *m)
|
|||||||
(void) magic_rsl_printf(r, m->desc, pp);
|
(void) magic_rsl_printf(r, m->desc, pp);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, 0, r,
|
||||||
MODNAME ": invalid m->type (%d) in mprint().",
|
MODNAME ": invalid m->type (%d) in mprint().",
|
||||||
m->type);
|
m->type);
|
||||||
return;
|
return;
|
||||||
@@ -1798,7 +1798,7 @@ static int mconvert(request_rec *r, union VALUETYPE *p, struct magic *m)
|
|||||||
((p->hl[3] << 24) | (p->hl[2] << 16) | (p->hl[1] << 8) | (p->hl[0]));
|
((p->hl[3] << 24) | (p->hl[2] << 16) | (p->hl[1] << 8) | (p->hl[0]));
|
||||||
return 1;
|
return 1;
|
||||||
default:
|
default:
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, 0, r,
|
||||||
MODNAME ": invalid type %d in mconvert().", m->type);
|
MODNAME ": invalid type %d in mconvert().", m->type);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1850,7 +1850,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
|
|||||||
int matched;
|
int matched;
|
||||||
|
|
||||||
if ((m->value.s[0] == 'x') && (m->value.s[1] == '\0')) {
|
if ((m->value.s[0] == 'x') && (m->value.s[1] == '\0')) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, 0, r,
|
||||||
MODNAME ": BOINK");
|
MODNAME ": BOINK");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -1895,7 +1895,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* bogosity, pretend that it just wasn't a match */
|
/* bogosity, pretend that it just wasn't a match */
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, 0, r,
|
||||||
MODNAME ": invalid type %d in mcheck().", m->type);
|
MODNAME ": invalid type %d in mcheck().", m->type);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1905,7 +1905,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
|
|||||||
switch (m->reln) {
|
switch (m->reln) {
|
||||||
case 'x':
|
case 'x':
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
"%lu == *any* = 1", v);
|
"%lu == *any* = 1", v);
|
||||||
#endif
|
#endif
|
||||||
matched = 1;
|
matched = 1;
|
||||||
@@ -1914,7 +1914,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
|
|||||||
case '!':
|
case '!':
|
||||||
matched = v != l;
|
matched = v != l;
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
"%lu != %lu = %d", v, l, matched);
|
"%lu != %lu = %d", v, l, matched);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@@ -1922,7 +1922,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
|
|||||||
case '=':
|
case '=':
|
||||||
matched = v == l;
|
matched = v == l;
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
"%lu == %lu = %d", v, l, matched);
|
"%lu == %lu = %d", v, l, matched);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@@ -1931,14 +1931,14 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
|
|||||||
if (m->flag & UNSIGNED) {
|
if (m->flag & UNSIGNED) {
|
||||||
matched = v > l;
|
matched = v > l;
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
"%lu > %lu = %d", v, l, matched);
|
"%lu > %lu = %d", v, l, matched);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
matched = (long) v > (long) l;
|
matched = (long) v > (long) l;
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
"%ld > %ld = %d", v, l, matched);
|
"%ld > %ld = %d", v, l, matched);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1948,14 +1948,14 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
|
|||||||
if (m->flag & UNSIGNED) {
|
if (m->flag & UNSIGNED) {
|
||||||
matched = v < l;
|
matched = v < l;
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
"%lu < %lu = %d", v, l, matched);
|
"%lu < %lu = %d", v, l, matched);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
matched = (long) v < (long) l;
|
matched = (long) v < (long) l;
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
"%ld < %ld = %d", v, l, matched);
|
"%ld < %ld = %d", v, l, matched);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1964,7 +1964,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
|
|||||||
case '&':
|
case '&':
|
||||||
matched = (v & l) == l;
|
matched = (v & l) == l;
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
"((%lx & %lx) == %lx) = %d", v, l, l, matched);
|
"((%lx & %lx) == %lx) = %d", v, l, l, matched);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@@ -1972,7 +1972,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
|
|||||||
case '^':
|
case '^':
|
||||||
matched = (v & l) != l;
|
matched = (v & l) != l;
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
"((%lx & %lx) != %lx) = %d", v, l, l, matched);
|
"((%lx & %lx) != %lx) = %d", v, l, l, matched);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@@ -1980,7 +1980,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
|
|||||||
default:
|
default:
|
||||||
/* bogosity, pretend it didn't match */
|
/* bogosity, pretend it didn't match */
|
||||||
matched = 0;
|
matched = 0;
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, 0, r,
|
||||||
MODNAME ": mcheck: can't happen: invalid relation %d.",
|
MODNAME ": mcheck: can't happen: invalid relation %d.",
|
||||||
m->reln);
|
m->reln);
|
||||||
break;
|
break;
|
||||||
@@ -2160,7 +2160,7 @@ static int uncompress_child(void *data, child_info *pinfo)
|
|||||||
child_pid = ap_spawnvp(compr[parm->method].argv[0],
|
child_pid = ap_spawnvp(compr[parm->method].argv[0],
|
||||||
new_argv);
|
new_argv);
|
||||||
if (child_pid == -1)
|
if (child_pid == -1)
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, parm->r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, parm->r,
|
||||||
MODNAME ": could not execute `%s'.",
|
MODNAME ": could not execute `%s'.",
|
||||||
compr[parm->method].argv[0]);
|
compr[parm->method].argv[0]);
|
||||||
return (child_pid);
|
return (child_pid);
|
||||||
@@ -2181,11 +2181,12 @@ static int uncompress(request_rec *r, int method,
|
|||||||
* there are cases (i.e. generating directory indicies with mod_autoindex)
|
* there are cases (i.e. generating directory indicies with mod_autoindex)
|
||||||
* where we would end up with LOTS of zombies.
|
* where we would end up with LOTS of zombies.
|
||||||
*/
|
*/
|
||||||
sub_pool = ap_make_sub_pool(r->pool);
|
if (ap_create_context(&sub_pool, r->pool) != APR_SUCCESS)
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (!ap_bspawn_child(sub_pool, uncompress_child, &parm, kill_always,
|
if (!ap_bspawn_child(sub_pool, uncompress_child, &parm, kill_always,
|
||||||
NULL, &bout, NULL)) {
|
NULL, &bout, NULL)) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
MODNAME ": couldn't spawn uncompress process: %s", r->uri);
|
MODNAME ": couldn't spawn uncompress process: %s", r->uri);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -2193,7 +2194,7 @@ static int uncompress(request_rec *r, int method,
|
|||||||
*newch = (unsigned char *) ap_palloc(r->pool, n);
|
*newch = (unsigned char *) ap_palloc(r->pool, n);
|
||||||
if ((n = ap_bread(bout, *newch, n)) <= 0) {
|
if ((n = ap_bread(bout, *newch, n)) <= 0) {
|
||||||
ap_destroy_pool(sub_pool);
|
ap_destroy_pool(sub_pool);
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
|
||||||
MODNAME ": read failed %s", r->filename);
|
MODNAME ": read failed %s", r->filename);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -2300,7 +2301,7 @@ static int revision_suffix(request_rec *r)
|
|||||||
request_rec *sub;
|
request_rec *sub;
|
||||||
|
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
MODNAME ": revision_suffix checking %s", r->filename);
|
MODNAME ": revision_suffix checking %s", r->filename);
|
||||||
#endif /* MIME_MAGIC_DEBUG */
|
#endif /* MIME_MAGIC_DEBUG */
|
||||||
|
|
||||||
@@ -2319,7 +2320,7 @@ static int revision_suffix(request_rec *r)
|
|||||||
result = 0;
|
result = 0;
|
||||||
sub_filename = ap_pstrndup(r->pool, r->filename, suffix_pos);
|
sub_filename = ap_pstrndup(r->pool, r->filename, suffix_pos);
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
MODNAME ": subrequest lookup for %s", sub_filename);
|
MODNAME ": subrequest lookup for %s", sub_filename);
|
||||||
#endif /* MIME_MAGIC_DEBUG */
|
#endif /* MIME_MAGIC_DEBUG */
|
||||||
sub = ap_sub_req_lookup_file(sub_filename, r);
|
sub = ap_sub_req_lookup_file(sub_filename, r);
|
||||||
@@ -2328,7 +2329,7 @@ static int revision_suffix(request_rec *r)
|
|||||||
if (sub->content_type) {
|
if (sub->content_type) {
|
||||||
r->content_type = ap_pstrdup(r->pool, sub->content_type);
|
r->content_type = ap_pstrdup(r->pool, sub->content_type);
|
||||||
#if MIME_MAGIC_DEBUG
|
#if MIME_MAGIC_DEBUG
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r,
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r,
|
||||||
MODNAME ": subrequest %s got %s",
|
MODNAME ": subrequest %s got %s",
|
||||||
sub_filename, r->content_type);
|
sub_filename, r->content_type);
|
||||||
#endif /* MIME_MAGIC_DEBUG */
|
#endif /* MIME_MAGIC_DEBUG */
|
||||||
|
Reference in New Issue
Block a user