return "no write access" when it is an SPC_NOMOD field
This commit is contained in:
@@ -66,6 +66,7 @@ static char *sccsId = "%W% %G%";
|
||||
#include <sysLib.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -295,6 +295,9 @@ struct client *pc
|
||||
|
||||
void write_notify_reply(void *pArg);
|
||||
|
||||
int rsrvCheckPut (const struct channel_in_use *pciu);
|
||||
|
||||
|
||||
/*
|
||||
* !!KLUDGE!!
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user