From 4d8d3ce32150eed4005b158c03c21933c52c2181 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 11 Nov 2002 09:01:24 +0000 Subject: [PATCH] union is better to avoid problems with pointers (This used to be commit 1645567db3e85151c139115fdc1238149ccf33a2) --- source3/include/gums.h | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/source3/include/gums.h b/source3/include/gums.h index d1799f377d9..a44dadc8837 100644 --- a/source3/include/gums.h +++ b/source3/include/gums.h @@ -24,32 +24,14 @@ #define GUMS_VERSION_MAJOR 0 #define GUMS_VERSION_MINOR 1 -#define GUMS_OBJ_NORMAL_USER 1 -#define GUMS_OBJ_GROUP 2 -#define GUMS_OBJ_DOMAIN 3 +#define GUMS_OBJ_DOMAIN 1 +#define GUMS_OBJ_NORMAL_USER 2 +#define GUMS_OBJ_GROUP 3 #define GUMS_OBJ_ALIAS 4 #define GUMS_OBJ_WORKSTATION_TRUST 5 #define GUMS_OBJ_SERVER_TRUST 6 #define GUMS_OBJ_DOMAIN_TRUST 7 -typedef struct gums_object -{ - TALLOC_CTX *mem_ctx; - - uint32 type; /* Object Type */ - uint32 version; /* Object Version */ - uint32 seq_num; /* Object Sequence Number */ - - SEC_DESC *sec_desc; /* Security Descriptor */ - - DOM_SID *sid; /* Object Sid */ - char *name; /* Object Name */ - char *description; /* Object Description */ - - void *data; /* Object Specific data */ - -} GUMS_OBJECT; - typedef struct gums_user { DOM_SID *group_sid; /* Primary Group SID */ @@ -91,6 +73,30 @@ typedef struct gums_group } GUMS_GROUP; +union gums_obj_p { + gums_user *user; + gums_group *group; + gums_group *alias; +} + +typedef struct gums_object +{ + TALLOC_CTX *mem_ctx; + + uint32 type; /* Object Type */ + uint32 version; /* Object Version */ + uint32 seq_num; /* Object Sequence Number */ + + SEC_DESC *sec_desc; /* Security Descriptor */ + + DOM_SID *sid; /* Object Sid */ + char *name; /* Object Name */ + char *description; /* Object Description */ + + union gums_obj_p data; /* Object Specific data */ + +} GUMS_OBJECT; + typedef struct gums_data_set { int type; /* GUMS_SET_xxx */ -- 2.11.4.GIT