diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2019-07-24 00:02:51 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-09-29 17:10:05 +0200 |
commit | 8f609404caa511a464207507129de586d325b3d9 (patch) | |
tree | 9bcf4f2f884113da3215740d0886de0756ee4ff0 /nx-X11 | |
parent | 9dca2c598af64d8fbe56f7cb0608b906a88e1e6a (diff) | |
download | nx-libs-8f609404caa511a464207507129de586d325b3d9.tar.gz nx-libs-8f609404caa511a464207507129de586d325b3d9.tar.bz2 nx-libs-8f609404caa511a464207507129de586d325b3d9.zip |
NXproperty.c: prevent deletion of NX_AGENT_VERSION property
Fixes ArcticaProject/nx-libs#825
Diffstat (limited to 'nx-X11')
-rw-r--r-- | nx-X11/programs/Xserver/dix/property.c | 2 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 47 |
2 files changed, 49 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c index 66c38f56c..7f25a5c55 100644 --- a/nx-X11/programs/Xserver/dix/property.c +++ b/nx-X11/programs/Xserver/dix/property.c @@ -655,6 +655,7 @@ ProcListProperties(ClientPtr client) return(client->noClientException); } +#ifndef NXAGENT_SERVER int ProcDeleteProperty(register ClientPtr client) { @@ -692,3 +693,4 @@ ProcDeleteProperty(register ClientPtr client) else return(result); } +#endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index a0c355b41..94e9e4b2a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -682,3 +682,50 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, return(Success); } #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); +} |