tsolprotocol.c revision 799
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. 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 */