Patch proposal: include of absolute paths in the dictionary files

Maurice Makaay <[email protected]> Tue, 11 Nov 2003 15:24:38 +0100
Newsgroups gmane.comp.gnu.radius.bugs
Organization InterNLnet BV
Message-ID <[email protected]>
Hi,

We have a lot of radiusservers running on one system. We use a custom
dictionary for InterNLnet to have a couple of internally used attributes
(by using the rewriting capabilities of gnu-radius). I figured it would
be a good idea to store our dict.internlnet in a central place on the
server (/etc/radius/dict.internlnet). So I added the following to the
main dictionary file:

    $INCLUDE /etc/radius/dict.internlnet

This however did not work like expected. The radius server tried to open
<theradiusraddbdirectory>/etc/radius/dict.internlnet. Could the attached
patch be applied to lib/dict.c? This patch will allow absolute paths
to be used in the $INCLUDE statement of dictionary files.

Regards,

-- Maurice Makaay

_______________________________________________
Bug-gnu-radius mailing list
[email protected]
http://mail.gnu.org/mailman/listinfo/bug-gnu-radius
CVS-patch-dictincludeabsolutepath (text/plain, 620 B)
Index: lib/dict.c
===================================================================
RCS file: /cvsroot/radius/radius/lib/dict.c,v
retrieving revision 1.20
diff -u -r1.20 dict.c
--- lib/dict.c	8 Nov 2003 09:48:09 -0000	1.20
+++ lib/dict.c	11 Nov 2003 14:21:47 -0000
@@ -487,7 +487,10 @@
         int   rc;
         int   errcnt = 0;
         
-        path = mkfilename(radius_dir, name);
+        if (name[0] == '/')
+		path = estrdup(name);
+	else
+        	path = mkfilename(radius_dir, name);
         rc = read_raddb_file(path, 1, parse_dict_entry, &errcnt);
         if (errcnt)
                 radlog(L_NOTICE,