]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rlm_sql_freetds: established flag never set to true — server messages corrupt error...
authorAlexander Bainbridge-Sedivy <alex.bainbridge@inkbridge.io>
Wed, 13 May 2026 14:53:18 +0000 (10:53 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 27 May 2026 20:22:52 +0000 (16:22 -0400)
src/modules/rlm_sql/drivers/rlm_sql_freetds/rlm_sql_freetds.c

index 8e06bffd697f2f80784ea8efd6daa480bf887be0..2f43cfb7cdb49f87115a674e0e1bc57464cf1d36 100644 (file)
@@ -47,7 +47,7 @@ typedef struct {
        char            **results;      //!< Result strings from statement execution.
        CS_SMALLINT     *ind;           //!< Indicators of data length / NULL.
        char            *error;         //!< The last error string created by one of the call backs.
-       bool            established;    //!< Set to false once the connection has been properly established.
+       bool            established;    //!< Set to true once the connection has been properly established.
        CS_INT          rows_affected;  //!< Rows affected by last INSERT / UPDATE / DELETE.
 } rlm_sql_freetds_conn_t;
 
@@ -802,6 +802,7 @@ static connection_state_t _sql_connection_init(void **h, connection_t *conn, voi
        snprintf(database, sizeof(database), "USE %s;", config->sql_db);
        if (sql_query(NULL, c, database) != RLM_SQL_OK) goto error;
 
+       c->established = true;
        *h = c;
        return CONNECTION_STATE_CONNECTED;
 }