summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-10-17 13:51:11 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-10-17 13:51:11 -0400
commitdb66e66dbf26b91c655f1659859c022cc31f0db6 (patch)
tree011459d82a9ecffa1597e7faf44c05f79dcbd267
parente3a8cbe523bae8b771ad3c8ad497f4444f6d05d5 (diff)
xace: Add an access_mode field to the extension structure.
This allows the same callback to be used for both extension hooks.
-rw-r--r--Xext/xace.c15
-rw-r--r--Xext/xacestr.h1
2 files changed, 14 insertions, 2 deletions
diff --git a/Xext/xace.c b/Xext/xace.c
index 3de259f71..b12666159 100644
--- a/Xext/xace.c
+++ b/Xext/xace.c
@@ -67,6 +67,17 @@ int XaceHook(int hook, ...)
prv = &rec.status;
break;
}
+ case XACE_EXT_DISPATCH: {
+ XaceExtAccessRec rec = {
+ va_arg(ap, ClientPtr),
+ va_arg(ap, ExtensionEntry*),
+ DixUseAccess,
+ Success /* default allow */
+ };
+ calldata = &rec;
+ prv = &rec.status;
+ break;
+ }
case XACE_RESOURCE_ACCESS: {
XaceResourceAccessRec rec = {
va_arg(ap, ClientPtr),
@@ -141,11 +152,11 @@ int XaceHook(int hook, ...)
prv = &rec.status;
break;
}
- case XACE_EXT_DISPATCH:
case XACE_EXT_ACCESS: {
XaceExtAccessRec rec = {
va_arg(ap, ClientPtr),
va_arg(ap, ExtensionEntry*),
+ DixGetAttrAccess,
Success /* default allow */
};
calldata = &rec;
@@ -228,7 +239,7 @@ int XaceHook(int hook, ...)
/* call callbacks and return result, if any. */
CallCallbacks(&XaceHooks[hook], calldata);
- return prv ? *prv : 0;
+ return prv ? *prv : Success;
}
static int
diff --git a/Xext/xacestr.h b/Xext/xacestr.h
index 1dae4d6b5..1c615433b 100644
--- a/Xext/xacestr.h
+++ b/Xext/xacestr.h
@@ -97,6 +97,7 @@ typedef struct {
typedef struct {
ClientPtr client;
ExtensionEntry *ext;
+ Mask access_mode;
int status;
} XaceExtAccessRec;