(void *) APR_OFFSETOF(pg_auth_config_rec,
										auth_pg_grp_table), OR_AUTHCFG,
				  "the name of the table containing username/group tuples."),
	AP_INIT_TAKE1("Auth_PG_grp_group_field", ap_set_string_slot,
				  (void *) APR_OFFSETOF(pg_auth_config_rec,
										auth_pg_grp_group_field),
				  OR_AUTHCFG,
				  "the name of the group-name field."),
	AP_INIT_TAKE1("Auth_PG_grp_user_field", ap_set_string_slot,
				  (void *) APR_OFFSETOF(pg_auth_config_rec,
										auth_pg_grp_user_field),
				  OR_AUTHCFG,
				  "the name of the group-name field."),
	AP_INIT_FLAG("Auth_PG_nopasswd", ap_set_flag_slot,
				 (void *) APR_OFFSETOF(pg_auth_config_rec,
									   auth_pg_nopasswd),
				 OR_AUTHCFG,
				 "'on' or 'off'"),
	AP_INIT_FLAG("Auth_PG_encrypted", ap_set_flag_slot,
				 (void *) APR_OFFSETOF(pg_auth_config_rec,
									   auth_pg_encrypted),
				 OR_AUTHCFG,
				 "'on' or 'off'"),
	AP_INIT_TAKE1("Auth_PG_hash_type", pg_set_hash_type, NULL, OR_AUTHCFG,
				  "password hash type (CRYPT|MD5|BASE64|NETEPI)."),
	AP_INIT_FLAG("Auth_PG_netepi_old_passwords", ap_set_flag_slot,
				 (void *) APR_OFFSETOF(pg_auth_config_rec,
									   auth_pg_netepi_old_passwords),
				 OR_AUTHCFG,
				 "'on' or 'off'"),
	AP_INIT_FLAG("Auth_PG_cache_passwords", ap_set_flag_slot,
Пример #2
0
        ls->interval = APR_USEC_PER_SEC * (apr_time_t) atol(inte);
        if (ls->interval < INTERVAL_MIN) {
            ls->interval = INTERVAL_MIN;
        }
    }

    if (NULL != offs) {
        /* Offset in minutes */
        ls->offset = APR_USEC_PER_SEC * 60 * (apr_time_t) atol(offs);
    }

    return NULL;
}

static const command_rec rotate_log_cmds[] = {
    AP_INIT_FLAG(  "RotateLogs", set_rotated_logs, NULL, RSRC_CONF,
                   "Enable rotated logging"),
    AP_INIT_FLAG(  "RotateLogsLocalTime", set_localtime, NULL, RSRC_CONF,
                   "Rotate relative to local time"),
    AP_INIT_TAKE12("RotateInterval", set_interval, NULL, RSRC_CONF,
                   "Set rotation interval in seconds with"
                   " optional offset in minutes"),
    {NULL}
};

static void *make_log_options(apr_pool_t *p, server_rec *s) {
    log_options *ls;

    ls = (log_options *) apr_palloc(p, sizeof(log_options));
    ls->enabled     = 1;
    ls->interval    = INTERVAL_DEFAULT;
    ls->offset      = 0;
Пример #3
0
                    r->server->port    = atoi(portvalue);
                    r->parsed_uri.port = r->server->port;
                } else {
                    r->server->port = cfg->orig_port;
                }
            }
        }
    }
    return DECLINED;
}

static const command_rec rpaf_cmds[] = {
    AP_INIT_FLAG(
                 "RPAF_Enable",
                 rpaf_enable,
                 NULL,
                 RSRC_CONF,
                 "Enable mod_rpaf"
                 ),
    AP_INIT_FLAG(
                 "RPAF_SetHostName",
                 rpaf_sethostname,
                 NULL,
                 RSRC_CONF,
                 "Let mod_rpaf set the hostname from the X-Host header and update vhosts"
                 ),
    AP_INIT_FLAG(
                 "RPAF_SetHTTPS",
                 rpaf_sethttps,
                 NULL,
                 RSRC_CONF,
Пример #4
0
    return NULL;
}

#define PROTO_FLAGS AP_FILTER_PROTO_CHANGE|AP_FILTER_PROTO_CHANGE_LENGTH
static void register_hooks(apr_pool_t *pool)
{
    ap_register_output_filter(substitute_filter_name, substitute_filter,
                              NULL, AP_FTYPE_RESOURCE);
}

static const command_rec substitute_cmds[] = {
    AP_INIT_TAKE1("Substitute", set_pattern, NULL, OR_FILEINFO,
                  "Pattern to filter the response content (s/foo/bar/[inf])"),
    AP_INIT_TAKE1("SubstituteMaxLineLength", set_max_line_length, NULL, OR_FILEINFO,
                  "Maximum line length"),
    AP_INIT_FLAG("SubstituteInheritBefore", ap_set_flag_slot,
                 (void *)APR_OFFSETOF(subst_dir_conf, inherit_before), OR_FILEINFO,
                 "Apply inherited patterns before those of the current context"),
    {NULL}
};

AP_DECLARE_MODULE(substitute) = {
    STANDARD20_MODULE_STUFF,
    create_substitute_dcfg,     /* dir config creater */
    merge_substitute_dcfg,      /* dir merger --- default is to override */
    NULL,                       /* server config */
    NULL,                       /* merge server config */
    substitute_cmds,            /* command table */
    register_hooks              /* register hooks */
};
    dir->enabled= 0;
    dir->authoritative= 1;	/* strong by default */

    return dir;
}


/*
 * Config file commands that this module can handle
 */

static const command_rec authz_unixgroup_cmds[] =
{
    AP_INIT_FLAG("AuthzUnixgroup",
	ap_set_flag_slot,
	(void *)APR_OFFSETOF(authz_unixgroup_dir_config_rec, enabled),
	OR_AUTHCFG,
	"Set to 'on' to enable unix group checking"),

    AP_INIT_FLAG("AuthzUnixgroupAuthoritative",
	ap_set_flag_slot,
	(void *)APR_OFFSETOF(authz_unixgroup_dir_config_rec, authoritative),
	OR_AUTHCFG,
	"Set to 'off' to allow access control to be passed along to lower "
	    "modules if this module can't confirm access rights" ),

    { NULL }
};


/* Check if the named user is in the given list of groups.  The list of
Пример #6
0
     (void *)APR_OFFSETOF(dbm_auth_config_rec, auth_dbmpwfile),
     OR_AUTHCFG, "dbm database file containing user IDs and passwords"),
    AP_INIT_TAKE1("AuthDBMGroupFile", ap_set_file_slot,
     (void *)APR_OFFSETOF(dbm_auth_config_rec, auth_dbmgrpfile),
     OR_AUTHCFG, "dbm database file containing group names and member user IDs"),
    AP_INIT_TAKE12("AuthUserFile", set_dbm_slot,
     (void *)APR_OFFSETOF(dbm_auth_config_rec, auth_dbmpwfile),
     OR_AUTHCFG, NULL),
    AP_INIT_TAKE12("AuthGroupFile", set_dbm_slot,
     (void *)APR_OFFSETOF(dbm_auth_config_rec, auth_dbmgrpfile),
     OR_AUTHCFG, NULL),
    AP_INIT_TAKE1("AuthDBMType", set_dbm_type,
     NULL,
     OR_AUTHCFG, "what type of DBM file the user file is"),
    AP_INIT_FLAG("AuthDBMAuthoritative", ap_set_flag_slot,
     (void *)APR_OFFSETOF(dbm_auth_config_rec, auth_dbmauthoritative),
     OR_AUTHCFG, "Set to 'no' to allow access control to be passed along to lower modules, if the UserID is not known in this module"),
    {NULL}
};

module AP_MODULE_DECLARE_DATA auth_dbm_module;

static char *get_dbm_pw(request_rec *r, 
                        char *user, 
                        char *auth_dbmpwfile, 
                        char *dbtype)
{
    apr_dbm_t *f;
    apr_datum_t d, q;
    char *pw = NULL;
    apr_status_t retval;
        if (config->proxies_header_name)
            apr_table_setn(r->headers_in, config->proxies_header_name,
                           conn->proxy_ips);
    }

    ap_log_rerror(APLOG_MARK, APLOG_INFO|APLOG_NOERRNO, 0, r,
                  conn->proxy_ips
                      ? "Using %s as client's IP by proxies %s"
                      : "Using %s as client's IP by internal proxies",
                  conn->proxied_ip, conn->proxy_ips);
    return OK;
}

static const command_rec reverseproxy_cmds[] =
{
    AP_INIT_FLAG("ReverseProxyEnable", reveseproxy_enable, NULL, RSRC_CONF,
                 "Enable mod_reverseproxy"),
    AP_INIT_TAKE1("ReverseProxyRemoteIPHeader", header_name_set, NULL, RSRC_CONF,
                  "Specifies a request header to trust as the client IP, "
                  "Overrides the default one"),
    AP_INIT_ITERATE("ReverseProxyRemoteIPTrusted", proxies_set, 0, RSRC_CONF,
                    "Specifies one or more proxies which are trusted "
                    "to present IP headers. Overrides the defaults."),
    { NULL }
};

static void register_hooks(apr_pool_t *p)
{
    // We need to run very early so as to not trip up mod_security.
    // Hence, this little trick, as mod_security runs at APR_HOOK_REALLY_FIRST.
    ap_hook_post_read_request(reverseproxy_modify_connection, NULL, NULL, APR_HOOK_REALLY_FIRST - 10);
}
Пример #8
0
                    apr_table_set(r->headers_in, "Host", apr_pstrdup(r->pool, hostvalue));
                    r->hostname = apr_pstrdup(r->pool, hostvalue);
                    ap_update_vhost_from_headers(r);
                }
            }

        }
    }
    return DECLINED;
}

static const command_rec rpaf_cmds[] = {
    AP_INIT_FLAG(
                 "RPAFenable",
                 rpaf_enable,
                 NULL,
                 RSRC_CONF,
                 "Enable mod_rpaf"
                 ),
    AP_INIT_FLAG(
                 "RPAFsethostname",
                 rpaf_sethostname,
                 NULL,
                 RSRC_CONF,
                 "Let mod_rpaf set the hostname from X-Host header and update vhosts"
                 ),
    AP_INIT_ITERATE(
                    "RPAFproxy_ips",
                    rpaf_set_proxy_ip,
                    NULL,
                    RSRC_CONF,
Пример #9
0
    ctype = apr_array_push(cfg->ctypes);
    ctype->data = apr_pstrdup(pool, line);

    return NULL;
}

static void register_hooks(apr_pool_t * pool)
{
    ap_register_output_filter(triger_filter_name,
			      triger_filter, NULL, AP_FTYPE_RESOURCE);
}

static const command_rec triger_cmds[] = {
    AP_INIT_FLAG("TrigerEnable",
		 set_enabled,
		 NULL,
		 RSRC_CONF | ACCESS_CONF | OR_FILEINFO,
		 "Enable/Disable the Triger output filter"),
    AP_INIT_FLAG("TrigerInherit",
		 set_inherit,
		 NULL,
		 RSRC_CONF | ACCESS_CONF | OR_FILEINFO,
		 "Inherit main server configurations or not. Only affect TrigerContentType, TrigerHTML, and TrigerCheckLength."),
    AP_INIT_FLAG("TrigerFullCheck",
		 set_full_chk,
		 NULL,
		 RSRC_CONF | ACCESS_CONF | OR_FILEINFO,
		 "Search each data bucket while no more than TrigerCheckLength, default is only check the first and last data buckets."),
    AP_INIT_ITERATE("TrigerContentType",
		    set_ctypes,
		    NULL,
Пример #10
0
    config->plugin_paths        = strlen(override->plugin_paths) ?
                                   override->plugin_paths :
                                   base->plugin_paths;

    config->precision           = (override->precision > 0) ?
                                   override->precision :
                                   base->precision;

    return (void *)config;
}

/* Commands */
static const command_rec sass_cmds[] =
{
    AP_INIT_FLAG("SassSaveOutput", ap_set_flag_slot,
                 (void *)APR_OFFSETOF(sass_dir_config_t, save_output),
                 RSRC_CONF|ACCESS_CONF, "Save CSS/source map output to file"),
    AP_INIT_FLAG("SassDisplayError", ap_set_flag_slot,
                 (void *)APR_OFFSETOF(sass_dir_config_t, display_error),
                 RSRC_CONF|ACCESS_CONF, "Display errors in the browser"),
    AP_INIT_TAKE1("SassOutputStyle", ap_set_string_slot,
                 (void *)APR_OFFSETOF(sass_dir_config_t, output_style),
                 RSRC_CONF|ACCESS_CONF, "Output style for the generated css code (Expanded | Nested | Compact | Compressed)"),
    AP_INIT_FLAG("SassSourceComments", ap_set_flag_slot,
                 (void *)APR_OFFSETOF(sass_dir_config_t, source_comments),
                 RSRC_CONF|ACCESS_CONF, "If you want inline source comments"),
    AP_INIT_FLAG("SassSourceMap", ap_set_flag_slot,
                 (void *)APR_OFFSETOF(sass_dir_config_t, source_map),
                 RSRC_CONF|ACCESS_CONF, "Generate a source map"),
    AP_INIT_FLAG("SassOmitSourceMapUrl", ap_set_flag_slot,
                 (void *)APR_OFFSETOF(sass_dir_config_t, omit_source_map_url),
    ap_hook_check_user_id(mod_stlog_check_user_id, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_type_checker(mod_stlog_type_checker, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_access_checker(mod_stlog_access_checker, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_auth_checker(mod_stlog_auth_checker, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_insert_filter(mod_stlog_insert_filter, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_fixups(mod_stlog_fixups, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_quick_handler(mod_stlog_quick_handler, NULL, NULL, APR_HOOK_FIRST);
    ap_hook_handler(mod_stlog_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);
    ap_hook_log_transaction(mod_stlog_log_transaction, NULL, NULL, APR_HOOK_MIDDLE);
    //ap_hook_error_log(mod_stlog_error_log, NULL, NULL, APR_HOOK_MIDDLE);
}

static const command_rec mod_stlog_cmds[] = {

    AP_INIT_TAKE1("DumpRequestLog", set_stlog_logname, NULL, RSRC_CONF | ACCESS_CONF, "Dumping log name."),
    AP_INIT_FLAG("DumpPostReadRequest", set_stlog_post_read_request, NULL, RSRC_CONF | ACCESS_CONF, "hook for post_read_request phase."),
    AP_INIT_FLAG("DumpTranslateName", set_stlog_translate_name, NULL, RSRC_CONF | ACCESS_CONF, "hook for translate_name phase."),
    AP_INIT_FLAG("DumpMapToStorage", set_stlog_map_to_storage, NULL, RSRC_CONF | ACCESS_CONF, "hook for map_to_storage phase."),
    AP_INIT_FLAG("DumpCheckUserId", set_stlog_check_user_id, NULL, RSRC_CONF | ACCESS_CONF, "hook for check_user_id phase."),
    AP_INIT_FLAG("DumpTypeChecker", set_stlog_type_checker, NULL, RSRC_CONF | ACCESS_CONF, "hook for type_checker phase."),
    AP_INIT_FLAG("DumpAccessChecker", set_stlog_access_checker, NULL, RSRC_CONF | ACCESS_CONF, "hook for access_checker phase."),
    AP_INIT_FLAG("DumpAuthChecker", set_stlog_auth_checker, NULL, RSRC_CONF | ACCESS_CONF, "hook for auth_checker phase."),
    AP_INIT_FLAG("DumpInsertFilter", set_stlog_insert_filter, NULL, RSRC_CONF | ACCESS_CONF, "hook for insert_filter phase."),
    AP_INIT_FLAG("DumpFixups", set_stlog_fixups, NULL, RSRC_CONF | ACCESS_CONF, "hook for fixups phase."),
    AP_INIT_FLAG("DumpQuickHandler", set_stlog_quick_handler, NULL, RSRC_CONF | ACCESS_CONF, "hook for quick_handler phase."),
    AP_INIT_FLAG("DumpHandler", set_stlog_handler, NULL, RSRC_CONF | ACCESS_CONF, "hook for handler phase."),
    AP_INIT_FLAG("DumpLogTransaction", set_stlog_log_transaction, NULL, RSRC_CONF | ACCESS_CONF, "hook for log_transaction phase."),
    //AP_INIT_FLAG("DumpErrorLog", set_stlog_error_log, NULL, RSRC_CONF | ACCESS_CONF, "hook for error_log phase."),
    {NULL}
};
Пример #12
0
  if (XSENDFILE_ENABLED != enabled) {
    return;
  }

  ap_add_output_filter(
    "XSENDFILE",
    NULL,
    r,
    r->connection
	  );
}
static const command_rec xsendfile_command_table[] = {
  AP_INIT_FLAG(
    "XSendFile",
    xsendfile_cmd_flag,
    NULL,
    OR_FILEINFO,
    "On|Off - Enable/disable(default) processing"
    ),
  AP_INIT_FLAG(
    "XSendFileIgnoreEtag",
    xsendfile_cmd_flag,
    NULL,
    OR_FILEINFO,
    "On|Off - Ignore script provided Etag headers (default: Off)"
    ),
  AP_INIT_FLAG(
    "XSendFileIgnoreLastModified",
    xsendfile_cmd_flag,
    NULL,
    OR_FILEINFO,
Пример #13
0
command_rec mod_vhost_ldap_cmds[] = {
	AP_INIT_TAKE1("VhostLDAPURL", mod_vhost_ldap_parse_url, NULL, RSRC_CONF,
					"URL to define LDAP connection.\n"),
	AP_INIT_TAKE1 ("VhostLDAPBaseDN", mod_vhost_ldap_set_basedn, NULL, RSRC_CONF,	"LDAP Hostname."),
	AP_INIT_TAKE1 ("VhostLDAPSearchScope", mod_vhost_ldap_set_searchscope, NULL, RSRC_CONF,
					"LDAP Hostname."),
	AP_INIT_TAKE1 ("VhostLDAPFilter", mod_vhost_ldap_set_filter, NULL, RSRC_CONF,
					"LDAP Hostname."),
				
	AP_INIT_TAKE1 ("VhostLDAPBindDN", mod_vhost_ldap_set_binddn, NULL, RSRC_CONF,
					"DN to use to bind to LDAP server. If not provided, will do an anonymous bind."),

	AP_INIT_TAKE1("VhostLDAPBindPassword", mod_vhost_ldap_set_bindpw, NULL, RSRC_CONF,
					"Password to use to bind to LDAP server. If not provided, will do an anonymous bind."),

	AP_INIT_FLAG("VhostLDAPEnabled", mod_vhost_ldap_set_enabled, NULL, RSRC_CONF,
					"Set to off to disable vhost_ldap, even if it's been enabled in a higher tree"),

	AP_INIT_TAKE1("VhostLDAPFallbackName", mod_vhost_ldap_set_fallback_name, NULL, RSRC_CONF,
					"Set default virtual host which will be used when requested hostname"
					"is not found in LDAP database. This option can be used to display"
					"\"virtual host not found\" type of page."),
	AP_INIT_TAKE1("VhostLDAPFallbackDocumentRoot", mod_vhost_ldap_set_fallback_docroot, NULL, RSRC_CONF,
					"Set default virtual host Document Root which will be used when requested hostname"
					"is not found in LDAP database. This option can be used to display"
					"\"virtual host not found\" type of page."),
	AP_INIT_TAKE1("VhostLDAProotdir", mod_vhost_ldap_set_rootdir, NULL, RSRC_CONF, "Configurable rootDir for vhosts"),
	AP_INIT_TAKE1("phpIncludePath",mod_vhost_ldap_set_phpincludepath, NULL, RSRC_CONF, "php include_path configuration for vhost"),
	{NULL}
};

static int ldapconnect(LDAP **ldapconn, mod_vhost_ldap_config_t *conf)
    } else {
        return apr_psprintf(cmd->pool, "No such variable %s", name);
    }

    return NULL;
}

/* ********************************************

    Configuration options

   ******************************************** */

static const command_rec commands[] = {
    AP_INIT_FLAG( "QS2Cookie",              set_config_enable,  NULL, OR_FILEINFO,
                  "whether or not to enable querystring to cookie module"),
    AP_INIT_FLAG( "QS2CookieEnableIfDNT",   set_config_enable,  NULL, OR_FILEINFO,
                  "whether or not to enable cookies if 'X-DNT' header is present"),
    AP_INIT_FLAG( "QS2CookieEncodeInKey",   set_config_enable,  NULL, OR_FILEINFO,
                  "rather than encoding the pairs in the value, encode them in the key"),
    AP_INIT_TAKE1("QS2CookieExpires",       set_config_value,   NULL, OR_FILEINFO,
                  "expiry time for the cookie, in seconds after the request is served"),
    AP_INIT_TAKE1("QS2CookieDomain",        set_config_value,   NULL, OR_FILEINFO,
                  "domain to which this cookie applies"),
    AP_INIT_TAKE1("QS2CookieMaxSize",       set_config_value,   NULL, OR_FILEINFO,
                  "maximum size to allow for all the key/value pairs in this request"),
    AP_INIT_TAKE1("QS2CookiePrefix",        set_config_value,   NULL, OR_FILEINFO,
                  "prefix all cookie keys with this string"),
    AP_INIT_TAKE1("QS2CookieName",          set_config_value,   NULL, OR_FILEINFO,
                  "this will be the cookie name, unless QS2CookieNameFrom is set"),
    AP_INIT_TAKE1("QS2CookieNameFrom",      set_config_value,   NULL, OR_FILEINFO,
Пример #15
0
    conf->etag_response = arg;

    return NULL;
}

/* cmd callbacks */
static const command_rec caldav_cmds[] =
{
    DIRECTIVE("MinDateTime",  min_date_time, "Minumum datetime")
    DIRECTIVE("MaxDateTime",  max_date_time, "Maximum datetime")
    DIRECTIVE("MaxInstances", max_instances, "Maximum instances")
    DIRECTIVE("MaxAttendeesPerInstance", max_attendees_per_instance,
		"Maximum attendees per instance")

    /* per directory/location, or per server */
    AP_INIT_FLAG("CalQueryETagResponse", etag_response, NULL,
		 OR_OPTIONS, "response with ETag for calendar-query"),
    { NULL }
};

/** store resource type for a calendar collection */
static int caldav_store_resource_type(request_rec *r,
                                      const dav_resource *resource)
{
    dav_db *db;
    dav_namespace_map *map = NULL;
    dav_prop_name restype[1] = { { NS_DAV, "resourcetype" } };
    apr_xml_elem el_child[1] = { { 0 } };
    apr_text text = { 0 };
    apr_array_header_t *ns;
    const dav_provider *provider = dav_lookup_provider(DAV_DEFAULT_PROVIDER);
    const dav_hooks_propdb *db_hooks = provider ? provider->propdb : NULL;
	 (void *)APR_OFFSETOF(cookie_auth_config_rec, cookie_auth_cookie),
	 OR_AUTHCFG, "auth cookie name"),
    AP_INIT_TAKE1("AuthCookieEnv", ap_set_string_slot,
	 (void *)APR_OFFSETOF(cookie_auth_config_rec, cookie_auth_env),
	 OR_AUTHCFG, "environment variable name for optional auxiliary auth info"),
     AP_INIT_TAKE1("AuthCookieEnvRedirect", ap_set_string_slot,
	 (void *)APR_OFFSETOF(cookie_auth_config_rec, cookie_auth_env_redirect),
	 OR_AUTHCFG, "path to redirect to if optional auxiliary auth info is missing in cookie"),
     AP_INIT_TAKE1("AuthCookieUnauthRedirect", ap_set_string_slot,
	 (void *)APR_OFFSETOF(cookie_auth_config_rec, cookie_auth_unauth_redirect),
	 OR_AUTHCFG, "path to redirect to if authentication cookie is not set"),
   AP_INIT_TAKE1("AuthCookieEncrypt", ap_set_string_slot,
	 (void *)APR_OFFSETOF(cookie_auth_config_rec, cookie_auth_encrypt),
	 OR_AUTHCFG, "secret key used to DES-encrypt the cookie"),
    AP_INIT_FLAG("AuthCookieOverride", ap_set_flag_slot,
     (void *)APR_OFFSETOF(cookie_auth_config_rec, cookie_auth_override),
     OR_AUTHCFG, "Limited to 'on' or 'off'"),
    AP_INIT_FLAG("AuthCookieBase64", ap_set_flag_slot,
     (void *)APR_OFFSETOF(cookie_auth_config_rec, cookie_auth_base64),
     OR_AUTHCFG, "Limited to 'on' or 'off'"),
    {NULL}
};

module AP_MODULE_DECLARE_DATA auth_cookie_module;

static int check_auth_cookie(request_rec *r)
{

	const char *cookies = NULL, *auth_line = NULL;
	char *cookie = NULL;
Пример #17
0
    }
    else {
	conf->user = user;
        conf->user_set = 1;

    }

    return NULL;
}


static const command_rec auth_env_cmds[] = {
	AP_INIT_TAKE1("AuthEnvUser", add_env_user, NULL, OR_AUTHCFG, 
		"Specify the username to set REMOTE_USER"),
        AP_INIT_FLAG("AuthEnvAuthoritative", set_authoritative, NULL, OR_AUTHCFG,
		"Set to 'Off' to allow access control to be passed along"),
	{ NULL }
};


static void *create_auth_env_dir_config(apr_pool_t *p, char *d)
{
    auth_env_config_rec *conf = apr_pcalloc(p, sizeof(*conf));

    /* Any failures are fatal. */
    conf->authoritative = 1;

    return conf;
}

static void *merge_auth_env_dir_config(apr_pool_t *p, void *basev, void *overridesv)
Пример #18
0
        if (dbd_prepare == NULL) {
            return "You must load mod_dbd to enable AuthzDBD functions";
        }
        dbd_handle = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_acquire);
    }
    label = apr_psprintf(cmd->pool, "authz_dbd_%d", ++label_num);

    dbd_prepare(cmd->server, query, label);

    /* save the label here for our own use */
    return ap_set_string_slot(cmd, cfg, label);
}

static const command_rec authz_dbd_cmds[] = {
    AP_INIT_FLAG("AuthzDBDLoginToReferer", ap_set_flag_slot,
                 (void*)APR_OFFSETOF(authz_dbd_cfg, redirect), ACCESS_CONF,
                 "Whether to redirect to referer on successful login"),
    AP_INIT_TAKE1("AuthzDBDQuery", authz_dbd_prepare,
                  (void*)APR_OFFSETOF(authz_dbd_cfg, query), ACCESS_CONF,
                  "SQL query for DBD Authz or login"),
    AP_INIT_TAKE1("AuthzDBDRedirectQuery", authz_dbd_prepare,
                  (void*)APR_OFFSETOF(authz_dbd_cfg, redir_query), ACCESS_CONF,
                  "SQL query to get per-user redirect URL after login"),
    {NULL}
};

static int authz_dbd_login(request_rec *r, authz_dbd_cfg *cfg,
                           const char *action)
{
    int rv;
    const char *newuri = NULL;
Пример #19
0
/*
 * Respond to a callback to create a config record for a specific directory.
 */
static void *create_mconfig_for_directory(apr_pool_t *p, char *dir)
{
    return mkconfig(p);
}

/*
 * Define the directives specific to this module.  This structure is referenced
 * later by the 'module' structure.
 */
static const command_rec speling_cmds[] =
{
    AP_INIT_FLAG("CheckSpelling", ap_set_flag_slot,
                  (void*)APR_OFFSETOF(spconfig, enabled), OR_OPTIONS,
                 "whether or not to fix miscapitalized/misspelled requests"),
    AP_INIT_FLAG("CheckCaseOnly", ap_set_flag_slot,
                  (void*)APR_OFFSETOF(spconfig, check_case_only), OR_OPTIONS,
                 "whether or not to fix only miscapitalized requests"),
    AP_INIT_FLAG("CheckBasenameMatch", ap_set_flag_slot,
                  (void*)APR_OFFSETOF(spconfig, check_basename_match), OR_OPTIONS,
                 "whether or not to fix files with the same base name"),
    { NULL }
};

typedef enum {
    SP_IDENTICAL = 0,
    SP_MISCAPITALIZED = 1,
    SP_TRANSPOSITION = 2,
    SP_MISSINGCHAR = 3,
Пример #20
0
static const char *mag_deleg_ccache_dir(cmd_parms *parms, void *mconfig,
                                        const char *value)
{
    struct mag_config *cfg = (struct mag_config *)mconfig;

    cfg->deleg_ccache_dir = apr_pstrdup(parms->pool, value);
    if (!cfg->deleg_ccache_dir) {
        ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, parms->server,
                     "%s", "OOM handling GssapiDelegCcacheDir option");
    }

    return NULL;
}

static const command_rec mag_commands[] = {
    AP_INIT_FLAG("GssapiSSLonly", mag_ssl_only, NULL, OR_AUTHCFG,
                  "Work only if connection is SSL Secured"),
    AP_INIT_FLAG("GssapiLocalName", mag_map_to_local, NULL, OR_AUTHCFG,
                  "Translate principals to local names"),
    AP_INIT_FLAG("GssapiConnectionBound", mag_conn_ctx, NULL, OR_AUTHCFG,
                  "Authentication is bound to the TCP connection"),
    AP_INIT_FLAG("GssapiUseSessions", mag_use_sess, NULL, OR_AUTHCFG,
                  "Authentication uses mod_sessions to hold status"),
    AP_INIT_RAW_ARGS("GssapiSessionKey", mag_sess_key, NULL, OR_AUTHCFG,
                     "Key Used to seal session data."),
#ifdef HAVE_GSS_ACQUIRE_CRED_FROM
    AP_INIT_FLAG("GssapiUseS4U2Proxy", mag_use_s4u2p, NULL, OR_AUTHCFG,
                  "Initializes credentials for s4u2proxy usage"),
#endif
#ifdef HAVE_GSS_STORE_CRED_INTO
    AP_INIT_ITERATE("GssapiCredStore", mag_cred_store, NULL, OR_AUTHCFG,
                    "Credential Store"),
Пример #21
0
	const char* makeProgram;
	const char* makeOptions;
	const char* includeFileTypes;
	const char* excludeFileTypes;
	// const char* excludeRegex;
	const char* errorURI;
	const char* errorCSS;
	int debug;
} dir_cfg;

static const char* cfg_set_filetype(cmd_parms* cmd, void* cfg, const char* val);
static void* create_dir_conf(apr_pool_t* pool, char* x);
static void make_hooks(apr_pool_t *pool);
	
static const command_rec cmds[]={
	AP_INIT_FLAG("Make",				  ap_set_flag_slot,   (void*)APR_OFFSETOF(dir_cfg,onoff),	        OR_ALL,"Enable mod_make"),
	AP_INIT_TAKE1("MakeSourceRoot",		  ap_set_string_slot, (void*)APR_OFFSETOF(dir_cfg,sourceRoot),	    OR_ALL,"Source root"),
	AP_INIT_TAKE1("MakeFilename",		  ap_set_string_slot, (void*)APR_OFFSETOF(dir_cfg,makefileName),    OR_ALL,"Make filename (i.e., Makefile)"),
	AP_INIT_TAKE1("MakeProgram",		  ap_set_string_slot, (void*)APR_OFFSETOF(dir_cfg,makeProgram),	    OR_ALL,"Make binary"),
	AP_INIT_TAKE1("MakeOptions",		  ap_set_string_slot, (void*)APR_OFFSETOF(dir_cfg,makeOptions),	    OR_ALL,"Make options"),
	AP_INIT_ITERATE("MakeIncludeFileTypes", cfg_set_filetype, (void*)APR_OFFSETOF(dir_cfg,includeFileTypes),OR_ALL,"Include file types"),
	AP_INIT_ITERATE("MakeExcludeFileTypes", cfg_set_filetype, (void*)APR_OFFSETOF(dir_cfg,excludeFileTypes),OR_ALL,"Exclude file types"),
	// AP_INIT_TAKE1("MakeExcludeRegex",	  ap_set_string_slot, (void*)APR_OFFSETOF(dir_cfg,excludeRegex),	OR_ALL,"Exclude regex"),
	AP_INIT_TAKE1("MakeErrorURI",		  ap_set_string_slot, (void*)APR_OFFSETOF(dir_cfg,errorURI),		OR_ALL,"Error URI"),
	AP_INIT_TAKE1("MakeErrorCSS",		  ap_set_string_slot, (void*)APR_OFFSETOF(dir_cfg,errorCSS),		OR_ALL,"Error CSS"),
	AP_INIT_FLAG("MakeDebug",			  ap_set_flag_slot,   (void*)APR_OFFSETOF(dir_cfg,debug),	        OR_ALL,"Enable mod_make debug mode"),
	{NULL}
};

module AP_MODULE_DECLARE_DATA make_module = {
        STANDARD20_MODULE_STUFF,
Пример #22
0
    const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE);
    if (err != NULL) {
        return err;
    }

    cmd->server->keep_alive_max = atoi(arg);
    return NULL;
}

static const command_rec http_cmds[] = {
    AP_INIT_TAKE1("KeepAliveTimeout", set_keep_alive_timeout, NULL, RSRC_CONF,
                  "Keep-Alive timeout duration (sec)"),
    AP_INIT_TAKE1("MaxKeepAliveRequests", set_keep_alive_max, NULL, RSRC_CONF,
                  "Maximum number of Keep-Alive requests per connection, "
                  "or 0 for infinite"),
    AP_INIT_FLAG("KeepAlive", set_keep_alive, NULL, RSRC_CONF,
                  "Whether persistent connections should be On or Off"),
    { NULL }
};

static const char *http_scheme(const request_rec *r)
{
    /*
     * The http module shouldn't return anything other than
     * "http" (the default) or "https".
     */
    if (r->server->server_scheme &&
        (strcmp(r->server->server_scheme, "https") == 0))
        return "https";

    return "http";
}
Пример #23
0
        (geoip_server_config_rec *) apr_pcalloc(p,
                                                sizeof
                                                (geoip_server_config_rec));
    dcfg->gips = NULL;
    dcfg->numGeoIPFiles = 0;
    dcfg->GeoIPFilenames = NULL;
    dcfg->GeoIPEnabled = 0;
    dcfg->GeoIPEnableUTF8 = 0;
    dcfg->GeoIPOutput = GEOIP_INIT;
    dcfg->GeoIPFlags = GEOIP_STANDARD;
    dcfg->GeoIPFlags2 = NULL;
    return dcfg;
}

static const command_rec geoip_cmds[] = {
    AP_INIT_FLAG("GeoIPScanProxyHeaders", geoip_scanproxy, NULL, RSRC_CONF,
                 "Get IP from HTTP_CLIENT IP or X-Forwarded-For"),
    AP_INIT_FLAG("GeoIPUseFirstNonPrivateXForwardedForIP",
                 geoip_use_first_non_private_x_forwarded_for_ip, NULL,
                 RSRC_CONF,
                 "For more IP's in X-Forwarded-For, use the first non private IP"),
    AP_INIT_FLAG("GeoIPUseFirstXForwardedForIP",
                 geoip_use_first_x_forwarded_for_ip, NULL, RSRC_CONF,
                 "For more IP's in X-Forwarded-For, use the first"),
    AP_INIT_FLAG("GeoIPUseLastXForwardedForIP",
                 geoip_use_last_x_forwarded_for_ip, NULL, RSRC_CONF,
                 "For more IP's in X-Forwarded-For, use the last"),
    AP_INIT_FLAG("GeoIPEnable", set_geoip_enable, NULL,
                 RSRC_CONF | OR_FILEINFO, "Turn on mod_geoip"),
    AP_INIT_FLAG("GeoIPEnableUTF8", set_geoip_enable_utf8, NULL, RSRC_CONF,
                 "Turn on utf8 characters for city names"),
    AP_INIT_TAKE12("GeoIPDBFile", set_geoip_filename, NULL, RSRC_CONF,
Пример #24
0
		  	safe_sql_insert(orig, LOGSQL_TABLE_HEADERSIN,hin_tablename,hin_query);

		if (cookie_query)
		  	safe_sql_insert(orig, LOGSQL_TABLE_COOKIES,cookie_tablename,cookie_query);

		return OK;
	}
}


/* Setup of the available httpd.conf configuration commands.
 * Structure: command, function called, NULL, where available, how many arguments, verbose description
 */
static const command_rec log_sql_cmds[] = {
	AP_INIT_FLAG("LogSQLAnnounce", set_global_flag_slot,
	 (void *)APR_OFFSETOF(global_config_t, announce), RSRC_CONF,
	 "Whether to announce that mod_log_sql is loaded in the server header")
	,
	/* DB connection parameters */
	AP_INIT_TAKE13("LogSQLLoginInfo", set_log_sql_info, NULL, RSRC_CONF,
	 "The database connection URI in the form &quot;driver://user:password@hostname:port/database&quot;")
	,
	AP_INIT_TAKE2("LogSQLDBParam", set_dbparam, NULL, RSRC_CONF,
	 "First argument is the DB parameter, second is the value to assign")
	,
	AP_INIT_FLAG("LogSQLForcePreserve", set_global_flag_slot,
	 (void *)APR_OFFSETOF(global_config_t, forcepreserve), RSRC_CONF,
	 "Forces logging to preserve file and bypasses database")
	,
	AP_INIT_FLAG("LogSQLDisablePreserve", set_global_flag_slot,
	 (void *)APR_OFFSETOF(global_config_t, disablepreserve), RSRC_CONF,
Пример #25
0
set_debug_level(cmd_parms *cmd, void *config, const char *arg)
{
    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
    if (err != NULL) return err;
    debuglevel = strtol(arg, NULL, 10);
    return NULL;
}
#endif


/* module info */

static const command_rec aclr_cmds[] =
{
    AP_INIT_FLAG("AccelRedirectSet", set_aclr_state,
    NULL, ACCESS_CONF|RSRC_CONF,
    "Turn X-Accel-Redirect support On or Off (default Off)"),

    AP_INIT_TAKE1("AccelRedirectSize", set_redirect_min_size,
    NULL, ACCESS_CONF|RSRC_CONF,
    "Minimum size of file for redirect"),

    AP_INIT_FLAG("AccelRedirectOutsideDocRoot", set_aclr_outside_of_docroot,
    NULL, RSRC_CONF,
    "Allow redirect outside of DocumentRoot (default Off)"),

#ifdef DEBUG
    AP_INIT_TAKE1("AccelRedirectDebug", set_debug_level,
    NULL, RSRC_CONF,
    "Debug level (0=off, 1=min, 2=mid, 3=max)"),
#endif
Пример #26
0
            break;
        }
        apr_brigade_cleanup(bb);

        /* Announce our intent to loop */
        update_echo_child_status(c->sbh, SERVER_BUSY_KEEPALIVE, NULL, NULL);
    }
    apr_brigade_destroy(bb);
    ap_time_process_request(c->sbh, STOP_PREQUEST);
    update_echo_child_status(c->sbh, SERVER_CLOSING, c, NULL);
    return OK;
}

static const command_rec echo_cmds[] =
{
    AP_INIT_FLAG("ProtocolEcho", echo_on, NULL, RSRC_CONF,
                 "Run an echo server on this host"),
    { NULL }
};

static void register_hooks(apr_pool_t *p)
{
    ap_hook_process_connection(process_echo_connection, NULL, NULL,
                               APR_HOOK_MIDDLE);
}

AP_DECLARE_MODULE(echo) = {
    STANDARD20_MODULE_STUFF,
    NULL,                       /* create per-directory config structure */
    NULL,                       /* merge per-directory config structures */
    create_echo_server_config,  /* create per-server config structure */
    NULL,                       /* merge per-server config structures */
Пример #27
0
  
            if ( device_info->is_tablet ) {
                apr_table_setn(r->subprocess_env, sconf->mobile_env, "true");
            }
        }
    } else {
    	// ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server , "No entry found for UA: %s", user_agent);
    }

    return DECLINED;
}


static const command_rec wurfl_cmds[] =
{
    AP_INIT_FLAG("WurflEnable", cmd_wurflengine, NULL, RSRC_CONF,
                 "On or off to enable the whole WURFL module"),
    AP_INIT_TAKE1("WurflDBFile", cmd_wurfldb, NULL, RSRC_CONF,
                 "the filename of the WURFL-DB xml file"),
    AP_INIT_TAKE1("WurflMobileEnv", cmd_wurflmobileenv, NULL, RSRC_CONF,
    			"ENV to set for mobile user agents"),
    AP_INIT_TAKE1("WurflTabletEnv", cmd_wurfltabletenv, NULL, RSRC_CONF,
    		   	 "ENV to set for tablet user agents"),

    { NULL }
};

static void register_hooks(apr_pool_t *p)
{
    ap_hook_header_parser(wurfl_match_headers, NULL, NULL, APR_HOOK_MIDDLE);
}
Пример #28
0
    else {
        return apr_psprintf(cmd->pool, "Invalid %s keyword: '%s'",
                            cmd->cmd->name, name);
    }

    return NULL;
}

static const command_rec cookie_log_cmds[] = {
    AP_INIT_TAKE1("CookieExpires", set_cookie_exp, NULL, OR_FILEINFO,
                  "an expiry date code"),
    AP_INIT_TAKE1("CookieDomain", set_cookie_domain, NULL, OR_FILEINFO,
                  "domain to which this cookie applies"),
    AP_INIT_TAKE1("CookieStyle", set_cookie_style, NULL, OR_FILEINFO,
                  "'Netscape', 'Cookie' (RFC2109), or 'Cookie2' (RFC2965)"),
    AP_INIT_FLAG("CookieTracking", set_cookie_enable, NULL, OR_FILEINFO,
                 "whether or not to enable cookies"),
    AP_INIT_TAKE1("CookieName", set_cookie_name, NULL, OR_FILEINFO,
                  "name of the tracking cookie"),
    {NULL}
};

static void register_hooks(apr_pool_t *p)
{
    ap_hook_fixups(spot_cookie,NULL,NULL,APR_HOOK_REALLY_FIRST);
}

AP_DECLARE_MODULE(usertrack) = {
    STANDARD20_MODULE_STUFF,
    make_cookie_dir,            /* dir config creater */
    NULL,                       /* dir merger --- default is to override */
    make_cookie_log_state,      /* server config */
Пример #29
0
        return MODULE_NAME_STR ": IronBee directive not allowed in VirtualHost";
    }
    dummy = ap_get_module_config(cmd->server->module_config, &ironbee_module);
    return ap_set_int_slot(cmd, dummy, p1);
}

/**
 * @internal
 *
 * Declares all configuration directives.
 */
static const command_rec ironbee_cmds[] = {
    AP_INIT_FLAG(
      "IronBeeEnable",
      ironbee_cmd_ibenable,
      (void*)APR_OFFSETOF(ironbee_config_t, enabled),
      RSRC_CONF,
      "enable ironbee module"
    ),
    AP_INIT_TAKE1(
      "IronBeeConfig",
      ironbee_cmd_ibconfig,
      (void*)APR_OFFSETOF(ironbee_config_t, config),
      RSRC_CONF,
      "specify ironbee configuration file"
    ),
    AP_INIT_TAKE1(
      "IronBeeBufferSize",
      ironbee_cmd_sz,
      (void*)APR_OFFSETOF(ironbee_config_t, buf_size),
      RSRC_CONF,
Пример #30
0
#ifdef HAVE_MOD_PHP_SUPPORT
	if(reqc->homedirectory != NULL)
		vhx_php_config(r, vhr, reqc->homedirectory, reqc->phpoptions);
	else
		vhx_php_config(r, vhr, reqc->docroot, reqc->phpoptions);
#endif /* HAVE_MOD_PHP_SUPPORT */

	VH_AP_LOG_RERROR(APLOG_MARK, APLOG_DEBUG, 0, r, "vhx_translate_name: END ***, pid=%d",getpid());
	return OK;
}

/*
 * Stuff for registering the module
 */
static const command_rec vhx_commands[] = {
	AP_INIT_FLAG( "EnableVhx", set_flag, (void *)5, RSRC_CONF, "Enable VHS module"),

	//AP_INIT_TAKE1("vhx_Path_Prefix", set_field, (void *)1, RSRC_CONF, "Set path prefix."),
	AP_INIT_TAKE1("vhx_PathPrefix", set_field, (void *)1, RSRC_CONF, "Set path prefix."),
	//AP_INIT_TAKE1("vhx_Default_Host", set_field, (void *)2, RSRC_CONF, "Set default host if HTTP/1.1 is not used."),
	AP_INIT_TAKE1("vhx_NotFoundRedirect", set_field, (void *)2, RSRC_CONF, "Redirect to this URL if no host found"),
	//AP_INIT_FLAG( "vhx_Lamer", set_flag, (void *)0, RSRC_CONF, "Enable Lamer Friendly mode"),
	AP_INIT_FLAG( "vhx_WWWMode", set_flag, (void *)0, RSRC_CONF, "Enable WWW mode (where host not found, try again with www. prepended)"),
	//AP_INIT_FLAG( "vhx_LogNotFound", set_flag, (void *)7, RSRC_CONF, "Log on error log when host or path is not found."),

#ifdef HAVE_MOD_PHP_SUPPORT
	//AP_INIT_FLAG( "vhx_PHPopen_basedir", set_flag, (void *)2, RSRC_CONF, "Set PHP open_basedir to path"),
	AP_INIT_FLAG( "vhx_PHPOpenBasedir", set_flag, (void *)2, RSRC_CONF, "Enable setting of PHP open_basedir"),
	//AP_INIT_FLAG( "vhx_PHPopt_fromdb", set_flag, (void *)3, RSRC_CONF, "Gets PHP options from db/libhome"),
	AP_INIT_FLAG( "vhx_PHPOptFromDb", set_flag, (void *)3, RSRC_CONF, "Gets PHP options from db/libhome"),
	//AP_INIT_FLAG( "vhx_PHPdisplay_errors", set_flag, (void *)4, RSRC_CONF, "Enable PHP display_errors"),