1 #define _LARGEFILE64_SOURCE
5 #include "http_config.h"
7 #include "http_protocol.h"
8 #include "http_request.h"
16 #include <sys/types.h>
20 #error "make sure you include the right stuff here"
24 #define MAXNAMELEN 1024
27 #ifdef STANDARD20_MODULE_STUFF
28 #include <apr_strings.h>
29 #include <apr_base64.h>
30 #include <apr_compat.h>
31 #include <apu_compat.h>
33 module AP_MODULE_DECLARE_DATA waklog_module;
35 #include <http_conf_globals.h>
36 #define MK_POOL apr_pool_t
37 #define MK_TABLE_GET apr_table_get
38 #define MK_TABLE_SET ap_table_set
40 extern unixd_config_rec unixd_config;
41 #define ap_user_id unixd_config.user_id
42 #define ap_group_id unixd_config.group_id
43 #define ap_user_name unixd_config.user_name
44 #define command(name, func, var, type, usage) \
45 AP_INIT_ ## type (name, (void*) func, \
46 (void*)APR_OFFSETOF(waklog_config, var), \
47 OR_AUTHCFG | RSRC_CONF, usage)
52 const char *userdata_key = "waklog_init";
54 #include "ap_config.h"
58 #define MK_TABLE_GET ap_table_get
59 #define command(name, func, var, type, usage) \
61 (void*)XtOffsetOf(waklog_config, var), \
62 OR_AUTHCFG | RSRC_CONF, type, usage }
63 #endif /* STANDARD20_MODULE_STUFF */
65 #define getModConfig(P, X) P = (waklog_host_config *) ap_get_module_config( (X)->module_config, &waklog_module );
70 #include <sys/ioccom.h>
73 #include <afs/venus.h>
77 #define KEYTAB "/etc/keytab.wwwserver"
78 #define KEYTAB_PRINCIPAL "someplacewwwserver"
79 #define AFS_CELL "someplace.edu"
81 #define TKT_LIFE 10*60*60
82 #define SLEEP_TIME TKT_LIFE - 5*60
83 /* If there's an error, retry more aggressively */
84 #define ERR_SLEEP_TIME 5*60
87 #define K5PATH "FILE:/tmp/waklog.creds.k5"
94 char *keytab_principal;
100 struct ktc_token token;
101 } waklog_child_config;
102 waklog_child_config child;
105 log_error(const char *file, int line, int level, int status,
106 const server_rec *s, const char *fmt, ...)
112 vsnprintf(errstr, sizeof(errstr), fmt, ap);
115 #ifdef STANDARD20_MODULE_STUFF
116 ap_log_error(file, line, level | APLOG_NOERRNO, status, s, "%s", errstr);
118 ap_log_error(file, line, level | APLOG_NOERRNO, s, "%s", errstr);
124 waklog_create_server_config( MK_POOL *p, server_rec *s )
126 waklog_host_config *cfg;
128 cfg = (waklog_host_config *)ap_pcalloc( p, sizeof( waklog_host_config ));
133 cfg->keytab = KEYTAB;
134 cfg->keytab_principal = KEYTAB_PRINCIPAL;
135 cfg->afs_cell = AFS_CELL;
137 log_error( APLOG_MARK, APLOG_DEBUG, 0, s, "mod_waklog: server config created." );
144 set_waklog_protect( cmd_parms *params, void *mconfig, int flag )
146 waklog_host_config *cfg;
148 getModConfig(cfg, params->server );
152 log_error( APLOG_MARK, APLOG_DEBUG, 0, params->server, "mod_waklog: waklog_protect set" );
158 set_waklog_keytab( cmd_parms *params, void *mconfig, char *file )
160 waklog_host_config *cfg;
162 getModConfig(cfg, params->server );
164 log_error( APLOG_MARK, APLOG_INFO, 0, params->server,
165 "mod_waklog: will use keytab: %s", file );
167 cfg->keytab = ap_pstrdup ( params->pool, file );
174 set_waklog_use_keytab_principal( cmd_parms *params, void *mconfig, char *file )
176 waklog_host_config *cfg;
178 getModConfig(cfg, params->server );
180 log_error( APLOG_MARK, APLOG_INFO, 0, params->server,
181 "mod_waklog: will use keytab_principal: %s", file );
183 cfg->keytab_principal = ap_pstrdup ( params->pool, file );
190 set_waklog_use_afs_cell( cmd_parms *params, void *mconfig, char *file )
192 waklog_host_config *cfg;
194 getModConfig(cfg, params->server );
196 log_error( APLOG_MARK, APLOG_INFO, 0, params->server,
197 "mod_waklog: will use afs_cell: %s", file );
199 cfg->afs_cell = ap_pstrdup( params->pool, file );
206 #ifdef STANDARD20_MODULE_STUFF
207 waklog_child_init(MK_POOL *p, server_rec *s)
209 waklog_child_init(server_rec *s, MK_POOL *p)
213 log_error( APLOG_MARK, APLOG_DEBUG, 0, s,
214 "mod_waklog: child_init called" );
216 memset( &child.token, 0, sizeof( struct ktc_token ) );
220 log_error( APLOG_MARK, APLOG_DEBUG, 0, s,
221 "mod_waklog: child_init returned" );
233 command_rec waklog_cmds[ ] =
235 command("WaklogProtected", set_waklog_protect, wak_protect, FLAG, "enable waklog on a location or directory basis"),
237 command("WaklogKeytab", set_waklog_keytab, wak_keytab, TAKE1, "Use the supplied keytab rather than the default"),
239 command("WaklogUseKeytabPrincipal", set_waklog_use_keytab_principal, wak_ktprinc, TAKE1, "Use the supplied keytab principal rather than the default"),
241 command("WaklogUseAFSCell", set_waklog_use_afs_cell, wak_afscell, TAKE1, "Use the supplied AFS cell rather than the default"),
248 token_cleanup( void *data )
250 request_rec *r = (request_rec *)data;
252 if ( child.token.ticketLen ) {
253 memset( &child.token, 0, sizeof( struct ktc_token ) );
255 ktc_ForgetAllTokens();
257 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
258 "mod_waklog: ktc_ForgetAllTokens succeeded: pid: %d", getpid() );
265 waklog_kinit( server_rec *s )
267 krb5_error_code kerror = 0;
268 krb5_context kcontext = NULL;
269 krb5_principal kprinc = NULL;
270 krb5_get_init_creds_opt kopts;
272 krb5_ccache kccache = NULL;
273 krb5_keytab keytab = NULL;
274 char ktbuf[ MAX_KEYTAB_NAME_LEN + 1 ];
276 waklog_host_config *cfg;
278 log_error( APLOG_MARK, APLOG_DEBUG, 0, s,
279 "mod_waklog: waklog_kinit called: pid: %d", getpid() );
281 getModConfig(cfg, s);
283 if (( kerror = krb5_init_context( &kcontext ))) {
284 log_error( APLOG_MARK, APLOG_ERR, 0, s,
285 "mod_waklog: %s", (char *)error_message( kerror ));
291 if (( kerror = krb5_cc_resolve( kcontext, K5PATH, &kccache )) != 0 ) {
292 log_error( APLOG_MARK, APLOG_ERR, 0, s,
293 "mod_waklog: %s", (char *)error_message( kerror ));
298 log_error( APLOG_MARK, APLOG_DEBUG, 0, s,
299 "mod_waklog: keytab_principal: %s", cfg->keytab_principal );
301 if (( kerror = krb5_parse_name( kcontext, cfg->keytab_principal, &kprinc ))) {
302 log_error( APLOG_MARK, APLOG_ERR, 0, s,
303 "mod_waklog: %s", (char *)error_message( kerror ));
308 krb5_get_init_creds_opt_init( &kopts );
309 krb5_get_init_creds_opt_set_tkt_life( &kopts, TKT_LIFE );
310 krb5_get_init_creds_opt_set_renew_life( &kopts, 0 );
311 krb5_get_init_creds_opt_set_forwardable( &kopts, 1 );
312 krb5_get_init_creds_opt_set_proxiable( &kopts, 0 );
314 /* keytab from config */
315 strncpy( ktbuf, cfg->keytab, sizeof( ktbuf ) - 1 );
317 log_error( APLOG_MARK, APLOG_DEBUG, 0, s,
318 "mod_waklog: waklog_kinit using: %s", ktbuf );
320 if (( kerror = krb5_kt_resolve( kcontext, ktbuf, &keytab )) != 0 ) {
321 log_error( APLOG_MARK, APLOG_ERR, 0, s,
322 "mod_waklog:krb5_kt_resolve %s", (char *)error_message( kerror ));
327 memset( (char *)&v5creds, 0, sizeof(v5creds));
330 if (( kerror = krb5_get_init_creds_keytab( kcontext, &v5creds,
331 kprinc, keytab, 0, NULL, &kopts ))) {
333 log_error( APLOG_MARK, APLOG_ERR, 0, s,
334 "mod_waklog:krb5_get_init_creds_keytab %s", (char *)error_message( kerror ));
339 if (( kerror = krb5_cc_initialize( kcontext, kccache, kprinc )) != 0 ) {
340 log_error( APLOG_MARK, APLOG_ERR, 0, s,
341 "mod_waklog:krb5_cc_initialize %s", (char *)error_message( kerror ));
346 kerror = krb5_cc_store_cred( kcontext, kccache, &v5creds );
347 krb5_free_cred_contents( kcontext, &v5creds );
349 log_error( APLOG_MARK, APLOG_ERR, 0, s,
350 "mod_waklog: %s", (char *)error_message( kerror ));
355 log_error( APLOG_MARK, APLOG_DEBUG, 0, s,
356 "mod_waklog: waklog_kinit success" );
360 (void)krb5_kt_close( kcontext, keytab );
362 krb5_free_principal( kcontext, kprinc );
364 krb5_cc_close( kcontext, kccache );
366 krb5_free_context( kcontext );
368 log_error( APLOG_MARK, APLOG_DEBUG, 0, s,
369 "mod_waklog: waklog_kinit: exiting" );
376 waklog_aklog( request_rec *r )
379 char buf[ MAXKTCTICKETLEN ];
380 const char *k5path = NULL;
381 krb5_error_code kerror;
382 krb5_context kcontext = NULL;
384 krb5_creds *v5credsp = NULL;
385 krb5_ccache kccache = NULL;
386 struct ktc_principal server = { "afs", "", "" };
387 struct ktc_principal client;
388 struct ktc_token token;
389 waklog_host_config *cfg;
392 k5path = MK_TABLE_GET( r->subprocess_env, "KRB5CCNAME" );
394 log_error( APLOG_MARK, APLOG_INFO, 0, r->server,
395 "mod_waklog: waklog_aklog called: k5path: %s", k5path );
397 if ( k5path == NULL ) {
398 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
399 "mod_waklog: waklog_aklog giving up" );
404 ** Get/build creds from file/tgs, then see if we need to SetToken
407 if (( kerror = krb5_init_context( &kcontext ))) {
408 /* Authentication Required ( kerberos error ) */
409 log_error( APLOG_MARK, APLOG_ERR, 0, r->server,
410 (char *)error_message( kerror ));
415 memset( (char *)&increds, 0, sizeof(increds));
417 getModConfig(cfg, r->server );
419 /* afs/<cell> or afs */
420 strncpy( buf, "afs", sizeof( buf ) - 1 );
421 if ( strcmp( cfg->afs_cell, AFS_CELL ) ) {
422 strncat( buf, "/" , sizeof( buf ) - strlen( buf ) - 1 );
423 strncat( buf, cfg->afs_cell, sizeof( buf ) - strlen( buf ) - 1 );
426 /* set server part */
427 if (( kerror = krb5_parse_name( kcontext, buf, &increds.server ))) {
428 log_error( APLOG_MARK, APLOG_ERR, 0, r->server,
429 (char *)error_message( kerror ));
434 if (( kerror = krb5_cc_resolve( kcontext, k5path, &kccache )) != 0 ) {
435 log_error( APLOG_MARK, APLOG_ERR, 0, r->server,
436 (char *)error_message( kerror ));
441 /* set client part */
442 krb5_cc_get_principal( kcontext, kccache, &increds.client );
444 increds.times.endtime = 0;
445 /* Ask for DES since that is what V4 understands */
446 increds.keyblock.enctype = ENCTYPE_DES_CBC_CRC;
448 /* get the V5 credentials */
449 if (( kerror = krb5_get_credentials( kcontext, 0, kccache,
450 &increds, &v5credsp ) ) ) {
451 log_error( APLOG_MARK, APLOG_ERR, 0, r->server,
452 "mod_waklog: krb5_get_credentials: %s", error_message( kerror ));
457 if ( v5credsp->ticket.length >= MAXKTCTICKETLEN ) { /* from krb524d.c */
458 log_error( APLOG_MARK, APLOG_ERR, 0, r->server,
459 "mod_waklog: ticket size (%d) too big to fake", v5credsp->ticket.length );
463 /* assemble the token */
464 memset( &token, 0, sizeof( struct ktc_token ) );
466 token.startTime = v5credsp->times.starttime ? v5credsp->times.starttime : v5credsp->times.authtime;
467 token.endTime = v5credsp->times.endtime;
468 memmove( &token.sessionKey, v5credsp->keyblock.contents, v5credsp->keyblock.length );
469 token.kvno = RXKAD_TKT_TYPE_KERBEROS_V5;
470 token.ticketLen = v5credsp->ticket.length;
471 memmove( token.ticket, v5credsp->ticket.data, token.ticketLen );
473 /* make sure we have to do this */
474 if ( child.token.kvno != token.kvno ||
475 child.token.ticketLen != token.ticketLen ||
476 (memcmp( &child.token.sessionKey, &token.sessionKey,
477 sizeof( token.sessionKey ) )) ||
478 (memcmp( child.token.ticket, token.ticket, token.ticketLen )) ) {
480 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
481 "mod_waklog: client: %s", buf );
484 memmove( buf, v5credsp->client->data[0].data,
485 min( v5credsp->client->data[0].length, MAXKTCNAMELEN - 1 ) );
486 buf[ v5credsp->client->data[0].length ] = '\0';
487 if ( v5credsp->client->length > 1 ) {
488 strncat( buf, ".", sizeof( buf ) - strlen( buf ) - 1 );
489 buflen = strlen( buf );
490 memmove( buf + buflen, v5credsp->client->data[1].data,
491 min( v5credsp->client->data[1].length, MAXKTCNAMELEN - strlen( buf ) - 1 ) );
492 buf[ buflen + v5credsp->client->data[1].length ] = '\0';
495 /* assemble the client */
496 strncpy( client.name, buf, sizeof( client.name ) - 1 );
497 strncpy( client.instance, "", sizeof( client.instance) - 1 );
498 memmove( buf, v5credsp->client->realm.data,
499 min( v5credsp->client->realm.length, MAXKTCNAMELEN - 1 ) );
500 buf[ v5credsp->client->realm.length ] = '\0';
501 strncpy( client.cell, buf, sizeof( client.cell ) - 1 );
503 /* assemble the server's cell */
504 strncpy( server.cell, cfg->afs_cell , sizeof( server.cell ) - 1 );
506 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
507 "mod_waklog: server: name=%s, instance=%s, cell=%s",
508 server.name, server.instance, server.cell );
510 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
511 "mod_waklog: client: name=%s, instance=%s, cell=%s",
512 client.name, client.instance, client.cell );
516 /* rumor: we have to do this for AIX 4.1.4 with AFS 3.4+ */
519 if ( ( rc = ktc_SetToken( &server, &token, &client, 0 ) ) ) {
520 log_error( APLOG_MARK, APLOG_ERR, 0, r->server,
521 "mod_waklog: settoken returned %d", rc );
526 memmove( &child.token, &token, sizeof( struct ktc_token ) );
528 /* we'll need to unlog when this connection is done. */
529 ap_register_cleanup( r->pool, (void *)r, token_cleanup, ap_null_cleanup );
534 krb5_free_cred_contents( kcontext, v5credsp );
535 if ( increds.client )
536 krb5_free_principal( kcontext, increds.client );
537 if ( increds.server )
538 krb5_free_principal( kcontext, increds.server );
540 krb5_cc_close( kcontext, kccache );
542 krb5_free_context( kcontext );
544 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
545 "mod_waklog: finished with waklog_aklog" );
552 waklog_child_routine( void *s, child_info *pinfo )
555 log_error( APLOG_MARK, APLOG_DEBUG, 0, s,
556 "mod_waklog: waklog_child_routine called as root" );
558 /* this was causing the credential file to get owned by root */
559 #ifdef STANDARD20_MODULE_STUFF
567 log_error( APLOG_MARK, APLOG_DEBUG, 0, s,
568 "mod_waklog: child_routine sleeping" );
570 log_error( APLOG_MARK, APLOG_DEBUG, 0, s,
571 "mod_waklog: slept, calling waklog_kinit" );
576 #ifdef STANDARD20_MODULE_STUFF
578 waklog_init_handler(apr_pool_t *p, apr_pool_t *plog,
579 apr_pool_t *ptemp, server_rec *s)
582 extern char *version;
584 waklog_host_config *cfg;
587 getModConfig(cfg, s);
589 /* initialize_module() will be called twice, and if it's a DSO
590 * then all static data from the first call will be lost. Only
591 * set up our static data on the second call.
592 * see http://issues.apache.org/bugzilla/show_bug.cgi?id=37519 */
593 apr_pool_userdata_get(&data, userdata_key, s->process->pool);
596 apr_pool_userdata_set((const void *)1, userdata_key,
597 apr_pool_cleanup_null, s->process->pool);
599 log_error( APLOG_MARK, APLOG_INFO, 0, s,
600 "mod_waklog: version %s initialized.", version );
602 proc = (apr_proc_t *)ap_pcalloc( s->process->pool, sizeof(apr_proc_t));
604 rv = apr_proc_fork(proc, s->process->pool);
606 if (rv == APR_INCHILD) {
607 waklog_child_routine(s, NULL);
609 apr_pool_note_subprocess(s->process->pool, proc, APR_KILL_ALWAYS);
611 /* parent and child */
612 cfg->forked = proc->pid;
618 waklog_init( server_rec *s, MK_POOL *p )
620 extern char *version;
623 log_error( APLOG_MARK, APLOG_INFO, 0, s,
624 "mod_waklog: version %s initialized.", version );
626 pid = ap_bspawn_child( p, waklog_child_routine, s, kill_always,
629 log_error( APLOG_MARK, APLOG_DEBUG, 0, s,
630 "mod_waklog: ap_bspawn_child: %d.", pid );
635 waklog_phase0( request_rec *r )
637 waklog_host_config *cfg;
639 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
640 "mod_waklog: phase0 called" );
642 getModConfig(cfg, r->server );
644 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
645 "mod_waklog: phase0, checking cfg->protect" );
646 if ( !cfg->protect ) {
647 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
648 "mod_waklog: phase0 declining" );
652 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
653 "mod_waklog: phase0, NOT setting environment variable" );
654 /* set our environment variable */
655 apr_table_set( r->subprocess_env, "KRB5CCNAME", K5PATH );
657 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
658 "mod_waklog: phase0, checking child.token.ticketLen" );
659 /* do this only if we are still unauthenticated */
660 if ( !child.token.ticketLen ) {
662 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
663 "mod_waklog: phase0, calling waklog_aklog" );
664 /* stuff the credentials into the kernel */
668 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
669 "mod_waklog: phase0 returning" );
675 waklog_phase7( request_rec *r )
677 waklog_host_config *cfg;
679 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
680 "mod_waklog: phase7 called" );
682 getModConfig(cfg, r->server );
684 if ( !cfg->protect ) {
688 /* stuff the credentials into the kernel */
690 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
691 "mod_waklog: phase7, calling waklog_aklog" );
694 log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
695 "mod_waklog: phase7 returning" );
702 #ifdef STANDARD20_MODULE_STUFF
707 waklog_new_connection (conn_rec * c
708 #ifdef STANDARD20_MODULE_STUFF
716 log_error (APLOG_MARK, APLOG_DEBUG, 0, c->base_server,
717 "mod_waklog: new_connection called: pid: %d", getpid ());
719 getModConfig(cfg, c->base_server);
721 if ( cfg->default_principal ) {
722 log_error(APLOG_MARK, APLOG_DEBUG, 0, c->base_server, "mod_waklog: new conn setting default user %s",
723 cfg->default_principal);
724 set_auth( c->base_server, NULL, 0, cfg->default_principal, cfg->default_keytab, 0);
729 #ifdef STANDARD20_MODULE_STUFF
737 ** Here's a quick explaination for phase0 and phase2:
738 ** Apache does a stat() on the path between phase0 and
739 ** phase2, and must by ACLed rl to succeed. So, at
740 ** phase0 we acquire credentials for umweb:servers from
741 ** a keytab, and at phase2 we must ensure we remove them.
743 ** Failure to "unlog" would be a security risk.
746 waklog_phase2 (request_rec * r)
749 log_error (APLOG_MARK, APLOG_DEBUG, 0, r->server,
750 "mod_waklog: phase2 called");
752 if (child.token.ticketLen)
754 memset (&child.token, 0, sizeof (struct ktc_token));
756 ktc_ForgetAllTokens ();
758 log_error (APLOG_MARK, APLOG_DEBUG, 0, r->server,
759 "mod_waklog: ktc_ForgetAllTokens succeeded: pid: %d",
763 log_error (APLOG_MARK, APLOG_DEBUG, 0, r->server,
764 "mod_waklog: phase2 returning");
769 #ifndef STANDARD20_MODULE_STUFF
770 module MODULE_VAR_EXPORT waklog_module = {
771 STANDARD_MODULE_STUFF,
772 waklog_init, /* module initializer */
774 waklog_create_dir_config, /* create per-dir config structures */
776 NULL, /* create per-dir config structures */
778 NULL, /* merge per-dir config structures */
779 waklog_create_server_config, /* create per-server config structures */
780 NULL, /* merge per-server config structures */
781 waklog_cmds, /* table of config file commands */
782 NULL, /* [#8] MIME-typed-dispatched handlers */
783 NULL, /* [#1] URI to filename translation */
784 NULL, /* [#4] validate user id from request */
785 NULL, /* [#5] check if the user is ok _here_ */
786 NULL, /* [#3] check access by host address */
787 NULL, /* [#6] determine MIME type */
788 waklog_phase7, /* [#7] pre-run fixups */
789 NULL, /* [#9] log a transaction */
790 waklog_phase2, /* [#2] header parser */
791 waklog_child_init, /* child_init */
792 NULL, /* child_exit */
793 waklog_phase0 /* [#0] post read-request */
795 ,NULL, /* EAPI: add_module */
796 NULL, /* EAPI: remove_module */
797 NULL, /* EAPI: rewrite_command */
798 waklog_new_connection /* EAPI: new_connection */
803 waklog_register_hooks (apr_pool_t * p)
805 ap_hook_header_parser (waklog_phase2, NULL, NULL, APR_HOOK_FIRST);
806 ap_hook_fixups (waklog_phase7, NULL, NULL, APR_HOOK_FIRST);
807 ap_hook_child_init (waklog_child_init, NULL, NULL, APR_HOOK_FIRST);
808 ap_hook_post_read_request (waklog_phase0, NULL, NULL, APR_HOOK_FIRST);
809 ap_hook_pre_connection (waklog_new_connection, NULL, NULL, APR_HOOK_FIRST);
810 ap_hook_post_config (waklog_init_handler, NULL, NULL, APR_HOOK_MIDDLE);
814 module AP_MODULE_DECLARE_DATA waklog_module =
816 STANDARD20_MODULE_STUFF,
817 NULL, /* create per-dir conf structures */
818 NULL, /* merge per-dir conf structures */
819 waklog_create_server_config, /* create per-server conf structures */
820 NULL, /* merge per-server conf structures */
821 waklog_cmds, /* table of configuration directives */
822 waklog_register_hooks /* register hooks */