summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2002-11-11 09:01:24 +0000
committerSimo Sorce <idra@samba.org>2002-11-11 09:01:24 +0000
commit4d8d3ce32150eed4005b158c03c21933c52c2181 (patch)
tree84266a0d93271d364b55dacb23fb560acb60e716
parent7f94064e4ae14b1bfdbb6553420c504a1e571103 (diff)
downloadsamba-4d8d3ce32150eed4005b158c03c21933c52c2181.tar.gz
samba-4d8d3ce32150eed4005b158c03c21933c52c2181.tar.bz2
samba-4d8d3ce32150eed4005b158c03c21933c52c2181.zip
union is better to avoid problems with pointers
(This used to be commit 1645567db3e85151c139115fdc1238149ccf33a2)
-rw-r--r--source3/include/gums.h48
1 files changed, 27 insertions, 21 deletions
diff --git a/source3/include/gums.h b/source3/include/gums.h
index d1799f377d..a44dadc883 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 */