Browse Source

Plan 9 from Bell Labs 2012-04-25

David du Colombier 12 years ago
parent
commit
246e700db9

+ 7 - 4
rc/bin/fshalt

@@ -80,10 +80,12 @@ for(i in $f) @ {
 }
 
 # flush the last bit of possible fossil traffic
-echo -n venti...
-venti/sync -h localhost >[2]/dev/null &
-venti/sync  >[2]/dev/null &
-sleep 5
+if (ls /srv | grep -s fossil) {
+	echo -n venti...
+	venti/sync -h localhost >[2]/dev/null &
+	venti/sync  >[2]/dev/null &
+	sleep 5
+}
 
 for (i in $k){
 	echo -n $i... 
@@ -108,6 +110,7 @@ bind /tmp /bin
 # put this in a shell function so this rc script doesn't get read
 # when it's no longer accessible
 fn x {
+	rfork s
 	echo
 	echo -n halting...
 	for(i in $f) @ {

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


File diff suppressed because it is too large
+ 816 - 806
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
-7206 lines in original code,
-6242 lines after pruning white space and comments.
+7215 lines in original code,
+6253 lines after pruning white space and comments.
 
-2244 lines were involved in 621 matches
+2252 lines were involved in 621 matches
 These constitute 36 percent of the ncsl.
-Approximately 1408 lines are redundant,or 23 percent of the ncsl.
+Approximately 1415 lines are redundant,or 23 percent of the ncsl.
 
 match length: number of matches of that length
 	   3: 269

+ 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:
 
-19, 150, 60; 5,5
-      30, 240; 5,dh.c:
-      30, 240; 5,dh.c:
+18, 150, 60; 5,5
+      29, 240; 5,dh.c:
+      29, 240; 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, 639, 316; 9,9
-      34, 992; 9,netssh.c:
-      34, 992; 9,netssh.c:
+22, 646, 316; 9,9
+      35, 1000; 9,netssh.c:
+      35, 1000; 9,netssh.c:
 
 5, 10, 3; 10,10
       10, 20; 10,pubkey.c:

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

@@ -1,19 +1,19 @@
 193	netssh.c:2242,2435	established()
 187	netssh.c:1074,1261	writectlproc()
-153	dh.c:51,204	dh_init()
+153	dh.c:60,213	dh_init()
 143	netssh.c:738,881	readreqrem()
 134	netssh.c:2087,2221	negotiating()
 125	netssh.c:609,734	stread()
 111	netssh.c:2453,2564	reader0()
 104	netssh.c:1265,1369	writereqremproc()
 98	sshsession.c:182,280	main()
-98	dh.c:453,551	dh_server()
+98	dh.c:462,560	dh_server()
 98	netssh.c:1908,2006	dohandshake()
+96	dh.c:685,781	dh_client12()
 96	ssh.c:477,573	main()
 95	netssh.c:2595,2690	validatekexs()
-94	dh.c:808,902	genkeys()
+94	dh.c:821,915	genkeys()
 93	netssh.c:3126,3219	shutdown()
-92	dh.c:676,768	dh_client12()
 88	netssh.c:1417,1505	stclunk()
 85	dial.c:337,422	csdial()
 84	dial.thread.c:337,421	csdial()
@@ -26,7 +26,7 @@
 71	netssh.c:489,560	stlischan()
 70	netssh.c:2934,3004	auth_req()
 70	dial.thread.c:426,496	call()
-65	dh.c:306,371	rsa_verify()
+65	dh.c:315,380	rsa_verify()
 65	sshsession.c:333,398	newchannel()
 65	netssh.c:1633,1698	alloc_chan()
 65	netssh.c:325,390	stopen()
@@ -35,8 +35,8 @@
 58	netssh.c:2872,2930	authreqpk()
 53	sshsession.c:444,497	runcmd()
 51	ssh.c:345,396	bidircopy()
-50	dh.c:247,297	rsa_sign()
-50	dh.c:622,672	verifyhostkey()
+50	dh.c:256,306	rsa_sign()
+50	dh.c:631,681	verifyhostkey()
 49	ssh.c:288,337	keyproc()
 49	netssh.c:168,217	threadmain()
 48	pubkey.c:17,65	parsepubkey()
@@ -46,22 +46,22 @@
 41	netssh.c:564,605	getdata()
 41	transport.c:133,174	finish_packet()
 40	ssh.c:204,244	cmdmode()
-38	dh.c:580,618	findkeyinuserring()
-38	dh.c:391,429	dss_sign()
+38	dh.c:589,627	findkeyinuserring()
+38	dh.c:400,438	dss_sign()
+35	dial.thread.c:93,128	dialimpl()
 35	ssh.c:248,283	keyprompt()
 35	dial.c:77,112	dialimpl()
-35	dial.thread.c:93,128	dialimpl()
 34	netssh.c:3088,3122	factlookup()
 34	netssh.c:1373,1407	writedataproc()
-34	ssh.c:587,621	doauth()
 33	netssh.c:277,310	server()
+32	transport.c:182,214	undo_packet()
 32	netssh.c:2827,2859	keyfsauth()
 32	dial.thread.c:243,275	recvresults()
-32	transport.c:182,214	undo_packet()
 31	netssh.c:1781,1812	exchids()
 30	dial.thread.c:284,314	dialmulti()
-30	netssh.c:2790,2820	mkcap()
 30	dial.c:303,333	dialmulti()
+30	netssh.c:2790,2820	mkcap()
+30	ssh.c:587,617	doauth()
 30	ssh.c:84,114	parseargs()
 29	dial.thread.c:199,228	callproc()
 28	dial.c:531,559	_dial_string_parse()

+ 54 - 55
sys/src/cmd/ssh2/magic.out

@@ -16,61 +16,60 @@ cipherblowfish.c:62: 8,
 cipherrc4.c:21: setupRC4state(&cs->state, c->s2cek, 16);
 cipherrc4.c:23: setupRC4state(&cs->state, c->c2sek, 16);
 cipherrc4.c:41: 8,
-dh.c:21: "29024E088A67CC74020BBEA63B139B22514A08798E3404DD"
-dh.c:28: * 2048-bit MODP group (id 14) from RFC 3526
-dh.c:32: "29024E088A67CC74020BBEA63B139B22514A08798E3404DD"
-dh.c:37: "83655D23DCA3AD961C62F356208552BB9ED529077096966D"
-dh.c:38: "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B"
-dh.c:41: "15728E5A8AACAA68FFFFFFFFFFFFFFFF";
-dh.c:60: two = strtomp("2", nil, 10, nil);
-dh.c:61: p1 = strtomp(group1p, nil, 16, nil);
-dh.c:62: p14 = strtomp(group14p, nil, 16, nil);
-dh.c:103: myrsakey.pub.n = strtomp(p+3, nil, 16, nil);
-dh.c:114: myrsakey.pub.ek = strtomp(p+4, nil, 16, nil);
-dh.c:127: myrsakey.dk = strtomp(p+5, nil, 16, nil);
-dh.c:170: mydsskey.pub.p = strtomp(p+3, nil, 16, nil);
-dh.c:177: mydsskey.pub.q = strtomp(p+3, nil, 16, nil);
-dh.c:184: mydsskey.pub.alpha = strtomp(p+7, nil, 16, nil);
-dh.c:191: mydsskey.pub.key = strtomp(p+5, nil, 16, nil);
-dh.c:202: mydsskey.secret = strtomp(p+9, nil, 16, nil);
-dh.c:233: n = nb - (nelem(sha1der) + SHA1dlen) - 3;
-dh.c:257: n = (nbit + 7) / 8;
-dh.c:260: /* Compute s: RFC 3447 */
-dh.c:276: auth_rpc(ar, "start", "role=sign proto=rsa", 19) != ARok ||
-dh.c:319: n = (nbit + 7) / 8;
-dh.c:321: /* Compute s: RFC 3447 */
-dh.c:324: s = mpnew(1024);
-dh.c:341: buf = emalloc9p(Blobsz / 2);
-dh.c:343: p = (char *)get_string(nil, (uchar *)sig, buf, Blobsz / 2, nil);
-dh.c:397: uchar sstr[2*SHA1dlen];
-dh.c:415: auth_rpc(ar, "start", "role=sign proto=dsa", 19) != ARok ||
-dh.c:427: add_block(sig, sstr, 2*SHA1dlen);
-dh.c:442: return dh_server(c, pack1, p1, 1024);
-dh.c:448: return dh_server(c, pack1, p14, 2048);
-dh.c:465: y = mprand(nbit / 8, genrandom, nil);
-dh.c:482: /* Compute H: RFC 4253 */
-dh.c:561: c->e = mpnew(1024);
-dh.c:566: c->x = mprand(128, genrandom, nil);
-dh.c:588: keymbox.msg = smprint("b%04ld%s", strlen(newkey), newkey);
-dh.c:597: keymbox.msg = smprint("%c%04ld%s", n == NoKeyFile || n == NoKey?
-dh.c:607: keymbox.msg = smprint("f%04ld%s", strlen(newkey), newkey);
-dh.c:633: return -2;
-dh.c:679: char buf[10];
-dh.c:694: q += nhgetl(q) + 4;
-dh.c:697: k = mpnew(1024);
-dh.c:700: /* Compute H: RFC 4253 */
-dh.c:731: q += nhgetl(q) + 4;
-dh.c:743: case -2:
-dh.c:747: keymbox.msg = smprint("f%04ld%s", strlen(newkey), newkey);
-dh.c:751: keymbox.msg = smprint("f%04ld%s", strlen(newkey), newkey);
-dh.c:778: e = mpnew(2048);
-dh.c:779: x = mprand(256, genrandom, nil);
-dh.c:810: char buf[82], *bp, *be;			/* magic 82 */
-dh.c:814: /* Compute 40 bytes (320 bits) of keys: each alg can use what it needs */
-dh.c:882: for (n = 0, bp = buf; n < SHA1dlen*2; ++n)
-dh.c:887: for (n = 0, bp = buf; n < SHA1dlen*2; ++n)
-dh.c:892: for (n = 0, bp = buf; n < SHA1dlen*2; ++n)
-dh.c:897: for (n = 0, bp = buf; n < SHA1dlen*2; ++n)
+dh.c:16: Errnokey = -2,	/* no key on keyring */
+dh.c:30: "29024E088A67CC74020BBEA63B139B22514A08798E3404DD"
+dh.c:37: * 2048-bit MODP group (id 14) from RFC 3526
+dh.c:41: "29024E088A67CC74020BBEA63B139B22514A08798E3404DD"
+dh.c:46: "83655D23DCA3AD961C62F356208552BB9ED529077096966D"
+dh.c:47: "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B"
+dh.c:50: "15728E5A8AACAA68FFFFFFFFFFFFFFFF";
+dh.c:69: two = strtomp("2", nil, 10, nil);
+dh.c:70: p1 = strtomp(group1p, nil, 16, nil);
+dh.c:71: p14 = strtomp(group14p, nil, 16, nil);
+dh.c:112: myrsakey.pub.n = strtomp(p+3, nil, 16, nil);
+dh.c:123: myrsakey.pub.ek = strtomp(p+4, nil, 16, nil);
+dh.c:136: myrsakey.dk = strtomp(p+5, nil, 16, nil);
+dh.c:179: mydsskey.pub.p = strtomp(p+3, nil, 16, nil);
+dh.c:186: mydsskey.pub.q = strtomp(p+3, nil, 16, nil);
+dh.c:193: mydsskey.pub.alpha = strtomp(p+7, nil, 16, nil);
+dh.c:200: mydsskey.pub.key = strtomp(p+5, nil, 16, nil);
+dh.c:211: mydsskey.secret = strtomp(p+9, nil, 16, nil);
+dh.c:242: n = nb - (nelem(sha1der) + SHA1dlen) - 3;
+dh.c:266: n = (nbit + 7) / 8;
+dh.c:269: /* Compute s: RFC 3447 */
+dh.c:285: auth_rpc(ar, "start", "role=sign proto=rsa", 19) != ARok ||
+dh.c:328: n = (nbit + 7) / 8;
+dh.c:330: /* Compute s: RFC 3447 */
+dh.c:333: s = mpnew(1024);
+dh.c:350: buf = emalloc9p(Blobsz / 2);
+dh.c:352: p = (char *)get_string(nil, (uchar *)sig, buf, Blobsz / 2, nil);
+dh.c:406: uchar sstr[2*SHA1dlen];
+dh.c:424: auth_rpc(ar, "start", "role=sign proto=dsa", 19) != ARok ||
+dh.c:436: add_block(sig, sstr, 2*SHA1dlen);
+dh.c:451: return dh_server(c, pack1, p1, 1024);
+dh.c:457: return dh_server(c, pack1, p14, 2048);
+dh.c:474: y = mprand(nbit / 8, genrandom, nil);
+dh.c:491: /* Compute H: RFC 4253 */
+dh.c:570: c->e = mpnew(1024);
+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: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)
 dial.c:14: Maxstring	= 128,
 dial.c:15: Maxpath		= 256,
 dial.c:17: Maxcsreply	= 64*80,	/* this is probably overly generous */

+ 1 - 5
sys/src/cmd/ssh2/ssh.c

@@ -599,11 +599,6 @@ doauth(int cfd1, char *whichkey)
 	}
 	if (nopw)
 		return -1;
-	/*
-	up = auth_getuserpasswd(iflag? auth_getkey: nil,
-		"proto=pass service=ssh server=%q user=%q !password?",
-		remote, user);
-	 */
 	up = auth_getuserpasswd(iflag? auth_getkey: nil,
 		"proto=pass service=ssh server=%q user=%q", remote, user);
 	if (up == nil) {
@@ -613,6 +608,7 @@ doauth(int cfd1, char *whichkey)
 	n = fprint(cfd1, "ssh-userauth k %s %s", user, up->passwd);
 	if (n >= 0)
 		return 0;
+
 	path[0] = '\0';
 	fd2path(cfd1, path, sizeof path);
 	fprint(2, "%s: auth ctl msg `ssh-userauth k %s <password>' for %s: %r\n",

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