Exemplo n.º 1
0
static void ssl_add_version_components(apr_pool_t *p,
                                       server_rec *s)
{
    char *modver = ssl_var_lookup(p, s, NULL, NULL, "SSL_VERSION_INTERFACE");
    char *libver = ssl_var_lookup(p, s, NULL, NULL, "SSL_VERSION_LIBRARY");
    char *incver = ssl_var_lookup(p, s, NULL, NULL, 
                                  "SSL_VERSION_LIBRARY_INTERFACE");

    ap_add_version_component(p, modver);
    ap_add_version_component(p, libver);

    ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
                 "%s compiled against Server: %s, Library: %s",
                 modver, AP_SERVER_BASEVERSION, incver);
}
Exemplo n.º 2
0
static int
post_config(apr_pool_t *p, apr_pool_t *l, apr_pool_t *t, server_rec *s)
{
	struct srv *srv = ap_get_module_config(s->module_config, &MODULE_ENTRY);
	ap_add_version_component(p, APACHE2_TLS_AAA_MODULE_VERSION);
	return OK;
}
Exemplo n.º 3
0
static void *
cse_init_server_config(apr_pool_t *p, char *dummy)
{
  ap_add_version_component(p, VERSION);
  
  return 0;
}
Exemplo n.º 4
0
/**
 * ap_add_version_component (apr_pool_t *pconf, const char *component)
 * Add a component to the server description and banner strings
 * @param pconf The pool to allocate the component from
 * @param component The string to add
  */
static int lua_ap_add_version_component (lua_State *L)
{
  request_rec *r = CHECK_REQUEST_OBJECT(1);
  const char* component = luaL_checkstring(L, 2);
  ap_add_version_component(r->server->process->pconf, component);
  return 0;
}
Exemplo n.º 5
0
static int amagent_init(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp,
        server_rec *s) {
    /* main process init */
    int status;
    apr_status_t rv = APR_SUCCESS;
    void *data;

#define AMAGENT_INIT_ONCE "AMAGENT_INIT_ONCE"
    apr_pool_userdata_get(&data, AMAGENT_INIT_ONCE, s->process->pool);
    if (!data) {
        /* module has already been initialized */
        apr_pool_userdata_set((const void *) 1, AMAGENT_INIT_ONCE,
                apr_pool_cleanup_null, s->process->pool);
        return rv;
    }
    apr_pool_cleanup_register(pconf, s, amagent_cleanup, apr_pool_cleanup_null);
    ap_add_version_component(pconf, MODINFO);
    LOG_S(APLOG_DEBUG, s, "amagent_init() %d", getpid());

#ifndef _WIN32
    status = am_init();
    if (status != AM_SUCCESS) {
        rv = APR_EINIT;
        LOG_S(APLOG_ERR, s, "amagent_init() status: %s", am_strerror(status));
    }
#endif
    return rv;
}
Exemplo n.º 6
0
static void embperl_ApacheInit (server_rec *s, apr_pool_t *p)
#endif

    {
#ifndef APACHE2
    int     rc;
#endif
    dTHX ;

#ifndef APACHE2
    embperl_ApacheInitUnload (p) ;
#endif

    bApDebug |= ap_exists_config_define("EMBPERL_APDEBUG") ;
    
    if (bApDebug)
        ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, APLOG_STATUSCODE NULL, "EmbperlDebug: ApacheInit [%d/%d]\n", getpid(), gettid()) ;

#ifdef APACHE2
    bApInit = 1 ;
    return APR_SUCCESS ;
#else
    ap_add_version_component ("Embperl/"VERSION) ;

    if ((rc = embperl_Init (aTHX_ NULL, NULL, s)) != ok)
        {
        ap_log_error (APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, APLOG_STATUSCODE NULL, "Initialization of Embperl failed (#%d)\n", rc) ;
        }
    bApInit = 1 ;

#endif
    }
Exemplo n.º 7
0
static int
svc_simulator_256b_post_config(
    apr_pool_t *pconf,
    apr_pool_t *plog,
    apr_pool_t *ptemp,
    server_rec *svr_rec)
{
    apr_status_t status = APR_SUCCESS;
    void *data = NULL;
    const char *userdata_key = "svc_simulator_256b_init";
    svc_simulator_256b_config_rec_t *conf = (svc_simulator_256b_config_rec_t *)ap_get_module_config(
            svr_rec->module_config, &svc_simulator_256b_module);

    /* svc_simulator_256b_post_config() will be called twice. Don't bother
     * going through all of the initialization on the first call
     * because it will just be thrown away.*/

    ap_add_version_component(pconf, SVC_SIMULATOR_HTTP_HEADER_SERVER_SVC_SIMULATOR);

    apr_pool_userdata_get(&data, userdata_key, svr_rec->process->pool);
    if(!data)
    {
        apr_pool_userdata_set((const void *)1, userdata_key, apr_pool_cleanup_null,
            svr_rec->process->pool);
        return OK;
    }

    return OK;
}
Exemplo n.º 8
0
/* ====================================================================
 * Initialize WebKit Module
 * ==================================================================== */
static void wk_init(server_rec *s, pool *p) {
    //int ret;

#if MODULE_MAGIC_NUMBER >= 19980527
    /* Tell apache we're here */
    ap_add_version_component(VERSION_COMPONENT);
#endif
}
Exemplo n.º 9
0
static void aurora_init(server_rec *s, pool *p) {
  STRLEN len = 0;
  SV *version;
  char *serverstring;
  version = perl_get_sv("Aurora::VERSION", TRUE | GV_ADDMULTI);
  serverstring = ap_psprintf(p, "Aurora/%s", SvPV(version, len));
  ap_add_version_component(serverstring);
}
Exemplo n.º 10
0
static int init_mod_yk(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
{ 
    ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
                 LOG_PREFIX "Version [" MOD_AUTHN_YUBIKEY_VERSION "] initialized");

    ap_add_version_component(pconf, MOD_AUTHN_YUBIKEY_NAME "/" MOD_AUTHN_YUBIKEY_VERSION);

    return OK;
}
Exemplo n.º 11
0
static int
lisp_post_config (apr_pool_t * cfg_pool,
			     		  apr_pool_t * log_pool,
					  		  apr_pool_t * temp_pool,
							  		  server_rec * s)
{
  ap_add_version_component (cfg_pool, "mod_lisp2/" VERSION_STRING);
  return (OK);
}
Exemplo n.º 12
0
static int mag_post_config(apr_pool_t *cfgpool, apr_pool_t *log,
                           apr_pool_t *temp, server_rec *s)
{
    /* FIXME: create mutex to deal with connections and contexts ? */
    mag_is_https = APR_RETRIEVE_OPTIONAL_FN(ssl_is_https);
    mag_post_config_session();
    ap_add_version_component(cfgpool, MOD_AUTH_GSSAPI_VERSION);

    return OK;
}
Exemplo n.º 13
0
static int mod_vhost_ldap_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
{
	module **m;

	/* Stolen from modules/generators/mod_cgid.c */
	total_modules = 0;
	for (m = ap_preloaded_modules; *m != NULL; m++)
	  total_modules++;

	ap_add_version_component(p, MOD_VHOST_LDAP_VERSION);
	return OK;
}
Exemplo n.º 14
0
static int
pg_auth_init_handler(apr_pool_t * p, apr_pool_t * plog, apr_pool_t * ptemp,
					 server_rec * s)
{
#ifdef DEBUG_AUTH_PGSQL
	ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, p,
				  "[mod_auth_pgsql.c] - pg_auth_init_handler -  ");
#endif							/* DEBUG_AUTH_PGSQL */

	ap_add_version_component(p, "mod_auth_pgsql/" AUTH_PGSQL_VERSION);
	return OK;
}
Exemplo n.º 15
0
static void log_sql_module_init(server_rec *s, apr_pool_t *p)
#endif
{
    /* TODO: Add local_address, remote_address, server_name, connection_status */
    /* Register handlers */
    log_sql_register_item(s,p,'A', extract_agent,             "agent",            1, 1);
    log_sql_register_item(s,p,'a', extract_request_query,     "request_args",     1, 1);
    log_sql_register_item(s,p,'b', extract_bytes_sent,        "bytes_sent",       0, 0);
    log_sql_register_item(s,p,'c', extract_cookie,            "cookie",           0, 1);
    /* TODO: Document */
    log_sql_register_item(s,p,'f', extract_request_file,      "request_file",     0, 1);
    log_sql_register_item(s,p,'H', extract_request_protocol,  "request_protocol", 0, 1);
    log_sql_register_item(s,p,'h', extract_remote_host,       "remote_host",      0, 1);
    log_sql_register_item(s,p,'I', extract_unique_id,         "id",               0, 1);
    log_sql_register_item(s,p,'l', extract_remote_logname,    "remote_logname",   0, 1);
    log_sql_register_item(s,p,'m', extract_request_method,    "request_method",   0, 1);
    log_sql_register_item(s,p,'M', extract_machine_id,        "machine_id",       0, 1);
    log_sql_register_item(s,p,'P', extract_child_pid,         "child_pid",        0, 0);
    log_sql_register_item(s,p,'p', extract_server_port,       "server_port",      0, 0);
    log_sql_register_item(s,p,'R', extract_referer,           "referer",          1, 1);
    log_sql_register_item(s,p,'r', extract_request_line,      "request_line",     1, 1);
    log_sql_register_item(s,p,'S', extract_request_timestamp, "time_stamp",       0, 0);
    log_sql_register_item(s,p,'s', extract_status,            "status",           1, 0);
    log_sql_register_item(s,p,'T', extract_request_duration,  "request_duration", 1, 0);
    log_sql_register_item(s,p,'t', extract_request_time,      "request_time",     0, 1);
    log_sql_register_item(s,p,'u', extract_remote_user,       "remote_user",      0, 1);
    log_sql_register_item(s,p,'U', extract_request_uri,       "request_uri",      1, 1);
    log_sql_register_item(s,p,'x', extract_forwarded_for,     "remote_host",      0, 1);
    log_sql_register_item(s,p,'v', extract_virtual_host,      "virtual_host",     0, 1);
    log_sql_register_item(s,p,'V', extract_server_name,       "virtual_host",     0, 1);

    if (global_config.announce) {
        ap_add_version_component(p, PACKAGE_NAME"/"PACKAGE_VERSION);
    }
	/* ap_server_root_relative any default preserve file locations */
	{
	    server_rec *cur_s;
	    const char *default_p = ap_server_root_relative(p, DEFAULT_PRESERVE_FILE);
	    for (cur_s = s; cur_s != NULL; cur_s= cur_s->next) {
    	     logsql_state *cls = ap_get_module_config(cur_s->module_config,
									&log_sql_module);
             if (cls->preserve_file == DEFAULT_PRESERVE_FILE)
                 cls->preserve_file = default_p;
	    }
	}
    global_config.db.p = p;

#if defined(WITH_APACHE20)
	return OK;
#endif
}
Exemplo n.º 16
0
static int mod_mapcache_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
{
  mapcache_server_cfg* cfg = ap_get_module_config(s->module_config, &mapcache_module);
  if(!cfg) {
    ap_log_error(APLOG_MARK, APLOG_CRIT, 0, s, "configuration not found in server context");
    return 1;
  }

#ifdef USE_VERSION_STRING
  ap_add_version_component(p, MAPCACHE_USERAGENT);
#endif

  return 0;
}
Exemplo n.º 17
0
static int
prefork_post_config(apr_pool_t *p, apr_pool_t *plog,
		    apr_pool_t *dummy, server_rec *ptemp)
{
  g_start_time = time(0);
  
  ap_add_version_component(p, VERSION);

  g_ssl_lookup = APR_RETRIEVE_OPTIONAL_FN(ssl_var_lookup);

  apr_thread_mutex_create(&g_lock_lock, APR_THREAD_MUTEX_DEFAULT, p);

  return OK;
}
Exemplo n.º 18
0
static int
psgi_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
{
    dTHX;
    const void *key;
    char *file;
    SV *app;
    apr_hash_index_t *hi;
    void *data;
    const char *userdata_key = "psgi_post_config";
    psgi_apps_t *psgi_apps = NULL;
    apr_status_t rc;

    apr_pool_userdata_get(&data, userdata_key, s->process->pool);
    if (data == NULL) {
        apr_pool_userdata_set((const void *)1, userdata_key,
                apr_pool_cleanup_null, s->process->pool);
        return OK;
    }

    ap_add_version_component(pconf, apr_psprintf(pconf, "mod_psgi/%s", MOD_PSGI_VERSION));

    mutex_name = apr_psprintf(pconf, "/tmp/psgi_mutex.%ld", (long int) getpid());
    rc = apr_global_mutex_create(&psgi_mutex,
                        (const char *) mutex_name, APR_LOCK_DEFAULT, pconf);
    if (rc != APR_SUCCESS) {
        return DECLINED;
    }
    rc = apr_global_mutex_lock(psgi_mutex);
    if (rc != APR_SUCCESS) {
        return DECLINED;
    }

    /* shared name to store apps */
    shm_name = apr_pstrdup(pconf, "/tmp/psgi_shm");
    rc = apr_shm_attach(&psgi_shm, (const char *) shm_name, pconf);
    if (rc != APR_SUCCESS) {
        rc = apr_shm_create(&psgi_shm, sizeof(psgi_apps_t),
                        (const char *) shm_name, pconf);
    }
    if (rc == APR_SUCCESS) {
        psgi_apps = (psgi_apps_t *)apr_shm_baseaddr_get(psgi_shm);
        psgi_apps->apps = apr_hash_make(pconf);
    }
    apr_global_mutex_unlock(psgi_mutex);

    return OK;
}
Exemplo n.º 19
0
static int vhx_init_handler(apr_pool_t * pconf, apr_pool_t * plog, apr_pool_t * ptemp, server_rec * s) {

	/* make sure that mod_ldap (util_ldap) is loaded */
	if (ap_find_linked_module("util_ldap.c") == NULL) {
		VH_AP_LOG_ERROR(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, s,
				"%s: (vhx_init_handler) module mod_ldap missing. Mod_ldap (aka. util_ldap) "
				"must be loaded in order for vhx to function properly",VH_NAME);
		return HTTP_INTERNAL_SERVER_ERROR;
	}

	VH_AP_LOG_ERROR(APLOG_MARK, APLOG_INFO, 0, s, "Loading %s version %s", VH_NAME,VH_VERSION);

	ap_add_version_component(pconf, VH_VERSION);

#ifdef HAVE_MPM_ITK_SUPPORT
	unsigned short int itk_enable = 1;
	server_rec *sp;

	module *mpm_itk_module = ap_find_linked_module("itk.c");
	if (mpm_itk_module == NULL) {
		VH_AP_LOG_ERROR(APLOG_MARK, APLOG_ERR, 0, s, "%s: (vhx_init_handler) itk.c is not loaded",VH_NAME);
		itk_enable = 0;
	}

	for (sp = s; sp; sp = sp->next) {
		vhx_config_rec *vhr = (vhx_config_rec *) ap_get_module_config(sp->module_config, &vhostx_module);

		if (vhr->itk_enable) {
			if (!itk_enable) {
				vhr->itk_enable = 0;
			} else {
				itk_conf *cfg = (itk_conf *) ap_get_module_config(sp->module_config, mpm_itk_module);
				vhr->itk_defuid = cfg->uid;
				vhr->itk_defgid = cfg->gid;
				//vhr->itk_defusername = DEFAULT_USER;

				VH_AP_LOG_ERROR(APLOG_MARK, APLOG_DEBUG, 0, sp, "vhx_init_handler: itk uid='%d' itk gid='%d' "/*itk username='%s'*/, cfg->uid, cfg->gid/*, cfg->username */);
			}
		}       
	}
#endif /* HAVE_MPM_ITK_SUPPORT  */

	return OK;
}
Exemplo n.º 20
0
static int
init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
{
  svn_error_t *serr;
  ap_add_version_component(p, "SVN/" SVN_VER_NUMBER);

  serr = svn_fs_initialize(p);
  if (serr)
    {
      ap_log_perror(APLOG_MARK, APLOG_ERR, serr->apr_err, p,
                    "mod_dav_svn: error calling svn_fs_initialize: '%s'",
                    serr->message ? serr->message : "(no more info)");
      return HTTP_INTERNAL_SERVER_ERROR;
    }

  /* This returns void, so we can't check for error. */
  svn_utf_initialize(p);

  return OK;
}
Exemplo n.º 21
0
static int asn_post_config(apr_pool_t *pconf, apr_pool_t *plog, 
                               apr_pool_t *ptemp, server_rec *s)
{
    apr_version(&vsn);
    ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s,
                 "[mod_asn] compiled with APR/APR-Util %s/%s",
                 APR_VERSION_STRING, APU_VERSION_STRING);

    if ((vsn.major == 1) && (vsn.minor == 2)) {
        dbd_first_row = 0;
    } else {
        dbd_first_row = 1;
    }

    ap_add_version_component(pconf, VERSION_COMPONENT);

    /* make sure that mod_dbd is loaded */
    if (asn_dbd_prepare_fn == NULL) {
        asn_dbd_prepare_fn = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_prepare);
        if (asn_dbd_prepare_fn == NULL) {
            ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
                         "[mod_asn] You must load mod_dbd to enable mod_asn to work");
        return HTTP_INTERNAL_SERVER_ERROR;
        }
        asn_dbd_open_fn = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_open);
        asn_dbd_close_fn = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_close);
    }

    /* prepare DBD SQL statements */
    static unsigned int label_num = 0;
    server_rec *sp;
    for (sp = s; sp; sp = sp->next) {
        asn_server_conf *cfg = ap_get_module_config(sp->module_config, 
                                                        &asn_module);
        /* make a label */
        cfg->query_prep = apr_psprintf(pconf, "asn_dbd_%d", ++label_num);
        asn_dbd_prepare_fn(sp, cfg->query, cfg->query_prep);
    }

    return OK;
}
Exemplo n.º 22
0
static void init_module (server_rec *server, pool *p) 
{


  galax_err err=0;

  ap_add_version_component (MODULE_VERSION);

  galax_init();


  // FIX HERE: We cannot call this multiple times - Jerome
  if (pc_glob == NULL) {
    err = galax_default_processing_context(&pc_glob);
  }

#ifdef DEBUG
  if (0 == err) 
    fprintf (stderr, "\nmod_xquery: Default processing context was loaded.\n");
  else
    fprintf (stderr, "\nmod_xquery: Failed to load default processing context.\n");
#endif

  // FIX HERE: We cannot call this multiple times - Jerome
  if (cp_glob == NULL) {
    err = galax_load_standard_library(pc_glob, &cp_glob);
  }

#ifdef DEBUG
  if (0 == err) 
    fprintf (stderr, "mod_xquery: Standard library was loaded.\n");
  else
    fprintf (stderr, "mod_xquery: Failed to load standard library.\n");
#endif

}// init_module()
Exemplo n.º 23
0
/* map into the first apache */
static int log_rotate_post_config( apr_pool_t * p, apr_pool_t * plog, apr_pool_t * ptemp, server_rec * s)
{
	ap_add_version_component(p, "mod_log_rotate/1.02");
	return OK;
}
Exemplo n.º 24
0
static void mod_dirsize_init(server_rec *s, pool *p) 
{
  ap_add_version_component("mod_dirsize/0.1");
}
Exemplo n.º 25
0
static void php_apache_add_version(apr_pool_t *p)
{
	if (PG(expose_php)) {
		ap_add_version_component(p, "PHP/" PHP_VERSION);
	}
}
Exemplo n.º 26
0
/*
 *	ic_initialise()
 *	---------------
 *	Module initialisation.
 */
static void ic_initialise(server_rec *s,pool *p)
{
	ap_add_version_component(MODULE_VERSION);
}
static int line_edit(apr_pool_t* pool, apr_pool_t* p1,
		apr_pool_t* p2, server_rec* s) {
  ap_add_version_component(pool, "Line-Edit/" LINE_EDIT_VERSION) ;
  return DECLINED ;
}
Exemplo n.º 28
0
static void child_init(apr_pool_t *p, server_rec *s)
{
    ap_add_version_component(p, MODULE_NAME "/" MODULE_VERSION);
}
Exemplo n.º 29
0
static int cwx_prefork_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *dummy, server_rec *ptemp){
    ap_add_version_component(p, CWX_VERSION);
    return OK;
}
Exemplo n.º 30
0
static int embperl_ApachePostConfig (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)

    {
    ap_add_version_component (p, "Embperl/"VERSION) ;
    return APR_SUCCESS ;
    }