#! /bin/sh /usr/share/dpatch/dpatch-run ## 006-options.dpatch by Adrian Bridgett ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Properly set 1-byte int config variables @DPATCH@ diff -urNad mod-auth-mysql~/mod_auth_mysql.c mod-auth-mysql/mod_auth_mysql.c --- mod-auth-mysql~/mod_auth_mysql.c 2008-05-14 19:35:05.000000000 +0200 +++ mod-auth-mysql/mod_auth_mysql.c 2008-05-14 20:05:44.000000000 +0200 @@ -645,6 +645,24 @@ return NULL; } +static const char *set_empty_passwords(cmd_parms *cmd, void *sconf, int arg) +{ + mysql_auth_config_rec *sec = (mysql_auth_config_rec *) sconf; + + sec->allow_empty_passwords = arg; + APACHELOG(APLOG_DEBUG, cmd, "set_empty_passwords: Setting allow_empty_passwords in %s to %i", sec->dir, sec->allow_empty_passwords); + return NULL; +} + +static const char *set_authoritative(cmd_parms *cmd, void *sconf, int arg) +{ + mysql_auth_config_rec *sec = (mysql_auth_config_rec *) sconf; + + sec->authoritative = arg; + APACHELOG(APLOG_DEBUG, cmd, "set_authoritative: Setting authoritative in %s to %i", sec->dir, sec->authoritative); + return NULL; +} + /* The command list. What it's called, when it's legal to use it, and * what to do when we find it. Pretty cool, IMHO. */ @@ -788,20 +806,20 @@ (void*)APR_OFFSETOF(mysql_auth_config_rec, group_user_field), OR_AUTHCFG, "The name of the user-name field in the MySQL group table; defaults to the same as the username field for the password table." ), - AP_INIT_FLAG( "Auth_MySQL_Empty_Passwords", ap_set_flag_slot, - (void*)APR_OFFSETOF(mysql_auth_config_rec, allow_empty_passwords), + AP_INIT_FLAG( "Auth_MySQL_Empty_Passwords", set_empty_passwords, + NULL, OR_AUTHCFG, "Enable (on) or disable (off) empty password strings; in which case any user password is accepted." ), - AP_INIT_FLAG( "AuthMySQL_Empty_Passwords", ap_set_flag_slot, - (void*)APR_OFFSETOF(mysql_auth_config_rec, allow_empty_passwords), + AP_INIT_FLAG( "AuthMySQL_Empty_Passwords", set_empty_passwords, + NULL, OR_AUTHCFG, "Enable (on) or disable (off) empty password strings; in which case any user password is accepted." ), - AP_INIT_FLAG( "Auth_MySQL_Authoritative", ap_set_flag_slot, - (void*)APR_OFFSETOF(mysql_auth_config_rec, authoritative), + AP_INIT_FLAG( "Auth_MySQL_Authoritative", set_authoritative, + NULL, OR_AUTHCFG, "When 'on' the MySQL database is taken to be authoritative and access control is not passed along to other db or access modules." ), - AP_INIT_FLAG( "AuthMySQL_Authoritative", ap_set_flag_slot, - (void*)APR_OFFSETOF(mysql_auth_config_rec, authoritative), + AP_INIT_FLAG( "AuthMySQL_Authoritative", set_authoritative, + NULL, OR_AUTHCFG, "When 'on' the MySQL database is taken to be authoritative and access control is not passed along to other db or access modules." ), AP_INIT_FLAG( "AuthMySQL_AllowOverride", set_auth_mysql_override, @@ -984,20 +1002,20 @@ (void *) XtOffsetOf(mysql_auth_config_rec, group_user_field), OR_AUTHCFG, TAKE1, "The name of the user-name field in the MySQL group table; defaults to the same as the username field for the password table." }, - { "Auth_MySQL_Empty_Passwords", ap_set_flag_slot, - (void *) XtOffsetOf(mysql_auth_config_rec, allow_empty_passwords), + { "Auth_MySQL_Empty_Passwords", set_empty_passwords, + NULL, OR_AUTHCFG, FLAG, "Enable (on) or disable (off) empty password strings; in which case any user password is accepted." }, - { "AuthMySQL_Empty_Passwords", ap_set_flag_slot, - (void *) XtOffsetOf(mysql_auth_config_rec, allow_empty_passwords), + { "AuthMySQL_Empty_Passwords", set_empty_passwords, + NULL, OR_AUTHCFG, FLAG, "Enable (on) or disable (off) empty password strings; in which case any user password is accepted." }, - { "Auth_MySQL_Authoritative", ap_set_flag_slot, - (void *) XtOffsetOf(mysql_auth_config_rec, authoritative), + { "Auth_MySQL_Authoritative", set_authoritative, + NULL, OR_AUTHCFG, FLAG, "When 'on' the MySQL database is taken to be authoritative and access control is not passed along to other db or access modules." }, - { "AuthMySQL_Authoritative", ap_set_flag_slot, - (void *) XtOffsetOf(mysql_auth_config_rec, authoritative), + { "AuthMySQL_Authoritative", set_authoritative, + NULL, OR_AUTHCFG, FLAG, "When 'on' the MySQL database is taken to be authoritative and access control is not passed along to other db or access modules." }, { "AuthMySQL_AllowOverride", set_auth_mysql_override,