[master] b2c1870 Use "none" to disable authentication

Federico G. Schwindt fgsch at lodoss.net
Tue Jul 19 10:37:08 CEST 2016


commit b2c18706f2d4b1005f2765ae632997ef01195fc2
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Tue Jul 19 09:09:43 2016 +0100

    Use "none" to disable authentication
    
    Previously you needed an empty argument (''), which didn't play very
    well along sysv init scripts and was not documented.
    This should address both problems.
    
    Fixes #2007.

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 6874f70..2611e15 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -720,9 +720,9 @@ main(int argc, char * const *argv)
 	if (b_arg != NULL && f_arg != NULL)
 		ARGV_ERR("Only one of -b or -f can be specified\n");
 
-	if (S_arg != NULL && *S_arg == '\0') {
+	if (S_arg != NULL && !strcmp(S_arg, "none")) {
 		fprintf(stderr,
-		    "Warning: Empty -S argument, no CLI authentication.\n");
+		    "Warning: CLI authentication disabled.\n");
 	} else if (S_arg != NULL) {
 		VJ_master(JAIL_MASTER_FILE);
 		o = open(S_arg, O_RDONLY, 0);
@@ -822,7 +822,7 @@ main(int argc, char * const *argv)
 	if (d_flag)
 		mgt_cli_setup(0, 1, 1, "debug", cli_stdin_close, NULL);
 
-	if (*S_arg != '\0')
+	if (strcmp(S_arg, "none"))
 		mgt_cli_secret(S_arg);
 
 	if (M_arg != NULL)
diff --git a/doc/sphinx/reference/varnishd.rst b/doc/sphinx/reference/varnishd.rst
index 3999e20..3e19dd4 100644
--- a/doc/sphinx/reference/varnishd.rst
+++ b/doc/sphinx/reference/varnishd.rst
@@ -123,11 +123,11 @@ OPTIONS
   *vmod_path* read only as these can potentially be used to escalate
   privileges from the CLI.
 
--S file
+-S secret-file
 
   Path to a file containing a secret used for authorizing access to
   the management port. If not provided a new secret will be drawn
-  from the system PRNG.
+  from the system PRNG.  To disable authentication use ``none``.
 
 -s <[name=]type[,options]>
 



More information about the varnish-commit mailing list