1ea1d6981Smrg<?xml version="1.0" encoding="UTF-8" ?> 2ea1d6981Smrg<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" 3ea1d6981Smrg "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" 4ea1d6981Smrg[ 5ea1d6981Smrg<!ENTITY % defs SYSTEM "defs.ent"> %defs; 6ea1d6981Smrg]> 7ea1d6981Smrg<!--translated from security.tex, on 2010-06-27 15:29:00, 8ea1d6981Smrgby TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/) 9ea1d6981Smrgxhtml,docbook,html,refcaption --> 10ea1d6981Smrg 11ea1d6981Smrg<book id="security"> 12ea1d6981Smrg 13ea1d6981Smrg<bookinfo> 14ea1d6981Smrg <title>Security Extension Specification</title> 15ea1d6981Smrg <subtitle>X Consortium Standard</subtitle> 16ea1d6981Smrg <authorgroup> 17ea1d6981Smrg <author> 18ea1d6981Smrg <firstname>David</firstname><othername>P.</othername><surname>Wiggins</surname> 19ea1d6981Smrg <affiliation><orgname>X Consortium</orgname></affiliation> 20ea1d6981Smrg </author> 21ea1d6981Smrg </authorgroup> 22ea1d6981Smrg <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo> 23ea1d6981Smrg <releaseinfo>Version 7.1</releaseinfo> 24ea1d6981Smrg <copyright><year>1996</year><holder>X Consortium</holder></copyright> 25ea1d6981Smrg 26ea1d6981Smrg<legalnotice> 27ea1d6981Smrg<para> 28ea1d6981SmrgPermission is hereby granted, free of charge, to any person obtaining a copy 29ea1d6981Smrgof this software and associated documentation files (the “Software”), to deal 30ea1d6981Smrgin the Software without restriction, including without limitation the rights 31ea1d6981Smrgto use, copy, modify, merge, publish, distribute, sublicense, and/or sell 32ea1d6981Smrgcopies of the Software, and to permit persons to whom the Software is 33ea1d6981Smrgfurnished to do so, subject to the following conditions: 34ea1d6981Smrg</para> 35ea1d6981Smrg<para> 36ea1d6981SmrgThe above copyright notice and this permission notice shall be included in 37ea1d6981Smrgall copies or substantial portions of the Software. 38ea1d6981Smrg</para> 39ea1d6981Smrg<para> 40ea1d6981SmrgTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 41ea1d6981SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 42ea1d6981SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 43ea1d6981SmrgX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 44ea1d6981SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 45ea1d6981SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 46ea1d6981Smrg</para> 47ea1d6981Smrg<para> 48ea1d6981SmrgExcept as contained in this notice, the name of the X Consortium shall not be 49ea1d6981Smrgused in advertising or otherwise to promote the sale, use or other dealings 50ea1d6981Smrgin this Software without prior written authorization from the X Consortium. 51ea1d6981Smrg</para> 52ea1d6981Smrg<para>X Window System is a trademark of The OpenGroup.</para> 53ea1d6981Smrg</legalnotice> 54ea1d6981Smrg 55ea1d6981Smrg<pubdate>November 15, 1996</pubdate> 56ea1d6981Smrg 57ea1d6981Smrg</bookinfo> 58ea1d6981Smrg 59ea1d6981Smrg<chapter id='Introduction'> 60ea1d6981Smrg<title>Introduction</title> 61ea1d6981Smrg 62ea1d6981Smrg<para> 63ea1d6981SmrgThe Security extension contains new protocol needed to provide enhanced X 64ea1d6981Smrgserver security. The Security extension should not be exposed to untrusted 65ea1d6981Smrgclients (defined below). 66ea1d6981Smrg</para> 67ea1d6981Smrg 68ea1d6981Smrg</chapter> 69ea1d6981Smrg 70ea1d6981Smrg<chapter id='Requests'> 71ea1d6981Smrg<title>Requests</title> 72ea1d6981Smrg 73ea1d6981Smrg<sect1 id='SecurityQueryVersion'> 74ea1d6981Smrg<title>SecurityQueryVersion</title> 75ea1d6981Smrg<para> 76ea1d6981SmrgThis request returns the major and minor version numbers of this extension. 77ea1d6981Smrg</para> 78ea1d6981Smrg 79ea1d6981Smrg<para>SecurityQueryVersion</para> 80ea1d6981Smrg 81ea1d6981Smrg<informaltable frame='none'> 82ea1d6981Smrg <?dbfo keep-together="always" ?> 83ea1d6981Smrg <tgroup cols='2' align='left' colsep='0' rowsep='0'> 84ea1d6981Smrg <colspec colname='c1' colwidth="1.0*"/> 85ea1d6981Smrg <colspec colname='c2' colwidth="1.5*"/> 86ea1d6981Smrg <tbody> 87ea1d6981Smrg <row> 88ea1d6981Smrg <entry> 89ea1d6981Smrg <para>client-major-version</para> 90ea1d6981Smrg </entry> 91ea1d6981Smrg <entry> 92ea1d6981Smrg <para>CARD16</para> 93ea1d6981Smrg </entry> 94ea1d6981Smrg </row> 95ea1d6981Smrg <row> 96ea1d6981Smrg <entry> 97ea1d6981Smrg <para>client-minor-version</para> 98ea1d6981Smrg </entry> 99ea1d6981Smrg <entry> 100ea1d6981Smrg <para>CARD16</para> 101ea1d6981Smrg </entry> 102ea1d6981Smrg </row> 103ea1d6981Smrg <row> 104ea1d6981Smrg <entry> 105ea1d6981Smrg <para>=></para> 106ea1d6981Smrg </entry> 107ea1d6981Smrg </row> 108ea1d6981Smrg <row> 109ea1d6981Smrg <entry> 110ea1d6981Smrg <para>server-major-version</para> 111ea1d6981Smrg </entry> 112ea1d6981Smrg <entry> 113ea1d6981Smrg <para>CARD16</para> 114ea1d6981Smrg </entry> 115ea1d6981Smrg </row> 116ea1d6981Smrg <row> 117ea1d6981Smrg <entry> 118ea1d6981Smrg <para>server-minor-version</para> 119ea1d6981Smrg </entry> 120ea1d6981Smrg <entry> 121ea1d6981Smrg <para>CARD16</para> 122ea1d6981Smrg </entry> 123ea1d6981Smrg </row> 124ea1d6981Smrg </tbody> 125ea1d6981Smrg </tgroup> 126ea1d6981Smrg</informaltable> 127ea1d6981Smrg 128ea1d6981Smrg<para> 129ea1d6981SmrgThe client-major-version and client-minor-version numbers indicate what 130ea1d6981Smrgversion of the protocol the client wants the server to implement. The 131ea1d6981Smrgserver-major-version and the server-minor-version numbers returned 132ea1d6981Smrgindicate the protocol this extension actually supports. This might not 133ea1d6981Smrgequal the version sent by the client. An implementation can (but need not) 134ea1d6981Smrgsupport more than one version simultaneously. The server-major-version 135ea1d6981Smrgand server-minor-version allow the creation of future revisions of the 136ea1d6981SmrgSecurity protocol that may be necessary. In general, the major version 137ea1d6981Smrgwould increment for incompatible changes, and the minor version would 138ea1d6981Smrgincrement for small, upward-compatible changes. Servers that support 139ea1d6981Smrgthe protocol defined in this document will return a server-major-version 140ea1d6981Smrgof one (1), and a server-minor-version of zero (0). 141ea1d6981Smrg</para> 142ea1d6981Smrg 143ea1d6981Smrg<para> 144ea1d6981SmrgClients using the Security extension must issue a SecurityQueryVersion 145ea1d6981Smrgrequest before any other Security request in order to negotiate a compatible 146ea1d6981Smrgprotocol version; otherwise, the client will get undefined behavior 147ea1d6981Smrg(Security may or may not work). 148ea1d6981Smrg</para> 149ea1d6981Smrg</sect1> 150ea1d6981Smrg 151ea1d6981Smrg<sect1 id='SecurityGenerateAuthorization'> 152ea1d6981Smrg<title>SecurityGenerateAuthorization</title> 153ea1d6981Smrg 154ea1d6981Smrg<para> 155ea1d6981SmrgThis request causes the server to create and return a new authorization with 156ea1d6981Smrgspecific characteristics. Clients can subsequently connect using the new 157ea1d6981Smrgauthorization and will inherit some of the characteristics of the 158ea1d6981Smrgauthorization. 159ea1d6981Smrg</para> 160ea1d6981Smrg 161ea1d6981Smrg<para> 162ea1d6981SmrgSecurityGenerateAuthorization 163ea1d6981Smrg</para> 164ea1d6981Smrg<informaltable frame='none'> 165ea1d6981Smrg <?dbfo keep-together="always" ?> 166ea1d6981Smrg <tgroup cols='2' align='left' colsep='0' rowsep='0'> 167ea1d6981Smrg <colspec colname='c1' colwidth="1.0*"/> 168ea1d6981Smrg <colspec colname='c2' colwidth="1.5*"/> 169ea1d6981Smrg <tbody> 170ea1d6981Smrg <row> 171ea1d6981Smrg <entry> 172ea1d6981Smrg <para>authorization-protocol-name</para> 173ea1d6981Smrg </entry> 174ea1d6981Smrg <entry> 175ea1d6981Smrg <para>STRING8</para> 176ea1d6981Smrg </entry> 177ea1d6981Smrg </row> 178ea1d6981Smrg <row> 179ea1d6981Smrg <entry> 180ea1d6981Smrg <para>authorization-protocol-data</para> 181ea1d6981Smrg </entry> 182ea1d6981Smrg <entry> 183ea1d6981Smrg <para>STRING8</para> 184ea1d6981Smrg </entry> 185ea1d6981Smrg </row> 186ea1d6981Smrg <row> 187ea1d6981Smrg <entry> 188ea1d6981Smrg <para>value-mask</para> 189ea1d6981Smrg </entry> 190ea1d6981Smrg <entry> 191ea1d6981Smrg <para>BITMASK</para> 192ea1d6981Smrg </entry> 193ea1d6981Smrg </row> 194ea1d6981Smrg <row> 195ea1d6981Smrg <entry> 196ea1d6981Smrg <para>value-list</para> 197ea1d6981Smrg </entry> 198ea1d6981Smrg <entry> 199ea1d6981Smrg <para>LISTofVALUE</para> 200ea1d6981Smrg </entry> 201ea1d6981Smrg </row> 202ea1d6981Smrg <row> 203ea1d6981Smrg <entry> 204ea1d6981Smrg <para>=></para> 205ea1d6981Smrg </entry> 206ea1d6981Smrg <entry> 207ea1d6981Smrg </entry> 208ea1d6981Smrg </row> 209ea1d6981Smrg <row> 210ea1d6981Smrg <entry> 211ea1d6981Smrg <para>authorization-id</para> 212ea1d6981Smrg </entry> 213ea1d6981Smrg <entry> 214ea1d6981Smrg <para>AUTHID</para> 215ea1d6981Smrg </entry> 216ea1d6981Smrg </row> 217ea1d6981Smrg <row> 218ea1d6981Smrg <entry> 219ea1d6981Smrg <para>authorization-data-return</para> 220ea1d6981Smrg </entry> 221ea1d6981Smrg <entry> 222ea1d6981Smrg <para>STRING8</para> 223ea1d6981Smrg </entry> 224ea1d6981Smrg </row> 225ea1d6981Smrg </tbody> 226ea1d6981Smrg </tgroup> 227ea1d6981Smrg</informaltable> 228ea1d6981Smrg 229ea1d6981Smrg<para> 230ea1d6981SmrgErrors: <function>AuthorizationProtocol</function>, <function>Value</function>, <function>Alloc</function> 231ea1d6981Smrg</para> 232ea1d6981Smrg 233ea1d6981Smrg<para> 234ea1d6981Smrgauthorization-protocol-name is the name of the authorization method for 235ea1d6981Smrgwhich the server should generate a new authorization that subsequent 236ea1d6981Smrgclients can use to connect to the server. If the authorization-protocol-name 237ea1d6981Smrgis not one that the server supports, or if authorization-protocol-data 238ea1d6981Smrgdoes not make sense for the given authorization-protocol-name, an 239ea1d6981SmrgAuthorizationProtocol error results. 240ea1d6981Smrg</para> 241ea1d6981Smrg 242ea1d6981Smrg<para> 243ea1d6981Smrgauthorization-protocol-data is authorization-method specific data that can 244ea1d6981Smrgbe used in some way to generate the authorization. 245ea1d6981Smrg</para> 246ea1d6981Smrg 247ea1d6981Smrg<note><para> 248ea1d6981SmrgIn this version of the extension, the only authorization method 249ea1d6981Smrgrequired to be supported is "MIT-MAGIC-COOKIE-1" with any amount 250ea1d6981Smrgof authorization-protocol-data (including none). The server may use the 251ea1d6981Smrgauthorization-protocol-data as an additional source of randomness used 252ea1d6981Smrgto generate the authorization. Other authorization methods can supply 253ea1d6981Smrgtheir own interpretation of authorization-protocol-data. 254ea1d6981Smrg</para></note> 255ea1d6981Smrg 256ea1d6981Smrg<para> 257ea1d6981SmrgThe value-mask and value-list specify attributes of the authorization 258ea1d6981Smrgthat are to be explicitly initialized. The possible values are: 259ea1d6981Smrg</para> 260ea1d6981Smrg 261ea1d6981Smrg<informaltable frame='topbot'> 262ea1d6981Smrg <?dbfo keep-together="always" ?> 263ea1d6981Smrg <tgroup cols='3' align='left' colsep='0' rowsep='0'> 264ea1d6981Smrg <colspec colname='c1' colwidth="1.0*"/> 265ea1d6981Smrg <colspec colname='c2' colwidth="1.0*"/> 266ea1d6981Smrg <colspec colname='c3' colwidth="1.0*"/> 267ea1d6981Smrg <thead> 268ea1d6981Smrg <row rowsep='1'> 269ea1d6981Smrg <entry>Attribute</entry> 270ea1d6981Smrg <entry>Type</entry> 271ea1d6981Smrg <entry>Default</entry> 272ea1d6981Smrg </row> 273ea1d6981Smrg </thead> 274ea1d6981Smrg <tbody> 275ea1d6981Smrg <row> 276ea1d6981Smrg <entry> 277ea1d6981Smrg <para>timeout</para> 278ea1d6981Smrg </entry> 279ea1d6981Smrg <entry> 280ea1d6981Smrg <para>CARD32</para> 281ea1d6981Smrg </entry> 282ea1d6981Smrg <entry> 283ea1d6981Smrg <para>60</para> 284ea1d6981Smrg </entry> 285ea1d6981Smrg </row> 286ea1d6981Smrg <row> 287ea1d6981Smrg <entry> 288ea1d6981Smrg <para>group</para> 289ea1d6981Smrg </entry> 290ea1d6981Smrg <entry> 291ea1d6981Smrg <para>XID or None</para> 292ea1d6981Smrg </entry> 293ea1d6981Smrg <entry> 294ea1d6981Smrg <para>None</para> 295ea1d6981Smrg </entry> 296ea1d6981Smrg </row> 297ea1d6981Smrg <row> 298ea1d6981Smrg <entry> 299ea1d6981Smrg <para>trust-level</para> 300ea1d6981Smrg </entry> 301ea1d6981Smrg <entry> 302ea1d6981Smrg <para>{SecurityClientTrusted,</para> 303ea1d6981Smrg </entry> 304ea1d6981Smrg </row> 305ea1d6981Smrg <row> 306ea1d6981Smrg <entry> 307ea1d6981Smrg <para></para> 308ea1d6981Smrg </entry> 309ea1d6981Smrg <entry> 310ea1d6981Smrg <para>SecurityClientUntrusted}</para> 311ea1d6981Smrg </entry> 312ea1d6981Smrg <entry> 313ea1d6981Smrg <para>SecurityClientUntrusted</para> 314ea1d6981Smrg </entry> 315ea1d6981Smrg </row> 316ea1d6981Smrg <row> 317ea1d6981Smrg <entry> 318ea1d6981Smrg <para>event-mask</para> 319ea1d6981Smrg </entry> 320ea1d6981Smrg <entry> 321ea1d6981Smrg <para>SecurityAuthorizationRevoked,</para> 322ea1d6981Smrg </entry> 323ea1d6981Smrg </row> 324ea1d6981Smrg <row rowsep="1"> 325ea1d6981Smrg <entry> 326ea1d6981Smrg <para></para> 327ea1d6981Smrg </entry> 328ea1d6981Smrg <entry> 329ea1d6981Smrg <para>or None</para> 330ea1d6981Smrg </entry> 331ea1d6981Smrg <entry> 332ea1d6981Smrg <para>None</para> 333ea1d6981Smrg </entry> 334ea1d6981Smrg </row> 335ea1d6981Smrg </tbody> 336ea1d6981Smrg </tgroup> 337ea1d6981Smrg</informaltable> 338ea1d6981Smrg 339ea1d6981Smrg<para> 340ea1d6981Smrgtimeout is the timeout period in seconds for this authorization. A 341ea1d6981Smrgtimeout value of zero means this authorization will never expire. For 342ea1d6981Smrgnon-zero timeout values, when timeout seconds have elapsed since the 343ea1d6981Smrglast time that the authorization entered the state of having no 344ea1d6981Smrgconnections authorized by it, and if no new connections used the 345ea1d6981Smrgauthorization during that time, the authorization is automatically purged. 346ea1d6981Smrg(Note that when an authorization is created, it enters the state of having no 347ea1d6981Smrgconnections authorized by it.) Subsequent connection attempts using that 348ea1d6981Smrgauthorization will fail. This is to facilitate "fire and forget" launching of 349ea1d6981Smrgapplications. 350ea1d6981Smrg</para> 351ea1d6981Smrg 352ea1d6981Smrg<para> 353ea1d6981Smrggroup is an application group ID as defined by the Application Group 354ea1d6981Smrgextension, or None. Any other values will cause a Value error. When a 355ea1d6981Smrggroup is destroyed, all authorizations specifying that group are revoked 356ea1d6981Smrgas described under the SecurityRevokeAuthorization request. The Application 357ea1d6981SmrgGroup extension attaches additional semantics to the group. 358ea1d6981Smrg</para> 359ea1d6981Smrg 360ea1d6981Smrg<para> 361ea1d6981Smrgtrust-level tells whether clients using the authorization are trusted or 362ea1d6981Smrguntrusted. If trust-level is not one of the constants SecurityClientTrusted 363ea1d6981Smrgor SecurityClientUntrusted, a Value error results. 364ea1d6981Smrg</para> 365ea1d6981Smrg 366ea1d6981Smrg<para> 367ea1d6981Smrgevent-mask defines which events the client is interested in for this 368ea1d6981Smrgauthorization. When the authorization expires or is revoked if event-mask 369ea1d6981Smrgcontains SecurityAuthorizationRevoked a SecurityAuthorizationRevoked event 370ea1d6981Smrgis reported to the client. 371ea1d6981Smrg</para> 372ea1d6981Smrg 373ea1d6981Smrg<para> 374ea1d6981SmrgThe SecurityAuthorizationRevoked event contains the following field: 375ea1d6981Smrg</para> 376ea1d6981Smrg 377ea1d6981Smrg<informaltable frame='topbot'> 378ea1d6981Smrg <?dbfo keep-together="always" ?> 379ea1d6981Smrg <tgroup cols='2' align='left' colsep='0' rowsep='0'> 380ea1d6981Smrg <colspec colname='c1' colwidth="1.0*"/> 381ea1d6981Smrg <colspec colname='c2' colwidth="1.5*"/> 382ea1d6981Smrg <thead> 383ea1d6981Smrg <row rowsep="1"> 384ea1d6981Smrg <entry>Field</entry> 385ea1d6981Smrg <entry>Type</entry> 386ea1d6981Smrg </row> 387ea1d6981Smrg </thead> 388ea1d6981Smrg <tbody> 389ea1d6981Smrg <row> 390ea1d6981Smrg <entry> 391ea1d6981Smrg <para>authorization-id</para> 392ea1d6981Smrg </entry> 393ea1d6981Smrg <entry> 394ea1d6981Smrg <para>AUTHID</para> 395ea1d6981Smrg </entry> 396ea1d6981Smrg </row> 397ea1d6981Smrg </tbody> 398ea1d6981Smrg </tgroup> 399ea1d6981Smrg</informaltable> 400ea1d6981Smrg 401ea1d6981Smrg<para> 402ea1d6981Smrgwhere authorization-id is the identification of the authorization that was 403ea1d6981Smrgrevoked. 404ea1d6981Smrg</para> 405ea1d6981Smrg<para> 406ea1d6981SmrgIf an invalid value-mask is specified, a Value error occurs. 407ea1d6981Smrg</para> 408ea1d6981Smrg 409ea1d6981Smrg<para> 410ea1d6981SmrgThe returned authorization-id is a non-zero value that uniquely identifies 411ea1d6981Smrgthis authorization for use in other requests. The value space for type 412ea1d6981SmrgAUTHID is not required to be disjoint from values spaces of other core 413ea1d6981SmrgX types, e.g. resource ids, atoms, visual ids, and keysyms. Thus, a given 414ea1d6981Smrgnumeric value might be both a valid AUTHID and a valid atom, for example. 415ea1d6981Smrg</para> 416ea1d6981Smrg 417ea1d6981Smrg<para> 418ea1d6981Smrgauthorization-data-return is the data that a client should use in some 419ea1d6981Smrgauthorization-method-specific way to make a connection with this 420ea1d6981Smrgauthorization. For "MIT-MAGIC-COOKIE-1," authorization-data-return should 421ea1d6981Smrgbe sent as the authorization-protocol-data in the connection setup message. 422ea1d6981SmrgIt is not required that other authorization methods use 423ea1d6981Smrgauthorization-data-return this way. 424ea1d6981Smrg</para> 425ea1d6981Smrg 426ea1d6981Smrg</sect1> 427ea1d6981Smrg 428ea1d6981Smrg<sect1 id='SecurityRevokeAuthorization'> 429ea1d6981Smrg<title>SecurityRevokeAuthorization</title> 430ea1d6981Smrg 431ea1d6981Smrg<para> 432ea1d6981SmrgThis request deletes an authorization created by SecurityGenerateAuthorization. 433ea1d6981Smrg</para> 434ea1d6981Smrg 435ea1d6981Smrg<para> 436ea1d6981SmrgSecurityRevokeAuthorization 437ea1d6981Smrg</para> 438ea1d6981Smrg 439ea1d6981Smrg<informaltable frame='none'> 440ea1d6981Smrg <?dbfo keep-together="always" ?> 441ea1d6981Smrg <tgroup cols='2' align='left' colsep='0' rowsep='0'> 442ea1d6981Smrg <colspec colname='c1' colwidth="1.0*"/> 443ea1d6981Smrg <colspec colname='c2' colwidth="1.5*"/> 444ea1d6981Smrg <tbody> 445ea1d6981Smrg <row> 446ea1d6981Smrg <entry> 447ea1d6981Smrg <para><emphasis remap='I'>authorization-id</emphasis></para> 448ea1d6981Smrg </entry> 449ea1d6981Smrg <entry> 450ea1d6981Smrg <para>AUTHID</para> 451ea1d6981Smrg </entry> 452ea1d6981Smrg </row> 453ea1d6981Smrg </tbody> 454ea1d6981Smrg </tgroup> 455ea1d6981Smrg</informaltable> 456ea1d6981Smrg 457ea1d6981Smrg<para> 458ea1d6981SmrgErrors: <function>Authorization</function> 459ea1d6981Smrg</para> 460ea1d6981Smrg 461ea1d6981Smrg<para> 462ea1d6981SmrgIf authorization-id does not name a valid authorization, an Authorization 463ea1d6981Smrgerror occurs. Otherwise, this request kills all clients currently connected 464ea1d6981Smrgusing the authorization specified by authorization-id. The authorization is 465ea1d6981Smrgdeleted from the server's database, so future attempts by clients to connect 466ea1d6981Smrgwith this authorization will fail. 467ea1d6981Smrg</para> 468ea1d6981Smrg 469ea1d6981Smrg</sect1> 470ea1d6981Smrg</chapter> 471ea1d6981Smrg 472ea1d6981Smrg<chapter id='Changes_to_Core_Requests'> 473ea1d6981Smrg<title>Changes to Core Requests</title> 474ea1d6981Smrg 475ea1d6981Smrg<para> 476ea1d6981SmrgA server supporting this extension modifies the handling of some core 477ea1d6981Smrgrequests in the following ways. 478ea1d6981Smrg</para> 479ea1d6981Smrg<sect1 id='Resource_ID_Usage'> 480ea1d6981Smrg<title>Resource ID Usage</title> 481ea1d6981Smrg 482ea1d6981Smrg<para> 483ea1d6981SmrgIf an untrusted client makes a request that specifies a resource ID that is 484ea1d6981Smrgnot owned by another untrusted client, a protocol error is sent to the 485ea1d6981Smrgrequesting client indicating that the specified resource does not exist. 486ea1d6981SmrgThe following exceptions apply. An untrusted client can: 487ea1d6981Smrg</para> 488ea1d6981Smrg 489ea1d6981Smrg<orderedlist> 490ea1d6981Smrg <listitem> 491ea1d6981Smrg <para> 492ea1d6981Smrguse the QueryTree, GetGeometry, and TranslateCoordinates requests 493ea1d6981Smrgwithout restriction. 494ea1d6981Smrg </para> 495ea1d6981Smrg </listitem> 496ea1d6981Smrg <listitem> 497ea1d6981Smrg <para> 498ea1d6981Smrguse colormap IDs that are returned in the default-colormap field of its 499ea1d6981Smrgconnection setup information in any colormap requests. 500ea1d6981Smrg </para> 501ea1d6981Smrg </listitem> 502ea1d6981Smrg <listitem> 503ea1d6981Smrg <para>specify a root window as:</para> 504ea1d6981Smrg <orderedlist> 505ea1d6981Smrg <listitem> 506ea1d6981Smrg <para> 507ea1d6981Smrgthe drawable field of CreatePixmap, CreateGC, and QueryBestSize. 508ea1d6981Smrg </para> 509ea1d6981Smrg </listitem> 510ea1d6981Smrg <listitem> 511ea1d6981Smrg <para>the parent field of CreateWindow.</para> 512ea1d6981Smrg </listitem> 513ea1d6981Smrg <listitem> 514ea1d6981Smrg <para> 515ea1d6981Smrgthe window field of CreateColormap, ListProperties, and GetWindowAttributes. 516ea1d6981Smrg </para> 517ea1d6981Smrg </listitem> 518ea1d6981Smrg <listitem> 519ea1d6981Smrg <para>the grab-window or confine-to fields of GrabPointer. 520ea1d6981Smrg </para> 521ea1d6981Smrg </listitem> 522ea1d6981Smrg <listitem> 523ea1d6981Smrg <para>the grab-window field of UngrabButton.</para> 524ea1d6981Smrg </listitem> 525ea1d6981Smrg <listitem> 526ea1d6981Smrg <para> 527ea1d6981Smrgthe destination of SendEvent, but only if all of the following are true. 528ea1d6981Smrg(These conditions cover all the events that the ICCCM specifies with 529ea1d6981Smrga root window destination.) 530ea1d6981Smrg </para> 531ea1d6981Smrg <orderedlist> 532ea1d6981Smrg <listitem> 533d63b911fSmrg <para>The propagate field of SendEvent is False.</para> 534ea1d6981Smrg </listitem> 535ea1d6981Smrg <listitem> 536ea1d6981Smrg <para> 537ea1d6981SmrgThe event-mask field of SendEvent is ColormapChange, 538ea1d6981SmrgStructureNotify, or the logical OR of SubstructureRedirect with 539ea1d6981SmrgSubstructureNotify. 540ea1d6981Smrg </para> 541ea1d6981Smrg </listitem> 542ea1d6981Smrg <listitem> 543ea1d6981Smrg <para> 544ea1d6981SmrgThe event type being sent is UnmapNotify, ConfigureRequest, or 545ea1d6981SmrgClientMessage. 546ea1d6981Smrg </para> 547ea1d6981Smrg </listitem> 548ea1d6981Smrg </orderedlist> 549ea1d6981Smrg </listitem> 550ea1d6981Smrg <listitem> 551ea1d6981Smrg <para> 552ea1d6981Smrgthe window field of ChangeWindowAttributes, but only if the value-mask 553ea1d6981Smrgcontains only event-mask and the corresponding value is StructureNotify, 554ea1d6981SmrgPropertyChange, or the logical OR of both. 555ea1d6981Smrg </para> 556ea1d6981Smrg </listitem> 557ea1d6981Smrg </orderedlist> 558ea1d6981Smrg </listitem> 559ea1d6981Smrg</orderedlist> 560ea1d6981Smrg 561ea1d6981Smrg<note> 562ea1d6981Smrg<para> 563ea1d6981SmrgISSUE: are root window exceptions needed for these? WarpPointer, ReparentWindow 564ea1d6981Smrg(parent), CirculateWindow, QueryPointer (emacs does this), GetMotionEvents. 565ea1d6981Smrg</para> 566ea1d6981Smrg</note> 567ea1d6981Smrg 568ea1d6981Smrg</sect1> 569ea1d6981Smrg<sect1 id='Extension_Security'> 570ea1d6981Smrg<title>Extension Security</title> 571ea1d6981Smrg 572ea1d6981Smrg<para> 573ea1d6981SmrgThis extension introduces the notion of secure and insecure extensions. A 574ea1d6981Smrgsecure extension is believed to be safe to use by untrusted clients; that 575ea1d6981Smrgis, there are no significant security concerns known that an untrusted 576ea1d6981Smrgclient could use to destroy, modify, or steal data of trusted clients. This 577ea1d6981Smrgbelief may be founded on a careful analysis of the extension protocol, 578ea1d6981Smrgits implementation, and measures taken to "harden" the extension to close 579ea1d6981Smrgsecurity weaknesses. All extensions not considered secure are called 580ea1d6981Smrginsecure. The implementation details of how an extension is identified as 581ea1d6981Smrgsecure or insecure are beyond the scope of this specification. 582ea1d6981Smrg</para> 583ea1d6981Smrg 584ea1d6981Smrg<para> 585ea1d6981Smrg<function>ListExtensions</function> will only return names of secure 586ea1d6981Smrgextensions to untrusted clients. 587ea1d6981Smrg</para> 588ea1d6981Smrg 589ea1d6981Smrg<para> 590ea1d6981SmrgIf an untrusted client uses <function>QueryExtension</function> on an 591ea1d6981Smrginsecure extension that the server supports, the reply will have the 592ea1d6981Smrgpresent field set to False and the major-opcode field set to zero to 593ea1d6981Smrgindicate that the extension is not supported. 594ea1d6981Smrg</para> 595ea1d6981Smrg 596ea1d6981Smrg<para> 597ea1d6981SmrgIf an untrusted client successfully guesses the major opcode of an 598ea1d6981Smrginsecure extension, attempts by it to execute requests with that major 599ea1d6981Smrgopcode will fail with a Request error. 600ea1d6981Smrg</para> 601ea1d6981Smrg 602ea1d6981Smrg</sect1> 603ea1d6981Smrg 604ea1d6981Smrg<sect1 id='Keyboard_Security'> 605ea1d6981Smrg<title>Keyboard Security</title> 606ea1d6981Smrg 607ea1d6981Smrg 608ea1d6981Smrg<para> 609ea1d6981SmrgThe protocol interpretation changes in this section are intended to prevent 610ea1d6981Smrguntrusted applications from stealing keyboard input that was meant for 611ea1d6981Smrgtrusted clients and to prevent them from interfering with the use of the 612ea1d6981Smrgkeyboard. 613ea1d6981Smrg</para> 614ea1d6981Smrg 615ea1d6981Smrg<para> 616ea1d6981SmrgThe behavior of some keyboard-related requests and events is modified when 617ea1d6981Smrgthe client is untrusted depending on certain server state at the time of 618ea1d6981Smrgrequest execution or event generation. Specifically, if a hypothetical 619ea1d6981Smrgkeyboard event were generated given the current input focus, pointer 620ea1d6981Smrgposition, keyboard grab state, and window event selections, and if that 621ea1d6981Smrgkeyboard event would not be delivered to any untrusted client, the 622ea1d6981Smrgfollowing changes apply: 623ea1d6981Smrg</para> 624ea1d6981Smrg 625ea1d6981Smrg<orderedlist> 626ea1d6981Smrg <listitem> 627ea1d6981Smrg <para> 628ea1d6981SmrgThe bit vector representing the up/down state of the keys returned by 629ea1d6981Smrg<function>QueryKeymap</function> and 630ea1d6981Smrg<function>KeymapNotify</function> is all zeroes. 631ea1d6981Smrg </para> 632ea1d6981Smrg </listitem> 633ea1d6981Smrg <listitem> 634ea1d6981Smrg <para>GrabKeyboard returns a status of AlreadyGrabbed.</para> 635ea1d6981Smrg </listitem> 636ea1d6981Smrg <listitem> 637ea1d6981Smrg <para> 638ea1d6981Smrg<function>SetInputFocus</function> does nothing. Note that this means the 639ea1d6981SmrgGlobally Active 640ea1d6981SmrgInput and WM_TAKE_FOCUS mechanisms specified in the ICCCM will 641ea1d6981Smrgnot work with untrusted clients. 642ea1d6981Smrg </para> 643ea1d6981Smrg </listitem> 644ea1d6981Smrg <listitem> 645ea1d6981Smrg <para> 646ea1d6981SmrgPassive grabs established by GrabKey that would otherwise have activated 647ea1d6981Smrgdo not activate. 648ea1d6981Smrg </para> 649ea1d6981Smrg </listitem> 650ea1d6981Smrg</orderedlist> 651ea1d6981Smrg 652ea1d6981Smrg<para> 653ea1d6981SmrgIf an untrusted client attempts to use any of the following requests, the 654ea1d6981Smrgonly effect is that the client receives an Access error: SetModifierMapping, 655ea1d6981SmrgChangeKeyboardMapping, ChangeKeyboardControl. 656ea1d6981Smrg</para> 657ea1d6981Smrg 658ea1d6981Smrg<para> 659ea1d6981SmrgIf an InputOnly window owned by an untrusted client has a parent owned by a 660ea1d6981Smrgtrusted client, all attempts to map the window will be ignored. This includes 661ea1d6981Smrgmapping attempts resulting from MapWindow, MapSubwindows, ReparentWindow, 662ea1d6981Smrgand save-set processing. 663ea1d6981Smrg</para> 664ea1d6981Smrg<para> 665ea1d6981SmrgHowever, if the parent of an InputOnly window owned by an untrusted client 666ea1d6981Smrgis the root window, attempts to map that window will be performed as 667ea1d6981Smrgexpected. This is in line with the root window exceptions above. 668ea1d6981Smrg</para> 669ea1d6981Smrg</sect1> 670ea1d6981Smrg 671ea1d6981Smrg<sect1 id='Image_Security'> 672ea1d6981Smrg<title>Image Security</title> 673ea1d6981Smrg 674ea1d6981Smrg<para> 675ea1d6981SmrgIt should be impossible for an untrusted client to retrieve the image 676ea1d6981Smrgcontents of a trusted window unless a trusted client takes action to allow 677ea1d6981Smrgthis. We introduce the following defenses in support of this requirement. 678ea1d6981Smrg</para> 679ea1d6981Smrg 680ea1d6981Smrg<para> 681ea1d6981SmrgThe restrictions on resource ID usage listed above prevent untrusted clients 682ea1d6981Smrgfrom using GetImage directly on windows not belonging to trusted clients. 683ea1d6981Smrg</para> 684ea1d6981Smrg 685ea1d6981Smrg<para> 686ea1d6981SmrgIf an untrusted client tries to set the background-pixmap attribute of an 687ea1d6981Smrguntrusted window to None, the server will instead use a server-dependent 688ea1d6981Smrgbackground which must be different than None. 689ea1d6981Smrg</para> 690ea1d6981Smrg 691ea1d6981Smrg<para> 692ea1d6981SmrgThe X protocol description of <function>GetImage</function> states that the 693ea1d6981Smrgreturned contents of regions of a window obscured by noninferior windows are 694ea1d6981Smrgundefined if the window has no backing store. Some implementations return the 695ea1d6981Smrgcontents of the obscuring windows in these regions. When an untrusted client 696ea1d6981Smrguses <function>GetImage</function>, this behavior is forbidden; the server must 697ea1d6981Smrgfill the obscured regions in the returned image with a server-dependent pattern. 698ea1d6981Smrg</para> 699ea1d6981Smrg 700ea1d6981Smrg<para> 701ea1d6981SmrgIf an untrusted window has trusted inferiors, their contents are vulnerable 702ea1d6981Smrgto theft via <function>GetImage</function> on the untrusted parent, as well 703ea1d6981Smrgas being vulnerable to destruction via drawing with subwindow-mode 704ea1d6981SmrgIncludeInferiors on the untrusted parent. An untrusted window having trusted 705ea1d6981Smrginferiors can only occur at the request of a trusted client. It is expected 706ea1d6981Smrgto be an unusual configuration. 707ea1d6981Smrg</para> 708ea1d6981Smrg 709ea1d6981Smrg</sect1> 710ea1d6981Smrg 711ea1d6981Smrg<sect1 id='Property_Security'> 712ea1d6981Smrg<title>Property Security</title> 713ea1d6981Smrg 714ea1d6981Smrg<para> 715ea1d6981SmrgUnlike the other security provisions described in this document, security for 716ea1d6981Smrgproperty access is not amenable to a fixed policy because properties are 717ea1d6981Smrgused for inter-client communication in diverse ways and may contain data of 718ea1d6981Smrgvarying degrees of sensitivity. Therefore, we only list the possible 719ea1d6981Smrgrestrictions the server may decide to impose on use of properties on trusted 720ea1d6981Smrgwindows by untrusted clients. How the server chooses which restrictions from 721ea1d6981Smrgthis list to apply to a particular property access is implementation dependent 722ea1d6981Smrg <footnote><para> 723ea1d6981SmrgIn the X Consortium server implementation, property access is controlled by 724ea1d6981Smrga configuration file; see the -sp option in the Xserver(1) manual page. 725ea1d6981Smrg </para></footnote>. 726ea1d6981Smrg</para> 727ea1d6981Smrg 728ea1d6981Smrg<para>The X Protocol property requests are 729ea1d6981Smrg<function>ChangeProperty</function>, 730ea1d6981Smrg<function>GetProperty</function>, 731ea1d6981Smrg<function>DeleteProperty</function>, 732ea1d6981Smrg<function>RotateProperties</function>, and 733ea1d6981Smrg<function>ListProperties</function>. For these requests, the server can 734ea1d6981Smrgallow the request to execute normally (as if it had been issued by a 735ea1d6981Smrgtrusted client), ignore the request completely (as if it were a NoOperation), 736ea1d6981Smrgor ignore the request except to send an Atom error to the client. Ignoring 737ea1d6981Smrga <function>ListProperties</function> request means replying that 738ea1d6981Smrgthe window has no properties. <function>ListProperties</function> may also 739ea1d6981Smrgreply with a subset of the existing properties if the server is doing 740ea1d6981Smrgproperty hiding; see below. An ignored <function>GetProperty</function> 741ea1d6981Smrgrequest may reply that the property does not exist, or that it exists but 742ea1d6981Smrgcontains no data. 743ea1d6981Smrg</para> 744ea1d6981Smrg 745ea1d6981Smrg<para> 746ea1d6981SmrgThe server may decide to hide certain properties on certain windows from 747ea1d6981Smrguntrusted clients 748ea1d6981Smrg <footnote><para> 749ea1d6981SmrgThe X Consortium server implementation does not currently provide a way to 750ea1d6981Smrghide properties. 751ea1d6981Smrg </para></footnote>. 752ea1d6981SmrgIf a property is to be hidden, it must be done consistently to avoid 753ea1d6981Smrgconfusing clients. This means that for untrusted clients: 754ea1d6981Smrg</para> 755ea1d6981Smrg 756ea1d6981Smrg<itemizedlist> 757ea1d6981Smrg <listitem> 758ea1d6981Smrg <para> 759ea1d6981SmrgThat property should not be returned by 760ea1d6981Smrg<function>ListProperties</function>. 761ea1d6981Smrg </para> 762ea1d6981Smrg </listitem> 763ea1d6981Smrg <listitem> 764ea1d6981Smrg <para> 765ea1d6981Smrg<function>PropertyNotify</function> events should not be sent for that 766ea1d6981Smrgproperty.</para> 767ea1d6981Smrg </listitem> 768ea1d6981Smrg <listitem> 769ea1d6981Smrg <para> 770ea1d6981Smrg<function>GetProperty</function> on that property should reply that the 771ea1d6981Smrgproperty does not exist (the return type is None, the format and 772ea1d6981Smrgbytes-after are zero, and the value is empty). 773ea1d6981Smrg </para> 774ea1d6981Smrg </listitem> 775ea1d6981Smrg</itemizedlist> 776ea1d6981Smrg 777ea1d6981Smrg<para> 778ea1d6981SmrgFor a property that the server is protecting but not hiding, consistency 779ea1d6981Smrgmust also be maintained: 780ea1d6981Smrg</para> 781ea1d6981Smrg 782ea1d6981Smrg<itemizedlist> 783ea1d6981Smrg <listitem> 784ea1d6981Smrg <para> 785ea1d6981SmrgThat property should be returned by <function>ListProperties</function>. 786ea1d6981Smrg </para> 787ea1d6981Smrg </listitem> 788ea1d6981Smrg <listitem> 789ea1d6981Smrg <para> 790ea1d6981Smrg<function>PropertyNotify</function> events should be sent for that property. 791ea1d6981Smrg </para> 792ea1d6981Smrg </listitem> 793ea1d6981Smrg <listitem> 794ea1d6981Smrg <para> 795ea1d6981Smrg<function>GetProperty</function> on that property should reply that the 796ea1d6981Smrgproperty exists (if it really does) but the value is empty 797ea1d6981Smrg(return type and format are their real values, and the "length of value" 798ea1d6981Smrgfield in the reply is zero). 799ea1d6981Smrg </para> 800ea1d6981Smrg </listitem> 801ea1d6981Smrg</itemizedlist> 802ea1d6981Smrg 803ea1d6981Smrg</sect1> 804ea1d6981Smrg 805ea1d6981Smrg<sect1 id='Miscellaneous_Security'> 806ea1d6981Smrg<title>Miscellaneous Security</title> 807ea1d6981Smrg 808ea1d6981Smrg<para> 809ea1d6981SmrgIf an untrusted client attempts to use 810ea1d6981Smrg<function>ChangeHosts</function>, 811ea1d6981Smrg<function>ListHosts</function>, or 812ea1d6981Smrg<function>SetAccessControl</function>, 813ea1d6981Smrgthe only effect is that the client receives an Access error. 814ea1d6981Smrg</para> 815ea1d6981Smrg 816ea1d6981Smrg<para> 817ea1d6981SmrgIf an untrusted client attempts to use <function>ConvertSelection</function> 818ea1d6981Smrgon a selection with a trusted selection owner window, the server generates 819ea1d6981Smrga SelectionNotify event to the requestor with property None. 820ea1d6981Smrg</para> 821ea1d6981Smrg</sect1> 822ea1d6981Smrg</chapter> 823ea1d6981Smrg 824ea1d6981Smrg<chapter id='New_Authorization_Method'> 825ea1d6981Smrg<title>New Authorization Method</title> 826ea1d6981Smrg 827ea1d6981Smrg<para> 828ea1d6981SmrgThis extension includes a new authorization method named 829ea1d6981Smrg"XC-QUERY-SECURITY-1". Its purpose is to allow an external agent such as 830ea1d6981Smrgthe X firewall proxy to probe an X server to determine whether that server 831ea1d6981Smrgmeets certain security criteria without requiring the agent to have its 832ea1d6981Smrgown authorization for that server. The agent may use the returned information 833ea1d6981Smrgto make a decision. For example, the X firewall proxy may choose not to 834ea1d6981Smrgforward client connections to servers that do not meet the criteria. 835ea1d6981Smrg</para> 836ea1d6981Smrg 837ea1d6981Smrg<para> 838ea1d6981SmrgTo use this authorization method, the client (or proxy) sends 839ea1d6981Smrg"XC-QUERY-SECURITY-1" as the authorization-protocol-name in the initial 840ea1d6981Smrgconnection setup message. The authorization-protocol-data may be empty or 841d63b911fSmrgmay contain additional security criteria described below. If the success 842ea1d6981Smrgfield of the server's reply is Authenticate, the server supports the 843ea1d6981Smrgsecurity extension, and the server meets all specified additional security 844ea1d6981Smrgcriteria. In this case, the client should resend the initial connection 845ea1d6981Smrgsetup message substituting the authorization protocol name and data 846ea1d6981Smrgthat should be used to authorize the connection. If the success field of the 847ea1d6981Smrgserver's reply is anything other than Authenticate, either the server does not 848ea1d6981Smrgsupport the security extension, does not meet (or cannot determine if it 849ea1d6981Smrgmeets) all of the additional security criteria, or chooses for internal reasons 850ea1d6981Smrgnot to answer with Authenticate. In this case, the client should close the 851ea1d6981Smrgconnection. 852ea1d6981Smrg</para> 853ea1d6981Smrg 854ea1d6981Smrg<para> 855ea1d6981SmrgIf the authorization-protocol-data sent with "XC-QUERY-SECURITY-1" is not 856ea1d6981Smrgempty, it specifies additional security criteria for the server to check, as 857ea1d6981Smrgfollows. 858ea1d6981Smrg</para> 859ea1d6981Smrg 860ea1d6981Smrg<para> 861ea1d6981Smrg<function>authorization-protocol-data</function> 862ea1d6981Smrg</para> 863ea1d6981Smrg 864ea1d6981Smrg<informaltable frame='none'> 865ea1d6981Smrg <?dbfo keep-together="always" ?> 866ea1d6981Smrg <tgroup cols='2' align='left' colsep='0' rowsep='0'> 867ea1d6981Smrg <colspec colname='c1' colwidth="1.0*"/> 868ea1d6981Smrg <colspec colname='c2' colwidth="1.5*"/> 869ea1d6981Smrg <tbody> 870ea1d6981Smrg <row> 871ea1d6981Smrg <entry> 872ea1d6981Smrg <para>policy-mask</para> 873ea1d6981Smrg </entry> 874ea1d6981Smrg <entry> 875ea1d6981Smrg <para>BITMASK</para> 876ea1d6981Smrg </entry> 877ea1d6981Smrg </row> 878ea1d6981Smrg <row> 879ea1d6981Smrg <entry> 880ea1d6981Smrg <para>policies</para> 881ea1d6981Smrg </entry> 882ea1d6981Smrg <entry> 883ea1d6981Smrg <para>LISTofSECURITYPOLICY</para> 884ea1d6981Smrg </entry> 885ea1d6981Smrg </row> 886ea1d6981Smrg </tbody> 887ea1d6981Smrg </tgroup> 888ea1d6981Smrg</informaltable> 889ea1d6981Smrg 890ea1d6981Smrg<para> 891ea1d6981SmrgThe policy-mask field is any logical-OR combination of the constants 892ea1d6981SmrgExtensions and SitePolicies. For each bit set in policy-mask, there is a 893ea1d6981SmrgSECURITYPOLICY element in policies. The nth element in policies corresponds 894ea1d6981Smrgto the nth 1-bit in policy-mask, counting upward from bit 0. 895ea1d6981Smrg</para> 896ea1d6981Smrg 897ea1d6981Smrg<para><function>SECURITYPOLICY</function></para> 898ea1d6981Smrg 899ea1d6981Smrg<informaltable frame='none'> 900ea1d6981Smrg <?dbfo keep-together="always" ?> 901ea1d6981Smrg <tgroup cols='2' align='left' colsep='0' rowsep='0'> 902ea1d6981Smrg <colspec colname='c1' colwidth="1.0*"/> 903ea1d6981Smrg <colspec colname='c2' colwidth="1.5*"/> 904ea1d6981Smrg <tbody> 905ea1d6981Smrg <row> 906ea1d6981Smrg <entry> 907ea1d6981Smrg <para>policy-type</para> 908ea1d6981Smrg </entry> 909ea1d6981Smrg <entry> 910ea1d6981Smrg <para>{Disallow, Permit}</para> 911ea1d6981Smrg </entry> 912ea1d6981Smrg </row> 913ea1d6981Smrg <row> 914ea1d6981Smrg <entry> 915ea1d6981Smrg <para>names</para> 916ea1d6981Smrg </entry> 917ea1d6981Smrg <entry> 918ea1d6981Smrg <para>LISTofSTR</para> 919ea1d6981Smrg </entry> 920ea1d6981Smrg </row> 921ea1d6981Smrg </tbody> 922ea1d6981Smrg </tgroup> 923ea1d6981Smrg</informaltable> 924ea1d6981Smrg 925ea1d6981Smrg<para> 926ea1d6981SmrgFor a SECURITYPOLICY corresponding to policy-mask Extensions, if 927ea1d6981Smrgpolicy-type is Disallow the server is required to consider as insecure 928ea1d6981Smrgall extensions given in names. No policy is specified for extensions 929ea1d6981Smrgnot listed in names. If policy-type is Permit the server may consider 930ea1d6981Smrgonly those extensions given in names to be secure; all other extensions 931ea1d6981Smrgmust be treated as insecure. If these constraints are not met, the server 932ea1d6981Smrgshould not return Authenticate in the success field of the reply. 933ea1d6981SmrgServers can but need not dynamically configure themselves in response 934ea1d6981Smrgto an Extensions SECURITYPOLICY; a conforming server might simply compare 935ea1d6981Smrgthe policy with a compiled-in table of extensions and their security status. 936ea1d6981Smrg</para> 937ea1d6981Smrg 938ea1d6981Smrg<para> 939ea1d6981SmrgFor a SECURITYPOLICY corresponding to policy-mask SitePolicies, policy-type 940ea1d6981SmrgDisallow means the server must not have been configured with any of the site 941ea1d6981Smrgpolicies given in names. Policy-type Permit means the server must have 942ea1d6981Smrgbeen configured with at least one of the site policies given in names. If 943ea1d6981Smrgthese constraints are not met, the server should not return Authenticate in 944ea1d6981Smrgthe success field of the reply. 945ea1d6981Smrg</para> 946ea1d6981Smrg 947ea1d6981Smrg<para> 948ea1d6981SmrgSitePolicies provide a way to express new forms of security-relevant 949ea1d6981Smrginformation that could not be anticipated at the time of this writing. 950ea1d6981SmrgFor example, suppose the server is found to have a critical security defect. 951ea1d6981SmrgWhen a fix is developed, a site policy string could be associated with the 952ea1d6981Smrgfix. Servers with the fix would advertise that site policy, and the X 953ea1d6981Smrgfirewall proxy would specify that site policy in a SECURITYPOLICY with 954ea1d6981Smrgpolicy-type Permit. 955ea1d6981Smrg</para> 956ea1d6981Smrg 957ea1d6981Smrg</chapter> 958ea1d6981Smrg 959ea1d6981Smrg<chapter id='Encoding'> 960ea1d6981Smrg<title>Encoding</title> 961ea1d6981Smrg 962ea1d6981Smrg<para> 963ea1d6981SmrgPlease refer to the X11 Protocol Encoding document as this section 964ea1d6981Smrguses syntactic conventions and data types established there. 965ea1d6981Smrg</para> 966ea1d6981Smrg 967ea1d6981Smrg<para> 968ea1d6981SmrgThe name of this extension is "SECURITY". 969ea1d6981Smrg</para> 970ea1d6981Smrg 971ea1d6981Smrg<sect1 id='Types'> 972ea1d6981Smrg<title>Types</title> 973ea1d6981Smrg<para> 974ea1d6981SmrgAUTHID: CARD32 975ea1d6981Smrg</para> 976ea1d6981Smrg</sect1> 977ea1d6981Smrg 978ea1d6981Smrg<sect1 id='Request_Encoding'> 979ea1d6981Smrg<title>Request Encoding</title> 980ea1d6981Smrg 981ea1d6981Smrg<para> 982ea1d6981SmrgSecurityQueryVersion 983ea1d6981Smrg</para> 984ea1d6981Smrg<literallayout remap='FD'> 985ea1d6981Smrg1 CARD8 major-opcode 986ea1d6981Smrg1 0 minor-opcode 987ea1d6981Smrg2 2 request length 988ea1d6981Smrg2 CARD16 client-major-version 989ea1d6981Smrg2 CARD16 client-minor-version 990ea1d6981Smrg=> 991ea1d6981Smrg1 1 Reply 992ea1d6981Smrg1 unused 993ea1d6981Smrg2 CARD16 sequence number 994ea1d6981Smrg4 0 reply length 995ea1d6981Smrg2 CARD16 server-major-version 996ea1d6981Smrg2 CARD16 server-minor-version 997ea1d6981Smrg20 unused 998ea1d6981Smrg</literallayout> 999ea1d6981Smrg 1000ea1d6981Smrg<para> 1001ea1d6981Smrg<function>SecurityRevokeAuthorization</function> 1002ea1d6981Smrg</para> 1003ea1d6981Smrg 1004ea1d6981Smrg<literallayout remap='FD'> 1005ea1d6981Smrg1 CARD8 major-opcode 1006ea1d6981Smrg1 2 minor-opcode 1007ea1d6981Smrg2 2 request length 1008ea1d6981Smrg4 AUTHID authorization-id 1009ea1d6981Smrg</literallayout> 1010ea1d6981Smrg 1011ea1d6981Smrg<para> 1012ea1d6981SmrgSecurityGenerateAuthorization 1013ea1d6981Smrg</para> 1014ea1d6981Smrg 1015ea1d6981Smrg<literallayout remap='FD'> 1016ea1d6981Smrg1 CARD8 major-opcode 1017ea1d6981Smrg1 1 minor-opcode 1018ea1d6981Smrg2 3 + (m+n+3)/4 + s request length 1019ea1d6981Smrg2 CARD16 m, number of bytes in authorization protocol name 1020ea1d6981Smrg2 CARD16 n, number of bytes in authorization data 1021ea1d6981Smrgm STRING8 authorization protocol name 1022ea1d6981Smrgn STRING8 authorization protocol data 1023ea1d6981Smrgp unused, p=pad(m+n) 1024ea1d6981Smrg4 BITMASK value-mask (has s bits set to 1) 1025ea1d6981Smrg #x00000001 timeout 1026ea1d6981Smrg #x00000002 trust-level 1027ea1d6981Smrg #x00000004 group 1028ea1d6981Smrg #x00000008 event-mask 1029ea1d6981Smrg4s LISTofVALUE value-list 1030ea1d6981Smrg</literallayout> 1031ea1d6981Smrg 1032ea1d6981Smrg<para> 1033ea1d6981SmrgVALUES 1034ea1d6981Smrg</para> 1035ea1d6981Smrg<literallayout remap='FD'> 1036ea1d6981Smrg4 CARD32 timeout 1037ea1d6981Smrg4 trust-level 1038ea1d6981Smrg 0 SecurityClientTrusted 1039ea1d6981Smrg 1 SecurityClientUntrusted 1040ea1d6981Smrg4 XID group 1041ea1d6981Smrg0 None 1042ea1d6981Smrg4 CARD32 event-mask 1043ea1d6981Smrg #x00000001 SecurityAuthorizationRevoked 1044ea1d6981Smrg=> 1045ea1d6981Smrg1 1 Reply 1046ea1d6981Smrg1 unused 1047ea1d6981Smrg2 CARD16 sequence number 1048ea1d6981Smrg4 (q+3)/4 reply length 1049ea1d6981Smrg4 AUTHID authorization-id 1050ea1d6981Smrg2 CARD16 data-length 1051ea1d6981Smrg18 unused 1052ea1d6981Smrgq STRING8 authorization-data-return 1053ea1d6981Smrgr unused, r=pad(q) 1054ea1d6981Smrg</literallayout> 1055ea1d6981Smrg 1056ea1d6981Smrg</sect1> 1057ea1d6981Smrg 1058ea1d6981Smrg<sect1 id='Event_Encoding'> 1059ea1d6981Smrg<title>Event Encoding</title> 1060ea1d6981Smrg<para> 1061ea1d6981Smrg<function>SecurityAuthorizationRevoked</function> 1062ea1d6981Smrg</para> 1063ea1d6981Smrg 1064ea1d6981Smrg<literallayout remap='FD'> 1065ea1d6981Smrg1 0+extension event base code 1066ea1d6981Smrg1 unused 1067ea1d6981Smrg2 CARD16 sequence number 1068ea1d6981Smrg4 AUTHID authorization id 1069ea1d6981Smrg24 unused 1070ea1d6981Smrg</literallayout> 1071ea1d6981Smrg 1072ea1d6981Smrg</sect1> 1073ea1d6981Smrg 1074ea1d6981Smrg<sect1 id='Authorization_Method_Encoding'> 1075ea1d6981Smrg<title>Authorization Method Encoding</title> 1076ea1d6981Smrg 1077ea1d6981Smrg<para> 1078ea1d6981SmrgFor authorization-protocol-name "XC-QUERY-SECURITY-1", the 1079ea1d6981Smrgauthorization-protocol-data is interpreted as follows: 1080ea1d6981Smrg</para> 1081ea1d6981Smrg 1082ea1d6981Smrg<para> 1083ea1d6981Smrg<function>authorization-protocol-data</function> 1084ea1d6981Smrg</para> 1085ea1d6981Smrg<literallayout remap='FD'> 1086ea1d6981Smrg1 BITMASK policy-mask 1087ea1d6981Smrg #x00000001 Extensions 1088ea1d6981Smrg #x00000002 SitePolicies 1089ea1d6981Smrgm LISTofSECURITYPOLICY policies 1090ea1d6981Smrg</literallayout> 1091ea1d6981Smrg 1092ea1d6981Smrg<para> 1093ea1d6981Smrg<function>SECURITYPOLICY</function> 1094ea1d6981Smrg</para> 1095ea1d6981Smrg 1096ea1d6981Smrg<literallayout remap='FD'> 1097ea1d6981Smrg1 policy-type 1098ea1d6981Smrg 0 Permit 1099ea1d6981Smrg 1 Disallow 1100ea1d6981Smrg1 CARD8 number of STRs in names 1101ea1d6981Smrgn LISTofSTR names 1102ea1d6981Smrg</literallayout> 1103ea1d6981Smrg 1104ea1d6981Smrg<para> 1105ea1d6981SmrgLISTofSTR has the same encoding as in the X protocol: each STR is a single 1106ea1d6981Smrgbyte length, followed by that many characters, and there is no padding or 1107ea1d6981Smrgtermination between STRs. 1108ea1d6981Smrg</para> 1109ea1d6981Smrg</sect1> 1110ea1d6981Smrg 1111ea1d6981Smrg</chapter> 1112ea1d6981Smrg<chapter id='C_Language_Binding'> 1113ea1d6981Smrg<title>C Language Binding</title> 1114ea1d6981Smrg 1115ea1d6981Smrg<para> 1116ea1d6981SmrgThe header for this extension is <X11/extensions/security.h>. All 1117ea1d6981Smrgidentifier names provided by this header begin with XSecurity. 1118ea1d6981Smrg</para> 1119ea1d6981Smrg 1120ea1d6981Smrg<para> 1121ea1d6981SmrgAll functions that have return type Status will return nonzero for 1122ea1d6981Smrgsuccess and zero for failure. 1123ea1d6981Smrg</para> 1124ea1d6981Smrg 1125ea1d6981Smrg<funcsynopsis id='XSecurityQueryExtension'> 1126ea1d6981Smrg<funcprototype> 1127ea1d6981Smrg <funcdef>Status <function>XSecurityQueryExtension</function></funcdef> 1128ea1d6981Smrg <paramdef>Display <parameter> *dpy</parameter></paramdef> 1129ea1d6981Smrg <paramdef>int <parameter> *major_version_return</parameter></paramdef> 1130ea1d6981Smrg <paramdef>int <parameter> *minor_version_return</parameter></paramdef> 1131ea1d6981Smrg</funcprototype> 1132ea1d6981Smrg</funcsynopsis> 1133ea1d6981Smrg 1134ea1d6981Smrg<para> 1135ea1d6981Smrg<xref linkend='XSecurityQueryExtension' xrefstyle='select: title'/> sets major_version_return and 1136ea1d6981Smrgminor_version_return to the major and minor Security protocol version 1137ea1d6981Smrgsupported by the server. If the Security library is compatible with the 1138ea1d6981Smrgversion returned by the server, it returns nonzero. If dpy does not support 1139ea1d6981Smrgthe Security extension, or if there was an error during communication with 1140ea1d6981Smrgthe server, or if the server and library protocol versions are incompatible, 1141ea1d6981Smrgit returns zero. No other XSecurity functions may be called before this 1142ea1d6981Smrgfunction. If a client violates this rule, the effects of all subsequent 1143ea1d6981SmrgXSecurity calls that it makes are undefined. 1144ea1d6981Smrg</para> 1145ea1d6981Smrg 1146ea1d6981Smrg<funcsynopsis id='XSecurityAllocXauth'> 1147ea1d6981Smrg<funcprototype> 1148ea1d6981Smrg <funcdef>Xauth *<function>XSecurityAllocXauth</function></funcdef> 1149ea1d6981Smrg <paramdef><parameter>void</parameter></paramdef> 1150ea1d6981Smrg</funcprototype> 1151ea1d6981Smrg</funcsynopsis> 1152ea1d6981Smrg<para> 1153ea1d6981SmrgIn order to provide for future evolution, Xauth structures are used to 1154ea1d6981Smrgpass and return authorization data, and the library provides ways to 1155ea1d6981Smrgallocate and deallocate them. 1156ea1d6981Smrg</para> 1157ea1d6981Smrg 1158ea1d6981Smrg<para> 1159ea1d6981Smrg<xref linkend='XSecurityAllocXauth' xrefstyle='select: title'/> must be used to allocate the 1160ea1d6981SmrgXauth structure that is passed to 1161ea1d6981Smrg<xref linkend='XSecurityGenerateAuthorization' xrefstyle='select: title'/>. 1162ea1d6981Smrg</para> 1163ea1d6981Smrg 1164ea1d6981Smrg<para> 1165ea1d6981SmrgFor the purposes of the Security extension, the Xauth structure has 1166ea1d6981Smrgthe following fields: 1167ea1d6981Smrg</para> 1168ea1d6981Smrg 1169ea1d6981Smrg<informaltable frame='topbot'> 1170ea1d6981Smrg <?dbfo keep-together="always" ?> 1171ea1d6981Smrg <tgroup cols='3' align='left' colsep='0' rowsep='0'> 1172ea1d6981Smrg <colspec colname='c1' colwidth="1.0*"/> 1173ea1d6981Smrg <colspec colname='c2' colwidth="1.0*"/> 1174ea1d6981Smrg <colspec colname='c3' colwidth="3.0*"/> 1175ea1d6981Smrg <thead> 1176ea1d6981Smrg <row rowsep="1"> 1177ea1d6981Smrg <entry>Type</entry> 1178ea1d6981Smrg <entry>Field name</entry> 1179ea1d6981Smrg <entry>Description</entry> 1180ea1d6981Smrg </row> 1181ea1d6981Smrg </thead> 1182ea1d6981Smrg <tbody> 1183ea1d6981Smrg <row> 1184ea1d6981Smrg <entry> 1185ea1d6981Smrg <para>unsigned short</para> 1186ea1d6981Smrg </entry> 1187ea1d6981Smrg <entry> 1188ea1d6981Smrg <para>name_length</para> 1189ea1d6981Smrg </entry> 1190ea1d6981Smrg <entry> 1191ea1d6981Smrg <para>number of bytes in name</para> 1192ea1d6981Smrg </entry> 1193ea1d6981Smrg </row> 1194ea1d6981Smrg <row> 1195ea1d6981Smrg <entry> 1196ea1d6981Smrg <para>char *</para> 1197ea1d6981Smrg </entry> 1198ea1d6981Smrg <entry> 1199ea1d6981Smrg <para>name</para> 1200ea1d6981Smrg </entry> 1201ea1d6981Smrg <entry> 1202ea1d6981Smrg <para>authorization protocol name</para> 1203ea1d6981Smrg </entry> 1204ea1d6981Smrg </row> 1205ea1d6981Smrg <row> 1206ea1d6981Smrg <entry> 1207ea1d6981Smrg <para>unsigned short</para> 1208ea1d6981Smrg </entry> 1209ea1d6981Smrg <entry> 1210ea1d6981Smrg <para>data_length</para> 1211ea1d6981Smrg </entry> 1212ea1d6981Smrg <entry> 1213ea1d6981Smrg <para>number of bytes in data</para> 1214ea1d6981Smrg </entry> 1215ea1d6981Smrg </row> 1216ea1d6981Smrg <row rowsep="1"> 1217ea1d6981Smrg <entry> 1218ea1d6981Smrg <para>char *</para> 1219ea1d6981Smrg </entry> 1220ea1d6981Smrg <entry> 1221ea1d6981Smrg <para>data</para> 1222ea1d6981Smrg </entry> 1223ea1d6981Smrg <entry> 1224ea1d6981Smrg <para>authorization protocol data</para> 1225ea1d6981Smrg </entry> 1226ea1d6981Smrg </row> 1227ea1d6981Smrg </tbody> 1228ea1d6981Smrg </tgroup> 1229ea1d6981Smrg</informaltable> 1230ea1d6981Smrg<para> 1231ea1d6981SmrgThe Xauth structure returned by this function is initialized as follows: 1232ea1d6981Smrgname_length and data_length are zero, and name and data are NULL. 1233ea1d6981Smrg</para> 1234ea1d6981Smrg 1235ea1d6981Smrg<funcsynopsis id='XSecurityFreeXauth'> 1236ea1d6981Smrg<funcprototype> 1237ea1d6981Smrg <funcdef>void <function>XSecurityFreeXauth</function></funcdef> 1238ea1d6981Smrg <paramdef>Xauth<parameter> *auth</parameter></paramdef> 1239ea1d6981Smrg</funcprototype> 1240ea1d6981Smrg</funcsynopsis> 1241ea1d6981Smrg 1242ea1d6981Smrg<para> 1243ea1d6981Smrg<xref linkend='XSecurityFreeXauth' xrefstyle='select: title'/> must be used to free Xauth 1244ea1d6981Smrgstructures allocated by 1245ea1d6981Smrg<xref linkend='XSecurityAllocXauth' xrefstyle='select: title'/> or returned by 1246ea1d6981Smrg<xref linkend='XSecurityGenerateAuthorization' xrefstyle='select: title'/>. It is the 1247ea1d6981Smrgcaller's responsibility to fill in the name and data fields of Xauth structures 1248ea1d6981Smrgallocated with <xref linkend='XSecurityAllocXauth' xrefstyle='select: title'/>, so this function 1249ea1d6981Smrgwill not attempt to free them. In contrast, all storage associated with 1250ea1d6981SmrgXauth structures returned from 1251ea1d6981Smrg<xref linkend='XSecurityGenerateAuthorization' xrefstyle='select: title'/> will be freed by this 1252ea1d6981Smrgfunction, including the name and data fields. 1253ea1d6981Smrg</para> 1254ea1d6981Smrg 1255ea1d6981Smrg 1256ea1d6981Smrg<funcsynopsis id='XSecurityRevokeAuthorization'> 1257ea1d6981Smrg<funcprototype> 1258ea1d6981Smrg <funcdef>Bool <function>XSecurityRevokeAuthorization</function></funcdef> 1259ea1d6981Smrg <paramdef>Display<parameter> *dpy</parameter></paramdef> 1260ea1d6981Smrg <paramdef>XSecurityAuthorization<parameter> auth_id</parameter></paramdef> 1261ea1d6981Smrg</funcprototype> 1262ea1d6981Smrg</funcsynopsis> 1263ea1d6981Smrg 1264ea1d6981Smrg<para> 1265ea1d6981Smrg<xref linkend='XSecurityRevokeAuthorization' xrefstyle='select: title'/> deletes the authorization 1266ea1d6981Smrgspecified by auth_id, which must be a value returned in the auth_id_return 1267ea1d6981Smrgparameter of <xref linkend='XSecurityGenerateAuthorization' xrefstyle='select: title'/>. All 1268ea1d6981Smrgclients that connected with that authorization are be killed. Subsequently, 1269ea1d6981Smrgclients that attempt to connect using that authorization will be refused. 1270ea1d6981Smrg</para> 1271ea1d6981Smrg 1272ea1d6981Smrg 1273ea1d6981Smrg<funcsynopsis id='XSecurityGenerateAuthorization'> 1274ea1d6981Smrg<funcprototype> 1275ea1d6981Smrg <funcdef>Xauth *<function>XSecurityGenerateAuthorization</function></funcdef> 1276ea1d6981Smrg <paramdef>Display<parameter> *dpy</parameter></paramdef> 1277ea1d6981Smrg <paramdef>Xauth<parameter> *auth_in</parameter></paramdef> 1278ea1d6981Smrg <paramdef>unsigned long<parameter> valuemask</parameter></paramdef> 1279ea1d6981Smrg <paramdef>XSecurityAutorizationAttributes <parameter> *attributes</parameter></paramdef> 1280ea1d6981Smrg <paramdef>XSecurityAutorization<parameter> *auth_id_return</parameter></paramdef> 1281ea1d6981Smrg</funcprototype> 1282ea1d6981Smrg</funcsynopsis> 1283ea1d6981Smrg 1284ea1d6981Smrg<para> 1285ea1d6981Smrg<xref linkend='XSecurityGenerateAuthorization' xrefstyle='select: title'/> creates a new 1286ea1d6981Smrgauthorization with the specified attributes. The auth_in argument must be 1287ea1d6981Smrgallocated by <xref linkend='XSecurityAllocXauth' xrefstyle='select: title'/>. The 1288ea1d6981Smrgname and name_length fields of auth_in should be initialized to the 1289ea1d6981Smrgauthorization protocol name and its length in characters respectively. 1290ea1d6981SmrgIf there is authorization data, the data and data_length fields of 1291ea1d6981Smrgauth_in should be initialized to the data and its length in characters 1292d63b911fSmrgrespectively. The library does not assume that name and data are 1293ea1d6981Smrgnull-terminated strings. The auth_in argument must be freed with 1294ea1d6981Smrg<xref linkend='XSecurityFreeXauth' xrefstyle='select: title'/>. 1295ea1d6981Smrg</para> 1296ea1d6981Smrg 1297ea1d6981Smrg<para> 1298ea1d6981SmrgThe XSecurityAuthorizationAttributes structure has the following fields: 1299ea1d6981Smrg</para> 1300ea1d6981Smrg 1301ea1d6981Smrg<informaltable frame='topbot'> 1302ea1d6981Smrg <?dbfo keep-together="always" ?> 1303ea1d6981Smrg <tgroup cols='3' align='left' colsep='0' rowsep='0'> 1304ea1d6981Smrg <colspec colname='c1' colwidth="1.0*"/> 1305ea1d6981Smrg <colspec colname='c2' colwidth="1.0*"/> 1306ea1d6981Smrg <colspec colname='c3' colwidth="3.0*"/> 1307ea1d6981Smrg <thead> 1308ea1d6981Smrg <row rowsep="1"> 1309ea1d6981Smrg <entry>Type</entry> 1310ea1d6981Smrg <entry>Field name</entry> 1311ea1d6981Smrg <entry>Mask</entry> 1312ea1d6981Smrg </row> 1313ea1d6981Smrg </thead> 1314ea1d6981Smrg <tbody> 1315ea1d6981Smrg <row> 1316ea1d6981Smrg <entry> 1317ea1d6981Smrg <para>unsigned int</para> 1318ea1d6981Smrg </entry> 1319ea1d6981Smrg <entry> 1320ea1d6981Smrg <para>trust_level</para> 1321ea1d6981Smrg </entry> 1322ea1d6981Smrg <entry> 1323ea1d6981Smrg <para>XSecurityTrustLevel</para> 1324ea1d6981Smrg </entry> 1325ea1d6981Smrg </row> 1326ea1d6981Smrg <row> 1327ea1d6981Smrg <entry> 1328ea1d6981Smrg <para>unsigned int</para> 1329ea1d6981Smrg </entry> 1330ea1d6981Smrg <entry> 1331ea1d6981Smrg <para>timeout</para> 1332ea1d6981Smrg </entry> 1333ea1d6981Smrg <entry> 1334ea1d6981Smrg <para>XSecurityTimeout</para> 1335ea1d6981Smrg </entry> 1336ea1d6981Smrg </row> 1337ea1d6981Smrg <row> 1338ea1d6981Smrg <entry> 1339ea1d6981Smrg <para>XID</para> 1340ea1d6981Smrg </entry> 1341ea1d6981Smrg <entry> 1342ea1d6981Smrg <para>group</para> 1343ea1d6981Smrg </entry> 1344ea1d6981Smrg <entry> 1345ea1d6981Smrg <para>XSecurityGroup</para> 1346ea1d6981Smrg </entry> 1347ea1d6981Smrg </row> 1348ea1d6981Smrg <row rowsep="1"> 1349ea1d6981Smrg <entry> 1350ea1d6981Smrg <para>long</para> 1351ea1d6981Smrg </entry> 1352ea1d6981Smrg <entry> 1353ea1d6981Smrg <para>event_mask</para> 1354ea1d6981Smrg </entry> 1355ea1d6981Smrg <entry> 1356ea1d6981Smrg <para>XSecurityEventMask</para> 1357ea1d6981Smrg </entry> 1358ea1d6981Smrg </row> 1359ea1d6981Smrg </tbody> 1360ea1d6981Smrg </tgroup> 1361ea1d6981Smrg</informaltable> 1362ea1d6981Smrg 1363ea1d6981Smrg<para> 1364ea1d6981SmrgThese correspond to the trust-level, timeout, group, and event-mask 1365ea1d6981Smrgdescribed in the SecurityGenerateAuthorization protocol request. The 1366ea1d6981Smrgcaller can fill in values for any subset of these attributes. The valuemask 1367ea1d6981Smrgargument must be the bitwise OR of the symbols listed in the Mask column 1368ea1d6981Smrgfor all supplied attributes. The event_mask attribute can be None, 1369ea1d6981SmrgXSecurityAuthorizationRevokedMask, or XSecurityAllEventMasks. In this 1370ea1d6981Smrgrevision of the protocol specification XSecurityAllEventMasks is equivalent 1371ea1d6981Smrgto XSecurityAuthorizationRevokedMask. If the caller does not need to 1372ea1d6981Smrgspecify any attributes, the attributes argument can be NULL, and the 1373ea1d6981Smrgvaluemask argument must be zero. 1374ea1d6981Smrg</para> 1375ea1d6981Smrg<para> 1376ea1d6981SmrgIf the function fails, NULL is returned and auth_id_return is filled in 1377ea1d6981Smrgwith zero. Otherwise, a pointer to an Xauth structure is returned. The name 1378ea1d6981Smrgand name_length fields of the returned Xauth structure will be copies of the 1379ea1d6981Smrgname that was passed in, and the data and data_length fields will be set to 1380ea1d6981Smrgthe authorization data returned by the server. The caller should not assume 1381ea1d6981Smrgthat name and data are null-terminated strings. If no authorization data was 1382ea1d6981Smrgreturned by the server, the data and data_length fields will be set to NULL 1383d63b911fSmrgand zero respectively. The returned Xauth structure must be freed with 1384ea1d6981Smrg<xref linkend='XSecurityFreeXauth' xrefstyle='select: title'/>; the caller should not use any other 1385ea1d6981Smrgmeans free the structure or any of its components. The auth_id_return 1386ea1d6981Smrgargument will be filled in with the non-zero authorization id of the created 1387ea1d6981Smrgauthorization. 1388ea1d6981Smrg</para> 1389ea1d6981Smrg 1390ea1d6981Smrg<para> 1391ea1d6981SmrgThe XSecurityAuthorizationRevokedEvent structure has the following fields: 1392ea1d6981Smrg</para> 1393ea1d6981Smrg 1394ea1d6981Smrg<informaltable frame='topbot'> 1395ea1d6981Smrg <?dbfo keep-together="always" ?> 1396ea1d6981Smrg <tgroup cols='3' align='left' colsep='0' rowsep='0'> 1397ea1d6981Smrg <colspec colname='c1' colwidth="1.0*"/> 1398ea1d6981Smrg <colspec colname='c2' colwidth="1.0*"/> 1399ea1d6981Smrg <colspec colname='c3' colwidth="3.0*"/> 1400ea1d6981Smrg <thead> 1401ea1d6981Smrg <row rowsep="1"> 1402ea1d6981Smrg <entry>Type</entry> 1403ea1d6981Smrg <entry>Field name</entry> 1404ea1d6981Smrg <entry>Description</entry> 1405ea1d6981Smrg </row> 1406ea1d6981Smrg </thead> 1407ea1d6981Smrg <tbody> 1408ea1d6981Smrg <row> 1409ea1d6981Smrg <entry> 1410ea1d6981Smrg <para>int</para> 1411ea1d6981Smrg </entry> 1412ea1d6981Smrg <entry> 1413ea1d6981Smrg <para>type</para> 1414ea1d6981Smrg </entry> 1415ea1d6981Smrg <entry> 1416ea1d6981Smrg <para>event base + XSecurityAuthorizationRevoked</para> 1417ea1d6981Smrg </entry> 1418ea1d6981Smrg </row> 1419ea1d6981Smrg <row> 1420ea1d6981Smrg <entry> 1421ea1d6981Smrg <para>unsigned long</para> 1422ea1d6981Smrg </entry> 1423ea1d6981Smrg <entry> 1424ea1d6981Smrg <para>serial</para> 1425ea1d6981Smrg </entry> 1426ea1d6981Smrg <entry> 1427ea1d6981Smrg <para># of last request processed by server</para> 1428ea1d6981Smrg </entry> 1429ea1d6981Smrg </row> 1430ea1d6981Smrg <row> 1431ea1d6981Smrg <entry> 1432ea1d6981Smrg <para>Bool</para> 1433ea1d6981Smrg </entry> 1434ea1d6981Smrg <entry> 1435ea1d6981Smrg <para>send_event</para> 1436ea1d6981Smrg </entry> 1437ea1d6981Smrg <entry> 1438ea1d6981Smrg <para>true if this came from SendEvent</para> 1439ea1d6981Smrg </entry> 1440ea1d6981Smrg </row> 1441ea1d6981Smrg <row> 1442ea1d6981Smrg <entry> 1443ea1d6981Smrg <para>Display*</para> 1444ea1d6981Smrg </entry> 1445ea1d6981Smrg <entry> 1446ea1d6981Smrg <para>display</para> 1447ea1d6981Smrg </entry> 1448ea1d6981Smrg <entry> 1449ea1d6981Smrg <para>Display the event was read from</para> 1450ea1d6981Smrg </entry> 1451ea1d6981Smrg </row> 1452ea1d6981Smrg <row rowsep="1"> 1453ea1d6981Smrg <entry> 1454ea1d6981Smrg <para>XSecurityAuthorization</para> 1455ea1d6981Smrg </entry> 1456ea1d6981Smrg <entry> 1457ea1d6981Smrg <para>auth_id</para> 1458ea1d6981Smrg </entry> 1459ea1d6981Smrg <entry> 1460ea1d6981Smrg <para>revoked authorization id</para> 1461ea1d6981Smrg </entry> 1462ea1d6981Smrg </row> 1463ea1d6981Smrg </tbody> 1464ea1d6981Smrg </tgroup> 1465ea1d6981Smrg</informaltable> 1466ea1d6981Smrg</chapter> 1467ea1d6981Smrg</book> 1468