summaryrefslogtreecommitdiff
path: root/source3/include/smb.h
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-11-17 16:19:04 +0000
committerLuke Leighton <lkcl@samba.org>1998-11-17 16:19:04 +0000
commit74d539f5573a3ed3ff1b96c54752a389da4c3e14 (patch)
treecc4cee5bc8c5ff3e7ebfef04c4ed3ff6a199df48 /source3/include/smb.h
parentb7c4cd9fc6460c2138750237ee4525f929e93a76 (diff)
downloadsamba-74d539f5573a3ed3ff1b96c54752a389da4c3e14.tar.gz
samba-74d539f5573a3ed3ff1b96c54752a389da4c3e14.tar.bz2
samba-74d539f5573a3ed3ff1b96c54752a389da4c3e14.zip
- group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared. - interactive debug detection - re-added mem_man (andrew's memory management, detects memory corruption) - american spellings of "initialise" replaced with english spelling of "initialise". - started on "lookup_name()" and "lookup_sid()" functions. proper ones. - moved lots of functions around. created some modules of commonly used code. e.g the password file locking code, which is used in groupfile.c and aliasfile.c and smbpass.c - moved RID_TYPE_MASK up another bit. this is really unfortunate, but there is no other "fast" way to identify users from groups from aliases. i do not believe that this code saves us anything (the multipliers) and puts us at a disadvantage (reduces the useable rid space). the designers of NT aren't silly: if they can get away with a user- interface-speed LsaLookupNames / LsaLookupSids, then so can we. i spoke with isaac at the cifs conference, the only time for example that they do a security context check is on file create. certainly not on individual file reads / writes, which would drastically hit their performance and ours, too. - renamed myworkgroup to global_sam_name, amongst other things, when used in the rpc code. there is also a global_member_name, as we are always responsible for a SAM database, the scope of which is limited by the role of the machine (e.g if a member of a workgroup, your SAM is for _local_ logins only, and its name is the name of your server. you even still have a SID. see LsaQueryInfoPolicy, levels 3 and 5). - updated functionality of groupname.c to be able to cope with names like DOMAIN\group and SERVER\alias. used this code to be able to do aliases as well as groups. this code may actually be better off being used in username mapping, too. - created a connect to serverlist function in clientgen.c and used it in password.c - initialisation in server.c depends on the role of the server. well, it does now. - rpctorture. smbtorture. EXERCISE EXTREME CAUTION. (This used to be commit 0d21e1e6090b933f396c764af535ca3388a562db)
Diffstat (limited to 'source3/include/smb.h')
-rw-r--r--source3/include/smb.h130
1 files changed, 116 insertions, 14 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 0ffbcded13..63aa7c098d 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -463,30 +463,31 @@ typedef struct local_grp_info
{
fstring name;
fstring comment;
+ uint32 rid; /* alias rid */
} LOCAL_GRP;
-/*** enumerate these to get list of domain groups ***/
+/*** query a domain group, get a list of these: shows who is in that group ***/
-/* domain group member info */
-typedef struct domain_grp_info
+/* domain group info */
+typedef struct domain_grp_member_info
{
fstring name;
- fstring comment;
- uint32 rid; /* group rid */
uint8 attr; /* attributes forced to be set to 0x7: SE_GROUP_xxx */
-} DOMAIN_GRP;
+} DOMAIN_GRP_MEMBER;
-/*** query a domain group, get a list of these: shows who is in that group ***/
+/*** enumerate these to get list of domain groups ***/
-/* domain group info */
-typedef struct domain_grp_member_info
+/* domain group member info */
+typedef struct domain_grp_info
{
fstring name;
+ fstring comment;
+ uint32 rid; /* group rid */
uint8 attr; /* attributes forced to be set to 0x7: SE_GROUP_xxx */
-} DOMAIN_GRP_MEMBER;
+} DOMAIN_GRP;
/* DOM_CHAL - challenge info */
typedef struct chal_info
@@ -814,6 +815,110 @@ struct passdb_ops {
#endif
};
+/*
+ * Each implementation of the passgrp database code needs
+ * to support the following operations.
+ */
+
+struct passgrp_ops {
+ /*
+ * Password database ops.
+ */
+ void *(*startsmbgrpent)(BOOL);
+ void (*endsmbgrpent)(void *);
+ SMB_BIG_UINT (*getsmbgrppos)(void *);
+ BOOL (*setsmbgrppos)(void *, SMB_BIG_UINT);
+
+ /*
+ * smb passgrp database query functions.
+ */
+ struct smb_passwd *(*getsmbgrpnam)(char *, uint32**, int*, uint32**, int*);
+ struct smb_passwd *(*getsmbgrpuid)(uid_t , uint32**, int*, uint32**, int*);
+ struct smb_passwd *(*getsmbgrprid)(uint32, uint32**, int*, uint32**, int*);
+ struct smb_passwd *(*getsmbgrpent)(void *, uint32**, int*, uint32**, int*);
+
+};
+
+/*
+ * Each implementation of the group database code needs
+ * to support the following operations.
+ *
+ * This allows enumeration, modification and addition of groups. there
+ * is _no_ deletion of groups: you can only modify them to a status of
+ * "deleted" (this by the way is a requirement of c2 rating)
+ */
+
+struct groupdb_ops
+{
+ /*
+ * Group database ops.
+ */
+ void *(*startgroupent)(BOOL);
+ void (*endgroupent)(void *);
+ SMB_BIG_UINT (*getgrouppos)(void *);
+ BOOL (*setgrouppos)(void *, SMB_BIG_UINT);
+
+ /*
+ * group database query functions. set the BOOL to Tru
+ * if you want the members in the group as well.
+ */
+ DOMAIN_GRP *(*getgroupnam)(char *, DOMAIN_GRP_MEMBER **, int *);
+ DOMAIN_GRP *(*getgroupgid)(gid_t , DOMAIN_GRP_MEMBER **, int *);
+ DOMAIN_GRP *(*getgrouprid)(uint32, DOMAIN_GRP_MEMBER **, int *);
+ DOMAIN_GRP *(*getgroupent)(void *, DOMAIN_GRP_MEMBER **, int *);
+
+ /*
+ * group database modification functions.
+ */
+ BOOL (*add_group_entry)(DOMAIN_GRP *);
+ BOOL (*mod_group_entry)(DOMAIN_GRP *);
+
+ /*
+ * user group functions
+ */
+ BOOL (*getusergroupsnam)(char *, DOMAIN_GRP **, int *);
+};
+
+/*
+ * Each implementation of the alias database code needs
+ * to support the following operations.
+ *
+ * This allows enumeration, modification and addition of aliases. there
+ * is _no_ deletion of aliases: you can only modify them to a status of
+ * "deleted" (this by the way is a requirement of c2 rating)
+ */
+
+struct aliasdb_ops
+{
+ /*
+ * Alias database ops.
+ */
+ void *(*startaliasent)(BOOL);
+ void (*endaliasent)(void *);
+ SMB_BIG_UINT (*getaliaspos)(void *);
+ BOOL (*setaliaspos)(void *, SMB_BIG_UINT);
+
+ /*
+ * alias database query functions. set the BOOL to Tru
+ * if you want the members in the alias as well.
+ */
+ LOCAL_GRP *(*getaliasnam)(char *, LOCAL_GRP_MEMBER **, int *);
+ LOCAL_GRP *(*getaliasgid)(gid_t , LOCAL_GRP_MEMBER **, int *);
+ LOCAL_GRP *(*getaliasrid)(uint32, LOCAL_GRP_MEMBER **, int *);
+ LOCAL_GRP *(*getaliasent)(void *, LOCAL_GRP_MEMBER **, int *);
+
+ /*
+ * alias database modification functions.
+ */
+ BOOL (*add_alias_entry)(LOCAL_GRP *);
+ BOOL (*mod_alias_entry)(LOCAL_GRP *);
+
+ /*
+ * user alias functions
+ */
+ BOOL (*getuseraliasnam)(char *, LOCAL_GRP **, int *);
+};
+
/* this is used for smbstatus */
struct connect_record
@@ -1650,11 +1755,8 @@ extern int unix_ERR_code;
/* zero a structure */
#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
-/* zero a structure given a pointer to the structure - no zero check */
-#define ZERO_STRUCTPN(x) memset((char *)(x), 0, sizeof(*(x)))
-
/* zero a structure given a pointer to the structure */
-#define ZERO_STRUCTP(x) { if ((x) != NULL) ZERO_STRUCTPN(x); }
+#define ZERO_STRUCTP(x) { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); }
/* zero an array - note that sizeof(array) must work - ie. it must not be a
pointer */