module AP_MODULE_DECLARE_DATA waklog_module;
-#include <http_conf_globals.h>
#define MK_POOL apr_pool_t
#define MK_TABLE_GET apr_table_get
#define MK_TABLE_SET apr_table_set
#define ap_user_name unixd_config.user_name
#define command(name, func, var, type, usage) \
AP_INIT_ ## type (name, (void*) func, \
- (void*)APR_OFFSETOF(waklog_config, var), \
+ (void*)APR_OFFSETOF(waklog_commands, var), \
OR_AUTHCFG | RSRC_CONF, usage)
typedef struct {
int dummy;
#define MK_TABLE_GET ap_table_get
#define command(name, func, var, type, usage) \
{ name, func, \
- (void*)XtOffsetOf(waklog_config, var), \
+ (void*)XtOffsetOf(waklog_commands, var), \
OR_AUTHCFG | RSRC_CONF, type, usage }
#endif /* STANDARD20_MODULE_STUFF */
-#define getModConfig(P, X) P = (waklog_host_config *) ap_get_module_config( (X)->module_config, &waklog_module );
+#define getModConfig(P, X) P = (waklog_config *) ap_get_module_config( (X)->module_config, &waklog_module );
#include <krb5.h>
#include <rx/rxkad.h>
#define KEYTAB "/etc/keytab.wwwserver"
-#define KEYTAB_PRINCIPAL "someplacewwwserver"
+#define PRINCIPAL "someplacewwwserver"
#define AFS_CELL "someplace.edu"
#define TKT_LIFE 10*60*60
int configured;
int protect;
char *keytab;
- char *keytab_principal;
+ char *principal;
char *afs_cell;
MK_POOL *p;
}
-waklog_host_config;
+waklog_config;
typedef struct {
struct ktc_token token;
static void *
waklog_create_server_config( MK_POOL *p, server_rec *s )
{
- waklog_host_config *cfg;
+ waklog_config *cfg;
- cfg = (waklog_host_config *)ap_pcalloc( p, sizeof( waklog_host_config ));
+ cfg = (waklog_config *)ap_pcalloc( p, sizeof( waklog_config ));
cfg->p = p;
cfg->forked = 0;
cfg->configured = 0;
cfg->protect = 0;
cfg->keytab = KEYTAB;
- cfg->keytab_principal = KEYTAB_PRINCIPAL;
+ cfg->principal = PRINCIPAL;
cfg->afs_cell = AFS_CELL;
log_error( APLOG_MARK, APLOG_DEBUG, 0, s, "mod_waklog: server config created." );
static const char *
set_waklog_protect( cmd_parms *params, void *mconfig, int flag )
{
- waklog_host_config *cfg;
+ waklog_config *cfg;
getModConfig(cfg, params->server );
static const char *
set_waklog_keytab( cmd_parms *params, void *mconfig, char *file )
{
- waklog_host_config *cfg;
+ waklog_config *cfg;
getModConfig(cfg, params->server );
static const char *
-set_waklog_use_keytab_principal( cmd_parms *params, void *mconfig, char *file )
+set_waklog_use_principal( cmd_parms *params, void *mconfig, char *file )
{
- waklog_host_config *cfg;
+ waklog_config *cfg;
getModConfig(cfg, params->server );
log_error( APLOG_MARK, APLOG_INFO, 0, params->server,
- "mod_waklog: will use keytab_principal: %s", file );
+ "mod_waklog: will use principal: %s", file );
- cfg->keytab_principal = ap_pstrdup ( params->pool, file );
+ cfg->principal = ap_pstrdup ( params->pool, file );
cfg->configured = 1;
return( NULL );
}
static const char *
set_waklog_use_afs_cell( cmd_parms *params, void *mconfig, char *file )
{
- waklog_host_config *cfg;
+ waklog_config *cfg;
getModConfig(cfg, params->server );
char *wak_keytab;
char *wak_ktprinc;
char *wak_afscell;
-} waklog_config;
+} waklog_commands;
command_rec waklog_cmds[ ] =
{
command("WaklogKeytab", set_waklog_keytab, wak_keytab, TAKE1, "Use the supplied keytab rather than the default"),
- command("WaklogUseKeytabPrincipal", set_waklog_use_keytab_principal, wak_ktprinc, TAKE1, "Use the supplied keytab principal rather than the default"),
+ command("WaklogUseKeytabPrincipal", set_waklog_use_principal, wak_ktprinc, TAKE1, "Use the supplied keytab principal rather than the default"),
command("WaklogUseAFSCell", set_waklog_use_afs_cell, wak_afscell, TAKE1, "Use the supplied AFS cell rather than the default"),
krb5_keytab keytab = NULL;
char ktbuf[ MAX_KEYTAB_NAME_LEN + 1 ];
int i;
- waklog_host_config *cfg;
+ waklog_config *cfg;
log_error( APLOG_MARK, APLOG_DEBUG, 0, s,
"mod_waklog: waklog_kinit called: pid: %d", getpid() );
}
log_error( APLOG_MARK, APLOG_DEBUG, 0, s,
- "mod_waklog: keytab_principal: %s", cfg->keytab_principal );
+ "mod_waklog: principal: %s", cfg->principal );
- if (( kerror = krb5_parse_name( kcontext, cfg->keytab_principal, &kprinc ))) {
+ if (( kerror = krb5_parse_name( kcontext, cfg->principal, &kprinc ))) {
log_error( APLOG_MARK, APLOG_ERR, 0, s,
"mod_waklog: %s", (char *)error_message( kerror ));
struct ktc_principal server = { "afs", "", "" };
struct ktc_principal client;
struct ktc_token token;
- waklog_host_config *cfg;
+ waklog_config *cfg;
int buflen;
k5path = MK_TABLE_GET( r->subprocess_env, "KRB5CCNAME" );
int rv;
extern char *version;
apr_proc_t *proc;
- waklog_host_config *cfg;
+ waklog_config *cfg;
void *data;
getModConfig(cfg, s);
static int
waklog_phase0( request_rec *r )
{
- waklog_host_config *cfg;
+ waklog_config *cfg;
log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
"mod_waklog: phase0 called" );
static int
waklog_phase7( request_rec *r )
{
- waklog_host_config *cfg;
+ waklog_config *cfg;
log_error( APLOG_MARK, APLOG_DEBUG, 0, r->server,
"mod_waklog: phase7 called" );
)
{
- waklog_config *cfg;
+ waklog_commands *cfg;
log_error (APLOG_MARK, APLOG_DEBUG, 0, c->base_server,
"mod_waklog: new_connection called: pid: %d", getpid ());