security.pp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. (*
  2. Copyright 1996, 1998 The Open Group
  3. Permission to use, copy, modify, distribute, and sell this software and its
  4. documentation for any purpose is hereby granted without fee, provided that
  5. the above copyright notice appear in all copies and that both that
  6. copyright notice and this permission notice appear in supporting
  7. documentation.
  8. The above copyright notice and this permission notice shall be included
  9. in all copies or substantial portions of the Software.
  10. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  11. OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  13. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
  14. OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  15. ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  16. OTHER DEALINGS IN THE SOFTWARE.
  17. Except as contained in this notice, the name of The Open Group shall
  18. not be used in advertising or otherwise to promote the sale, use or
  19. other dealings in this Software without prior written authorization
  20. from The Open Group.
  21. *)
  22. unit security;
  23. {$PACKRECORDS c}
  24. interface
  25. uses
  26. ctypes, x, xlib;
  27. const
  28. libXext = 'Xext';
  29. {$define _XAUTH_STRUCT_ONLY}
  30. {$I xauth.inc}
  31. {$I secur.inc}
  32. type
  33. { type for returned auth ids }
  34. PXSecurityAuthorization = ^TXSecurityAuthorization;
  35. TXSecurityAuthorization = culong;
  36. PXSecurityAuthorizationAttributes = ^TXSecurityAuthorizationAttributes;
  37. TXSecurityAuthorizationAttributes = record
  38. timeout: cuint;
  39. trust_level: cuint;
  40. group: TXID;
  41. event_mask: clong;
  42. end;
  43. PXSecurityAuthorizationRevokedEvent = ^TXSecurityAuthorizationRevokedEvent;
  44. TXSecurityAuthorizationRevokedEvent = record
  45. _type: cint; { event base + XSecurityAuthorizationRevoked }
  46. serial: culong; { # of last request processed by server }
  47. send_event: TBool; { true if this came from a SendEvent request }
  48. display: PDisplay; { Display the event was read from }
  49. auth_id: TXSecurityAuthorization; { revoked authorization id }
  50. end;
  51. function XSecurityQueryExtension (
  52. dpy: PDisplay;
  53. major_version_return,
  54. minor_version_return: Pcint): TStatus; cdecl; external libXext;
  55. function XSecurityAllocXauth: PXauth; cdecl; external libXext;
  56. procedure XSecurityFreeXauth(auth: PXauth); cdecl; external libXext;
  57. function XSecurityGenerateAuthorization(
  58. dpy: PDisplay;
  59. auth_in: PXauth;
  60. valuemask: culong;
  61. attributes: PXSecurityAuthorizationAttributes;
  62. auth_id_return: PXSecurityAuthorization): PXauth; cdecl; external libXext;
  63. function XSecurityRevokeAuthorization(
  64. dpy: PDisplay;
  65. auth_id: TXSecurityAuthorization): TStatus; cdecl; external libXext;
  66. implementation
  67. end.