Mod_Auth_MySQL will not compile under Slackware 13

I tried to add the auth_mod_auth (3.0.0) module to my Slackware 13 (apache 2.2 & MySQL 5.0) system.

I ran the usual command line for apxs (as mention in the BUILD file)

apxs -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c

but I got the following error:

/usr/lib/apr-1.3.12/build-1/libtool --silent --mode=compile i486-slackware-linux-gcc -prefer-pic -O2 -march=i486 -mtune=i686  -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd  -I/usr/include/apr-1   -I/usr/include/apr-1  -I/usr/include/mysql  -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo
mod_auth_mysql.c:591: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:591: error: initializer element is not constant
mod_auth_mysql.c:591: error: (near initialization for 'mysql_auth_cmds[0].cmd_data')
mod_auth_mysql.c:595: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:595: error: initializer element is not constant
mod_auth_mysql.c:595: error: (near initialization for 'mysql_auth_cmds[1].cmd_data')
mod_auth_mysql.c:599: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:599: error: initializer element is not constant
mod_auth_mysql.c:599: error: (near initialization for 'mysql_auth_cmds[2].cmd_data')
mod_auth_mysql.c:603: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:603: error: initializer element is not constant
mod_auth_mysql.c:603: error: (near initialization for 'mysql_auth_cmds[3].cmd_data')
mod_auth_mysql.c:607: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:607: error: initializer element is not constant
mod_auth_mysql.c:607: error: (near initialization for 'mysql_auth_cmds[4].cmd_data')
mod_auth_mysql.c:611: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:611: error: initializer element is not constant
mod_auth_mysql.c:611: error: (near initialization for 'mysql_auth_cmds[5].cmd_data')
mod_auth_mysql.c:615: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:615: error: initializer element is not constant
mod_auth_mysql.c:615: error: (near initialization for 'mysql_auth_cmds[6].cmd_data')
mod_auth_mysql.c:619: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:619: error: initializer element is not constant
mod_auth_mysql.c:619: error: (near initialization for 'mysql_auth_cmds[7].cmd_data')
mod_auth_mysql.c:623: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:623: error: initializer element is not constant
mod_auth_mysql.c:623: error: (near initialization for 'mysql_auth_cmds[8].cmd_data')
mod_auth_mysql.c:627: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:627: error: initializer element is not constant
mod_auth_mysql.c:627: error: (near initialization for 'mysql_auth_cmds[9].cmd_data')
mod_auth_mysql.c:631: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:631: error: initializer element is not constant
mod_auth_mysql.c:631: error: (near initialization for 'mysql_auth_cmds[10].cmd_data')
mod_auth_mysql.c:635: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:635: error: initializer element is not constant
mod_auth_mysql.c:635: error: (near initialization for 'mysql_auth_cmds[11].cmd_data')
mod_auth_mysql.c:639: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:639: error: initializer element is not constant
mod_auth_mysql.c:639: error: (near initialization for 'mysql_auth_cmds[12].cmd_data')
mod_auth_mysql.c:643: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:643: error: initializer element is not constant
mod_auth_mysql.c:643: error: (near initialization for 'mysql_auth_cmds[13].cmd_data')
mod_auth_mysql.c:651: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:651: error: initializer element is not constant
mod_auth_mysql.c:651: error: (near initialization for 'mysql_auth_cmds[14].cmd_data')
mod_auth_mysql.c:655: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:655: error: initializer element is not constant
mod_auth_mysql.c:655: error: (near initialization for 'mysql_auth_cmds[15].cmd_data')
mod_auth_mysql.c:659: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:659: error: initializer element is not constant
mod_auth_mysql.c:659: error: (near initialization for 'mysql_auth_cmds[16].cmd_data')
mod_auth_mysql.c:663: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:663: error: initializer element is not constant
mod_auth_mysql.c:663: error: (near initialization for 'mysql_auth_cmds[17].cmd_data')
mod_auth_mysql.c:667: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:667: error: initializer element is not constant
mod_auth_mysql.c:667: error: (near initialization for 'mysql_auth_cmds[18].cmd_data')
mod_auth_mysql.c:671: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:671: error: initializer element is not constant
mod_auth_mysql.c:671: error: (near initialization for 'mysql_auth_cmds[19].cmd_data')
mod_auth_mysql.c: In function 'format_request':
mod_auth_mysql.c:947: warning: pointer/integer type mismatch in conditional expression
apxs:Error: Command failed with rc=65536

Seems like the mysql library do not match what the code expect. I looked around and it seems to be the last available version of the module although is getting old (june 2005).

Has anyone made it work with a similar setup? I've been tweaking around for half a day without any success :-(

This question and answers originated from unix.stackexchange.com
Question by (2/20/2011 10:36:35 PM)

Answer

I found an answer here: http://bugs.gentoo.org/show_bug.cgi?format=multiple&id=192391

And it works! :-)

It changes APR_XtOffsetOf to APR_OFFSETOF in the .c file.

Patch which solves the problem:

--- mod_auth_mysql.c.orig       2007-09-13 09:36:14.000000000 +0200
+++ mod_auth_mysql.c    2007-09-13 09:41:49.000000000 +0200
@@ -589,87 +589,87 @@
 static
 command_rec mysql_auth_cmds[] = {
        AP_INIT_TAKE1("AuthMySQLHost", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlhost),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlhost),
        OR_AUTHCFG, "mysql server host name"),

        AP_INIT_TAKE1("AuthMySQLPort", ap_set_int_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlport),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlport),
        OR_AUTHCFG, "mysql server port number"),

        AP_INIT_TAKE1("AuthMySQLSocket", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlsocket),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlsocket),
        OR_AUTHCFG, "mysql server socket path"),

        AP_INIT_TAKE1("AuthMySQLUser", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqluser),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqluser),
        OR_AUTHCFG, "mysql server user name"),

        AP_INIT_TAKE1("AuthMySQLPassword", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlpasswd),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlpasswd),
        OR_AUTHCFG, "mysql server user password"),

        AP_INIT_TAKE1("AuthMySQLDB", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlDB),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlDB),
        OR_AUTHCFG, "mysql database name"),

        AP_INIT_TAKE1("AuthMySQLUserTable", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlpwtable),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlpwtable),
        OR_AUTHCFG, "mysql user table name"),

        AP_INIT_TAKE1("AuthMySQLGroupTable", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlgrptable),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlgrptable),
        OR_AUTHCFG, "mysql group table name"),

        AP_INIT_TAKE1("AuthMySQLNameField", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlNameField),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlNameField),
        OR_AUTHCFG, "mysql User ID field name within User table"),

        AP_INIT_TAKE1("AuthMySQLGroupField", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlGroupField),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlGroupField),
        OR_AUTHCFG, "mysql Group field name within table"),

        AP_INIT_TAKE1("AuthMySQLGroupUserNameField", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec,
mysqlGroupUserNameField),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlGroupUserNameField),
        OR_AUTHCFG, "mysql User ID field name within Group table"),

        AP_INIT_TAKE1("AuthMySQLPasswordField", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlPasswordField),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlPasswordField),
        OR_AUTHCFG, "mysql Password field name within table"),

        AP_INIT_TAKE1("AuthMySQLPwEncryption", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlEncryptionField),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlEncryptionField),
        OR_AUTHCFG, "mysql password encryption method"),

        AP_INIT_TAKE1("AuthMySQLSaltField", ap_set_string_slot,
-       (void*) APR_XtOffsetOf(mysql_auth_config_rec, mysqlSaltField),
+       (void*) APR_OFFSETOF(mysql_auth_config_rec, mysqlSaltField),
        OR_AUTHCFG, "mysql salfe field name within table"),

 /*     AP_INIT_FLAG("AuthMySQLKeepAlive", ap_set_flag_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlKeepAlive),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlKeepAlive),
        OR_AUTHCFG, "mysql connection kept open across requests if On"),
 */
        AP_INIT_FLAG("AuthMySQLAuthoritative", ap_set_flag_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlAuthoritative),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlAuthoritative),
        OR_AUTHCFG, "mysql lookup is authoritative if On"),

        AP_INIT_FLAG("AuthMySQLNoPasswd", ap_set_flag_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlNoPasswd),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlNoPasswd),
        OR_AUTHCFG, "If On, only check if user exists; ignore password"),

        AP_INIT_FLAG("AuthMySQLEnable", ap_set_flag_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlEnable),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlEnable),
        OR_AUTHCFG, "enable mysql authorization"),

        AP_INIT_TAKE1("AuthMySQLUserCondition", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlUserCondition),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlUserCondition),
        OR_AUTHCFG, "condition to add to user where-clause"),

        AP_INIT_TAKE1("AuthMySQLGroupCondition", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlGroupCondition),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlGroupCondition),
        OR_AUTHCFG, "condition to add to group where-clause"),

        AP_INIT_TAKE1("AuthMySQLCharacterSet", ap_set_string_slot,
-       (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlCharacterSet),
+       (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlCharacterSet),
        OR_AUTHCFG, "mysql character set to be used"),

   { NULL }
Answer by

Find More Answers
Related Topics  mysql  apache  module  compiling  slackware
Related Questions
  • Removing default mysql on Slackware 13

    I was playing around the default mysql that comes with Slackware 13, and I think I broke it somehow. I don't want to fix it, I'd like to start from scratch, building from source and everything, but …
  • Touchpad scrolling is not happening in Slackware 13?

    Although other functions are working properly..little bemused...only the scrolling not happening..
  • trackpad on laptop in Slackware 13.37 not very sensitive

    I was using Slackware 13.1 and working on my laptop with its trackpad and it was all Ok. When I installed 13.37 my trackpad became somewhat insensible. I have to push it harder than usual to make it…
  • Troubles installing php with MySQL support

    So I wasn't sure if this question would go best here or on Overflow or Server Fault, but decided to try here first. I'm installing LAMP on a VPS, and am running into issues configuring and building …
  • mod_auth_mysql dont validate

    I compiled httpd-2.2.19 and mod_auth_mysql-3.0.0 manually, apache and mod_auth_mysql works fine, but when I try to make a mysql validation using Htaccess does not validate, always tells me that the …
  • mod_auth_mysql dont validate

    I compiled httpd-2.2.19 and mod_auth_mysql-3.0.0 manually, apache and mod_auth_mysql works fine, but when I try to make a mysql validation using Htaccess does not validate, always tells me that the …
  • Upgrading Slackware 12.2 to 13.0, any gotchas?

    I'm gradually upgrading a Slackware 12.0 to a 13.0. Using slapt-get I've done it gradually, just in case. So I've done 12.0 -> 12.1, 12.1 -> 12.2. I've sorted out that I need to manually upgrade…
  • mpstat on slackware 13.0 shows no utilization

    As the title says, the mpstat command, executed on Slack 13.0 continuously shows almost no processor utilization of any sort. In fact none of the output ever seems to change at all. The system is du…
  • Installing Redmine with apache in localhost slackware 13.1

    I just installed Redmine in slackware 13.1 I followed the instructions and test of the installation works fine using webrick: ruby script/server webrick -e production However, I now want to u…
  • Fail to install perf on slackware 13.1

    I was trying to install perf on slackware 13.1 When I first ran make at /usr/src/linux/tools/perf I got some errors. And I found this patch http://www.valimar.it/repo/linux/perf_fix-2.6.33.patch A…