Tell the libmysqlclient to read the sections [freeradius]
authornbk <nbk>
Fri, 9 Dec 2005 16:10:02 +0000 (16:10 +0000)
committernbk <nbk>
Fri, 9 Dec 2005 16:10:02 +0000 (16:10 +0000)
and [client] from file "my.cnf". This makes possible to
define any options specific to MySQL which are not available
through the "sql.conf".

For example, in the file "my.cnf":

# Options only for FreeRADIUS
[freeradius]
net_read_timeout = 10
net_write_timeout = 20

# Note that the client group is always read.
[client]
socket = /path/to/mysqld.sock

src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c

index 9488b3e..9d350c3 100644 (file)
@@ -76,6 +76,7 @@ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config)
                        sqlsocket->id);
 
        mysql_init(&(mysql_sock->conn));
+       mysql_options(&(mysql_sock->conn), MYSQL_READ_DEFAULT_GROUP, "freeradius");
        if (!(mysql_sock->sock = mysql_real_connect(&(mysql_sock->conn),
                                                    config->sql_server,
                                                    config->sql_login,