Unified · Split
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | 20090320 |
| 2 | 2 | emu/port/win-x11a.c: unintuitively use xdisplay not xkbdcon to send to kbdproc (with big stack) to change cursor |
| 3 | 3 | (the big stack is needed because XCreateBitmapFromData and XPutImage pass control to theme-related code that uses lots of stack space) |
| 4 | + use uname not aname for user name in libstyx and set aname to "" by default | |
| 4 | 5 | 20090222 |
| 5 | 6 | appl/cmd/ndb/registry.b and dis/registry.dis - implement flush for event file (issue 162) |
| 6 | 7 | 20090217 |
| @@ -95,3 +95,4 @@ Qid styxqid(int path, int isdir); · 94 unmodified lines | ||
| 95 | 95 | void *styxmalloc(int n); |
| 96 | 96 | void styxfree(void *p); |
| 97 | 97 | void styxdebug(void); |
| 98 | +void styxsetowner(char*); | |
| @@ -1,4 +1,6 @@ | ||
| 1 | 1 | INSTALL |
| 2 | +include | |
| 3 | + styxserver.h | |
| 2 | 4 | asm |
| 3 | 5 | NOTICE |
| 4 | 6 | asm.h |
| @@ -795,7 +797,6 @@ tools · 790 unmodified lines | ||
| 795 | 797 | mkfile |
| 796 | 798 | styxaux.h |
| 797 | 799 | styxserver.c |
| 798 | − styxserver.h | |
| 799 | 800 | mkfile |
| 800 | 801 | odbc |
| 801 | 802 | mkfile |
| @@ -3,6 +3,9 @@ · 2 unmodified lines | ||
| 3 | 3 | Styxserver \- C Styx server library |
| 4 | 4 | .SH SYNOPSIS |
| 5 | 5 | .EX |
| 6 | +#include <lib9.h> | |
| 7 | +#include <styx.h> | |
| 8 | +#include <styxserver.h> | |
| 6 | 9 | #define Qroot 0 |
| 7 | 10 | |
| 8 | 11 | #define MSGMAX ((((8192+128)*2)+3) & ~3) |
| @@ -114,7 +114,7 @@ newclient(Styxserver *server, int fd) · 113 unmodified lines | ||
| 114 | 114 | c->state = 0; |
| 115 | 115 | c->fids = nil; |
| 116 | 116 | c->uname = strdup(eve); |
| 117 | − c->aname = strdup(eve); | |
| 117 | + c->aname = strdup(""); | |
| 118 | 118 | c->next = server->clients; |
| 119 | 119 | server->clients = c; |
| 120 | 120 | if(server->ops->newclient) |
| @@ -167,7 +167,7 @@ rd(Client *c, Fcall *r) · 46 unmodified lines | ||
| 167 | 167 | { |
| 168 | 168 | if(c->nc > 0){ /* last convM2S consumed nc bytes */ |
| 169 | 169 | c->nread -= c->nc; |
| 170 | − if(c->nread < 0){ | |
| 170 | + if((int)c->nread < 0){ | |
| 171 | 171 | r->ename = "negative size in rd"; |
| 172 | 172 | return -1; |
| 173 | 173 | } |
| @@ -903,7 +903,7 @@ run(Client *c) · 729 unmodified lines | ||
| 903 | 903 | break; |
| 904 | 904 | case Tattach: |
| 905 | 905 | if(Debug) |
| 906 | − fprint(2, "Tattach %d %s\n", f.fid, f.uname[0] ? f.uname : c->uname); | |
| 906 | + fprint(2, "Tattach %d %s %s\n", f.fid, f.uname[0] ? f.uname : c->uname, f.aname[0]? f.aname: c->aname); | |
| 907 | 907 | if(fp){ |
| 908 | 908 | f.type = Rerror; |
| 909 | 909 | f.ename = "fid in use"; |
| @@ -1065,3 +1065,9 @@ styxqid(int path, int isdir) · 155 unmodified lines | ||
| 1065 | 1065 | q.type = 0; |
| 1066 | 1066 | return q; |
| 1067 | 1067 | } |
| 1068 | + | |
| 1069 | +void | |
| 1070 | +styxsetowner(char *name) | |
| 1071 | +{ | |
| 1072 | + eve = name; | |
| 1073 | +} | |
| @@ -844,7 +844,7 @@ dbopen(Qid *qid, int omode) · 843 unmodified lines | ||
| 844 | 844 | break; |
| 845 | 845 | case Qclonus: |
| 846 | 846 | p = &proto[PROTO(q)]; |
| 847 | − cv = protoclone(p, c->aname); | |
| 847 | + cv = protoclone(p, c->uname); | |
| 848 | 848 | if(cv == 0){ |
| 849 | 849 | return Enodev; |
| 850 | 850 | } |
| @@ -860,7 +860,7 @@ dbopen(Qid *qid, int omode) · 9 unmodified lines | ||
| 860 | 860 | case Qctl: |
| 861 | 861 | p = &proto[PROTO(q)]; |
| 862 | 862 | cv = p->conv[CONV(q)]; |
| 863 | − user = c->aname; | |
| 863 | + user = c->uname; | |
| 864 | 864 | if((perm & (cv->perm>>6)) != perm) { |
| 865 | 865 | if(strcmp(user, cv->owner) != 0 || |
| 866 | 866 | (perm & cv->perm) != perm) { |