Commit 8f609404 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

NXproperty.c: prevent deletion of NX_AGENT_VERSION property

Fixes ArcticaProject/nx-libs#825
parent 9dca2c59
...@@ -655,6 +655,7 @@ ProcListProperties(ClientPtr client) ...@@ -655,6 +655,7 @@ ProcListProperties(ClientPtr client)
return(client->noClientException); return(client->noClientException);
} }
#ifndef NXAGENT_SERVER
int int
ProcDeleteProperty(register ClientPtr client) ProcDeleteProperty(register ClientPtr client)
{ {
...@@ -692,3 +693,4 @@ ProcDeleteProperty(register ClientPtr client) ...@@ -692,3 +693,4 @@ ProcDeleteProperty(register ClientPtr client)
else else
return(result); return(result);
} }
#endif
...@@ -682,3 +682,50 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -682,3 +682,50 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
return(Success); return(Success);
} }
#endif #endif
int
ProcDeleteProperty(register ClientPtr client)
{
WindowPtr pWin;
REQUEST(xDeletePropertyReq);
int result;
REQUEST_SIZE_MATCH(xDeletePropertyReq);
UpdateCurrentTime();
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
DixWriteAccess);
if (!pWin)
return(BadWindow);
if (!ValidAtom(stuff->property))
{
client->errorValue = stuff->property;
return (BadAtom);
}
#ifdef XCSECURITY
switch(SecurityCheckPropertyAccess(client, pWin, stuff->property,
DixDestroyAccess))
{
case SecurityErrorOperation:
client->errorValue = stuff->property;
return BadAtom;;
case SecurityIgnoreOperation:
return Success;
}
#endif
#ifdef NXAGENT_SERVER
/* prevent clients from deleting the NX_AGENT_VERSION property */
{
Atom prop = MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True);
if (stuff->property == prop)
return client->noClientException;
}
#endif
result = DeleteProperty(pWin, stuff->property);
if (client->noClientException != Success)
return(client->noClientException);
else
return(result);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment