tsolprotocol.c revision 851
606N/A/* Copyright 2009 Sun Microsystems, Inc. All rights reserved. 0N/A * Permission is hereby granted, free of charge, to any person obtaining a 0N/A * copy of this software and associated documentation files (the 0N/A * "Software"), to deal in the Software without restriction, including 0N/A * without limitation the rights to use, copy, modify, merge, publish, 0N/A * distribute, and/or sell copies of the Software, and to permit persons 0N/A * to whom the Software is furnished to do so, provided that the above 0N/A * copyright notice(s) and this permission notice appear in all copies of 0N/A * the Software and that both the above copyright notice(s) and this 0N/A * permission notice appear in supporting documentation. 0N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 0N/A * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 0N/A * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 0N/A * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 0N/A * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 0N/A * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING 0N/A * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 0N/A * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 0N/A * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 0N/A * Except as contained in this notice, the name of a copyright holder 0N/A * shall not be used in advertising or otherwise to promote the sale, use 0N/A * or other dealings in this Software without prior written authorization 0N/A * of the copyright holder. 0N/A * Changes in one should go with corresponding changes in another. 73N/A * Get number of atoms defined in the system 0N/A * Update Tsol info for atoms. This function gets 606N/A * called typically during initialization. But, it could also get 0N/A * called if some atoms are created internally by server. 0N/A /* Allocate & Initialize the node for the first time */ 0N/A /* Atom id 0 is invalid */ 0N/A /* If the node is already allocated, see if it needs to be extended */ 0N/A ErrorF(
"Cannot allocate memory for Tsol node\n");
0N/A * Initialize all the newly created atoms 0N/A /* Mark as internal atom for GetAtomName to succeed */ 0N/A /* Store the label info for non-global atoms */ 0N/A /* private atoms must have a matching sl */ 0N/A /* Allocate storage for sl if needed */ 0N/A /* Expand storage space for sl if needed */ 0N/A /* Store client's sl */ 0N/A /* Assign tsol attributes to this atom */ 0N/A /* non-global atoms must have matching SL */ 0N/A /* SL can't be found, so return a blank string */ 606N/A/* Generic ProcVector wrapper for functions which just need to set the 0N/A client's TrustLevel to Trusted before executing. */ 606N/A /* Validate trusted stripe window */ 606N/A /* Validate trusted stripe window */ 606N/A /* stripe is already at head, nothing to do */ 606N/A/* Generic ProcVector wrapper for functions which just need to have 0N/A ResetStripeWindow called after executing. */ 606N/A * HotKey is Meta(Diamond)+ Stop Key 606N/A * Breaks untrusted Ptr and Kbd grabs. 606N/A * Trusted Grabs are NOT broken 606N/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 606N/A /* Reduce root window height = stripe height */ 0N/A /* REQUEST(xResourceReq); */ 606N/A /* turn off auditing because operation ignored */ 606N/A /* REQUEST(xResourceReq); */ 606N/A /* turn off auditing because operation ignored */ 606N/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 168N/A * events are non-protocol ones viz. ClientConnect, mapped to 9101 168N/A * and ClientDisconnect, mapped to 9102. 168N/A * The protocol events are mapped from 9103 onwards in the serial 168N/A * order of their respective protocol opcode, for eg, the protocol 168N/A * UngrabPointer which is has a protocol opcode 27 is mapped to 168N/A * All extension protocols are mapped to a single audit event 168N/A * AUE_XExtension as opcodes are assigined dynamically to these 168N/A * protocols. We set the extension protocol opcode to be 128, one 168N/A * more than the last standard opcode. 168N/A * Exclude Clients with Trusted Path such as tsoldtwm, tsoldtsession etc 0N/A * from generating the audit records for X protocols 0N/A /* Allow extensions in the labeled zones */ 0N/A /* Allow extensions in the labeled zones */ 0N/A /* requested area must be a subset of the window area */ 0N/A if(
/* check for being viewable */ 0N/A /* check for being on screen */ 0N/A /* check for being inside of border */ 0N/A /* only planes asked for */ 0N/A /* we have to make sure intermediate buffers don't need padding */ 0N/A * fill the buffer with zeros in case of security failure 606N/A /* Note that this is NOT a call to WriteSwappedDataToClient, 606N/A as we do NOT byte swap */ 0N/A/* Don't split me, gcc pukes when you do */ 0N/A * fill the buffer with zeros in case of security failure 0N/A /* Note: NOT a call to WriteSwappedDataToClient, 0N/A as we do NOT byte swap */ 0N/A/* Don't split me, gcc pukes when you do */ 0N/A /* ignore the error message */ 0N/A /* ignore the error message */ 0N/A /* ignore the error message for DnD zap effect */ 0N/A /* ignore the error message for DnD zap effect */ 606N/A /* ignore the error message for DnD zap effect */ 606N/A /* ignore the error message for DnD zap effect */