summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2009-03-20 19:00:27 +0000
committerCharles.Forsyth <devnull@localhost>2009-03-20 19:00:27 +0000
commita60fa48ce2f27a689f276bea9538b5db2b74ff86 (patch)
treea4481fed48337acdd6d2bd786eca5bf757364c46
parent390cfcfb235f8ef61e0467216902c4d718f51ad0 (diff)
20090320-1900
-rw-r--r--CHANGES1
-rw-r--r--include/styxserver.h (renamed from tools/libstyx/styxserver.h)1
-rw-r--r--lib/proto/src3
-rw-r--r--man/10/styxserver3
-rw-r--r--tools/libstyx/styxserver.c12
-rwxr-xr-xtools/odbc/odbc.c4
6 files changed, 18 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index 151462cd..2ef33bd8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,7 @@
20090320
emu/port/win-x11a.c: unintuitively use xdisplay not xkbdcon to send to kbdproc (with big stack) to change cursor
(the big stack is needed because XCreateBitmapFromData and XPutImage pass control to theme-related code that uses lots of stack space)
+ use uname not aname for user name in libstyx and set aname to "" by default
20090222
appl/cmd/ndb/registry.b and dis/registry.dis - implement flush for event file (issue 162)
20090217
diff --git a/tools/libstyx/styxserver.h b/include/styxserver.h
index 3aac9eee..09b83c74 100644
--- a/tools/libstyx/styxserver.h
+++ b/include/styxserver.h
@@ -95,3 +95,4 @@ Qid styxqid(int path, int isdir);
void *styxmalloc(int n);
void styxfree(void *p);
void styxdebug(void);
+void styxsetowner(char*);
diff --git a/lib/proto/src b/lib/proto/src
index 7b8c5241..3289e753 100644
--- a/lib/proto/src
+++ b/lib/proto/src
@@ -1,4 +1,6 @@
INSTALL
+include
+ styxserver.h
asm
NOTICE
asm.h
@@ -795,7 +797,6 @@ tools
mkfile
styxaux.h
styxserver.c
- styxserver.h
mkfile
odbc
mkfile
diff --git a/man/10/styxserver b/man/10/styxserver
index d0a8d321..8cd10fce 100644
--- a/man/10/styxserver
+++ b/man/10/styxserver
@@ -3,6 +3,9 @@
Styxserver \- C Styx server library
.SH SYNOPSIS
.EX
+#include <lib9.h>
+#include <styx.h>
+#include <styxserver.h>
#define Qroot 0
#define MSGMAX ((((8192+128)*2)+3) & ~3)
diff --git a/tools/libstyx/styxserver.c b/tools/libstyx/styxserver.c
index d0bf1c2c..34257349 100644
--- a/tools/libstyx/styxserver.c
+++ b/tools/libstyx/styxserver.c
@@ -114,7 +114,7 @@ newclient(Styxserver *server, int fd)
c->state = 0;
c->fids = nil;
c->uname = strdup(eve);
- c->aname = strdup(eve);
+ c->aname = strdup("");
c->next = server->clients;
server->clients = c;
if(server->ops->newclient)
@@ -167,7 +167,7 @@ rd(Client *c, Fcall *r)
{
if(c->nc > 0){ /* last convM2S consumed nc bytes */
c->nread -= c->nc;
- if(c->nread < 0){
+ if((int)c->nread < 0){
r->ename = "negative size in rd";
return -1;
}
@@ -903,7 +903,7 @@ run(Client *c)
break;
case Tattach:
if(Debug)
- fprint(2, "Tattach %d %s\n", f.fid, f.uname[0] ? f.uname : c->uname);
+ fprint(2, "Tattach %d %s %s\n", f.fid, f.uname[0] ? f.uname : c->uname, f.aname[0]? f.aname: c->aname);
if(fp){
f.type = Rerror;
f.ename = "fid in use";
@@ -1065,3 +1065,9 @@ styxqid(int path, int isdir)
q.type = 0;
return q;
}
+
+void
+styxsetowner(char *name)
+{
+ eve = name;
+}
diff --git a/tools/odbc/odbc.c b/tools/odbc/odbc.c
index 7b8194d9..f08a4f4f 100755
--- a/tools/odbc/odbc.c
+++ b/tools/odbc/odbc.c
@@ -844,7 +844,7 @@ dbopen(Qid *qid, int omode)
break;
case Qclonus:
p = &proto[PROTO(q)];
- cv = protoclone(p, c->aname);
+ cv = protoclone(p, c->uname);
if(cv == 0){
return Enodev;
}
@@ -860,7 +860,7 @@ dbopen(Qid *qid, int omode)
case Qctl:
p = &proto[PROTO(q)];
cv = p->conv[CONV(q)];
- user = c->aname;
+ user = c->uname;
if((perm & (cv->perm>>6)) != perm) {
if(strcmp(user, cv->owner) != 0 ||
(perm & cv->perm) != perm) {