util  Diff

Differences From Artifact [e965fe4be4]:

To Artifact [de39328fae]:


   323    323   		case term_clear_line:   write(tty,"\r\x1b[2K",5); break;
   324    324   		case term_clear_screen: write(tty,"\r\x1b[3J",5); break;
   325    325   	}
   326    326   }
   327    327   void term_bell(int tty) {
   328    328   	write(tty,"\a",1);
   329    329   }
   330         -#include<stdio.h>
          330  +
   331    331   typedef char password[kpw_db_pw_max + 1];
   332    332   bad pwread(bool obscure, char* dest, size_t* out_len, const char* prompt, const size_t plen) {
   333    333   	if (isatty(0)) {
   334    334   		int tty = 1;
   335    335   		if (!isatty(tty)) tty = open("/dev/tty", O_WRONLY);
   336    336   		if (tty == -1) return bad_insane;
   337    337   
................................................................................
   484    484   		alert(a_debug, "attempting to decrypt private key");
   485    485   		for (size_t i = 0; i < sz(key); ++i) {
   486    486   			priv[i] = priv_enc[i] ^ key[i];
   487    487   		}
   488    488   		hexdump(priv, sz(key));
   489    489   	} else {
   490    490   		/* found a key in memory; loading it into *priv */
   491         -		alert(a_notice, "using saved key");
          491  +		alert(a_debug, "using saved key");
   492    492   		key_priv* saved = shmat(shm, 0, 0);
   493    493   		if (saved == (void*)-1)
   494    494   			return bad_shm;
   495    495   		hexdump((byte*)saved, sizeof(key_priv));
   496    496   		memcpy(priv, saved, sizeof(key_priv));
   497    497   		shmdt(saved);
   498    498   	}
................................................................................
   741    741   		}
   742    742   
   743    743   		case chpw:
   744    744   		case regen:
   745    745   		case delpw:{ /* kpw -d <acct> */
   746    746   			if (param == 0) return emit_usage
   747    747   				  (op==delpw ? " -d <account>\n"          :
   748         -				   op==regen ? " -r[lmusp] <account> [<pw len>]" :
   749         -				/* op==chpw */ " -c <account> [<new pw>]");
          748  +				   op==regen ? " -r[lmusp] <account> [<pw len>]\n" :
          749  +				/* op==chpw */ " -c <account> [<new pw>]\n");
   750    750   
   751    751   			if (param < 1 || param > (op == delpw ? 1 : 2))
   752    752   				return bad_syntax;
   753    753   			const char* target = params[0];
   754    754   			const char* delta;
   755    755   			if (param == 2) delta=params[1];
   756    756   				else delta=NULL;