]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Check pre-condictions
authorAlan T. DeKok <aland@freeradius.org>
Mon, 14 Mar 2011 13:01:28 +0000 (14:01 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 14 Mar 2011 13:02:38 +0000 (14:02 +0100)
"inject file" requires "inject to" and "inject from"

src/main/command.c

index 77e5d3f832d27ffb8ad72325b71265d804276117..b644ec883f5c90552aef43b51a0f0a1d0092b265 100644 (file)
@@ -1139,6 +1139,16 @@ static int command_inject_file(rad_listen_t *listener, int argc, char *argv[])
                return 0;
        }
 
+       if (!sock->inject_listener) {
+               cprintf(listener, "ERROR: You must specify \"inject to\" before using \"inject file\"\n");
+               return 0;
+       }
+
+       if (!sock->inject_client) {
+               cprintf(listener, "ERROR: You must specify \"inject from\" before using \"inject file\"\n");
+               return 0;
+       }
+
        /*
         *      Output files always go to the logging directory.
         */