summaryrefslogtreecommitdiff
path: root/dix/resource.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-04-17 16:01:56 -0400
committerEamon Walsh <ewalsh@moss-uranus.epoch.ncsc.mil>2007-04-17 16:01:56 -0400
commit9cee4ec5e6e06d23aafb302494b082c77ade4623 (patch)
treeee073cce5999f79df2c8aa87f4891e83a38afaaa /dix/resource.c
parent47bd311e3dcc501cbb202ce79a55ac32e9db50f2 (diff)
xace: change the semantics of the return value of XACE hooks to allow
arbitrary X status codes instead of just TRUE/FALSE. The dix layer in most cases still does not propagate the return value of XACE hooks back to the client, however. There is more error propagation work to do.
Diffstat (limited to 'dix/resource.c')
-rw-r--r--dix/resource.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/dix/resource.c b/dix/resource.c
index e1bb74f64..67124c754 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -918,12 +918,16 @@ dixLookupResource(pointer *result, XID id, RESTYPE rtype,
(!istype && res->type & rtype)))
break;
}
- if (res) {
- if (client && !XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type,
- mode, res->value))
- return BadAccess;
- *result = res->value;
- return Success;
+ if (!res)
+ return BadValue;
+
+ if (client) {
+ cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type,
+ mode, res->value);
+ if (cid != Success)
+ return cid;
}
- return BadValue;
+
+ *result = res->value;
+ return Success;
}