From 5061d9fa920cb1821a51495fc42833c54e5bd714 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 10 Nov 2005 15:11:44 +0000 Subject: [PATCH] No functional Change: Removing trailing whitespace. This also means that "blank" lines consisting of just spaces or tabs are now really blank lines git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68 --- modules/aaa/mod_auth_basic.c | 4 +- modules/aaa/mod_auth_digest.c | 58 +- modules/aaa/mod_authn_alias.c | 26 +- modules/aaa/mod_authn_anon.c | 10 +- modules/aaa/mod_authn_dbd.c | 2 +- modules/aaa/mod_authn_dbm.c | 14 +- modules/aaa/mod_authnz_ldap.c | 150 ++-- modules/aaa/mod_authz_dbm.c | 8 +- modules/aaa/mod_authz_default.c | 4 +- modules/aaa/mod_authz_groupfile.c | 22 +- modules/aaa/mod_authz_host.c | 6 +- modules/aaa/mod_authz_owner.c | 2 +- modules/aaa/mod_authz_user.c | 6 +- modules/arch/netware/libprews.c | 4 +- modules/arch/netware/mod_netware.c | 12 +- modules/arch/netware/mod_nw_ssl.c | 166 ++-- modules/arch/win32/mod_isapi.c | 246 +++--- modules/arch/win32/mod_win32.c | 60 +- modules/cache/cache_hash.c | 4 +- modules/cache/cache_storage.c | 18 +- modules/cache/cache_util.c | 32 +- modules/cache/mod_cache.c | 88 +- modules/cache/mod_disk_cache.c | 28 +- modules/cache/mod_file_cache.c | 40 +- modules/cache/mod_mem_cache.c | 134 +-- modules/dav/fs/dbm.c | 4 +- modules/dav/fs/lock.c | 26 +- modules/dav/fs/repos.c | 44 +- modules/dav/lock/locks.c | 4 +- modules/dav/main/liveprop.c | 2 +- modules/dav/main/mod_dav.c | 20 +- modules/dav/main/util.c | 70 +- modules/dav/main/util_lock.c | 12 +- modules/debug/mod_bucketeer.c | 12 +- modules/debug/mod_dumpio.c | 16 +- modules/echo/mod_echo.c | 4 +- modules/experimental/mod_case_filter.c | 2 +- modules/experimental/mod_case_filter_in.c | 8 +- modules/experimental/mod_example.c | 24 +- modules/filters/mod_charset_lite.c | 114 +-- modules/filters/mod_deflate.c | 22 +- modules/filters/mod_ext_filter.c | 78 +- modules/filters/mod_filter.c | 8 +- modules/filters/mod_include.c | 40 +- modules/generators/mod_asis.c | 4 +- modules/generators/mod_autoindex.c | 4 +- modules/generators/mod_cgi.c | 54 +- modules/generators/mod_cgid.c | 798 +++++++++--------- modules/generators/mod_info.c | 14 +- modules/generators/mod_status.c | 28 +- modules/http/byterange_filter.c | 10 +- modules/http/chunk_filter.c | 2 +- modules/http/http_core.c | 26 +- modules/http/http_etag.c | 4 +- modules/http/http_filters.c | 40 +- modules/http/http_protocol.c | 20 +- modules/http/http_request.c | 30 +- modules/http/mod_mime.c | 80 +- modules/ldap/util_ldap.c | 388 ++++----- modules/ldap/util_ldap_cache.c | 18 +- modules/ldap/util_ldap_cache_mgr.c | 52 +- modules/loggers/mod_log_config.c | 58 +- modules/loggers/mod_log_forensic.c | 2 +- modules/loggers/mod_logio.c | 2 +- modules/mappers/mod_actions.c | 12 +- modules/mappers/mod_alias.c | 16 +- modules/mappers/mod_dir.c | 16 +- modules/mappers/mod_imagemap.c | 8 +- modules/mappers/mod_negotiation.c | 2 +- modules/mappers/mod_rewrite.c | 10 +- modules/mappers/mod_so.c | 58 +- modules/mappers/mod_speling.c | 12 +- modules/mappers/mod_userdir.c | 10 +- modules/mappers/mod_vhost_alias.c | 28 +- modules/metadata/mod_cern_meta.c | 20 +- modules/metadata/mod_env.c | 8 +- modules/metadata/mod_expires.c | 24 +- modules/metadata/mod_headers.c | 44 +- modules/metadata/mod_mime_magic.c | 20 +- modules/metadata/mod_setenvif.c | 10 +- modules/metadata/mod_unique_id.c | 18 +- modules/metadata/mod_usertrack.c | 6 +- modules/metadata/mod_version.c | 4 +- modules/proxy/ajp_header.c | 46 +- modules/proxy/ajp_link.c | 12 +- modules/proxy/ajp_msg.c | 44 +- modules/proxy/mod_proxy.c | 120 +-- modules/proxy/mod_proxy_ajp.c | 2 +- modules/proxy/mod_proxy_balancer.c | 94 +-- modules/proxy/mod_proxy_connect.c | 12 +- modules/proxy/mod_proxy_ftp.c | 28 +- modules/proxy/mod_proxy_http.c | 90 +- modules/proxy/proxy_util.c | 46 +- modules/ssl/mod_ssl.c | 16 +- modules/ssl/ssl_engine_config.c | 26 +- modules/ssl/ssl_engine_dh.c | 6 +- modules/ssl/ssl_engine_init.c | 22 +- modules/ssl/ssl_engine_io.c | 86 +- modules/ssl/ssl_engine_kernel.c | 60 +- modules/ssl/ssl_engine_log.c | 6 +- modules/ssl/ssl_engine_mutex.c | 2 +- modules/ssl/ssl_engine_pphrase.c | 24 +- modules/ssl/ssl_engine_rand.c | 4 +- modules/ssl/ssl_engine_vars.c | 30 +- modules/ssl/ssl_expr_eval.c | 2 +- modules/ssl/ssl_expr_parse.c | 10 +- modules/ssl/ssl_expr_scan.c | 18 +- modules/ssl/ssl_scache.c | 2 +- modules/ssl/ssl_scache_dbm.c | 6 +- modules/ssl/ssl_scache_dc.c | 6 +- modules/ssl/ssl_scache_shmcb.c | 44 +- modules/ssl/ssl_util.c | 28 +- modules/ssl/ssl_util_ssl.c | 20 +- os/beos/beosd.c | 8 +- os/beos/os.c | 2 +- os/bs2000/ebcdic.c | 2 +- os/tpf/ebcdic.c | 2 +- os/tpf/os.c | 4 +- os/unix/unixd.c | 14 +- os/win32/ap_regkey.c | 104 +-- os/win32/util_win32.c | 36 +- server/config.c | 24 +- server/connection.c | 2 +- server/core.c | 46 +- server/core_filters.c | 16 +- server/eoc_bucket.c | 4 +- server/eor_bucket.c | 4 +- server/gen_test_char.c | 6 +- server/listen.c | 16 +- server/log.c | 10 +- server/main.c | 8 +- server/mpm/beos/beos.c | 172 ++-- server/mpm/experimental/event/event.c | 76 +- server/mpm/experimental/event/fdqueue.c | 4 +- server/mpm/experimental/leader/leader.c | 226 ++--- server/mpm/experimental/perchild/perchild.c | 220 ++--- server/mpm/experimental/threadpool/pod.c | 2 +- .../mpm/experimental/threadpool/threadpool.c | 244 +++--- server/mpm/mpmt_os2/mpmt_os2.c | 20 +- server/mpm/mpmt_os2/mpmt_os2_child.c | 14 +- server/mpm/netware/mpm_netware.c | 76 +- server/mpm/prefork/prefork.c | 86 +- server/mpm/winnt/Win9xConHook.c | 132 +-- server/mpm/winnt/child.c | 170 ++-- server/mpm/winnt/mpm_winnt.c | 306 +++---- server/mpm/winnt/nt_eventlog.c | 40 +- server/mpm/winnt/service.c | 300 +++---- server/mpm/worker/fdqueue.c | 10 +- server/mpm/worker/pod.c | 2 +- server/mpm/worker/worker.c | 252 +++--- server/mpm_common.c | 46 +- server/protocol.c | 74 +- server/provider.c | 8 +- server/request.c | 48 +- server/scoreboard.c | 30 +- server/util.c | 50 +- server/util_cfgtree.c | 2 +- server/util_charset.c | 4 +- server/util_ebcdic.c | 10 +- server/util_filter.c | 48 +- server/util_md5.c | 4 +- server/util_pcre.c | 2 +- server/util_script.c | 38 +- server/vhost.c | 20 +- support/ab.c | 100 +-- support/htcacheclean.c | 12 +- support/htdbm.c | 50 +- support/htdigest.c | 16 +- support/htpasswd.c | 22 +- support/httxt2dbm.c | 16 +- support/logresolve.c | 58 +- support/rotatelogs.c | 4 +- support/suexec.c | 16 +- support/win32/ApacheMonitor.c | 428 +++++----- support/win32/wintty.c | 52 +- test/cls.c | 2 +- test/test_find.c | 4 +- test/test_limits.c | 6 +- test/test_parser.c | 4 +- test/time-sem.c | 4 +- test/zb.c | 116 +-- 181 files changed, 4240 insertions(+), 4240 deletions(-) diff --git a/modules/aaa/mod_auth_basic.c b/modules/aaa/mod_auth_basic.c index ee296a4491..c6192b36ef 100644 --- a/modules/aaa/mod_auth_basic.c +++ b/modules/aaa/mod_auth_basic.c @@ -256,7 +256,7 @@ static int authenticate_basic_user(request_rec *r) current_provider = current_provider->next; } while (current_provider); - + if (auth_result != AUTH_GRANTED) { int return_code; @@ -280,7 +280,7 @@ static int authenticate_basic_user(request_rec *r) break; case AUTH_GENERAL_ERROR: default: - /* We'll assume that the module has already said what its error + /* We'll assume that the module has already said what its error * was in the logs. */ return_code = HTTP_INTERNAL_SERVER_ERROR; diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c index 395fee0711..8a0ee5a130 100644 --- a/modules/aaa/mod_auth_digest.c +++ b/modules/aaa/mod_auth_digest.c @@ -51,7 +51,7 @@ * The only problem is that it allows replay attacks when somebody * captures a packet sent to one server and sends it to another * one. Should we add "AuthDigestNcCheck Strict"? - * - expired nonces give amaya fits. + * - expired nonces give amaya fits. */ #include "apr_sha1.h" @@ -80,8 +80,8 @@ #include "mod_auth.h" -/* Disable shmem until pools/init gets sorted out - * remove following two lines when fixed +/* Disable shmem until pools/init gets sorted out + * remove following two lines when fixed */ #undef APR_HAS_SHARED_MEMORY #define APR_HAS_SHARED_MEMORY 0 @@ -200,7 +200,7 @@ module AP_MODULE_DECLARE_DATA auth_digest_module; static apr_status_t cleanup_tables(void *not_used) { - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "Digest: cleaning up shared memory"); fflush(stderr); @@ -238,7 +238,7 @@ static apr_status_t initialize_secret(server_rec *s) if (status != APR_SUCCESS) { char buf[120]; ap_log_error(APLOG_MARK, APLOG_CRIT, status, s, - "Digest: error generating secret: %s", + "Digest: error generating secret: %s", apr_strerror(status, buf, sizeof(buf))); return status; } @@ -447,13 +447,13 @@ static const char *add_authn_provider(cmd_parms *cmd, void *config, digest_config_rec *conf = (digest_config_rec*)config; authn_provider_list *newp; const char *provider_name; - + if (strcasecmp(arg, "on") == 0) { provider_name = AUTHN_DEFAULT_PROVIDER; } else if (strcasecmp(arg, "off") == 0) { /* Clear all configured providers and return. */ - conf->providers = NULL; + conf->providers = NULL; return NULL; } else { @@ -540,7 +540,7 @@ static const char *set_nonce_lifetime(cmd_parms *cmd, void *config, char *endptr; long lifetime; - lifetime = strtol(t, &endptr, 10); + lifetime = strtol(t, &endptr, 10); if (endptr < (t+strlen(t)) && !apr_isspace(*endptr)) { return apr_pstrcat(cmd->pool, "Invalid time in AuthDigestNonceLifetime: ", @@ -608,7 +608,7 @@ static const char *set_shmem_size(cmd_parms *cmd, void *config, char *endptr; long size, min; - size = strtol(size_str, &endptr, 10); + size = strtol(size_str, &endptr, 10); while (apr_isspace(*endptr)) endptr++; if (*endptr == '\0' || *endptr == 'b' || *endptr == 'B') { ; @@ -645,23 +645,23 @@ static const char *set_shmem_size(cmd_parms *cmd, void *config, static const command_rec digest_cmds[] = { - AP_INIT_TAKE1("AuthName", set_realm, NULL, OR_AUTHCFG, + AP_INIT_TAKE1("AuthName", set_realm, NULL, OR_AUTHCFG, "The authentication realm (e.g. \"Members Only\")"), AP_INIT_ITERATE("AuthDigestProvider", add_authn_provider, NULL, OR_AUTHCFG, "specify the auth providers for a directory or location"), - AP_INIT_ITERATE("AuthDigestQop", set_qop, NULL, OR_AUTHCFG, + AP_INIT_ITERATE("AuthDigestQop", set_qop, NULL, OR_AUTHCFG, "A list of quality-of-protection options"), - AP_INIT_TAKE1("AuthDigestNonceLifetime", set_nonce_lifetime, NULL, OR_AUTHCFG, + AP_INIT_TAKE1("AuthDigestNonceLifetime", set_nonce_lifetime, NULL, OR_AUTHCFG, "Maximum lifetime of the server nonce (seconds)"), - AP_INIT_TAKE1("AuthDigestNonceFormat", set_nonce_format, NULL, OR_AUTHCFG, + AP_INIT_TAKE1("AuthDigestNonceFormat", set_nonce_format, NULL, OR_AUTHCFG, "The format to use when generating the server nonce"), - AP_INIT_FLAG("AuthDigestNcCheck", set_nc_check, NULL, OR_AUTHCFG, + AP_INIT_FLAG("AuthDigestNcCheck", set_nc_check, NULL, OR_AUTHCFG, "Whether or not to check the nonce-count sent by the client"), - AP_INIT_TAKE1("AuthDigestAlgorithm", set_algorithm, NULL, OR_AUTHCFG, + AP_INIT_TAKE1("AuthDigestAlgorithm", set_algorithm, NULL, OR_AUTHCFG, "The algorithm used for the hash calculation"), - AP_INIT_ITERATE("AuthDigestDomain", set_uri_list, NULL, OR_AUTHCFG, + AP_INIT_ITERATE("AuthDigestDomain", set_uri_list, NULL, OR_AUTHCFG, "A list of URI's which belong to the same protection space as the current URI"), - AP_INIT_TAKE1("AuthDigestShmemSize", set_shmem_size, NULL, RSRC_CONF, + AP_INIT_TAKE1("AuthDigestShmemSize", set_shmem_size, NULL, RSRC_CONF, "The amount of shared memory to allocate for keeping track of clients"), {NULL} }; @@ -1300,13 +1300,13 @@ static void note_digest_auth_failure(request_rec *r, * unneccessarily (it's usually > 200 bytes!). */ - + /* don't send domain * - for proxy requests * - if it's no specified */ if (r->proxyreq || !conf->uri_list) { - domain = NULL; + domain = NULL; } else { domain = conf->uri_list; @@ -1464,7 +1464,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp, if (dt > conf->nonce_lifetime) { ap_log_rerror(APLOG_MARK, APLOG_INFO, 0,r, "Digest: user %s: nonce expired (%.2f seconds old " - "- max lifetime %.2f) - sending new nonce", + "- max lifetime %.2f) - sending new nonce", r->user, (double)apr_time_sec(dt), (double)apr_time_sec(conf->nonce_lifetime)); note_digest_auth_failure(r, conf, resp, 1); @@ -1536,7 +1536,7 @@ static const char *new_digest(const request_rec *r, } -static void copy_uri_components(apr_uri_t *dst, +static void copy_uri_components(apr_uri_t *dst, apr_uri_t *src, request_rec *r) { if (src->scheme && src->scheme[0] != '\0') { dst->scheme = src->scheme; @@ -1684,30 +1684,30 @@ static int authenticate_digest_user(request_rec *r) ap_unescape_url(d_uri.query); } else if (r_uri.query) { - /* MSIE compatibility hack. MSIE has some RFC issues - doesn't + /* MSIE compatibility hack. MSIE has some RFC issues - doesn't * include the query string in the uri Authorization component * or when computing the response component. the second part * works out ok, since we can hash the header and get the same * result. however, the uri from the request line won't match - * the uri Authorization component since the header lacks the + * the uri Authorization component since the header lacks the * query string, leaving us incompatable with a (broken) MSIE. - * + * * the workaround is to fake a query string match if in the proper * environment - BrowserMatch MSIE, for example. the cool thing - * is that if MSIE ever fixes itself the simple match ought to + * is that if MSIE ever fixes itself the simple match ought to * work and this code won't be reached anyway, even if the * environment is set. */ - if (apr_table_get(r->subprocess_env, + if (apr_table_get(r->subprocess_env, "AuthDigestEnableQueryStringHack")) { - + ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, "Digest: " "applying AuthDigestEnableQueryStringHack " "to uri <%s>", resp->raw_request_uri); d_uri.query = r_uri.query; - } + } } if (r->method_number == M_CONNECT) { @@ -1800,7 +1800,7 @@ static int authenticate_digest_user(request_rec *r) */ return HTTP_INTERNAL_SERVER_ERROR; } - + if (resp->message_qop == NULL) { /* old (rfc-2069) style digest */ if (strcmp(resp->digest, old_digest(r, resp, conf->ha1))) { diff --git a/modules/aaa/mod_authn_alias.c b/modules/aaa/mod_authn_alias.c index 83d067774f..648ab059b9 100644 --- a/modules/aaa/mod_authn_alias.c +++ b/modules/aaa/mod_authn_alias.c @@ -51,19 +51,19 @@ static authn_status authn_alias_check_password(request_rec *r, const char *user, const char *provider_name = apr_table_get(r->notes, AUTHN_PROVIDER_NAME_NOTE); authn_status ret = AUTH_USER_NOT_FOUND; - authn_alias_srv_conf *authcfg = - (authn_alias_srv_conf *)ap_get_module_config(r->server->module_config, + authn_alias_srv_conf *authcfg = + (authn_alias_srv_conf *)ap_get_module_config(r->server->module_config, &authn_alias_module); if (provider_name) { - provider_alias_rec *prvdraliasrec = apr_hash_get(authcfg->alias_rec, + provider_alias_rec *prvdraliasrec = apr_hash_get(authcfg->alias_rec, provider_name, APR_HASH_KEY_STRING); ap_conf_vector_t *orig_dir_config = r->per_dir_config; - /* If we found the alias provider in the list, then merge the directory + /* If we found the alias provider in the list, then merge the directory configurations and call the real provider */ if (prvdraliasrec) { - r->per_dir_config = ap_merge_per_dir_configs(r->pool, orig_dir_config, + r->per_dir_config = ap_merge_per_dir_configs(r->pool, orig_dir_config, prvdraliasrec->sec_auth); ret = prvdraliasrec->provider->check_password(r,user,password); r->per_dir_config = orig_dir_config; @@ -83,19 +83,19 @@ static authn_status authn_alias_get_realm_hash(request_rec *r, const char *user, const char *provider_name = apr_table_get(r->notes, AUTHN_PROVIDER_NAME_NOTE); authn_status ret = AUTH_USER_NOT_FOUND; - authn_alias_srv_conf *authcfg = - (authn_alias_srv_conf *)ap_get_module_config(r->server->module_config, + authn_alias_srv_conf *authcfg = + (authn_alias_srv_conf *)ap_get_module_config(r->server->module_config, &authn_alias_module); if (provider_name) { - provider_alias_rec *prvdraliasrec = apr_hash_get(authcfg->alias_rec, + provider_alias_rec *prvdraliasrec = apr_hash_get(authcfg->alias_rec, provider_name, APR_HASH_KEY_STRING); ap_conf_vector_t *orig_dir_config = r->per_dir_config; - /* If we found the alias provider in the list, then merge the directory + /* If we found the alias provider in the list, then merge the directory configurations and call the real provider */ if (prvdraliasrec) { - r->per_dir_config = ap_merge_per_dir_configs(r->pool, orig_dir_config, + r->per_dir_config = ap_merge_per_dir_configs(r->pool, orig_dir_config, prvdraliasrec->sec_auth); ret = prvdraliasrec->provider->get_realm_hash(r,user,realm,rethash); r->per_dir_config = orig_dir_config; @@ -131,8 +131,8 @@ static const char *authaliassection(cmd_parms *cmd, void *mconfig, const char *a char *provider_name; const char *errmsg; ap_conf_vector_t *new_auth_config = ap_create_per_dir_config(cmd->pool); - authn_alias_srv_conf *authcfg = - (authn_alias_srv_conf *)ap_get_module_config(cmd->server->module_config, + authn_alias_srv_conf *authcfg = + (authn_alias_srv_conf *)ap_get_module_config(cmd->server->module_config, &authn_alias_module); const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); @@ -170,7 +170,7 @@ static const char *authaliassection(cmd_parms *cmd, void *mconfig, const char *a provider_alias_rec *prvdraliasrec = apr_pcalloc(cmd->pool, sizeof(provider_alias_rec)); const authn_provider *provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, provider_name,"0"); - /* Save off the new directory config along with the original provider name + /* Save off the new directory config along with the original provider name and function pointer data */ prvdraliasrec->sec_auth = new_auth_config; prvdraliasrec->provider_name = provider_name; diff --git a/modules/aaa/mod_authn_anon.c b/modules/aaa/mod_authn_anon.c index b0e48fbbdd..e3c308d651 100644 --- a/modules/aaa/mod_authn_anon.c +++ b/modules/aaa/mod_authn_anon.c @@ -20,7 +20,7 @@ * as the password. * * Just add the following tokes to your setup: - * + * * Anonymous magic-userid [magic-userid]... * * Anonymous_MustGiveEmail [ on | off ] default = on @@ -28,8 +28,8 @@ * Anonymous_VerifyEmail [ on | off ] default = off * Anonymous_NoUserId [ on | off ] default = off * - * The magic user id is something like 'anonymous', it is NOT case sensitive. - * + * The magic user id is something like 'anonymous', it is NOT case sensitive. + * * The MustGiveEmail flag can be used to force users to enter something * in the password field (like an email address). Default is on. * @@ -38,7 +38,7 @@ * in broken GUIs like W95 is often given by the user. The Default is off. * * Dirk.vanGulik@jrc.it; http://ewse.ceo.org; http://me-www.jrc.it/~dirkx - * + * */ #include "apr_strings.h" @@ -113,7 +113,7 @@ static const char *anon_set_string_slots(cmd_parms *cmd, static const command_rec authn_anon_cmds[] = { - AP_INIT_ITERATE("Anonymous", anon_set_string_slots, NULL, OR_AUTHCFG, + AP_INIT_ITERATE("Anonymous", anon_set_string_slots, NULL, OR_AUTHCFG, "a space-separated list of user IDs"), AP_INIT_FLAG("Anonymous_MustGiveEmail", ap_set_flag_slot, (void *)APR_OFFSETOF(authn_anon_config_rec, mustemail), diff --git a/modules/aaa/mod_authn_dbd.c b/modules/aaa/mod_authn_dbd.c index 39e75621ab..15d1ae4bb2 100644 --- a/modules/aaa/mod_authn_dbd.c +++ b/modules/aaa/mod_authn_dbd.c @@ -202,7 +202,7 @@ static void authn_dbd_hooks(apr_pool_t *p) &authn_dbd_password, &authn_dbd_realm }; - + ap_register_provider(p, AUTHN_PROVIDER_GROUP, "dbd", "0", &authn_dbd_provider); } module AP_MODULE_DECLARE_DATA authn_dbd_module = diff --git a/modules/aaa/mod_authn_dbm.c b/modules/aaa/mod_authn_dbm.c index 2f66203212..d9ed980bc1 100644 --- a/modules/aaa/mod_authn_dbm.c +++ b/modules/aaa/mod_authn_dbm.c @@ -16,9 +16,9 @@ /* * http_auth: authentication - * + * * Rob McCool & Brian Behlendorf. - * + * * Adapted to Apache by rst. * */ @@ -54,12 +54,12 @@ static void *create_authn_dbm_dir_config(apr_pool_t *p, char *d) return conf; } -static const char *set_dbm_type(cmd_parms *cmd, - void *dir_config, +static const char *set_dbm_type(cmd_parms *cmd, + void *dir_config, const char *arg) { authn_dbm_config_rec *conf = dir_config; - + conf->dbmtype = apr_pstrdup(cmd->pool, arg); return NULL; } @@ -85,7 +85,7 @@ static apr_status_t fetch_dbm_value(const char *dbmtype, const char *dbmfile, apr_datum_t key, val; apr_status_t rv; - rv = apr_dbm_open_ex(&f, dbmtype, dbmfile, APR_DBM_READONLY, + rv = apr_dbm_open_ex(&f, dbmtype, dbmfile, APR_DBM_READONLY, APR_OS_DEFAULT, pool); if (rv != APR_SUCCESS) { @@ -106,7 +106,7 @@ static apr_status_t fetch_dbm_value(const char *dbmtype, const char *dbmfile, } apr_dbm_close(f); - + return rv; } diff --git a/modules/aaa/mod_authnz_ldap.c b/modules/aaa/mod_authnz_ldap.c index e1ef01bb01..586f80bf43 100644 --- a/modules/aaa/mod_authnz_ldap.c +++ b/modules/aaa/mod_authnz_ldap.c @@ -67,9 +67,9 @@ typedef struct { int compare_dn_on_server; /* If true, will use server to do DN compare */ int have_ldap_url; /* Set if we have found an LDAP url */ - + apr_array_header_t *groupattr; /* List of Group attributes */ - int group_attrib_is_dn; /* If true, the group attribute is the DN, otherwise, + int group_attrib_is_dn; /* If true, the group attribute is the DN, otherwise, it's the exact string passed by the HTTP client */ int secure; /* True if SSL connections are requested */ @@ -106,12 +106,12 @@ static char* derive_codepage_from_lang (apr_pool_t *p, char *language) { int lang_len; char *charset; - + if (!language) /* our default codepage */ return apr_pstrdup(p, "ISO-8859-1"); else lang_len = strlen(language); - + charset = (char*) apr_hash_get(charset_conversions, language, APR_HASH_KEY_STRING); if (!charset) { @@ -163,14 +163,14 @@ static apr_xlate_t* get_conv_set (request_rec *r) * combined with a filter made up of the attribute provided with the URL, * and the actual username passed by the HTTP client. For example, assume * that the LDAP URL is - * + * * ldap://ldap.airius.com/ou=People, o=Airius?uid??(posixid=*) * * Further, assume that the userid passed by the client was `userj'. The * search filter will be (&(posixid=*)(uid=userj)). */ #define FILTER_LENGTH MAX_STRING_LEN -static void authn_ldap_build_filter(char *filtbuf, +static void authn_ldap_build_filter(char *filtbuf, request_rec *r, const char* sent_user, const char* sent_filter, @@ -210,13 +210,13 @@ static void authn_ldap_build_filter(char *filtbuf, } } - /* - * Create the first part of the filter, which consists of the + /* + * Create the first part of the filter, which consists of the * config-supplied portions. */ apr_snprintf(filtbuf, FILTER_LENGTH, "(&(%s)(%s=", filter, sec->attribute); - /* + /* * Now add the client-supplied username to the filter, ensuring that any * LDAP filter metachars are escaped. */ @@ -264,8 +264,8 @@ static void authn_ldap_build_filter(char *filtbuf, #endif *q = '\0'; - /* - * Append the closing parens of the filter, unless doing so would + /* + * Append the closing parens of the filter, unless doing so would * overrun the buffer. */ if (q + 2 <= filtbuf_end) @@ -274,7 +274,7 @@ static void authn_ldap_build_filter(char *filtbuf, static void *create_authnz_ldap_dir_config(apr_pool_t *p, char *d) { - authn_ldap_config_t *sec = + authn_ldap_config_t *sec = (authn_ldap_config_t *)apr_pcalloc(p, sizeof(authn_ldap_config_t)); sec->pool = p; @@ -284,7 +284,7 @@ static void *create_authnz_ldap_dir_config(apr_pool_t *p, char *d) /* sec->authz_enabled = 1; */ - sec->groupattr = apr_array_make(p, GROUPATTR_MAX_ELTS, + sec->groupattr = apr_array_make(p, GROUPATTR_MAX_ELTS, sizeof(struct mod_auth_ldap_groupattr_entry_t)); sec->have_ldap_url = 0; @@ -347,9 +347,9 @@ static authn_status authn_ldap_check_password(request_rec *r, const char *user, if (!sec->enabled) { return AUTH_USER_NOT_FOUND; } -*/ +*/ - /* + /* * Basic sanity checks before any LDAP operations even happen. */ if (!sec->have_ldap_url) { @@ -365,7 +365,7 @@ start_over: sec->secure); } else { - ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authenticate: no sec->host - weird...?", getpid()); return AUTH_GENERAL_ERROR; } @@ -405,7 +405,7 @@ start_over: /* handle bind failure */ if (result != LDAP_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authenticate: " "user %s authentication failed; URI %s [%s][%s]", getpid(), user, r->uri, ldc->reason, ldap_err2string(result)); @@ -442,7 +442,7 @@ start_over: } } - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authenticate: accepting %s", getpid(), user); return AUTH_GRANTED; @@ -491,7 +491,7 @@ static int authz_ldap_check_user_access(request_rec *r) if (!sec->enabled) { return DECLINED; } -*/ +*/ if (!sec->have_ldap_url) { return DECLINED; @@ -506,12 +506,12 @@ static int authz_ldap_check_user_access(request_rec *r) apr_pool_cleanup_null); } else { - ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: no sec->host - weird...?", getpid()); return sec->auth_authoritative? HTTP_UNAUTHORIZED : DECLINED; } - /* + /* * If there are no elements in the group attribute array, the default should be * member and uniquemember; populate the array now. */ @@ -583,49 +583,49 @@ static int authz_ldap_check_user_access(request_rec *r) t = reqs[x].requirement; w = ap_getword_white(r->pool, &t); - + if (strcmp(w, "ldap-user") == 0) { if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " - "require user: user's DN has not been defined; failing authorisation", + "require user: user's DN has not been defined; failing authorisation", getpid()); return sec->auth_authoritative? HTTP_UNAUTHORIZED : DECLINED; } - /* + /* * First do a whole-line compare, in case it's something like * require user Babs Jensen */ result = util_ldap_cache_compare(r, ldc, sec->url, req->dn, sec->attribute, t); switch(result) { case LDAP_COMPARE_TRUE: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require user: authorisation successful", getpid()); return OK; } default: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: require user: " "authorisation failed [%s][%s]", getpid(), ldc->reason, ldap_err2string(result)); } } - /* - * Now break apart the line and compare each word on it + /* + * Now break apart the line and compare each word on it */ while (t[0]) { w = ap_getword_conf(r->pool, &t); result = util_ldap_cache_compare(r, ldc, sec->url, req->dn, sec->attribute, w); switch(result) { case LDAP_COMPARE_TRUE: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require user: authorisation successful", getpid()); return OK; } default: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require user: authorisation failed [%s][%s]", getpid(), ldc->reason, ldap_err2string(result)); @@ -637,7 +637,7 @@ static int authz_ldap_check_user_access(request_rec *r) if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " - "require dn: user's DN has not been defined; failing authorisation", + "require dn: user's DN has not been defined; failing authorisation", getpid()); return sec->auth_authoritative? HTTP_UNAUTHORIZED : DECLINED; } @@ -645,13 +645,13 @@ static int authz_ldap_check_user_access(request_rec *r) result = util_ldap_cache_comparedn(r, ldc, sec->url, req->dn, t, sec->compare_dn_on_server); switch(result) { case LDAP_COMPARE_TRUE: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require dn: authorisation successful", getpid()); return OK; } default: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require dn \"%s\": LDAP error [%s][%s]", getpid(), t, ldc->reason, ldap_err2string(result)); @@ -666,42 +666,42 @@ static int authz_ldap_check_user_access(request_rec *r) if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: require group: " - "user's DN has not been defined; failing authorisation", + "user's DN has not been defined; failing authorisation", getpid()); return sec->auth_authoritative? HTTP_UNAUTHORIZED : DECLINED; } } else { if (req->user == NULL || strlen(req->user) == 0) { - /* We weren't called in the authentication phase, so we didn't have a + /* We weren't called in the authentication phase, so we didn't have a * chance to set the user field. Do so now. */ req->user = r->user; } } - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: require group: " - "testing for group membership in \"%s\"", + "testing for group membership in \"%s\"", getpid(), t); for (i = 0; i < sec->groupattr->nelts; i++) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: require group: " "testing for %s: %s (%s)", getpid(), ent[i].name, sec->group_attrib_is_dn ? req->dn : req->user, t); - result = util_ldap_cache_compare(r, ldc, sec->url, t, ent[i].name, + result = util_ldap_cache_compare(r, ldc, sec->url, t, ent[i].name, sec->group_attrib_is_dn ? req->dn : req->user); switch(result) { case LDAP_COMPARE_TRUE: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: require group: " "authorisation successful (attribute %s) [%s][%s]", getpid(), ent[i].name, ldc->reason, ldap_err2string(result)); return OK; } default: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: require group \"%s\": " "authorisation failed [%s][%s]", getpid(), t, ldc->reason, ldap_err2string(result)); @@ -713,7 +713,7 @@ static int authz_ldap_check_user_access(request_rec *r) if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " - "require ldap-attribute: user's DN has not been defined; failing authorisation", + "require ldap-attribute: user's DN has not been defined; failing authorisation", getpid()); return sec->auth_authoritative? HTTP_UNAUTHORIZED : DECLINED; } @@ -728,17 +728,17 @@ static int authz_ldap_check_user_access(request_rec *r) w, value); switch(result) { case LDAP_COMPARE_TRUE: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require attribute: authorisation " "successful", getpid()); return OK; } default: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require attribute: authorisation " - "failed [%s][%s]", getpid(), + "failed [%s][%s]", getpid(), ldc->reason, ldap_err2string(result)); } } @@ -748,13 +748,13 @@ static int authz_ldap_check_user_access(request_rec *r) if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " - "require ldap-filter: user's DN has not been defined; failing authorisation", + "require ldap-filter: user's DN has not been defined; failing authorisation", getpid()); return sec->auth_authoritative? HTTP_UNAUTHORIZED : DECLINED; } if (t[0]) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, - "[%" APR_PID_T_FMT "] auth_ldap authorise: checking filter %s", + "[%" APR_PID_T_FMT "] auth_ldap authorise: checking filter %s", getpid(), t); /* Build the username filter */ @@ -767,33 +767,33 @@ static int authz_ldap_check_user_access(request_rec *r) /* Make sure that the filtered search returned the correct user dn */ if (result == LDAP_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, - "[%" APR_PID_T_FMT "] auth_ldap authorise: checking dn match %s", + "[%" APR_PID_T_FMT "] auth_ldap authorise: checking dn match %s", getpid(), dn); - result = util_ldap_cache_comparedn(r, ldc, sec->url, req->dn, dn, + result = util_ldap_cache_comparedn(r, ldc, sec->url, req->dn, dn, sec->compare_dn_on_server); } switch(result) { case LDAP_COMPARE_TRUE: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require ldap-filter: authorisation " "successful", getpid()); return OK; } case LDAP_FILTER_ERROR: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require ldap-filter: %s authorisation " - "failed [%s][%s]", getpid(), + "failed [%s][%s]", getpid(), filtbuf, ldc->reason, ldap_err2string(result)); break; } default: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require ldap-filter: authorisation " - "failed [%s][%s]", getpid(), + "failed [%s][%s]", getpid(), ldc->reason, ldap_err2string(result)); } } @@ -802,19 +802,19 @@ static int authz_ldap_check_user_access(request_rec *r) } if (!method_restricted) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, - "[%" APR_PID_T_FMT "] auth_ldap authorise: agreeing because non-restricted", + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + "[%" APR_PID_T_FMT "] auth_ldap authorise: agreeing because non-restricted", getpid()); return OK; } if (!sec->auth_authoritative) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: declining to authorise", getpid()); return DECLINED; } - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: authorisation denied", getpid()); ap_note_basic_auth_failure (r); @@ -822,11 +822,11 @@ static int authz_ldap_check_user_access(request_rec *r) } -/* +/* * Use the ldap url parsing routines to break up the ldap url into * host and port. */ -static const char *mod_auth_ldap_parse_url(cmd_parms *cmd, +static const char *mod_auth_ldap_parse_url(cmd_parms *cmd, void *config, const char *url, const char *mode) @@ -855,9 +855,9 @@ static const char *mod_auth_ldap_parse_url(cmd_parms *cmd, ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server, "[%" APR_PID_T_FMT "] auth_ldap url parse: attrib: %s", getpid(), urld->lud_attrs? urld->lud_attrs[0] : "(null)"); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, - cmd->server, "[%" APR_PID_T_FMT "] auth_ldap url parse: scope: %s", getpid(), - (urld->lud_scope == LDAP_SCOPE_SUBTREE? "subtree" : - urld->lud_scope == LDAP_SCOPE_BASE? "base" : + cmd->server, "[%" APR_PID_T_FMT "] auth_ldap url parse: scope: %s", getpid(), + (urld->lud_scope == LDAP_SCOPE_SUBTREE? "subtree" : + urld->lud_scope == LDAP_SCOPE_BASE? "base" : urld->lud_scope == LDAP_SCOPE_ONELEVEL? "onelevel" : "unknown")); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server, "[%" APR_PID_T_FMT "] auth_ldap url parse: filter: %s", getpid(), urld->lud_filter); @@ -896,7 +896,7 @@ static const char *mod_auth_ldap_parse_url(cmd_parms *cmd, if (urld->lud_filter) { if (urld->lud_filter[0] == '(') { - /* + /* * Get rid of the surrounding parens; later on when generating the * filter, they'll be put back. */ @@ -939,7 +939,7 @@ static const char *mod_auth_ldap_parse_url(cmd_parms *cmd, else { sec->port = urld->lud_port? urld->lud_port : LDAP_PORT; - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server, + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server, "LDAP: auth_ldap not using SSL connections"); } @@ -981,7 +981,7 @@ static const char *mod_auth_ldap_add_group_attribute(cmd_parms *cmd, void *confi new = apr_array_push(sec->groupattr); new->name = apr_pstrdup(cmd->pool, arg); - + return NULL; } @@ -994,7 +994,7 @@ static const char *set_charset_config(cmd_parms *cmd, void *config, const char * static const command_rec authnz_ldap_cmds[] = { - AP_INIT_TAKE12("AuthLDAPURL", mod_auth_ldap_parse_url, NULL, OR_AUTHCFG, + AP_INIT_TAKE12("AuthLDAPURL", mod_auth_ldap_parse_url, NULL, OR_AUTHCFG, "URL to define LDAP connection. This should be an RFC 2255 complaint\n" "URL of the form ldap://host[:port]/basedn[?attrib[?scope[?filter]]].\n" "\nFurthermore, the following related " "documents were found:\n