]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Tie virtual servers to home servers
authorAlan T. DeKok <aland@freeradius.org>
Wed, 15 Jun 2011 08:31:31 +0000 (10:31 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 15 Jun 2011 08:31:31 +0000 (10:31 +0200)
If a home is defined in a virtual, proxying from that
virtual will use globally defined homes, OR homes specific
to that virtual

src/main/realms.c

index b539a6636cf94b2b8bd2b1880b4ca348fc462744..c82131dbd8e8f92c53bb706a353656da49dec678 100644 (file)
@@ -2121,6 +2121,30 @@ home_server *home_server_ldb(const char *realmname,
                }
 #endif
 
+               /*
+                *      Default virtual: ignore homes tied to a
+                *      virtual.
+                */
+               if (!request->server && home->parent_server) {
+                       continue;
+               }
+
+               /*
+                *      A virtual AND home is tied to virtual,
+                *      ignore ones which don't match.
+                */
+               if (request->server && home->parent_server &&
+                   strcmp(request->server, home->parent_server) != 0) {
+                       continue;
+               }
+
+               /*
+                *      Allow request->server && !home->parent_server
+                *
+                *      i.e. virtuals can proxy to globally defined
+                *      homes.
+                */
+
                /*
                 *      It's zombie, so we remember the first zombie
                 *      we find, but we don't mark it as a "live"