]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add "listen" state for proto ldap sync
authorAlan T. DeKok <aland@freeradius.org>
Thu, 22 Aug 2024 16:24:17 +0000 (12:24 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 22 Aug 2024 16:24:17 +0000 (12:24 -0400)
src/lib/server/cf_file.c
src/lib/server/cf_priv.h

index 818d13daaee79407025b044dd92722050551624a..9cc8c71d083df8ee03f527daf6992d50b1897988 100644 (file)
@@ -2402,6 +2402,11 @@ check_for_eol:
                                css->allow_locals = true;
                                break;
                        }
+
+                       if (strcmp(css->name1, "listen") == 0) {
+                               css->unlang = CF_UNLANG_LISTEN;
+                               break;
+                       }
                        break;
 
                        /*
@@ -2462,6 +2467,14 @@ check_for_eol:
                        css->unlang = CF_UNLANG_DICTIONARY;
                        css->allow_locals = true;
                        break;
+
+               case CF_UNLANG_LISTEN:
+                       if (strcmp(css->name1, "update") == 0) {
+                               css->unlang = CF_UNLANG_ASSIGNMENT;
+                       } else {
+                               css->unlang = CF_UNLANG_LISTEN;
+                       }
+                       break;
                }
 
        add_section:
index ae8bffd2d5e57d7dfa59a1b83e845cefd3249c1b..0abf2888ebc389be34cbcc20e62fa8239e9607d0 100644 (file)
@@ -92,6 +92,7 @@ typedef enum {
        CF_UNLANG_EDIT,                         //!< only edit commands
        CF_UNLANG_ASSIGNMENT,                   //!< only assignments inside of map / update
        CF_UNLANG_DICTIONARY,                   //!< only local variable definitions
+       CF_UNLANG_LISTEN,                       //!< ldap sync has "update" in a "listen" section.
 } cf_unlang_t;
 
 /** A section grouping multiple #CONF_PAIR