[PATCH 08/22] os: Remove LocalClientCred

Adam Jackson ajax at redhat.com
Tue Jul 22 08:46:28 PDT 2014


The comment lies, shm hasn't used this code since:

    commit fdef7be5c8d5989e0aa453d0a5b86d0a6952e960
    Author: Alan Coopersmith <alan.coopersmith at sun.com>
    Date:   Tue Oct 9 18:44:04 2007 -0700

        Sun bug 6589829: include zoneid of shm segment in access [...]

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 include/os.h |  3 ---
 os/access.c  | 27 ---------------------------
 2 files changed, 30 deletions(-)

diff --git a/include/os.h b/include/os.h
index 9982c9b..e4ec4b1 100644
--- a/include/os.h
+++ b/include/os.h
@@ -380,9 +380,6 @@ typedef struct sockaddr *sockaddrPtr;
 extern _X_EXPORT int
 InvalidHost(sockaddrPtr /*saddr */ , int /*len */ , ClientPtr client);
 
-extern _X_EXPORT int
-LocalClientCred(ClientPtr, int *, int *);
-
 #define LCC_UID_SET	(1 << 0)
 #define LCC_GID_SET	(1 << 1)
 #define LCC_PID_SET	(1 << 2)
diff --git a/os/access.c b/os/access.c
index 9fcf99a..125f35f 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1008,33 +1008,6 @@ ComputeLocalClient(ClientPtr client)
 }
 
 /*
- * Return the uid and gid of a connected local client
- * 
- * Used by XShm to test access rights to shared memory segments
- */
-int
-LocalClientCred(ClientPtr client, int *pUid, int *pGid)
-{
-    LocalClientCredRec *lcc;
-    int ret = GetLocalClientCreds(client, &lcc);
-
-    if (ret == 0) {
-#ifdef HAVE_GETZONEID           /* only local if in the same zone */
-        if ((lcc->fieldsSet & LCC_ZID_SET) && (lcc->zoneid != getzoneid())) {
-            FreeLocalClientCreds(lcc);
-            return -1;
-        }
-#endif
-        if ((lcc->fieldsSet & LCC_UID_SET) && (pUid != NULL))
-            *pUid = lcc->euid;
-        if ((lcc->fieldsSet & LCC_GID_SET) && (pGid != NULL))
-            *pGid = lcc->egid;
-        FreeLocalClientCreds(lcc);
-    }
-    return ret;
-}
-
-/*
  * Return the uid and all gids of a connected local client
  * Allocates a LocalClientCredRec - caller must call FreeLocalClientCreds
  * 
-- 
1.9.3



More information about the xorg-devel mailing list