Add -D option support to dhcpclient

Add support for -D option to radclient. The option allows overriding the
main dictionary directory location. This fixes the inability to fully
override dictionary locations introduced with
"freeradius-fix-dhcp-dictionary-loading.patch".

Related: Bug#1146939
This commit is contained in:
Nikolai Kondrashov 2014-12-05 16:18:49 +02:00
parent 34d5060c31
commit 9f95b2d211
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,37 @@
From 08700ea8b1f3a1ace01d294548f3ba2391cc06ab Mon Sep 17 00:00:00 2001
From: "Alan T. DeKok" <aland@freeradius.org>
Date: Sun, 2 Nov 2014 14:44:32 -0500
Subject: [PATCH 1/1] Added -D option to mirror radclient
---
src/modules/proto_dhcp/dhcpclient.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/modules/proto_dhcp/dhcpclient.c b/src/modules/proto_dhcp/dhcpclient.c
index ac52ffd..3bce4b3 100644
--- a/src/modules/proto_dhcp/dhcpclient.c
+++ b/src/modules/proto_dhcp/dhcpclient.c
@@ -73,6 +73,7 @@ static void NEVER_RETURNS usage(void)
fprintf(stderr, " <command> One of discover, request, offer, decline, release, inform.\n");
fprintf(stderr, " -d <directory> Set the directory where the dictionaries are stored (defaults to " RADDBDIR ").\n");
+ fprintf(stderr, " -D <dictdir> Set main dictionary directory (defaults to " DICTDIR ").\n");
fprintf(stderr, " -f <file> Read packets from file, not stdin.\n");
fprintf(stderr, " -t <timeout> Wait 'timeout' seconds for a reply (may be a floating point number).\n");
fprintf(stderr, " -v Show program version information.\n");
@@ -270,7 +271,11 @@ int main(int argc, char **argv)
fr_debug_flag = 0;
- while ((c = getopt(argc, argv, "d:f:hr:t:vx")) != EOF) switch(c) {
+ while ((c = getopt(argc, argv, "d:D:f:hr:t:vx")) != EOF) switch(c) {
+ case 'D':
+ dict_dir = optarg;
+ break;
+
case 'd':
radius_dir = optarg;
break;
--
2.1.3

View File

@ -41,6 +41,7 @@ Patch17: freeradius-ignore-SIGTERM-when-firing-stop-and-signal.term.patch
Patch18: freeradius-raddb-update-triggers-in-trigger.conf.patch
Patch19: freeradius-make-grp-tallo-c-too.patch
Patch20: freeradius-fix-checks-for-PW_TYPE_FILE_INPUT.patch
Patch21: freeradius-added-D-option-to-mirror-radclient.patch
%global docdir %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
@ -217,6 +218,7 @@ This plugin provides the unixODBC support for the FreeRADIUS server project.
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%build
# Force compile/link options, extra security for network facing daemon