From 7cd173d2f775a060d9c42446a2ccd85ee79ef467 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 11 Aug 1999 18:54:53 +0000 Subject: [PATCH] return "no write access" when it is an SPC_NOMOD field --- src/rsrv/camessage.c | 23 ++++++++++++++++++++--- src/rsrv/caservertask.c | 4 ++-- src/rsrv/server.h | 3 +++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/rsrv/camessage.c b/src/rsrv/camessage.c index b86713b82..52a076e5e 100644 --- a/src/rsrv/camessage.c +++ b/src/rsrv/camessage.c @@ -66,6 +66,7 @@ static char *sccsId = "%W% %G%"; #include #include "db_access.h" +#include "special.h" #include "task_params.h" #include "ellLib.h" #include "freeList.h" @@ -694,7 +695,7 @@ struct client *client return ERROR; } - if(!asCheckPut(pciu->asClientPVT)){ + if(!rsrvCheckPut(pciu)){ v41 = CA_V41( CA_PROTOCOL_VERSION, client->minor_version_number); @@ -1017,7 +1018,7 @@ LOCAL void access_rights_reply(struct channel_in_use *pciu) if(asCheckGet(pciu->asClientPVT)){ ar |= CA_PROTO_ACCESS_RIGHT_READ; } - if(asCheckPut(pciu->asClientPVT)){ + if(rsrvCheckPut(pciu)){ ar |= CA_PROTO_ACCESS_RIGHT_WRITE; } @@ -1481,7 +1482,7 @@ struct client *client return ERROR; } - if(!asCheckPut(pciu->asClientPVT)){ + if(!rsrvCheckPut(pciu)){ putNotifyErrorReply(client, mp, ECA_NOWTACCESS); return OK; } @@ -2240,3 +2241,19 @@ int camessage( return OK; } + +/* + * rsrvCheckPut () + */ +int rsrvCheckPut (const struct channel_in_use *pciu) +{ + /* + * SPC_NOMOD fields are always unwritable + */ + if (pciu->addr.special==SPC_NOMOD) { + return 0; + } + else { + return asCheckPut (pciu->asClientPVT); + } +} diff --git a/src/rsrv/caservertask.c b/src/rsrv/caservertask.c index 901e41b71..2052790e5 100644 --- a/src/rsrv/caservertask.c +++ b/src/rsrv/caservertask.c @@ -581,11 +581,11 @@ LOCAL void log_one_client(struct client *client, unsigned level) pciu->addr.precord->name, ellCount(&pciu->eventq), asCheckGet(pciu->asClientPVT)?'r':'-', - asCheckPut(pciu->asClientPVT)?'w':'-'); + rsrvCheckPut(pciu)?'w':'-'); pciu = (struct channel_in_use *) ellNext(&pciu->node); if( ++i % 3 == 0){ printf("\n"); - } + } } FASTUNLOCK(&client->addrqLock); printf("\n"); diff --git a/src/rsrv/server.h b/src/rsrv/server.h index 10ba70eaf..ac3ab8493 100644 --- a/src/rsrv/server.h +++ b/src/rsrv/server.h @@ -295,6 +295,9 @@ struct client *pc void write_notify_reply(void *pArg); +int rsrvCheckPut (const struct channel_in_use *pciu); + + /* * !!KLUDGE!! *