shithub: riscv

Download patch

ref: 07faf720c9077201e88016fe5a308e48e4e5913c
parent: fd80dde429cf35fffa8662c7933a7df36240ab79
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Apr 22 16:08:50 EDT 2015

secstore: don't print errors for dial() and readnvram() when not in verbose mode

when no secstore server has been configured or no nvram is
setup, exit silently with error status.

--- a/sys/src/cmd/auth/secstore/secstore.c
+++ b/sys/src/cmd/auth/secstore/secstore.c
@@ -390,7 +390,8 @@
 	c = emalloc(sizeof(*c));
 	if(pass_nvram){
 		if(readnvram(&nvr, 0) < 0){
-			fprint(2, "secstore: readnvram: %r\n");
+			if(verbose)
+				fprint(2, "secstore: readnvram: %r\n");
 			exits("readnvram failed");
 		}
 		strecpy(c->pass, c->pass+sizeof c->pass, nvr.config);
@@ -417,7 +418,8 @@
 			if((fd = dial(netmkaddr(*dest, "tcp", "5356"), nil, nil, nil)) >= 0)
 				break;
 			if(dest[1] == nil){
-				fprint(2, "secstore: can't dial %s: %r\n", *dest);
+				if(verbose)
+					fprint(2, "secstore: can't dial %s: %r\n", *dest);
 				exits("dial failed");
 			}
 		}