2 #include "../port/lib.h"
6 #include "../port/error.h"
11 char hostdomain[DOMLEN];
14 * return true if current user is eve
19 return strcmp(eve, up->user) == 0;
23 sysfversion(ulong *arg)
26 uint arglen, m, msize;
32 validaddr(arg[2], arglen, 1);
33 /* check there's a NUL in the version string */
34 if(arglen==0 || memchr(vers, 0, arglen)==0)
36 c = fdtochan(arg[0], ORDWR, 0, 1);
42 m = mntversion(c, vers, msize, arglen);
50 sys_fsession(ulong *arg)
52 /* deprecated; backwards compatibility only */
56 validaddr(arg[1], arg[2], 1);
57 ((uchar*)arg[1])[0] = '\0';
68 validaddr(arg[1], 1, 0);
69 aname = validnamedup((char*)arg[1], 1);
74 c = fdtochan(arg[0], ORDWR, 0, 1);
80 ac = mntauth(c, aname);
81 /* at this point ac is responsible for keeping c alive */
84 poperror(); /* aname */
97 /* always mark it close on exec */
104 * called by devcons() for user device
106 * anyone can become none
109 userwrite(char *a, int n)
111 if(n!=4 || strncmp(a, "none", 4)!=0)
113 kstrdup(&up->user, "none");
114 up->basepri = PriNormal;
119 * called by devcons() for host owner/domain
121 * writing hostowner also sets user
124 hostownerwrite(char *a, int n)
130 if(n <= 0 || n >= sizeof buf)
135 renameuser(eve, buf);
136 srvrenameuser(eve, buf);
138 kstrdup(&up->user, buf);
139 up->basepri = PriNormal;
144 hostdomainwrite(char *a, int n)
152 memset(buf, 0, DOMLEN);
156 memmove(hostdomain, buf, DOMLEN);