/* Licensed to the Apache Software Foundation (ASF) under one or more *contributorlicenseagreements.SeetheNOTICEfiledistributedwith *thisworkforadditionalinformationregardingcopyrightownership. *TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0 *(the"License");youmaynotusethisfileexceptincompliancewith *theLicense.YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting,software *distributedundertheLicenseisdistributedonan"ASIS"BASIS, *WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied. *SeetheLicenseforthespecificlanguagegoverningpermissionsand *limitationsundertheLicense.
*/
/* HOWMANY must be at least 4096 to make gzip -dcq work */ #define HOWMANY 4096 /* SMALL_HOWMANY limits how much work we do to figure out text files */ #define SMALL_HOWMANY 1024 #define MAXDESC 50/* max leng of text description */ #define MAXstring 64/* max leng of "string" types */
struct magic { struct magic *next; /* link to next entry */ int lineno; /* line number from magic file */
short flag; #define INDIR 1/* if '>(...)' appears, */ #defineUNSIGNED2/* comparison is unsigned */ short cont_level; /* level of ">" */ struct { char type; /* byte short long */ long offset; /* offset from indirection */
} in; long offset; /* offset to magic number */ unsignedchar reln; /* relation (0=eq, '>'=gt, etc) */ char type; /* int, short, long or string. */ char vallen; /* length of string value, if any */ #define BYTE 1 #defineSHORT2 #defineLONG4 #define STRING 5 #define DATE 6 #define BESHORT 7 #define BELONG 8 #define BEDATE 9 #define LESHORT 10 #define LELONG 11 #define LEDATE 12 union VALUETYPE { unsignedchar b; unsignedshort h; unsignedlong l; char s[MAXstring]; unsignedchar hs[2]; /* 2 bytes of a fixed-endian "short" */ unsignedchar hl[4]; /* 2 bytes of a fixed-endian "long" */
} value; /* either number or string */ unsignedlong mask; /* mask before comparison with value */ char nospflag; /* suppress space character */
/* NOTE: this string is suspected of overrunning - find it! */ char desc[MAXDESC]; /* description */
};
/* these types are used to index the apr_table_t 'types': keep em in sync! */ /* HTML inserted in first because this is a web server module now */ #define L_HTML 0/* HTML */ #define L_C 1/* first and foremost on UNIX */ #define L_FORT 2/* the oldest one */ #define L_MAKE 3/* Makefiles */ #define L_PLI 4/* PL/1 */ #define L_MACH 5/* some kinda assembler */ #define L_ENG 6/* English */ #define L_PAS 7/* Pascal */ #define L_MAIL 8/* Electronic mail */ #define L_NEWS 9/* Usenet Netnews */
staticconstchar *const types[] =
{ "text/html", /* HTML */ "text/plain", /* "c program text", */ "text/plain", /* "fortran program text", */ "text/plain", /* "make commands text", */ "text/plain", /* "pl/1 program text", */ "text/plain", /* "assembler program text", */ "text/plain", /* "English text", */ "text/plain", /* "pascal program text", */ "message/rfc822", /* "mail text", */ "message/news", /* "news text", */ "application/binary", /* "can't happen error on names.h/types", */ 0
};
typedefstruct magic_rsl_s { constchar *str; /* string, possibly a fragment */ struct magic_rsl_s *next; /* pointer to next fragment */
} magic_rsl;
/* *Apachemoduleconfigurationstructures
*/
/* per-server info */ typedefstruct { constchar *magicfile; /* where magic be found */ struct magic *magic; /* head of magic config list */ struct magic *last;
} magic_server_config_rec;
/* per-request info */ typedefstruct {
magic_rsl *head; /* result string list */
magic_rsl *tail;
} magic_req_rec;
staticvoid *create_magic_server_config(apr_pool_t *p, server_rec *d)
{ /* allocate the config - use pcalloc because it needs to be zeroed */ return apr_pcalloc(p, sizeof(magic_server_config_rec));
}
/* allocate a per-request structure and put it in the request record */ static magic_req_rec *magic_set_config(request_rec *r)
{
magic_req_rec *req_dat = (magic_req_rec *) apr_palloc(r->pool, sizeof(magic_req_rec));
/* add a string to the result string list for this request */ /* it is the responsibility of the caller to allocate "str" */ staticint magic_rsl_add(request_rec *r, constchar *str)
{
magic_req_rec *req_dat = (magic_req_rec *)
ap_get_module_config(r->request_config, &mime_magic_module);
magic_rsl *rsl;
/* make sure we have a list to put it in */ if (!req_dat) {
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 */ return -1;
}
}
/* allocate the list entry */
rsl = (magic_rsl *) apr_palloc(r->pool, sizeof(magic_rsl));
/* fill it */
rsl->str = str;
rsl->next = (magic_rsl *) NULL;
/* append to the list */ if (req_dat->head && req_dat->tail) {
req_dat->tail->next = rsl;
req_dat->tail = rsl;
} else {
req_dat->head = req_dat->tail = rsl;
}
/* assemble the string into the buffer */
va_start(ap, str);
apr_vsnprintf(buf, sizeof(buf), str, ap);
va_end(ap);
/* add the buffer to the list */ return magic_rsl_add(r, apr_pstrdup(r->pool, buf));
}
/* RSL hook for putchar-type functions */ staticint magic_rsl_putchar(request_rec *r, char c)
{ char str[2];
/* high overhead for 1 char - just hope they don't do this much */
str[0] = c;
str[1] = '\0'; return magic_rsl_add(r, apr_pstrdup(r->pool, str));
}
/* allocate and copy a contiguous string from a result string list */ staticchar *rsl_strdup(request_rec *r, int start_frag, int start_pos, int len)
{ char *result; /* return value */ int cur_frag, /* current fragment number/counter */
cur_pos, /* current position within fragment */
res_pos; /* position in result string */
magic_rsl *frag; /* list-traversal pointer */
magic_req_rec *req_dat = (magic_req_rec *)
ap_get_module_config(r->request_config, &mime_magic_module);
/* allocate the result string */
result = (char *) apr_palloc(r->pool, len + 1);
/* loop through and collect the string */
res_pos = 0; for (frag = req_dat->head, cur_frag = 0;
frag->next;
frag = frag->next, cur_frag++) { /* loop to the first fragment */ if (cur_frag < start_frag) continue;
/* loop through and collect chars */ for (cur_pos = (cur_frag == start_frag) ? start_pos : 0;
frag->str[cur_pos];
cur_pos++) { if (cur_frag >= start_frag
&& cur_pos >= start_pos
&& res_pos <= len) {
result[res_pos++] = frag->str[cur_pos]; if (res_pos > len) { break;
}
}
}
}
/* states for the state-machine algorithm in magic_rsl_to_request() */ typedefenum {
rsl_leading_space, rsl_type, rsl_subtype, rsl_separator, rsl_encoding
} rsl_states;
/* process the RSL and set the MIME info in the request record */ staticint magic_rsl_to_request(request_rec *r)
{ int cur_frag, /* current fragment number/counter */
cur_pos, /* current position within fragment */
type_frag, /* content type starting point: fragment */
type_pos, /* content type starting point: position */
type_len, /* content type length */
encoding_frag, /* content encoding starting point: fragment */
encoding_pos, /* content encoding starting point: position */
encoding_len; /* content encoding length */
/* check if we have a result */ if (!req_dat || !req_dat->head) { /* empty - no match, we defer to other Apache modules */ return DECLINED;
}
/* start searching for the type and encoding */
state = rsl_leading_space;
type_frag = type_pos = type_len = 0;
encoding_frag = encoding_pos = encoding_len = 0; for (frag = req_dat->head, cur_frag = 0;
frag && frag->next;
frag = frag->next, cur_frag++) { /* loop through the characters in the fragment */ for (cur_pos = 0; frag->str[cur_pos]; cur_pos++) { if (apr_isspace(frag->str[cur_pos])) { /* process whitespace actions for each state */ if (state == rsl_leading_space) { /* eat whitespace in this state */ continue;
} elseif (state == rsl_type) { /* whitespace: type has no slash! */ return DECLINED;
} elseif (state == rsl_subtype) { /* whitespace: end of MIME type */
state++; continue;
} elseif (state == rsl_separator) { /* eat whitespace in this state */ continue;
} elseif (state == rsl_encoding) { /* whitespace: end of MIME encoding */ /* we're done */
frag = req_dat->tail; break;
} else { /* should not be possible */ /* abandon malfunctioning module */
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01509)
MODNAME ": bad state %d (ws)", state); return DECLINED;
} /* NOTREACHED */
} elseif (state == rsl_type &&
frag->str[cur_pos] == '/') { /* copy the char and go to rsl_subtype state */
type_len++;
state++;
} else { /* process non-space actions for each state */ if (state == rsl_leading_space) { /* non-space: begin MIME type */
state++;
type_frag = cur_frag;
type_pos = cur_pos;
type_len = 1; continue;
} elseif (state == rsl_type ||
state == rsl_subtype) { /* non-space: adds to type */
type_len++; continue;
} elseif (state == rsl_separator) { /* non-space: begin MIME encoding */
state++;
encoding_frag = cur_frag;
encoding_pos = cur_pos;
encoding_len = 1; continue;
} elseif (state == rsl_encoding) { /* non-space: adds to encoding */
encoding_len++; continue;
} else { /* should not be possible */ /* abandon malfunctioning module */
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01510)
MODNAME ": bad state %d (ns)", state); return DECLINED;
} /* NOTREACHED */
} /* NOTREACHED */
}
}
/* if we ended prior to state rsl_subtype, we had incomplete info */ if (state != rsl_subtype && state != rsl_separator &&
state != rsl_encoding) { /* defer to other modules */ return DECLINED;
}
/* save the info in the request record */
tmp = rsl_strdup(r, type_frag, type_pos, type_len); /* XXX: this could be done at config time I'm sure... but I'm
* confused by all this magic_rsl stuff. -djg */
ap_content_type_tolower(tmp);
ap_set_content_type_ex(r, tmp, 1);
if (state == rsl_encoding) {
tmp = rsl_strdup(r, encoding_frag,
encoding_pos, encoding_len); /* XXX: this could be done at config time I'm sure... but I'm
* confused by all this magic_rsl stuff. -djg */
ap_str_tolower(tmp);
r->content_encoding = tmp;
}
/* 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, APLOGNO(01511)
MODNAME ": unexpected state %d; could be caused by bad " "data in magic file",
state); return HTTP_INTERNAL_SERVER_ERROR;
}
/* success! */ return OK;
}
/* *magic_process-processinputfilerApacheAPIrequestrecord *(formerlycalled"process"infilecommand,prefixaddedforclarity)Opens *thefileandreadsafixed-sizebuffertobeginprocessingthecontents.
*/ staticint magic_process(request_rec *r)
{
apr_file_t *fd = NULL; unsignedchar buf[HOWMANY + 1]; /* one extra for terminating '\0' */
apr_size_t nbytes = 0; /* number of bytes read from a datafile */ int result;
/* *firsttryjudgingthefilebasedonitsfilesystemstatus
*/ switch ((result = fsmagic(r, r->filename))) { case DONE:
magic_rsl_putchar(r, '\n'); return OK; case OK: break; default: /* fatal error, bail out */ return result;
}
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, APLOGNO(01512)
MODNAME ": can't read `%s'", r->filename); /* let some other handler decide what the problem is */ return DECLINED;
}
/* set up the magic list (empty) */
conf->magic = conf->last = NULL;
/* parse it */ for (lineno = 1; apr_file_gets(line, BUFSIZ, f) == APR_SUCCESS; lineno++) { int ws_offset; char *last = line + strlen(line) - 1; /* guaranteed that len >= 1 since an *"empty"linecontainsa'\n'
*/
/* delete newline and any other trailing whitespace */ while (last >= line
&& apr_isspace(*last)) {
*last = '\0';
--last;
}
/* skip leading whitespace */
ws_offset = 0; while (line[ws_offset] && apr_isspace(line[ws_offset])) {
ws_offset++;
}
/* append to linked list */
m->next = NULL; if (!conf->magic || !conf->last) {
conf->magic = conf->last = m;
} else {
conf->last->next = m;
conf->last = m;
}
/* set values in magic structure */
m->flag = 0;
m->cont_level = 0;
m->lineno = lineno;
while (*l == '>') {
++l; /* step over */
m->cont_level++;
}
if (m->cont_level != 0 && *l == '(') {
++l; /* step over */
m->flag |= INDIR;
}
/* 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, APLOGNO(01521)
MODNAME ": offset %s invalid", l);
}
l = t;
if (m->flag & INDIR) {
m->in.type = LONG;
m->in.offset = 0; /* *read[.lbs][+-]nnnnn)
*/ if (*l == '.') { switch (*++l) { case'l':
m->in.type = LONG; break; case's':
m->in.type = SHORT; break; case'b':
m->in.type = BYTE; break; default:
ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv, APLOGNO(01522)
MODNAME ": indirect offset type %c invalid", *l); break;
}
l++;
}
s = l; if (*l == '+' || *l == '-')
l++; if (apr_isdigit((unsignedchar) *l)) {
m->in.offset = strtol(l, &t, 0); if (*s == '-')
m->in.offset = -m->in.offset;
} else
t = l; if (*t++ != ')') {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv, APLOGNO(01523)
MODNAME ": missing ')' in indirect offset");
}
l = t;
}
while (apr_isdigit((unsignedchar) *l))
++l;
EATAB;
while ((c = *s++) != '\0') { if (apr_isspace(c)) break; if (p >= pmax) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv, APLOGNO(01526)
MODNAME ": string too long: %s", origs); break;
} if (c == '\\') { switch (c = *s++) {
case'\0': goto out;
default:
*p++ = (char) c; break;
case'n':
*p++ = '\n'; break;
case'r':
*p++ = '\r'; break;
case'b':
*p++ = '\b'; break;
case't':
*p++ = '\t'; break;
case'f':
*p++ = '\f'; break;
case'v':
*p++ = '\v'; break;
/* \ and up to 3 octal digits */ case'0': case'1': case'2': case'3': case'4': case'5': case'6': case'7':
val = c - '0';
c = *s++; /* try for 2 */ if (c >= '0' && c <= '7') {
val = (val << 3) | (c - '0');
c = *s++; /* try for 3 */ if (c >= '0' && c <= '7')
val = (val << 3) | (c - '0'); else
--s;
} else
--s;
*p++ = (char) val; break;
/* \x and up to 3 hex digits */ case'x':
val = 'x'; /* Default if no digits */
c = hextoint(*s++); /* Get next char */ if (c >= 0) {
val = c;
c = hextoint(*s++); if (c >= 0) {
val = (val << 4) + c;
c = hextoint(*s++); if (c >= 0) {
val = (val << 4) + c;
} else
--s;
} else
--s;
} else
--s;
*p++ = (char) val; break;
}
} else
*p++ = (char) c;
}
out:
*p = '\0';
*slen = p - origp; return s;
}
/* Single hex char to int; -1 if not a hex char. */ staticint hextoint(int c)
{ if (apr_isdigit(c)) return c - '0'; if ((c >= 'a') && (c <= 'f')) return c + 10 - 'a'; if ((c >= 'A') && (c <= 'F')) return c + 10 - 'A'; return -1;
}
/* *returnDONEtoindicateit'sbeenhandled *returnOKtoindicateit'saregularfilestillneedinghandling *otherreturnsindicateafailureofsomesort
*/ staticint fsmagic(request_rec *r, constchar *fn)
{ switch (r->finfo.filetype) { case APR_DIR:
magic_rsl_puts(r, DIR_MAGIC_TYPE); return DONE; case APR_CHR: /* *(void)magic_rsl_printf(r,"characterspecial(%d/%d)", *major(sb->st_rdev),minor(sb->st_rdev));
*/
(void) magic_rsl_puts(r, MIME_BINARY_UNKNOWN); return DONE; case APR_BLK: /* *(void)magic_rsl_printf(r,"blockspecial(%d/%d)", *major(sb->st_rdev),minor(sb->st_rdev));
*/
(void) magic_rsl_puts(r, MIME_BINARY_UNKNOWN); return DONE; /* TODO add code to handle V7 MUX and Blit MUX files */ case APR_PIPE: /* *magic_rsl_puts(r,"fifo(namedpipe)");
*/
(void) magic_rsl_puts(r, MIME_BINARY_UNKNOWN); return DONE; case APR_LNK: /* We used stat(), the only possible reason for this is that the *symlinkisbroken.
*/
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01527)
MODNAME ": broken symlink (%s)", fn); return HTTP_INTERNAL_SERVER_ERROR; case APR_SOCK:
magic_rsl_puts(r, MIME_BINARY_UNKNOWN); return DONE; case APR_REG: break; default:
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01528)
MODNAME ": invalid file type %d.", r->finfo.filetype); return HTTP_INTERNAL_SERVER_ERROR;
}
/* 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, APLOGNO(01533)
MODNAME ": rule matched, line=%d type=%d %s",
m->lineno, m->type,
(m->type == STRING) ? m->value.s : ""); #endif
/* print the match */
mprint(r, &p, m);
/* *Ifweprintedsomething,we'llneedtoprintablankbeforewe *printsomethingelse.
*/ if (m->desc[0])
need_separator = 1; /* and any continuations that match */
cont_level++; /* *while(m&&m->next&&m->next->cont_level!=0&&(m=m->next *))
*/
m = m->next; while (m && (m->cont_level != 0)) { #if MIME_MAGIC_DEBUG
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 : ""); #endif if (cont_level >= m->cont_level) { if (cont_level > m->cont_level) { /* *We'reattheendofthelevel"cont_level" *continuations.
*/
cont_level = m->cont_level;
} if (mget(r, &p, s, m, nbytes) &&
mcheck(r, &p, m)) { /* *Thiscontinuationmatched.Printitsmessage,witha *blankbeforeitifthepreviousitemprintedandthis *itemisn'tempty.
*/ /* space if previous printed */ if (need_separator
&& (m->nospflag == 0)
&& (m->desc[0] != '\0')
) {
(void) magic_rsl_putchar(r, ' ');
need_separator = 0;
}
mprint(r, &p, m); if (m->desc[0])
need_separator = 1;
/* move to next continuation record */
m = m->next;
} #if MIME_MAGIC_DEBUG
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01535)
MODNAME ": matched after %d rules", rule_counter); #endif return1; /* all through */
} #if MIME_MAGIC_DEBUG
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01536)
MODNAME ": failed after %d rules", rule_counter); #endif return0; /* no match at all */
}
caseSHORT: case BESHORT: case LESHORT:
v = p->h; break;
caseLONG: case BELONG: case LELONG: case DATE: case BEDATE: case LEDATE:
v = p->l; break;
case STRING:
l = 0; /* *Whatwewanthereis:v=strncmp(m->value.s,p->s,m->vallen); *butignoringanynulls.bcmpdoesn'tgive-/+/0andisn't *universallyavailableanyway.
*/
v = 0;
{ registerunsignedchar *a = (unsignedchar *) m->value.s; registerunsignedchar *b = (unsignedchar *) p->s; registerint len = m->vallen;
while (--len >= 0) if ((v = *b++ - *a++) != 0) break;
} break; default: /* bogosity, pretend that it just wasn't a match */
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01540)
MODNAME ": invalid type %d in mcheck().", m->type); return0;
}
/* look for tokens from names.h - this is expensive!, so we'll limit
* ourselves to only SMALL_HOWMANY bytes */
small_nbytes = (nbytes > SMALL_HOWMANY) ? SMALL_HOWMANY : nbytes; /* make a copy of the buffer here because apr_strtok() will destroy it */
s = (unsignedchar *) memcpy(nbuf, buf, small_nbytes);
s[small_nbytes] = '\0';
has_escapes = (memchr(s, '\033', small_nbytes) != NULL); while ((token = apr_strtok((char *) s, " \t\n\r\f", &strtok_state)) != NULL) {
s = NULL; /* make apr_strtok() keep on tokin' */ for (p = names; p < names + NNAMES; p++) { if (STREQ(p->name, token)) {
magic_rsl_puts(r, types[p->type]); if (has_escapes)
magic_rsl_puts(r, " (with escape sequences)"); return1;
}
}
}
staticconststruct { constchar *magic;
apr_size_t maglen; constchar *argv[3]; int silent; constchar *encoding; /* MUST be lowercase */
} compr[] = {
/* we use gzip here rather than uncompress because we have to pass *itafullfilename--anduncompressonlyconsidersfilenames *endingwith.Z
*/
{ "\037\235", 2, { "gzip", "-dcq", NULL
}, 0, "x-compress"
},
{ "\037\213", 2, { "gzip", "-dcq", NULL
}, 1, "x-gzip"
}, /* *XXXpcatdoesnotwork,causeIdon'tknowhowtomakeitreadstdin, *soweusegzip
*/
{ "\037\036", 2, { "gzip", "-dcq", NULL
}, 0, "x-gzip"
},
};
#define ncompr (sizeof(compr) / sizeof(compr[0]))
staticint zmagic(request_rec *r, unsignedchar *buf, apr_size_t nbytes)
{ unsignedchar *newbuf; int newsize; int i;
for (i = 0; i < ncompr; i++) { if (nbytes < compr[i].maglen) continue; if (memcmp(buf, compr[i].magic, compr[i].maglen) == 0) break;
}
if (i == ncompr) return0;
if ((newsize = uncompress(r, i, &newbuf, HOWMANY)) > 0) { /* set encoding type in the request record */
r->content_encoding = compr[i].encoding;
newbuf[newsize-1] = '\0'; /* null-terminate uncompressed data */ /* Try to detect the content type of the uncompressed data */ if (tryit(r, newbuf, newsize, 0) != OK) { return0;
}
} return1;
}
struct uncompress_parms {
request_rec *r; int method;
};
/* We make a sub_pool so that we can collect our child early, otherwise *therearecases(i.e.generatingdirectoryindiceswithmod_autoindex) *wherewewouldendupwithLOTSofzombies.
*/ if (apr_pool_create(&sub_context, r->pool) != APR_SUCCESS) return -1;
apr_pool_tag(sub_context, "magic_uncompress");
sum = 0;
p = header->charptr; for (i = sizeof(union record); --i >= 0;) { /* *Wecan'tuseunsignedcharherebecauseofoldcompilers,e.g.V7.
*/
sum += 0xFF & *p++;
}
/* Adjust checksum to count the "chksum" field as blanks. */ for (i = sizeof(header->header.chksum); --i >= 0;)
sum -= 0xFF & header->header.chksum[i];
sum += ' ' * sizeof header->header.chksum;
if (sum != recsum) return0; /* Not a tar archive */
if (0 == strcmp(header->header.magic, TMAGIC)) return2; /* Unix Standard tar archive */
/* initialize per-request info */ if (!magic_set_config(r)) { return HTTP_INTERNAL_SERVER_ERROR;
}
/* try excluding file-revision suffixes */ if (revision_suffix(r) != 1) { /* process it based on the file contents */ if ((result = magic_process(r)) != OK) { return result;
}
}
/* if we have any results, put them in the request structure */ return magic_rsl_to_request(r);
}
AP_DECLARE_MODULE(mime_magic) =
{
STANDARD20_MODULE_STUFF,
NULL, /* dir config creator */
NULL, /* dir merger --- default is to override */
create_magic_server_config, /* server config */
merge_magic_server_config, /* merge server config */
mime_magic_cmds, /* command apr_table_t */
register_hooks /* register hooks */
};
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.93Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.