]> granicus.if.org Git - apache/commitdiff
Use the new command-handler initializer macros in mod_auth;
authorJeff Trawick <trawick@apache.org>
Sun, 18 Jun 2000 13:33:29 +0000 (13:33 +0000)
committerJeff Trawick <trawick@apache.org>
Sun, 18 Jun 2000 13:33:29 +0000 (13:33 +0000)
clean up the resulting warnings.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85609 13f79535-47bb-0310-9956-ffa450edef68

include/http_config.h
modules/aaa/mod_auth.c
server/config.c

index 441a84500e0be8799510a58534a2e46aa17e487d..ee9fe1d02174f7a2b970d4526890f81c8ce1c76b 100644 (file)
@@ -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
index 4a6de2f02d49f510c3bf0774f819f8e8c097b092..7e645067dc894587055038244eeb3c185b52a2a5 100644 (file)
@@ -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}
 };
 
index d78d85b6f0f9ee10b26278ef8861441ecf1b4178..1d2f58fa839555832eca6804c3729ed3feca158d 100644 (file)
@@ -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;