From: Jeff Trawick Date: Sun, 18 Jun 2000 13:33:29 +0000 (+0000) Subject: Use the new command-handler initializer macros in mod_auth; X-Git-Tag: APACHE_2_0_ALPHA_5~306 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c58c39beeb8119987200945c96a1d15eed9aedd7;p=apache Use the new command-handler initializer macros in mod_auth; clean up the resulting warnings. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85609 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/http_config.h b/include/http_config.h index 441a84500e..ee9fe1d021 100644 --- a/include/http_config.h +++ b/include/http_config.h @@ -374,8 +374,8 @@ API_EXPORT_NONSTD(const char *) ap_set_string_slot(cmd_parms *, void *, const char *); API_EXPORT_NONSTD(const char *) ap_set_string_slot_lower(cmd_parms *, void *, const char *); -API_EXPORT_NONSTD(const char *) ap_set_flag_slot(cmd_parms *, char *, int); -API_EXPORT_NONSTD(const char *) ap_set_file_slot(cmd_parms *, char *, char *); +API_EXPORT_NONSTD(const char *) ap_set_flag_slot(cmd_parms *, void *, int); +API_EXPORT_NONSTD(const char *) ap_set_file_slot(cmd_parms *, char *, const char *); /* For modules which need to read config files, open logs, etc. ... * this returns the fname argument if it begins with '/'; otherwise diff --git a/modules/aaa/mod_auth.c b/modules/aaa/mod_auth.c index 4a6de2f02d..7e645067dc 100644 --- a/modules/aaa/mod_auth.c +++ b/modules/aaa/mod_auth.c @@ -95,7 +95,8 @@ static void *create_auth_dir_config(ap_pool_t *p, char *d) return sec; } -static const char *set_auth_slot(cmd_parms *cmd, void *offset, char *f, char *t) +static const char *set_auth_slot(cmd_parms *cmd, void *offset, const char *f, + const char *t) { if (t && strcmp(t, "standard")) return ap_pstrcat(cmd->pool, "Invalid auth file type: ", t, NULL); @@ -105,16 +106,17 @@ static const char *set_auth_slot(cmd_parms *cmd, void *offset, char *f, char *t) static const command_rec auth_cmds[] = { - {"AuthUserFile", set_auth_slot, - (void *) XtOffsetOf(auth_config_rec, auth_pwfile), OR_AUTHCFG, TAKE12, - "text file containing user IDs and passwords"}, - {"AuthGroupFile", set_auth_slot, - (void *) XtOffsetOf(auth_config_rec, auth_grpfile), OR_AUTHCFG, TAKE12, - "text file containing group names and member user IDs"}, - {"AuthAuthoritative", ap_set_flag_slot, - (void *) XtOffsetOf(auth_config_rec, auth_authoritative), - OR_AUTHCFG, FLAG, - "Set to 'no' to allow access control to be passed along to lower modules if the UserID is not known to this module"}, + AP_INIT_TAKE12("AuthUserFile", set_auth_slot, + (void *) XtOffsetOf(auth_config_rec, auth_pwfile), OR_AUTHCFG, + "text file containing user IDs and passwords"), + AP_INIT_TAKE12("AuthGroupFile", set_auth_slot, + (void *) XtOffsetOf(auth_config_rec, auth_grpfile), OR_AUTHCFG, + "text file containing group names and member user IDs"), + AP_INIT_FLAG("AuthAuthoritative", ap_set_flag_slot, + (void *) XtOffsetOf(auth_config_rec, auth_authoritative), + OR_AUTHCFG, + "Set to 'no' to allow access control to be passed along to lower " + "modules if the UserID is not known to this module"), {NULL} }; diff --git a/server/config.c b/server/config.c index d78d85b6f0..1d2f58fa83 100644 --- a/server/config.c +++ b/server/config.c @@ -1110,16 +1110,18 @@ API_EXPORT_NONSTD(const char *) ap_set_string_slot_lower(cmd_parms *cmd, } API_EXPORT_NONSTD(const char *) ap_set_flag_slot(cmd_parms *cmd, - char *struct_ptr, int arg) + void *struct_ptr_v, int arg) { /* This one's pretty generic too... */ int offset = (int) (long) cmd->info; + char *struct_ptr = (char *)struct_ptr_v; *(int *) (struct_ptr + offset) = arg ? 1 : 0; return NULL; } -API_EXPORT_NONSTD(const char *) ap_set_file_slot(cmd_parms *cmd, char *struct_ptr, char *arg) +API_EXPORT_NONSTD(const char *) ap_set_file_slot(cmd_parms *cmd, char *struct_ptr, + const char *arg) { /* Prepend server_root to relative arg. This allows .htaccess to be independent of server_root, @@ -1127,7 +1129,7 @@ API_EXPORT_NONSTD(const char *) ap_set_file_slot(cmd_parms *cmd, char *struct_pt char *p; int offset = (int) (long) cmd->info; if (ap_os_is_path_absolute(arg)) - p = arg; + p = ap_pstrdup(cmd->pool, arg); else p = ap_make_full_path(cmd->pool, ap_server_root, arg); *(char **) (struct_ptr + offset) = p;