History

20090320-1900

Charles.Forsyth committed 17 years ago

Commit d49685a1 parent 14d820f6 files · +18 −6Browse files

Unified · Split

6 files
  1. CHANGES +1 −0
  2. include/styxserver.h +1 −0
  3. lib/proto/src +2 −1
  4. man/10/styxserver +3 −0
  5. tools/libstyx/styxserver.c +9 −3
  6. tools/odbc/odbc.c +2 −2
CHANGES+1−0
@@ -1,6 +1,7 @@
11 20090320
22 emu/port/win-x11a.c: unintuitively use xdisplay not xkbdcon to send to kbdproc (with big stack) to change cursor
33 (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
45 20090222
56 appl/cmd/ndb/registry.b and dis/registry.dis - implement flush for event file (issue 162)
67 20090217
include/styxserver.hrenamed from tools/libstyx/styxserver.h+1−0
@@ -95,3 +95,4 @@ Qid styxqid(int path, int isdir); · 94 unmodified lines
9595 void *styxmalloc(int n);
9696 void styxfree(void *p);
9797 void styxdebug(void);
98+void styxsetowner(char*);
lib/proto/src+2−1
@@ -1,4 +1,6 @@
11 INSTALL
2+include
3+ styxserver.h
24 asm
35 NOTICE
46 asm.h
@@ -795,7 +797,6 @@ tools · 790 unmodified lines
795797 mkfile
796798 styxaux.h
797799 styxserver.c
798− styxserver.h
799800 mkfile
800801 odbc
801802 mkfile
man/10/styxserver+3−0
@@ -3,6 +3,9 @@ · 2 unmodified lines
33 Styxserver \- C Styx server library
44 .SH SYNOPSIS
55 .EX
6+#include <lib9.h>
7+#include <styx.h>
8+#include <styxserver.h>
69 #define Qroot 0
710
811 #define MSGMAX ((((8192+128)*2)+3) & ~3)
tools/libstyx/styxserver.c+9−3
@@ -114,7 +114,7 @@ newclient(Styxserver *server, int fd) · 113 unmodified lines
114114 c->state = 0;
115115 c->fids = nil;
116116 c->uname = strdup(eve);
117− c->aname = strdup(eve);
117+ c->aname = strdup("");
118118 c->next = server->clients;
119119 server->clients = c;
120120 if(server->ops->newclient)
@@ -167,7 +167,7 @@ rd(Client *c, Fcall *r) · 46 unmodified lines
167167 {
168168 if(c->nc > 0){ /* last convM2S consumed nc bytes */
169169 c->nread -= c->nc;
170− if(c->nread < 0){
170+ if((int)c->nread < 0){
171171 r->ename = "negative size in rd";
172172 return -1;
173173 }
@@ -903,7 +903,7 @@ run(Client *c) · 729 unmodified lines
903903 break;
904904 case Tattach:
905905 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);
907907 if(fp){
908908 f.type = Rerror;
909909 f.ename = "fid in use";
@@ -1065,3 +1065,9 @@ styxqid(int path, int isdir) · 155 unmodified lines
10651065 q.type = 0;
10661066 return q;
10671067 }
1068+
1069+void
1070+styxsetowner(char *name)
1071+{
1072+ eve = name;
1073+}
tools/odbc/odbc.c+2−2
@@ -844,7 +844,7 @@ dbopen(Qid *qid, int omode) · 843 unmodified lines
844844 break;
845845 case Qclonus:
846846 p = &proto[PROTO(q)];
847− cv = protoclone(p, c->aname);
847+ cv = protoclone(p, c->uname);
848848 if(cv == 0){
849849 return Enodev;
850850 }
@@ -860,7 +860,7 @@ dbopen(Qid *qid, int omode) · 9 unmodified lines
860860 case Qctl:
861861 p = &proto[PROTO(q)];
862862 cv = p->conv[CONV(q)];
863− user = c->aname;
863+ user = c->uname;
864864 if((perm & (cv->perm>>6)) != perm) {
865865 if(strcmp(user, cv->owner) != 0 ||
866866 (perm & cv->perm) != perm) {