tsolutils.c revision 633
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 * after all references in Xsun is pulled out 0N/A * in policy routines. So we had to move it there 606N/A * Key to lookup devPrivate data in various structures 0N/A/* This structure is used for protocol request ListHosts */ 0N/A/* This table contains list of users who can connect to the server */ 0N/A/* Index must match with keywords */ 0N/A "extension",
"privilege"};
0N/A "_TSOL_CMWLABEL_CHANGE",
0N/A "_TSOL_CLIENT_TERM",
0N/A/* Initialize UID table, this table should at least contains owner UID */ 0N/A/* Count how many valid entried in the uid table */ 0N/A /* Search entire table */ 0N/A/* return (1); if userid is in the table */ 0N/A return (
1);
/* yes, found it */ 0N/A return (0);
/* not found */ 0N/A/* Passed into a pointer to a storage which is used to store UID */ 0N/A/* and nUid represents how many UID in the table(returned by count_uid_table) */ 0N/A/* add userid into UIDtable */ 0N/A * Search entire uidtable, to prevent duplicate uid 0N/A * entry in the table 0N/A /* this uid entry is already in the table; no-op */ 0N/A return (
1);
/* Success, uid in the table */ 0N/A * If we can find an empty entry, then add this uid 0N/A return (
1);
/* Success, uid in the table */ 0N/A /* uidtable overflow */ 0N/A ErrorF(
"Server problem: Please enlarge the table size of uidtable \n");
0N/A/* remove userid from UIDtable */ 0N/A ErrorF(
"\n UID 0 can not be removed from server UID list");
0N/A /* delete this entry in the table */ 0N/A return (
1);
/* Success, uid in the table */ 0N/A /* no such entry in the table, why delete it? no-op */ 0N/A /* found a matching sensitivity label in sltable */ 0N/A * can't find a matching entry in sltable, 0N/A * however, we have empty entry to store this 0N/A * new sensitivity label; store it. 0N/A * no matching entry in sltable, and no room to 0N/A * store this new sensitivity label, 0N/A * the server needs to recomplie with a larger slabel 0N/A ErrorF(
"Server problem: Please enlarge the table size of sltable \n");
196N/A /* compute new millimeter height */ 0N/A * Converts keycode to keysym, helper function. 0N/A * Modelled after Xlib code 0N/A * Converts keysym to a keycode 0N/A * Modelled after Xlib code 0N/A * converts a keysym to modifier equivalent mask 0N/A * Modelled after Xlib 0N/A * Initialize Hot Key keys. On A Sun type 5/6 keyboard 0N/A * It's Meta(Diamond) + Stop. On a non-Sun keyboard, it's 0N/A * Alt + Break(Pause) key. Hold down the meta or alt key 0N/A * press stop or break key. 0N/A * Both Left & Right keys for (Meta or Alt) return the 0N/A * same modifier mask 0N/A return;
/* ignore incomplete entries */ 0N/A /* find a matching keyword */ 0N/A /* Invalid keyword */ 0N/A * Load Trusted Solaris configuration file 0N/A * TBD: Process extension keywords 0N/A /* open the file from /etc first followed by /usr */ 0N/A ErrorF(
"Cannot load %s. Some desktop applications may not\n" 0N/A /* Read and parse the config file */ 0N/A /* ignore all comments, lines starting with white space */ 0N/A * It does not really tell if this atom is to be polyinstantiated 0N/A * or not. Further check should be done to determine this. 0N/A /* Create new TSOL atoms */ 0N/A /* Create atoms defined in config file */ 0N/A * Names starting with a slash in selection.atoms and property.atoms 606N/A * are treated as regular expressions to be matched against the 0N/A * selection and property names. They may optionally end with a slash. 0N/A /* Extract regular expression from between slashes */ 0N/A /* Compile the regular expression */ 0N/A /* Make null-terminated copy of string */ 0N/A /* Compare string to regular expression */ 0N/A/* Property is polyinstantiated only on root window */ 0N/A * Returns true if a matching sl.uid pair found. Must be applied 0N/A * only to polyprops. 0N/A * client or is a default server xid 0N/A * Same as TopClientWin() 0N/A * except that it returns a Window ID 0N/A * Return root window of pWin 0N/A * Return Top level client window of pWin 0N/A * returns the window under pointer. This is function because 0N/A * sprite is static & TsolPointerWindow is called in policy functions. 606N/A * Matches in the list of disabled extensions via 36N/A * the policy file (TrustedExtensionsPolicy) 36N/A * TRUE - if a match is found 36N/A * FALSE - otherwise