Browse Source

Plan 9 from Bell Labs 2012-07-31

David du Colombier 11 years ago
parent
commit
b6a55cfc90

+ 1 - 0
sys/games/lib/fortunes

@@ -4294,3 +4294,4 @@ Does that say 25 or 29? - rae;  It says PH1. - jmk
 "The advantage of being an Ethernet device is so strong that even the plip interface (the interface that uses the printer ports) declares itself as [one]" - some linux book
 Error: Dependency is not satisfiable: libpython2.7 (>= 2.7)
 That's a lot of ioctls.  Why not just create a new system call, or many system calls, instead?
+In my nightmares I am buffeted by this kind of jargon-ridden empty bullshit; demons sneak into my room and whisper ``efficiency explosions of dynamic risk that cause creative destruction and facilitate innovation.'' - Freddie deBoer on David Brooks

+ 1 - 0
sys/src/cmd/file.c

@@ -802,6 +802,7 @@ struct	FILE_STRING
 	"\033E\033",	"HP PCL printer data",		3,	OCTET,
 	"\033&",	"HP PCL printer data",		2,	OCTET,
 	"\033%-12345X",	"HPJCL file",		9,	"application/hpjcl",
+	"\033Lua",		"Lua bytecode",		4,	OCTET,
 	"ID3",			"mp3 audio with id3",	3,	"audio/mpeg",
 	"\211PNG",		"PNG image",		4,	"image/png",
 	"P3\n",			"ppm",				3,	"image/ppm",

+ 2 - 0
sys/src/cmd/ip/imap4d/imap4d.c

@@ -604,6 +604,8 @@ copyUCmd(char *tg, char *cmd, int uids)
 		Bprint(&bout, "%s NO %s%s bad mailbox\r\n", tg, uid, cmd);
 		return;
 	}
+	if(cistrcmp(mbox, "inbox") == 0)
+		mbox = "mbox";
 	if(!cdExists(mboxDir, mbox)){
 		check();
 		Bprint(&bout, "%s NO [TRYCREATE] %s mailbox does not exist\r\n", tg, cmd);

+ 6 - 1
sys/src/cmd/ssh2/dh.c

@@ -684,7 +684,9 @@ static int
 dh_client12(Conn *c, Packet *p)
 {
 	int n, retval;
+#ifdef VERIFYKEYS
 	char *newkey;
+#endif
 	char buf[10];
 	uchar *q;
 	uchar h[SHA1dlen];
@@ -692,7 +694,6 @@ dh_client12(Conn *c, Packet *p)
 	Packet *ks, *sig, *pack2;
 	RSApub *srvkey;
 
-	retval = -1;
 	ks = new_packet(c);
 	sig = new_packet(c);
 	pack2 = new_packet(c);
@@ -748,6 +749,8 @@ dh_client12(Conn *c, Packet *p)
 		n = Errnone;
 	else
 		n = verifyhostkey(c, srvkey, sig);
+	retval = -1;
+	USED(retval);
 	switch (n) {
 #ifdef VERIFYKEYS
 	case Errnokey:
@@ -771,7 +774,9 @@ dh_client12(Conn *c, Packet *p)
 	nbsendul(keymbox.mchan, 1);
 	if (retval == 0)
 		genkeys(c, h, k);
+#ifdef VERIFYKEYS
 out:
+#endif
 	mpfree(k);
 	free(ks);
 	free(sig);

File diff suppressed because it is too large
+ 438 - 431
sys/src/cmd/ssh2/dup.out


File diff suppressed because it is too large
+ 231 - 227
sys/src/cmd/ssh2/dup.pro


+ 4 - 4
sys/src/cmd/ssh2/dup.sum

@@ -2,12 +2,12 @@
 Summary:
 Reporting parameterized matches of at least 3 lines.
 15 files
-7227 lines in original code,
-6266 lines after pruning white space and comments.
+7233 lines in original code,
+6272 lines after pruning white space and comments.
 
-2245 lines were involved in 615 matches
+2247 lines were involved in 615 matches
 These constitute 36 percent of the ncsl.
-Approximately 1411 lines are redundant,or 23 percent of the ncsl.
+Approximately 1416 lines are redundant,or 23 percent of the ncsl.
 
 match length: number of matches of that length
 	   3: 262

+ 6 - 6
sys/src/cmd/ssh2/dup.xpr

@@ -18,9 +18,9 @@ percent of file involved, #lines in file involved; file2,filename2
       28, 11; 3,cipherrc4.c:
       28, 11; 3,cipherrc4.c:
 
-18, 150, 60; 5,5
-      29, 240; 5,dh.c:
-      29, 240; 5,dh.c:
+19, 152, 60; 5,5
+      30, 244; 5,dh.c:
+      30, 244; 5,dh.c:
 
 7, 28, 9; 6,6
       13, 56; 6,dial.c:
@@ -30,9 +30,9 @@ percent of file involved, #lines in file involved; file2,filename2
       8, 34; 7,dial.thread.c:
       8, 34; 7,dial.thread.c:
 
-22, 643, 316; 9,9
-      34, 998; 9,netssh.c:
-      34, 998; 9,netssh.c:
+22, 646, 316; 9,9
+      34, 996; 9,netssh.c:
+      34, 996; 9,netssh.c:
 
 5, 10, 3; 10,10
       10, 20; 10,pubkey.c:

+ 14 - 14
sys/src/cmd/ssh2/long.funcs

@@ -4,27 +4,27 @@
 143	netssh.c:739,882	readreqrem()
 134	netssh.c:2087,2221	negotiating()
 125	netssh.c:610,735	stread()
-111	netssh.c:2453,2564	reader0()
+112	netssh.c:2453,2565	reader0()
 104	netssh.c:1266,1370	writereqremproc()
+101	dh.c:685,786	dh_client12()
 98	sshsession.c:187,285	main()
 98	dh.c:462,560	dh_server()
 98	netssh.c:1908,2006	dohandshake()
 97	ssh.c:476,573	main()
-96	dh.c:685,781	dh_client12()
-95	netssh.c:2595,2690	validatekexs()
-94	dh.c:821,915	genkeys()
-93	netssh.c:3126,3219	shutdown()
+95	netssh.c:2596,2691	validatekexs()
+94	dh.c:826,920	genkeys()
+93	netssh.c:3127,3220	shutdown()
 88	netssh.c:1418,1506	stclunk()
 85	dial.c:338,423	csdial()
 84	dial.thread.c:343,427	csdial()
 82	netssh.c:1547,1629	alloc_conn()
 81	netssh.c:405,486	stlisconn()
-79	netssh.c:2694,2773	validatekexc()
+79	netssh.c:2695,2774	validatekexc()
 76	dial.c:427,503	call()
-75	netssh.c:3008,3083	client_auth()
+75	netssh.c:3009,3084	client_auth()
 74	netssh.c:997,1071	userauth()
 71	netssh.c:490,561	stlischan()
-70	netssh.c:2934,3004	auth_req()
+70	netssh.c:2935,3005	auth_req()
 70	dial.thread.c:432,502	call()
 65	dh.c:315,380	rsa_verify()
 65	sshsession.c:338,403	newchannel()
@@ -32,12 +32,12 @@
 65	netssh.c:326,391	stopen()
 64	netssh.c:2010,2074	send_kexinit()
 62	pubkey.c:142,204	replacekey()
-58	netssh.c:2872,2930	authreqpk()
+58	netssh.c:2873,2931	authreqpk()
 53	sshsession.c:449,502	runcmd()
 51	ssh.c:344,395	bidircopy()
 50	dh.c:256,306	rsa_sign()
-50	dh.c:631,681	verifyhostkey()
 50	netssh.c:168,218	threadmain()
+50	dh.c:631,681	verifyhostkey()
 48	ssh.c:288,336	keyproc()
 48	pubkey.c:17,65	parsepubkey()
 47	netssh.c:886,933	readdata()
@@ -53,15 +53,15 @@
 35	dial.c:77,112	dialimpl()
 35	ssh.c:248,283	keyprompt()
 34	netssh.c:1374,1408	writedataproc()
-34	netssh.c:3088,3122	factlookup()
+34	netssh.c:3089,3123	factlookup()
 33	netssh.c:278,311	server()
 32	transport.c:182,214	undo_packet()
-32	netssh.c:2827,2859	keyfsauth()
+32	netssh.c:2828,2860	keyfsauth()
 31	netssh.c:1781,1812	exchids()
 30	dial.thread.c:288,318	dialmulti()
 30	dial.c:304,334	dialmulti()
 30	ssh.c:587,617	doauth()
-30	netssh.c:2790,2820	mkcap()
+30	netssh.c:2791,2821	mkcap()
 30	ssh.c:86,116	parseargs()
 29	dial.thread.c:199,228	callproc()
 28	dial.c:532,560	_dial_string_parse()
@@ -72,9 +72,9 @@
 27	cipherblowfish.c:16,43	initblowfish()
 27	netssh.c:1876,1903	dohandshake()
 26	sshsession.c:157,183	listenloop()
-26	sshsession.c:127,153	authnewns()
 26	pubkey.c:112,138	findkey()
 26	ssh.c:446,472	remotecmd()
+26	sshsession.c:127,153	authnewns()
 25	dial.c:169,194	notedeath()
 25	sshsession.c:420,445	confine()
 25	ssh.c:175,200	starttunnel()

+ 27 - 27
sys/src/cmd/ssh2/magic.out

@@ -55,21 +55,21 @@ dh.c:575: c->x = mprand(128, genrandom, nil);
 dh.c:597: keymbox.msg = smprint("b%04ld%s", strlen(newkey), newkey);
 dh.c:606: keymbox.msg = smprint("%c%04ld%s", n == NoKeyFile || n == NoKey?
 dh.c:616: keymbox.msg = smprint("f%04ld%s", strlen(newkey), newkey);
-dh.c:688: char buf[10];
-dh.c:703: q += nhgetl(q) + 4;
-dh.c:706: k = mpnew(1024);
-dh.c:709: /* Compute H: RFC 4253 */
-dh.c:740: q += nhgetl(q) + 4;
-dh.c:757: keymbox.msg = smprint("f%04ld%s", strlen(newkey), newkey);
-dh.c:761: keymbox.msg = smprint("f%04ld%s", strlen(newkey), newkey);
-dh.c:791: e = mpnew(2048);
-dh.c:792: x = mprand(256, genrandom, nil);
-dh.c:823: char buf[82], *bp, *be;			/* magic 82 */
-dh.c:827: /* Compute 40 bytes (320 bits) of keys: each alg can use what it needs */
-dh.c:895: for (n = 0, bp = buf; n < SHA1dlen*2; ++n)
+dh.c:690: char buf[10];
+dh.c:704: q += nhgetl(q) + 4;
+dh.c:707: k = mpnew(1024);
+dh.c:710: /* Compute H: RFC 4253 */
+dh.c:741: q += nhgetl(q) + 4;
+dh.c:760: keymbox.msg = smprint("f%04ld%s", strlen(newkey), newkey);
+dh.c:764: keymbox.msg = smprint("f%04ld%s", strlen(newkey), newkey);
+dh.c:796: e = mpnew(2048);
+dh.c:797: x = mprand(256, genrandom, nil);
+dh.c:828: char buf[82], *bp, *be;			/* magic 82 */
+dh.c:832: /* Compute 40 bytes (320 bits) of keys: each alg can use what it needs */
 dh.c:900: for (n = 0, bp = buf; n < SHA1dlen*2; ++n)
 dh.c:905: for (n = 0, bp = buf; n < SHA1dlen*2; ++n)
 dh.c:910: for (n = 0, bp = buf; n < SHA1dlen*2; ++n)
+dh.c:915: for (n = 0, bp = buf; n < SHA1dlen*2; ++n)
 dial.c:14: Maxstring	= 128,
 dial.c:15: Maxpath		= 256,
 dial.c:17: Maxcsreply	= 64*80,	/* this is probably overly generous */
@@ -204,21 +204,21 @@ netssh.c:2494: /* SHA1dlen was magic 20 */
 netssh.c:2495: if (np != p->rlength + 4 - nb || c->inmac != -1 && nm != SHA1dlen) {
 netssh.c:2500: p->rlength = n - 4;
 netssh.c:2531: get_string(p, p->payload + 5, buf, Arbbufsz, nil);
-netssh.c:2542: case -2:
-netssh.c:2602: q = p->payload + 17;
-netssh.c:2701: q = p->payload + 17;
-netssh.c:2801: cap = emalloc9p(fromtosz + sizeof(rand)*3 + 1);
-netssh.c:2802: snprint(cap, fromtosz + sizeof(rand)*3 + 1, "%s@%s", from, to);
-netssh.c:2805: enc64(key, sizeof(rand)*3, rand, sizeof(rand));
-netssh.c:2848: werrstr("Password mismatch 2");
-netssh.c:2874: char method[32];
-netssh.c:2937: char key1[DESKEYLEN], key2[DESKEYLEN], method[32];
-netssh.c:3041: ek = strtomp(r+4, nil, 16, nil);
-netssh.c:3042: nk = strtomp(s+3, nil, 16, nil);
-netssh.c:3133: if (c->clonefile->ref <= 2 && c->ctlfile->ref <= 2 &&
-netssh.c:3134: c->datafile->ref <= 2 && c->listenfile->ref <= 2 &&
-netssh.c:3135: c->localfile->ref <= 2 && c->remotefile->ref <= 2 &&
-netssh.c:3136: c->statusfile->ref <= 2)
+netssh.c:2543: case -2:		/* can't happen, now at least */
+netssh.c:2603: q = p->payload + 17;
+netssh.c:2702: q = p->payload + 17;
+netssh.c:2802: cap = emalloc9p(fromtosz + sizeof(rand)*3 + 1);
+netssh.c:2803: snprint(cap, fromtosz + sizeof(rand)*3 + 1, "%s@%s", from, to);
+netssh.c:2806: enc64(key, sizeof(rand)*3, rand, sizeof(rand));
+netssh.c:2849: werrstr("Password mismatch 2");
+netssh.c:2875: char method[32];
+netssh.c:2938: char key1[DESKEYLEN], key2[DESKEYLEN], method[32];
+netssh.c:3042: ek = strtomp(r+4, nil, 16, nil);
+netssh.c:3043: nk = strtomp(s+3, nil, 16, nil);
+netssh.c:3134: if (c->clonefile->ref <= 2 && c->ctlfile->ref <= 2 &&
+netssh.c:3135: c->datafile->ref <= 2 && c->listenfile->ref <= 2 &&
+netssh.c:3136: c->localfile->ref <= 2 && c->remotefile->ref <= 2 &&
+netssh.c:3137: c->statusfile->ref <= 2)
 pubkey.c:12: Arbsz =	256,
 pubkey.c:22: n = strtoul(s, &p, 10);
 pubkey.c:33: n = strtoul(s, &p, 10);

+ 5 - 4
sys/src/cmd/ssh2/netssh.c

@@ -2534,12 +2534,13 @@ reader0(Conn *c, Packet *p, Packet *p2)
 			bail(c, p, p2, "msg disconnect");
 		case SSH_MSG_USERAUTH_REQUEST:
 			switch (auth_req(p, c)) {
-			case 0:
+			case 0:			/* success */
 				establish(c);
 				break;
-			case -1:
+			case 1:			/* ok to try again */
+			case -1:		/* failure */
 				break;
-			case -2:
+			case -2:		/* can't happen, now at least */
 				bail(c, p, p2, "in userauth request");
 			}
 			break;
@@ -2892,7 +2893,7 @@ authreqpk(Packet *p, Packet *p2, Conn *c, char *user, uchar *q,
 		add_byte(p2, SSH_MSG_USERAUTH_PK_OK);
 		add_string(p2, alg);
 		add_block(p2, blob, nblob);
-		return 0;
+		return 1;
 	}
 
 	get_string(p, q, sig, Blobsz, &nsig);

+ 2 - 2
sys/src/libmach/5db.c

@@ -298,7 +298,7 @@ plocal(Instr *i)
  * Print value v as name[+offset]
  */
 static int
-gsymoff(char *buf, int n, long v, int space)
+gsymoff(char *buf, int n, ulong v, int space)
 {
 	Symbol s;
 	int r;
@@ -1011,7 +1011,7 @@ format(char *mnemonic, Instr *i, char *f)
 
 		case 'b':
 			i->curr += symoff(i->curr, i->end-i->curr,
-				i->imm, CTEXT);
+				(ulong)i->imm, CTEXT);
 			break;
 
 		case 'g':

Some files were not shown because too many files changed in this diff