From 3b573ec5c56fbdf51141291a2247f08cc2a54d18 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 7 Dec 1991 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1991-12-07 --- gnot/lib.h | 7 ++++--- pc/kbd.c | 4 ++-- port/devcons.c | 14 +++++++------- port/lib.h | 7 ++++--- port/portdat.h | 3 +-- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/gnot/lib.h b/gnot/lib.h index a283f1889479305b34d69c2969b6324bf625a624..35d88be2f290788b264bf97254511e04096abf41 100644 --- a/gnot/lib.h +++ b/gnot/lib.h @@ -83,9 +83,10 @@ typedef struct Qid Qid; typedef struct Dir Dir; typedef struct Waitmsg Waitmsg; -#define ERRLEN 64 -#define DIRLEN 116 -#define NAMELEN 28 +#define ERRLEN 64 +#define DIRLEN 116 +#define NAMELEN 28 +#define DESKEYLEN 7 struct Qid { diff --git a/pc/kbd.c b/pc/kbd.c index 1e29a766427a9ff1049d24dc05f332b24d468dad..a8810594db36ed7c0e4d6ed2b4da9c633ed0a1de 100644 --- a/pc/kbd.c +++ b/pc/kbd.c @@ -189,10 +189,10 @@ kbdinit(void) outb(Cmd, 0x60); if(outready() < 0) print("kbd init failed\n"); - outb(Data, 0x47); + outb(Data, 0x47); /* BUG -- on 6300 0x65 */ if(outready() < 0) print("kbd init failed\n"); - outb(Cmd, 0xA8); + outb(Cmd, 0xA8); /* BUG -- should this be AE? */ /* make mouse streaming, enabled */ if(mousecmd(0xEA) < 0 diff --git a/port/devcons.c b/port/devcons.c index ebeec71aafba6a92cae66ab7c516fffacd48054a..b64307cbf7f33a7b89216170d87cbdb79024271b 100644 --- a/port/devcons.c +++ b/port/devcons.c @@ -21,7 +21,7 @@ KIOQ kbdq; Ref raw; /* whether kbd i/o is raw (rcons is open) */ char eve[NAMELEN] = "bootes"; -char evekey[KEYLEN]; +char evekey[DESKEYLEN]; /* * init the queues and set the output routine @@ -351,7 +351,7 @@ Dirtab consdir[]={ "user", {Quser}, 0, 0666, "chal", {Qchal}, 8, 0666, "crypt", {Qcrypt}, 0, 0666, - "key", {Qkey}, KEYLEN, 0222, + "key", {Qkey}, DESKEYLEN, 0222, "klog", {Qklog}, 0, 0444, "sysstat", {Qsysstat}, 0, 0666, "swap", {Qswap}, 0, 0666, @@ -762,11 +762,11 @@ conswrite(Chan *c, void *va, long n, ulong offset) break; case Qkey: - if(n != KEYLEN) + if(n != DESKEYLEN) error(Ebadarg); - memmove(u->p->pgrp->crypt->key, a, KEYLEN); + memmove(u->p->pgrp->crypt->key, a, DESKEYLEN); if(strcmp(u->p->user, eve) == 0) - memmove(evekey, a, KEYLEN); + memmove(evekey, a, DESKEYLEN); break; case Quser: @@ -786,14 +786,14 @@ conswrite(Chan *c, void *va, long n, ulong offset) case Qchal: if(offset != 0) error(Ebadarg); - if(n != 8+NAMELEN+KEYLEN) + if(n != 8+NAMELEN+DESKEYLEN) error(Ebadarg); decrypt(evekey, a, n); if(memcmp(u->p->pgrp->crypt->chal, a, 8) != 0) errors("authentication failure"); strncpy(u->p->user, a+8, NAMELEN); u->p->user[NAMELEN-1] = '\0'; - memmove(u->p->pgrp->crypt->key, a+NAMELEN+KEYLEN, KEYLEN); + memmove(u->p->pgrp->crypt->key, a+NAMELEN+DESKEYLEN, DESKEYLEN); break; case Qnull: diff --git a/port/lib.h b/port/lib.h index a283f1889479305b34d69c2969b6324bf625a624..35d88be2f290788b264bf97254511e04096abf41 100644 --- a/port/lib.h +++ b/port/lib.h @@ -83,9 +83,10 @@ typedef struct Qid Qid; typedef struct Dir Dir; typedef struct Waitmsg Waitmsg; -#define ERRLEN 64 -#define DIRLEN 116 -#define NAMELEN 28 +#define ERRLEN 64 +#define DIRLEN 116 +#define NAMELEN 28 +#define DESKEYLEN 7 struct Qid { diff --git a/port/portdat.h b/port/portdat.h index 3be87b711631005e56876a1d71a6de243f688d33..f363095e62e5ef5cbfd9ab948abb16eb05674a36 100644 --- a/port/portdat.h +++ b/port/portdat.h @@ -165,10 +165,9 @@ struct Chan Qid mqid; /* qid of root of mount point */ }; -#define KEYLEN 7 struct Crypt { - char key[KEYLEN]; /* des encryption key */ + char key[DESKEYLEN]; /* des encryption key */ char chal[8]; /* challenge for setting user name */ };