diff --git a/src/rsrv/camessage.c b/src/rsrv/camessage.c index f32e15ee4..06131e894 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); @@ -751,7 +752,6 @@ struct client *client return OK; } - /* * host_name_action() */ @@ -761,7 +761,7 @@ struct client *client ) { struct channel_in_use *pciu; - unsigned size; + unsigned size; char *pName; char *pMalloc; int status; @@ -1017,7 +1017,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; } @@ -1480,7 +1480,7 @@ struct client *client return ERROR; } - if(!asCheckPut(pciu->asClientPVT)){ + if(!rsrvCheckPut(pciu)){ putNotifyErrorReply(client, mp, ECA_NOWTACCESS); return OK; } @@ -1488,6 +1488,7 @@ struct client *client size = dbr_size_n(mp->m_type, mp->m_count); if(pciu->pPutNotify){ + /* * serialize concurrent put notifies */ @@ -1688,6 +1689,7 @@ struct client *client return OK; } + /* * clear_channel_reply() @@ -2237,3 +2239,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 7f5dc0a65..96d128f8c 100644 --- a/src/rsrv/caservertask.c +++ b/src/rsrv/caservertask.c @@ -45,6 +45,7 @@ */ static char *sccsId = "@(#) $Id$"; + #include #include @@ -71,6 +72,7 @@ static char *sccsId = "@(#) $Id$"; #include "bsdSocketResource.h" #include "server.h" +#include "bsdSocketResource.h" LOCAL int terminate_one_client(struct client *client); LOCAL void log_one_client(struct client *client, unsigned level); @@ -506,7 +508,7 @@ LOCAL void log_one_client(struct client *client, unsigned level) float recv_delay; unsigned long bytes_reserved; char *state[] = {"up", "down"}; - char clientHostName[128]; + char clientHostName[256]; ipAddrToA (&client->addr, clientHostName, sizeof(clientHostName)); @@ -581,11 +583,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!! *