tsolprotocol.c revision 919
606N/A/* Copyright 2009 Sun Microsystems, Inc. All rights reserved. 919N/A * Use is subject to license terms. 0N/A * Permission is hereby granted, free of charge, to any person obtaining a 919N/A * copy of this software and associated documentation files (the "Software"), 919N/A * to deal in the Software without restriction, including without limitation 919N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense, 919N/A * and/or sell copies of the Software, and to permit persons to whom the 919N/A * Software is furnished to do so, subject to the following conditions: 919N/A * The above copyright notice and this permission notice (including the next 919N/A * paragraph) shall be included in all copies or substantial portions of the 919N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 919N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 919N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 919N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 919N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 919N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 919N/A * DEALINGS IN THE SOFTWARE. 0N/A * Changes in one should go with corresponding changes in another. 0N/A * Get number of atoms defined in the system 0N/A * Update Tsol info for atoms. This function gets 0N/A * called typically during initialization. But, it could also get 0N/A * called if some atoms are created internally by server. 799N/A /* Allocate & Initialize the node for the first time */ 799N/A /* Atom id 0 is invalid */ 799N/A /* If the node is already allocated, see if it needs to be extended */ 799N/A * Initialize all the newly created atoms 799N/A /* Mark as internal atom for GetAtomName to succeed */ 799N/A /* Store the label info for non-global atoms */ 799N/A /* private atoms must have a matching sl */ 799N/A /* Allocate storage for sl if needed */ 799N/A /* Expand storage space for sl if needed */ 799N/A /* Store client's sl */ 799N/A /* Assign tsol attributes to this atom */ 799N/A /* non-global atoms must have matching SL */ 799N/A /* SL can't be found, so return a blank string */ 606N/A/* Generic ProcVector wrapper for functions which just need to set the 606N/A client's TrustLevel to Trusted before executing. */ 470N/A /* Validate trusted stripe window */ 311N/A /* Validate trusted stripe window */ 311N/A /* stripe is already at head, nothing to do */ 606N/A/* Generic ProcVector wrapper for functions which just need to have 606N/A ResetStripeWindow called after executing. */ 0N/A * HotKey is Meta(Diamond)+ Stop Key 705N/A * Breaks untrusted Ptr and Kbd grabs. 606N/A * Trusted Grabs are NOT broken 0N/A * Warps pointer to the Trusted Stripe if not Trusted grabs in force. 0N/A * Warp the pointer to the Trusted Stripe 0N/A * Checks that tpwin & its siblings have same 0N/A * parents. Returns 0 if OK, a # indicating which 0N/A * Sibling has a bad parent 196N/A /* Reduce root window height = stripe height */ 633N/A /* REQUEST(xResourceReq); */ 0N/A /* turn off auditing because operation ignored */ 633N/A /* REQUEST(xResourceReq); */ 0N/A /* turn off auditing because operation ignored */ 0N/A * Because of its recursive nature, QuerryTree can leave a huge trail 0N/A * of audit records which could make deciphering the audit log for 0N/A * critical records difficult. So we turn off any more auditing of 36N/A * events are non-protocol ones viz. ClientConnect, mapped to 9101 36N/A * and ClientDisconnect, mapped to 9102. 36N/A * The protocol events are mapped from 9103 onwards in the serial 36N/A * order of their respective protocol opcode, for eg, the protocol 36N/A * UngrabPointer which is has a protocol opcode 27 is mapped to 36N/A * 9129 (9102 + 27). 36N/A * All extension protocols are mapped to a single audit event 36N/A * AUE_XExtension as opcodes are assigined dynamically to these 36N/A * protocols. We set the extension protocol opcode to be 128, one 36N/A * more than the last standard opcode. 36N/A * Exclude Clients with Trusted Path such as tsoldtwm, tsoldtsession etc 36N/A * from generating the audit records for X protocols 606N/A /* Allow extensions in the labeled zones */ 36N/A /* Allow extensions in the labeled zones */ 73N/A /* requested area must be a subset of the window area */ 64N/A if(
/* check for being viewable */ 64N/A /* check for being on screen */ 64N/A /* check for being inside of border */ 64N/A /* only planes asked for */ 64N/A /* we have to make sure intermediate buffers don't need padding */ 64N/A /* nothing to do */ 64N/A * fill the buffer with zeros in case of security failure 64N/A /* Note that this is NOT a call to WriteSwappedDataToClient, 64N/A as we do NOT byte swap */ 64N/A/* Don't split me, gcc pukes when you do */ 64N/A else /* XYPixmap */ 64N/A * fill the buffer with zeros in case of security failure 64N/A /* Note: NOT a call to WriteSwappedDataToClient, 64N/A as we do NOT byte swap */ 64N/A/* Don't split me, gcc pukes when you do */ 799N/A /* ignore the error message */ 64N/A /* ignore the error message */ 64N/A /* ignore the error message for DnD zap effect */ 64N/A /* ignore the error message for DnD zap effect */ 64N/A /* ignore the error message for DnD zap effect */ 799N/A /* ignore the error message for DnD zap effect */