From: Alan T. DeKok Date: Mon, 14 Mar 2011 13:01:28 +0000 (+0100) Subject: Check pre-condictions X-Git-Tag: release_2_1_11~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50e6401b8447a6d44a748c2e3100ba5366f86484;p=thirdparty%2Ffreeradius-server.git Check pre-condictions "inject file" requires "inject to" and "inject from" --- diff --git a/src/main/command.c b/src/main/command.c index 77e5d3f832d..b644ec883f5 100644 --- a/src/main/command.c +++ b/src/main/command.c @@ -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. */