diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-04-17 16:01:56 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-uranus.epoch.ncsc.mil> | 2007-04-17 16:01:56 -0400 |
commit | 9cee4ec5e6e06d23aafb302494b082c77ade4623 (patch) | |
tree | ee073cce5999f79df2c8aa87f4891e83a38afaaa /dix/resource.c | |
parent | 47bd311e3dcc501cbb202ce79a55ac32e9db50f2 (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.c | 18 |
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; } |