| plan 9 kernel history: overview | file list | diff list |
2001/0808/port/auth.c (diff list | history)
| 2001/0807/sys/src/9/port/auth.c:11,41 – 2001/0808/sys/src/9/port/auth.c:11,16 (short | long | prev | next) | ||
| 1993/0330 | char evekey[DESKEYLEN]; char hostdomain[DOMLEN]; | |
| 2001/0807 |
| |
| 1993/0330 | /* * return true if current user is eve */ | |
| 2001/0807/sys/src/9/port/auth.c:136,151 – 2001/0808/sys/src/9/port/auth.c:111,146 | ||
| 2001/0527 | return m; | |
| 1993/0330 | } | |
| 2001/0807 |
| |
| 2001/0808 | long sysfsession(ulong *arg) | |
| 1993/0330 | { | |
| 2001/0527 | Fcall f; uchar *msg; | |
| 2001/0807 |
| |
| 2001/0808 | uint authlen, n, m; Chan *c; | |
| 2001/0527 | uvlong oo; | |
| 1993/0330 | ||
| 2001/0808 | //BUG print("warning: stub fsession being used\n"); authlen = arg[2]; validaddr(arg[1], authlen, 1); c = fdtochan(arg[0], ORDWR, 0, 1); if(waserror()){ cclose(c); nexterror(); } if(c->flag & CMSG){ //BUG what to do? ((uchar*)arg[1])[0] = 0; poperror(); cclose(c); return 0; } | |
| 2001/0527 | f.type = Tsession; f.tag = NOTAG; | |
| 2001/0808 | f.nchal = 0; f.chal = (uchar*)""; | |
| 2001/0529 | msg = smalloc(8192+IOHDRSZ); | |
| 2001/0527 | if(waserror()){ free(msg); | |
| 2001/0807/sys/src/9/port/auth.c:161,167 – 2001/0808/sys/src/9/port/auth.c:156,161 | ||
| 2001/0527 | unlock(c); | |
| 1993/0330 | ||
| 2001/0527 | m = devtab[c->type]->write(c, msg, n, oo); | |
| 2001/0807 |
| |
| 1993/0731 | ||
| 2001/0527 | if(m < n){ lock(c); | |
| 2001/0807/sys/src/9/port/auth.c:174,180 – 2001/0808/sys/src/9/port/auth.c:168,173 | ||
| 2001/0529 | m = devtab[c->type]->read(c, msg, 8192+IOHDRSZ, c->offset); | |
| 2001/0527 | if(m <= 0) error("EOF receiving fsession reply"); | |
| 2001/0807 |
| |
| 1993/0330 | ||
| 2001/0527 | lock(c); c->offset += m; | |
| 2001/0807/sys/src/9/port/auth.c:181,251 – 2001/0808/sys/src/9/port/auth.c:174,201 | ||
| 2001/0527 | unlock(c); | |
| 1993/0731 | ||
| 2001/0527 | n = convM2S(msg, m, &f); | |
| 2001/0807 |
| |
| 2001/0527 | if(n != m) error("bad fsession conversion on reply"); if(f.type != Rsession) error("unexpected reply type in fsession"); | |
| 2001/0807 |
| |
| 2001/0808 | m = f.nchal; if(m > authlen) error(Eshort); //BUG print("auth stuff ignored; noauth by default\n"); ((uchar*)arg[1])[0] = 0; | |
| 1993/0731 | ||
| 2001/0527 | free(msg); poperror(); | |
| 2001/0807 |
| |
| 2001/0527 | poperror(); cclose(c); | |
| 2001/0807 |
| |
| 2001/0808 | return m; | |
| 1993/0330 | } long | |
| 2001/0807 |
| |
| 2001/0808 | sysfauth(ulong *) | |
| 1993/0330 | { | |
| 2001/0807 |
| |
| 2001/0808 | error("sysfauth unimplemented"); return -1; | |
| 1993/0731 | } /* | |