~ubuntu-branches/debian/wheezy/apache2/wheezy

« back to all changes in this revision

Viewing changes to srclib/apr-util/include/apr_hooks.h

  • Committer: Package Import Robot
  • Author(s): Stefan Fritsch, Stefan Fritsch, Arno Töll
  • Date: 2012-02-01 21:49:04 UTC
  • mfrom: (0.13.15)
  • Revision ID: package-import@ubuntu.com-20120201214904-nlchebp6wu7z55jw
Tags: 2.2.22-1
[ Stefan Fritsch ]
* New upstream release, urgency medium due to security fixes:
  - Fix CVE-2012-0021: mod_log_config: DoS with '%{cookiename}C' log format
  - Fix CVE-2012-0031: Unprivileged child process could cause the parent to
    crash at shutdown
  - Fix CVE-2012-0053: Exposure of "httpOnly" cookies in code 400 error
    message.
* Move httxt2dbm to apache2-utils
* Adjust debian/control to point to new git repository.

[ Arno Töll ]
* Fix "typo in /etc/apache2/apache2.conf" (Closes: #653801)

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 * @ingroup APR_Util
35
35
 * @{
36
36
 */
 
37
 
 
38
/**
 
39
 * @defgroup apr_hook_probes Hook probe capability
 
40
 * APR hooks provide a trace probe capability for capturing
 
41
 * the flow of control and return values with hooks.
 
42
 *
 
43
 * In order to use this facility, the application must define
 
44
 * the symbol APR_HOOK_PROBES_ENABLED and the four APR_HOOK_PROBE_
 
45
 * macros described below before including apr_hooks.h in files
 
46
 * that use the APR_IMPLEMENT_EXTERNAL_HOOK_* macros.
 
47
 *
 
48
 * This probe facility is not provided for APR optional hooks.
 
49
 * @{
 
50
 */
 
51
 
 
52
#ifdef APR_HOOK_PROBES_ENABLED
 
53
#define APR_HOOK_INT_DCL_UD void *ud = NULL
 
54
#else
 
55
/** internal implementation detail to avoid the ud declaration when
 
56
 * hook probes are not used
 
57
 */
 
58
#define APR_HOOK_INT_DCL_UD
 
59
/**
 
60
 * User-defined hook probe macro that is invoked when the hook
 
61
 * is run, before calling any hook functions.
 
62
 * @param ud A void * user data field that should be filled in by
 
63
 * this macro, and will be provided to the other hook probe macros.
 
64
 * @param ns The namespace prefix of the hook functions
 
65
 * @param name The name of the hook
 
66
 * @param args The argument list to the hook functions, with enclosing
 
67
 * parens.
 
68
 */
 
69
#define APR_HOOK_PROBE_ENTRY(ud,ns,name,args)
 
70
/**
 
71
 * User-defined hook probe macro that is invoked after the hook
 
72
 * has run.
 
73
 * @param ud A void * user data field that was filled in by the user-
 
74
 * provided APR_HOOK_PROBE_ENTRY().
 
75
 * @param ns The namespace prefix of the hook functions
 
76
 * @param name The name of the hook
 
77
 * @param rv The return value of the hook, or 0 if the hook is void.
 
78
 * @param args The argument list to the hook functions, with enclosing
 
79
 * parens.
 
80
 */
 
81
#define APR_HOOK_PROBE_RETURN(ud,ns,name,rv,args)
 
82
/**
 
83
 * User-defined hook probe macro that is invoked before calling a
 
84
 * hook function.
 
85
 * @param ud A void * user data field that was filled in by the user-
 
86
 * provided APR_HOOK_PROBE_ENTRY().
 
87
 * @param ns The namespace prefix of the hook functions
 
88
 * @param name The name of the hook
 
89
 * @param src The value of apr_hook_debug_current at the time the function
 
90
 * was hooked (usually the source file implementing the hook function).
 
91
 * @param args The argument list to the hook functions, with enclosing
 
92
 * parens.
 
93
 */
 
94
#define APR_HOOK_PROBE_INVOKE(ud,ns,name,src,args)
 
95
/**
 
96
 * User-defined hook probe macro that is invoked after calling a
 
97
 * hook function.
 
98
 * @param ud A void * user data field that was filled in by the user-
 
99
 * provided APR_HOOK_PROBE_ENTRY().
 
100
 * @param ns The namespace prefix of the hook functions
 
101
 * @param name The name of the hook
 
102
 * @param src The value of apr_hook_debug_current at the time the function
 
103
 * was hooked (usually the source file implementing the hook function).
 
104
 * @param rv The return value of the hook function, or 0 if the hook is void.
 
105
 * @param args The argument list to the hook functions, with enclosing
 
106
 * parens.
 
107
 */
 
108
#define APR_HOOK_PROBE_COMPLETE(ud,ns,name,src,rv,args)
 
109
#endif
 
110
 
 
111
/** @} */
 
112
 
37
113
/** macro to return the prototype of the hook function */    
38
114
#define APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name) \
39
115
link##_DECLARE(apr_array_header_t *) ns##_hook_get_##name(void)
106
182
    { \
107
183
    ns##_LINK_##name##_t *pHook; \
108
184
    int n; \
109
 
\
110
 
    if(!_hooks.link_##name) \
111
 
        return; \
112
 
\
113
 
    pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
114
 
    for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
115
 
        pHook[n].pFunc args_use; \
 
185
    APR_HOOK_INT_DCL_UD; \
 
186
\
 
187
    APR_HOOK_PROBE_ENTRY(ud, ns, name, args_use); \
 
188
\
 
189
    if(_hooks.link_##name) \
 
190
        { \
 
191
        pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
 
192
        for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
 
193
            { \
 
194
            APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName, args_use); \
 
195
            pHook[n].pFunc args_use; \
 
196
            APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, 0, args_use); \
 
197
            } \
 
198
        } \
 
199
\
 
200
    APR_HOOK_PROBE_RETURN(ud, ns, name, 0, args_use); \
 
201
\
116
202
    }
117
203
 
118
204
/* FIXME: note that this returns ok when nothing is run. I suspect it should
139
225
    { \
140
226
    ns##_LINK_##name##_t *pHook; \
141
227
    int n; \
142
 
    ret rv; \
143
 
\
144
 
    if(!_hooks.link_##name) \
145
 
        return ok; \
146
 
\
147
 
    pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
148
 
    for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
149
 
        { \
150
 
        rv=pHook[n].pFunc args_use; \
151
 
\
152
 
        if(rv != ok && rv != decline) \
153
 
            return rv; \
154
 
        } \
155
 
    return ok; \
 
228
    ret rv = ok; \
 
229
    APR_HOOK_INT_DCL_UD; \
 
230
\
 
231
    APR_HOOK_PROBE_ENTRY(ud, ns, name, args_use); \
 
232
\
 
233
    if(_hooks.link_##name) \
 
234
        { \
 
235
        pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
 
236
        for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
 
237
            { \
 
238
            APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName, args_use); \
 
239
            rv=pHook[n].pFunc args_use; \
 
240
            APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, rv, args_use); \
 
241
            if(rv != ok && rv != decline) \
 
242
                break; \
 
243
            rv = ok; \
 
244
            } \
 
245
        } \
 
246
\
 
247
    APR_HOOK_PROBE_RETURN(ud, ns, name, rv, args_use); \
 
248
\
 
249
    return rv; \
156
250
    }
157
251
 
158
252
 
176
270
    { \
177
271
    ns##_LINK_##name##_t *pHook; \
178
272
    int n; \
179
 
    ret rv; \
180
 
\
181
 
    if(!_hooks.link_##name) \
182
 
        return decline; \
183
 
\
184
 
    pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
185
 
    for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
186
 
        { \
187
 
        rv=pHook[n].pFunc args_use; \
188
 
\
189
 
        if(rv != decline) \
190
 
            return rv; \
191
 
        } \
192
 
    return decline; \
 
273
    ret rv = decline; \
 
274
    APR_HOOK_INT_DCL_UD; \
 
275
\
 
276
    APR_HOOK_PROBE_ENTRY(ud, ns, name, args_use); \
 
277
\
 
278
    if(_hooks.link_##name) \
 
279
        { \
 
280
        pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
 
281
        for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
 
282
            { \
 
283
            APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName, args_use); \
 
284
            rv=pHook[n].pFunc args_use; \
 
285
            APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, rv, args_use); \
 
286
\
 
287
            if(rv != decline) \
 
288
                break; \
 
289
            } \
 
290
        } \
 
291
\
 
292
    APR_HOOK_PROBE_RETURN(ud, ns, name, rv, args_use); \
 
293
\
 
294
    return rv; \
193
295
    }
194
296
 
195
297
    /* Hook orderings */