From: Chris Hofstaedtler Date: Tue, 3 Apr 2018 09:26:45 +0000 (+0200) Subject: dnsdist: avoid hiding -k/--setkey from "plaintext" builds X-Git-Tag: dnsdist-1.3.1~181^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6435%2Fhead;p=thirdparty%2Fpdns.git dnsdist: avoid hiding -k/--setkey from "plaintext" builds --- diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index d16ecbf5ea..be1049dd80 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -2071,9 +2071,7 @@ try {"gid", required_argument, 0, 'g'}, {"help", no_argument, 0, 'h'}, {"local", required_argument, 0, 'l'}, -#ifdef HAVE_LIBSODIUM {"setkey", required_argument, 0, 'k'}, -#endif {"supervised", no_argument, 0, 3}, {"uid", required_argument, 0, 'u'}, {"verbose", no_argument, 0, 'v'}, @@ -2083,11 +2081,7 @@ try int longindex=0; string optstring; for(;;) { -#ifdef HAVE_LIBSODIUM int c=getopt_long(argc, argv, "a:cC:e:g:hk:l:u:vV", longopts, &longindex); -#else - int c=getopt_long(argc, argv, "a:cC:e:g:hl:u:vV", longopts, &longindex); -#endif if(c==-1) break; switch(c) { @@ -2122,14 +2116,17 @@ try optstring=optarg; g_ACL.modify([optstring](NetmaskGroup& nmg) { nmg.addMask(optstring); }); break; -#ifdef HAVE_LIBSODIUM case 'k': +#ifdef HAVE_LIBSODIUM if (B64Decode(string(optarg), g_consoleKey) < 0) { cerr<<"Unable to decode key '"<