From c9fb8a35332d101897607d8f06ed5a6512eac7cf Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Thu, 22 Mar 2007 17:23:26 -0400 Subject: [PATCH] dix: move access codes to separate header file, add DixCreateAccess. --- include/Makefile.am | 1 + include/dixaccess.h | 29 +++++++++++++++++++++++++++++ include/resource.h | 15 +-------------- 3 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 include/dixaccess.h diff --git a/include/Makefile.am b/include/Makefile.am index 4d8910b66..82e71905e 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -11,6 +11,7 @@ sdk_HEADERS = \ cursor.h \ cursorstr.h \ dix.h \ + dixaccess.h \ dixevents.h \ dixfont.h \ dixfontstr.h \ diff --git a/include/dixaccess.h b/include/dixaccess.h new file mode 100644 index 000000000..205b76cb1 --- /dev/null +++ b/include/dixaccess.h @@ -0,0 +1,29 @@ +/*********************************************************** + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +******************************************************************/ + +#ifndef DIX_ACCESS_H +#define DIX_ACCESS_H + +/* These are the access modes that can be passed in the last parameter + * to several of the dix lookup functions. They were originally part + * of the Security extension, now used by XACE. + * + * You can or these values together to indicate multiple modes + * simultaneously. + */ + +#define DixUnknownAccess 0 /* don't know intentions */ +#define DixReadAccess (1<<0) /* inspecting the object */ +#define DixWriteAccess (1<<1) /* changing the object */ +#define DixDestroyAccess (1<<2) /* destroying the object */ +#define DixCreateAccess (1<<3) /* creating the object */ + +#endif /* DIX_ACCESS_H */ diff --git a/include/resource.h b/include/resource.h index 9949dd2fc..f7fa5f188 100644 --- a/include/resource.h +++ b/include/resource.h @@ -48,6 +48,7 @@ SOFTWARE. #ifndef RESOURCE_H #define RESOURCE_H 1 #include "misc.h" +#include "dixaccess.h" /***************************************************************** * STUFF FOR RESOURCES @@ -225,20 +226,6 @@ extern pointer LookupClientResourceComplex( FindComplexResType func, pointer cdata); -/* These are the access modes that can be passed in the last parameter - * to SecurityLookupIDByType/Class. The Security extension doesn't - * currently make much use of these; they're mainly provided as an - * example of what you might need for discretionary access control. - * You can or these values together to indicate multiple modes - * simultaneously. - */ - -#define DixUnknownAccess 0 /* don't know intentions */ -#define DixReadAccess (1<<0) /* inspecting the object */ -#define DixWriteAccess (1<<1) /* changing the object */ -#define DixReadWriteAccess (DixReadAccess|DixWriteAccess) -#define DixDestroyAccess (1<<2) /* destroying the object */ - extern pointer SecurityLookupIDByType( ClientPtr /*client*/, XID /*id*/,