~kris/9p

9hist

ref: 5fb1b09c0ef1912b96a9aa24e5a4e769a42b1e48 9hist/boot/glendakey.c -rw-r--r-- 499 bytes
5fb1b09c — David du Colombier Plan 9 from Bell Labs 2001-05-26 25 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <u.h>
#include <libc.h>
#include <auth.h>
#include <../boot/boot.h>

/*
 *  pretend to get info out of nvram.
 */
void
glendakey(int, Method*)
{
	char key[DESKEYLEN];

	passtokey(key, "boyd");

	/* set host's key */
	if(writefile("#c/key", key, DESKEYLEN) < 0)
		warning("#c/key");

	/* set host's owner (and uid of current process) */
	if(writefile("#c/hostowner", "glenda", 6) < 0)
		warning("#c/hostowner");

	if(writefile("#c/hostdomain", "plan9", 5) < 0)
		warning("#c/hostdomain");
}