summaryrefslogtreecommitdiff
path: root/Xext/xselinux_hooks.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-04-26 17:22:21 -0700
committerKeith Packard <keithp@keithp.com>2010-06-05 19:23:03 -0700
commitfaeebead7bfcc78535757ca7acc1faf7554c03b7 (patch)
tree1a8f13a3b1ae968011efb9679bc3ed79a29020be /Xext/xselinux_hooks.c
parentc865a24401f06bcf1347d8b41f736a066ab25693 (diff)
Change the devPrivates API to require dixRegisterPrivateKey
This patch only changes the API, not the implementation of the devPrivates infrastructure. This will permit a new devPrivates implementation to be layed into the server without requiring simultaneous changes in every devPrivates user. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Diffstat (limited to 'Xext/xselinux_hooks.c')
-rw-r--r--Xext/xselinux_hooks.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c
index 13e5243c2..560e1e9bf 100644
--- a/Xext/xselinux_hooks.c
+++ b/Xext/xselinux_hooks.c
@@ -59,12 +59,9 @@ typedef struct {
} SELinuxAuditRec;
/* private state keys */
-static int subjectKeyIndex;
-DevPrivateKey subjectKey = &subjectKeyIndex;
-static int objectKeyIndex;
-DevPrivateKey objectKey = &objectKeyIndex;
-static int dataKeyIndex;
-DevPrivateKey dataKey = &dataKeyIndex;
+DevPrivateKeyRec subjectKeyRec;
+DevPrivateKeyRec objectKeyRec;
+DevPrivateKeyRec dataKeyRec;
/* audit file descriptor */
static int audit_fd;
@@ -896,9 +893,9 @@ SELinuxFlaskInit(void)
FatalError("SELinux: Failed to open the system audit log\n");
/* Allocate private storage */
- if (!dixRequestPrivate(subjectKey, sizeof(SELinuxSubjectRec)) ||
- !dixRequestPrivate(objectKey, sizeof(SELinuxObjectRec)) ||
- !dixRequestPrivate(dataKey, sizeof(SELinuxObjectRec)))
+ if (!dixRegisterPrivateKey(subjectKey, PRIVATE_XSELINUX, sizeof(SELinuxSubjectRec)) ||
+ !dixRegisterPrivateKey(objectKey, PRIVATE_XSELINUX, sizeof(SELinuxObjectRec)) ||
+ !dixRegisterPrivateKey(dataKey, PRIVATE_XSELINUX, sizeof(SELinuxObjectRec)))
FatalError("SELinux: Failed to allocate private storage.\n");
/* Create atoms for doing window labeling */