From: Nick Porter Date: Wed, 10 Apr 2024 14:24:42 +0000 (+0100) Subject: Re-introduce read_profiles config option X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9242d6174f86f2eaa4281313e891efcc81976df;p=thirdparty%2Ffreeradius-server.git Re-introduce read_profiles config option --- diff --git a/raddb/mods-available/sql b/raddb/mods-available/sql index 33db5b742a3..e8b158ccdaa 100644 --- a/raddb/mods-available/sql +++ b/raddb/mods-available/sql @@ -167,6 +167,20 @@ sql { # # read_groups = yes + # + # read_profiles:: Read the user profile attributes from the database. + # + # Following `check` and `reply` item handling and, depending on the `read_groups` option + # and `Fall-Through` value, groups processing, the SQL module will treat values of the + # `User-Profile` attributes in the control list as additional groups that the user belongs + # to and repeat the group `check` and `reply` processing. + # + # If set to `yes`, we process the user profiles unless `Fall-Through = no` in the reply list. + # If set to `no`, we do not process the user profiles unless `Fall-Through = yes` in the reply list. + # + # Default is `yes`. +# read_profile = yes + # # logfile:: Write SQL queries to a logfile. # diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index 917f11be68b..8144d56256c 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -92,6 +92,7 @@ static const conf_parser_t module_config[] = { { FR_CONF_OFFSET("read_groups", rlm_sql_config_t, read_groups), .dflt = "yes" }, { FR_CONF_OFFSET("group_attribute", rlm_sql_config_t, group_attribute) }, { FR_CONF_OFFSET("cache_groups", rlm_sql_config_t, cache_groups) }, + { FR_CONF_OFFSET("read_profiles", rlm_sql_config_t, read_profiles), .dflt = "yes" }, { FR_CONF_OFFSET_FLAGS("logfile", CONF_FLAG_XLAT, rlm_sql_config_t, logfile) }, { FR_CONF_OFFSET("open_query", rlm_sql_config_t, connect_query) }, diff --git a/src/modules/rlm_sql/rlm_sql.h b/src/modules/rlm_sql/rlm_sql.h index a9a1561deca..dc5b7aacc85 100644 --- a/src/modules/rlm_sql/rlm_sql.h +++ b/src/modules/rlm_sql/rlm_sql.h @@ -106,6 +106,10 @@ typedef struct { //!< If false, Fall-Through = yes is required //!< in the previous reply list to process //!< groups. + bool read_profiles; //!< Read user profiles by default. + //!< If false, Fall-Through = yes is required + //!< in the previous reply list to process + //!< profiles. char const *logfile; //!< Keep a log of all SQL queries executed //!< Useful for batch insertion with the //!< NULL drivers.