Registering names for all resource types

Alan Coopersmith alan.coopersmith at sun.com
Thu Feb 12 19:36:05 PST 2009


While debugging an issue with the Xace callback to check resource access
in our Solaris Trusted Extensions module, I found several of the resource
types being passed to us had no names registered in the dix name registry.

I started adding RegisterResourceName calls to all the extensions, but 
found the variety of methods to check for failure of CreateNewResourceType
(and the number of places it wasn't checked) made this messy, so I just
added a simple new helper function to do allow doing it the same way 
everywhere, and to make it easier to find where it wasn't being set.

I also cleaned up some, but not all, of the inconsistencies in checking
the CreateNewResourceType return value, including a number of places 
where the value was |'ed with a set of flags and then checked for 0,
which didn't really catch the error condition.

While all the core resource type names are all caps with spaces, some
extensions, like security, had used CamelCase names, so I followed their
example.  If we want consistent all caps names, it's easy enough to change
now that I've found all the places the resource types are registered.

	-Alan Coopersmith-           alan.coopersmith at sun.com
	 Sun Microsystems, Inc. - X Window System Engineering



More information about the xorg-devel mailing list