/* make sure we have a list to put it in */
if (!req_dat) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EINVAL, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EINVAL, r, APLOGNO(01507)
MODNAME ": request config should not be NULL");
if (!(req_dat = magic_set_config(r))) {
/* failure */
/* clean up and return */
result[res_pos] = 0;
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01508)
MODNAME ": rsl_strdup() %d chars: %s", res_pos - 1, result);
#endif
return result;
else {
/* should not be possible */
/* abandon malfunctioning module */
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01509)
MODNAME ": bad state %d (ws)", state);
return DECLINED;
}
else {
/* should not be possible */
/* abandon malfunctioning module */
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01510)
MODNAME ": bad state %d (ns)", state);
return DECLINED;
}
/* detect memory allocation or other errors */
if (!r->content_type ||
(state == rsl_encoding && !r->content_encoding)) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01511)
MODNAME ": unexpected state %d; could be caused by bad "
"data in magic file",
state);
if (apr_file_open(&fd, r->filename, APR_READ, APR_OS_DEFAULT, r->pool) != APR_SUCCESS) {
/* We can't open it, but we were able to stat it. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01512)
MODNAME ": can't read `%s'", r->filename);
/* let some other handler decide what the problem is */
return DECLINED;
*/
nbytes = sizeof(buf) - 1;
if ((result = apr_file_read(fd, (char *) buf, &nbytes)) != APR_SUCCESS) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, result, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, result, r, APLOGNO(01513)
MODNAME ": read failed: %s", r->filename);
return HTTP_INTERNAL_SERVER_ERROR;
}
const char *fname = ap_server_root_relative(p, conf->magicfile);
if (!fname) {
- ap_log_error(APLOG_MARK, APLOG_ERR, APR_EBADPATH, s,
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EBADPATH, s, APLOGNO(01514)
MODNAME ": Invalid magic file path %s", conf->magicfile);
return -1;
}
if ((result = apr_file_open(&f, fname, APR_READ | APR_BUFFERED,
APR_OS_DEFAULT, p)) != APR_SUCCESS) {
- ap_log_error(APLOG_MARK, APLOG_ERR, result, s,
+ ap_log_error(APLOG_MARK, APLOG_ERR, result, s, APLOGNO(01515)
MODNAME ": can't read magic file %s", fname);
return -1;
}
(void) apr_file_close(f);
#if MIME_MAGIC_DEBUG
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01516)
MODNAME ": apprentice conf=%x file=%s m=%s m->next=%s last=%s",
conf,
conf->magicfile ? conf->magicfile : "NULL",
conf->magic ? "set" : "NULL",
(conf->magic && conf->magic->next) ? "set" : "NULL",
conf->last ? "set" : "NULL");
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01517)
MODNAME ": apprentice read %d lines, %d rules, %d errors",
lineno, rule, errs);
#endif
#if MIME_MAGIC_DEBUG
prevm = 0;
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01518)
MODNAME ": apprentice test");
for (m = conf->magic; m; m = m->next) {
if (apr_isprint((((unsigned long) m) >> 24) & 255) &&
apr_isprint((((unsigned long) m) >> 16) & 255) &&
apr_isprint((((unsigned long) m) >> 8) & 255) &&
apr_isprint(((unsigned long) m) & 255)) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01519)
MODNAME ": apprentice: POINTER CLOBBERED! "
"m=\"%c%c%c%c\" line=%d",
(((unsigned long) m) >> 24) & 255,
case STRING:
break;
default:
- ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(01520)
MODNAME ": can't happen: m->type=%d", m->type);
return -1;
}
/* get offset, then skip over it */
m->offset = (int) strtol(l, &t, 0);
if (l == t) {
- ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv,
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv, APLOGNO(01521)
MODNAME ": offset %s invalid", l);
}
l = t;
m->in.type = BYTE;
break;
default:
- ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv,
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv, APLOGNO(01522)
MODNAME ": indirect offset type %c invalid", *l);
break;
}
else
t = l;
if (*t++ != ')') {
- ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv,
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv, APLOGNO(01523)
MODNAME ": missing ')' in indirect offset");
}
l = t;
l += NLEDATE;
}
else {
- ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv,
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv, APLOGNO(01524)
MODNAME ": type %s invalid", l);
return -1;
}
apr_cpystrn(m->desc, l, sizeof(m->desc));
#if MIME_MAGIC_DEBUG
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, serv,
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, serv, APLOGNO(01525)
MODNAME ": parse line=%d m=%x next=%x cont=%d desc=%s",
lineno, m, m->next, m->cont_level, m->desc);
#endif /* MIME_MAGIC_DEBUG */
if (apr_isspace(c))
break;
if (p >= pmax) {
- ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv,
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv, APLOGNO(01526)
MODNAME ": string too long: %s", origs);
break;
}
/* We used stat(), the only possible reason for this is that the
* symlink is broken.
*/
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01527)
MODNAME ": broken symlink (%s)", fn);
return HTTP_INTERNAL_SERVER_ERROR;
case APR_SOCK:
case APR_REG:
break;
default:
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01528)
MODNAME ": invalid file type %d.", r->finfo.filetype);
return HTTP_INTERNAL_SERVER_ERROR;
}
struct magic *m;
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01529)
MODNAME ": match conf=%x file=%s m=%s m->next=%s last=%s",
conf,
conf->magicfile ? conf->magicfile : "NULL",
apr_isprint((((unsigned long) m) >> 16) & 255) &&
apr_isprint((((unsigned long) m) >> 8) & 255) &&
apr_isprint(((unsigned long) m) & 255)) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01530)
MODNAME ": match: POINTER CLOBBERED! "
"m=\"%c%c%c%c\"",
(((unsigned long) m) >> 24) & 255,
for (m = conf->magic; m; m = m->next) {
#if MIME_MAGIC_DEBUG
rule_counter++;
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01531)
MODNAME ": line=%d desc=%s", m->lineno, m->desc);
#endif
while (m_cont && (m_cont->cont_level != 0)) {
#if MIME_MAGIC_DEBUG
rule_counter++;
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01532)
MODNAME ": line=%d mc=%x mc->next=%x cont=%d desc=%s",
m_cont->lineno, m_cont,
m_cont->next, m_cont->cont_level,
/* if we get here, the main entry rule was a match */
/* this will be the last run through the loop */
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01533)
MODNAME ": rule matched, line=%d type=%d %s",
m->lineno, m->type,
(m->type == STRING) ? m->value.s : "");
m = m->next;
while (m && (m->cont_level != 0)) {
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01534)
MODNAME ": match line=%d cont=%d type=%d %s",
m->lineno, m->cont_level, m->type,
(m->type == STRING) ? m->value.s : "");
m = m->next;
}
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01535)
MODNAME ": matched after %d rules", rule_counter);
#endif
return 1; /* all through */
}
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01536)
MODNAME ": failed after %d rules", rule_counter);
#endif
return 0; /* no match at all */
(void) magic_rsl_printf(r, m->desc, pp);
return;
default:
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01537)
MODNAME ": invalid m->type (%d) in mprint().",
m->type);
return;
((p->hl[3] << 24) | (p->hl[2] << 16) | (p->hl[1] << 8) | (p->hl[0]));
return 1;
default:
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01538)
MODNAME ": invalid type %d in mconvert().", m->type);
return 0;
}
int matched;
if ((m->value.s[0] == 'x') && (m->value.s[1] == '\0')) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01539)
MODNAME ": BOINK");
return 1;
}
break;
default:
/* bogosity, pretend that it just wasn't a match */
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01540)
MODNAME ": invalid type %d in mcheck().", m->type);
return 0;
}
switch (m->reln) {
case 'x':
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01541)
"%lu == *any* = 1", v);
#endif
matched = 1;
case '!':
matched = v != l;
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01542)
"%lu != %lu = %d", v, l, matched);
#endif
break;
case '=':
matched = v == l;
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01543)
"%lu == %lu = %d", v, l, matched);
#endif
break;
if (m->flag & UNSIGNED) {
matched = v > l;
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01544)
"%lu > %lu = %d", v, l, matched);
#endif
}
else {
matched = (long) v > (long) l;
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01545)
"%ld > %ld = %d", v, l, matched);
#endif
}
if (m->flag & UNSIGNED) {
matched = v < l;
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01546)
"%lu < %lu = %d", v, l, matched);
#endif
}
else {
matched = (long) v < (long) l;
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01547)
"%ld < %ld = %d", v, l, matched);
#endif
}
case '&':
matched = (v & l) == l;
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01548)
"((%lx & %lx) == %lx) = %d", v, l, l, matched);
#endif
break;
case '^':
matched = (v & l) != l;
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01549)
"((%lx & %lx) != %lx) = %d", v, l, l, matched);
#endif
break;
default:
/* bogosity, pretend it didn't match */
matched = 0;
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01550)
MODNAME ": mcheck: can't happen: invalid relation %d.",
m->reln);
break;
ap_make_dirstr_parent(r->pool, r->filename)) != APR_SUCCESS) ||
(apr_procattr_cmdtype_set(procattr, APR_PROGRAM_PATH) != APR_SUCCESS)) {
/* Something bad happened, tell the world. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_ENOPROC, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_ENOPROC, r, APLOGNO(01551)
"couldn't setup child process: %s", r->filename);
}
else {
if (rc != APR_SUCCESS) {
/* Bad things happened. Everyone should have cleaned up. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_ENOPROC, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_ENOPROC, r, APLOGNO(01552)
MODNAME ": could not execute `%s'.",
compr[parm->method].argv[0]);
}
return -1;
if ((rv = create_uncompress_child(&parm, sub_context, &pipe_out)) != APR_SUCCESS) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01553)
MODNAME ": couldn't spawn uncompress process: %s", r->uri);
return -1;
}
rv = apr_file_read(pipe_out, *newch, &n);
if (n == 0) {
apr_pool_destroy(sub_context);
- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01554)
MODNAME ": read failed from uncompress of %s", r->filename);
return -1;
}
request_rec *sub;
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01555)
MODNAME ": revision_suffix checking %s", r->filename);
#endif /* MIME_MAGIC_DEBUG */
result = 0;
sub_filename = apr_pstrndup(r->pool, r->filename, suffix_pos);
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01556)
MODNAME ": subrequest lookup for %s", sub_filename);
#endif /* MIME_MAGIC_DEBUG */
sub = ap_sub_req_lookup_file(sub_filename, r, NULL);
if (sub->content_type) {
ap_set_content_type(r, apr_pstrdup(r->pool, sub->content_type));
#if MIME_MAGIC_DEBUG
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01557)
MODNAME ": subrequest %s got %s",
sub_filename, r->content_type);
#endif /* MIME_MAGIC_DEBUG */
return OK;
#if MIME_MAGIC_DEBUG
prevm = 0;
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01558)
MODNAME ": magic_init 1 test");
for (m = conf->magic; m; m = m->next) {
if (apr_isprint((((unsigned long) m) >> 24) & 255) &&
apr_isprint((((unsigned long) m) >> 16) & 255) &&
apr_isprint((((unsigned long) m) >> 8) & 255) &&
apr_isprint(((unsigned long) m) & 255)) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01559)
MODNAME ": magic_init 1: POINTER CLOBBERED! "
"m=\"%c%c%c%c\" line=%d",
(((unsigned long) m) >> 24) & 255,