]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Re-introduce read_profiles config option
authorNick Porter <nick@portercomputing.co.uk>
Wed, 10 Apr 2024 14:24:42 +0000 (15:24 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Tue, 23 Apr 2024 09:47:05 +0000 (10:47 +0100)
raddb/mods-available/sql
src/modules/rlm_sql/rlm_sql.c
src/modules/rlm_sql/rlm_sql.h

index 33db5b742a39a1ebd83c9b7c446e13f17f8c1cc2..e8b158ccdaa5cc5d14d9f04a36225b593d0ce51a 100644 (file)
@@ -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.
        #
index 917f11be68b3e9adc4a21f838d99ddcd3093acf9..8144d56256c74c0b7cf4100bf01df7eaa91f28c7 100644 (file)
@@ -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) },
 
index a9a1561deca13cf4221f2964f06351c51d5a0fe1..dc5b7aacc85b3cb2bee3d015411763efe7ad3bf8 100644 (file)
@@ -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.