[X2Go-Commits] [nx-libs] 242/429: NXproperty.c, dix.c: simplify ProcDeleteProperty()

git-admin at x2go.org git-admin at x2go.org
Mon Oct 18 09:36:42 CEST 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit da9ac92e9729308bcaabd76cf2a9b37b7acca9ec
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Sat Jan 30 16:10:23 2021 +0100

    NXproperty.c, dix.c: simplify ProcDeleteProperty()
    
    by calling the dix version after a check
---
 nx-X11/programs/Xserver/dix/property.c          |  6 ++--
 nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 48 +++----------------------
 2 files changed, 9 insertions(+), 45 deletions(-)

diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c
index f0bfe1e65..37af8d592 100644
--- a/nx-X11/programs/Xserver/dix/property.c
+++ b/nx-X11/programs/Xserver/dix/property.c
@@ -661,9 +661,12 @@ ProcListProperties(ClientPtr client)
     return(client->noClientException);
 }
 
-#ifndef NXAGENT_SERVER
 int 
+#ifdef NXAGENT_SERVER
+xorg_ProcDeleteProperty(register ClientPtr client)
+#else
 ProcDeleteProperty(register ClientPtr client)
+#endif
 {
     WindowPtr pWin;
     REQUEST(xDeletePropertyReq);
@@ -699,4 +702,3 @@ 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 f4979ceb3..7cf41f241 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
@@ -180,11 +180,8 @@ ProcChangeProperty(ClientPtr client)
 
 #ifdef NXAGENT_SERVER
     /* prevent clients from changing the NX_AGENT_VERSION property */
-    {
-      Atom prop = MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True);
-      if (stuff->property == prop)
-        return client->noClientException;
-    }
+    if (stuff->property == MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True))
+      return client->noClientException;
 #endif
 
     err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format,
@@ -577,46 +574,11 @@ GetWindowProperty(WindowPtr pWin, Atom property, long longOffset,
 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
+    if (stuff->property == MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True))
+      return client->noClientException;
 
-    result = DeleteProperty(pWin, stuff->property);
-    if (client->noClientException != Success)
-        return(client->noClientException);
-    else
-        return(result);
+    return xorg_ProcDeleteProperty(client);
 }

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list