shithub: riscv

Download patch

ref: 2a6fd6ec25c66e87dd0127651549a2f8585c751f
parent: ad6bb37e33d647411e1ee6cbd067433710f98267
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Aug 4 07:47:12 EDT 2016

auth/login: add dp9ik key to sub factotum, get rid of temporary /srv file

--- a/sys/src/cmd/auth/login.c
+++ b/sys/src/cmd/auth/login.c
@@ -80,7 +80,6 @@
 			break;
 		}
 	ndbfree(t);
-fprint(2, "authdom=%s\n", authdom);
 	return authdom;
 }
 
@@ -103,11 +102,8 @@
 		sysfatal("starting factotum: %r");
 		break;
 	}
+	waitpid();
 
-	/* wait for agent to really be there */
-	while(access(srvname, 0) < 0)
-		sleep(250);
-
 	/* mount it */
 	mountfactotum(srvname);
 
@@ -115,7 +111,8 @@
 	fd = open("/mnt/factotum/ctl", ORDWR);
 	if(fd < 0)
 		sysfatal("opening factotum: %r");
-	fprint(fd, "key proto=p9sk1 dom=%s user=%q !password=%q", getauthdom(), user, password);
+	fprint(fd, "key proto=dp9ik dom=%s user=%q !password=%q\n", getauthdom(), user, password);
+	fprint(fd, "key proto=p9sk1 dom=%s user=%q !password=%q\n", getauthdom(), user, password);
 	close(fd);
 }
 
@@ -182,6 +179,9 @@
 	/* remount the factotum */
 	mountfactotum(srvname);
 
+	/* get rid of srvname */
+	remove(srvname);
+
 	/* set up a new environment */
 	cputype = getenv("cputype");
 	sysname = getenv("sysname");
@@ -205,5 +205,5 @@
 
 	/* read profile and start interactive rc */
 	execl("/bin/rc", "rc", "-li", nil);
-	exits(0);
+	exits(nil);
 }