You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@locus.apache.org on 2000/06/18 15:33:30 UTC
cvs commit: apache-2.0/src/modules/standard mod_auth.c
trawick 00/06/18 06:33:30
Modified: src/include http_config.h
src/main http_config.c
src/modules/standard mod_auth.c
Log:
Use the new command-handler initializer macros in mod_auth;
clean up the resulting warnings.
Revision Changes Path
1.37 +2 -2 apache-2.0/src/include/http_config.h
Index: http_config.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/include/http_config.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- http_config.h 2000/06/18 03:01:30 1.36
+++ http_config.h 2000/06/18 13:33:29 1.37
@@ -374,8 +374,8 @@
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
1.66 +5 -3 apache-2.0/src/main/http_config.c
Index: http_config.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/http_config.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- http_config.c 2000/06/17 21:37:04 1.65
+++ http_config.c 2000/06/18 13:33:29 1.66
@@ -1110,16 +1110,18 @@
}
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 @@
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;
1.20 +13 -11 apache-2.0/src/modules/standard/mod_auth.c
Index: mod_auth.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_auth.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- mod_auth.c 2000/05/27 22:40:34 1.19
+++ mod_auth.c 2000/06/18 13:33:29 1.20
@@ -95,7 +95,8 @@
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 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}
};