]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Make Exfile-Name trigger attribute work again
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 17 Sep 2018 08:02:34 +0000 (16:02 +0800)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 18 Sep 2018 02:31:21 +0000 (10:31 +0800)
This has been an issue for a while.  Present in v3.1.x at least...

src/lib/server/exfile.c

index 80352d76539df7930375eafd4672ee9332dd9fdd..253cebf45e645bfb981ffdb888cc0769e7f39d18 100644 (file)
@@ -97,8 +97,6 @@ static inline void exfile_trigger_exec(exfile_t *ef, REQUEST *request, exfile_en
 
 static void exfile_cleanup_entry(exfile_t *ef, REQUEST *request, exfile_entry_t *entry)
 {
-       TALLOC_FREE(entry->filename);
-
        if (entry->fd >= 0) close(entry->fd);
 
        entry->hash = 0;
@@ -108,6 +106,11 @@ static void exfile_cleanup_entry(exfile_t *ef, REQUEST *request, exfile_entry_t
         *      Issue close trigger *after* we've closed the fd
         */
        exfile_trigger_exec(ef, request, entry, "close");
+
+       /*
+        *      Trigger still needs access to filename to populate Exfile-Name
+        */
+       TALLOC_FREE(entry->filename);
 }