summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-05-19 17:48:40 +0000
committerLuke Leighton <lkcl@samba.org>1998-05-19 17:48:40 +0000
commit0a36b8d8a959c18c670a7e41e3f5a728f3ea88c3 (patch)
tree196e17410cdfc8c8427eb6424c51b1a48add1926 /source3/include
parent643e16be620b920f72f59a037e0d0d4940016a29 (diff)
downloadsamba-0a36b8d8a959c18c670a7e41e3f5a728f3ea88c3.tar.gz
samba-0a36b8d8a959c18c670a7e41e3f5a728f3ea88c3.tar.bz2
samba-0a36b8d8a959c18c670a7e41e3f5a728f3ea88c3.zip
ldap.c :
- added support for some of the new passdb_ops functions. - removed functions that are supported "indirectly" through passdb.c nisppass.c : - modified make_nisname_from_xxx() functions to take a "file" arg. - turned getnisp21pwuid() into getnisp21pwrid(). getnisp21pwuid() functionality is available through "indirect" support in passdb.c - removed functions that are supported "indirectly" through passdb.c - added support for some of the new passdb_ops functions. passdb.c : - created getsam21pwrid() function to go alongside getsam21pwuid. it is not expected that getsam21pwuid ever be used, certainly not from the lib/rpc code. - created getsamdisprid() and getsamdispent(). these are primarily for support of SamrQueryDisplayInfo, however given that they [struct sam_disp_info] return username, rid and fullname, there may be further instances where these functions will be useful. - added support where either the get/add/mod-smb or get/add/mod-sam21 functions are optional. this can be done very easily by checking whether the struct passdb_ops table functions are NULL or not. documented this capability in the notes at the top of the module. - where unix uid was referenced, use uid_t. - where unix gid was referenced, use gid_t. smb.h : - added sam_disp_info functions to passdb_ops. - added getsam21pwrid() function. smbpass.c : - added reference to iterate_getsam21pwrid(). lib/rpc/server/srv_samr.c : - removed group rid code added to get_user_info_21() code: this had been added in the wrong place. the client / server should already know whether it wants to do a lookup by user rid or by group rid. the test of whether the rid is a user or group rid has been left in because this may become useful consistency-check code. - converted back to getsam21pwrid() not getsam21pwuid(pdb_user_rid_to_uid()). this is because the unix uid to user rid mapping can be non-monotonic in some password database systems, and monotonic in others. imposing the restriction by converting immediately from rid to uid at this point is inadviseable, and will place this potential restriction on _all_ password database systems, not just some which, for whatever reason, do not support user rids. it should be up to the individual password database writer to convert from user rid to unix uid, should that module not support rids. lib/rpc/server/srv_util.c : - got lookup_user_name() to call getsamdisprid() not getsmbpwuid(). a bug was introduced (or at least the bug already there was not fixed) whereby the nt user rid was converted to a unix uid, and then not used. (This used to be commit 0193dd21c3c44e0611add742c6f92b92474de6b8)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/proto.h15
-rw-r--r--source3/include/smb.h28
2 files changed, 36 insertions, 7 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 8207aa8adc..177a45c9c0 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1568,13 +1568,16 @@ BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override);
struct smb_passwd *getsmbpwnam(char *name);
struct smb_passwd *getsmbpwuid(uid_t smb_userid);
struct sam_passwd *iterate_getsam21pwnam(char *name);
-struct sam_passwd *iterate_getsam21pwuid(uint32 uid);
+struct sam_passwd *iterate_getsam21pwrid(uint32 rid);
+struct sam_passwd *iterate_getsam21pwuid(uid_t uid);
+struct sam_disp_info *getsamdisprid(uint32 rid);
struct sam_disp_info *getsamdispent(void *vp);
struct sam_passwd *getsam21pwent(void *vp);
BOOL add_sam21pwd_entry(struct sam_passwd *newpwd);
BOOL mod_sam21pwd_entry(struct sam_passwd* pwd, BOOL override);
struct sam_passwd *getsam21pwnam(char *name);
-struct sam_passwd *getsam21pwuid(uint32 uid);
+struct sam_passwd *getsam21pwrid(uint32 rid);
+struct sam_passwd *getsam21pwuid(uid_t uid);
void pdb_init_dispinfo(struct sam_disp_info *user);
void pdb_init_smb(struct smb_passwd *user);
void pdb_init_sam(struct sam_passwd *user);
@@ -1588,10 +1591,10 @@ uint16 pdb_decode_acct_ctrl(char *p);
int pdb_gethexpwd(char *p, char *pwd);
BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid);
BOOL pdb_generate_machine_sid(void);
-uint32 pdb_user_rid_to_uid(uint32 u_rid);
-uint32 pdb_group_rid_to_gid(uint32 u_gid);
-uint32 pdb_uid_to_user_rid(uint32 uid);
-uint32 pdb_gid_to_group_rid(uint32 gid);
+uid_t pdb_user_rid_to_uid(uint32 u_rid);
+gid_t pdb_group_rid_to_gid(uint32 g_rid);
+uint32 pdb_uid_to_user_rid(uid_t uid);
+uint32 pdb_gid_to_group_rid(gid_t gid);
BOOL pdb_rid_is_user(uint32 rid);
/*The following definitions come from password.c */
diff --git a/source3/include/smb.h b/source3/include/smb.h
index fff44f179d..8687f618e4 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -637,6 +637,17 @@ struct shmem_ops {
/*
* Each implementation of the password database code needs
* to support the following operations.
+ *
+ * either the get/mod/add-smbXXX or the get/mod/add-sam21XXX functions
+ * are optional, but not both. conversion routines will be called
+ * if only one of each is supported. the preference is to provide
+ * full getsam21pwXXX functionality.
+ *
+ * e.g: provide a getsam21pwnam() function but set getsmbpwnam() to NULL:
+ * passdb.c will automatically call getsam21pwnam() and then call the
+ * sam21-to-smb conversion routine if the passdb.c::getsmbpwnam() function
+ * is called.
+ *
*/
struct passdb_ops {
@@ -647,12 +658,14 @@ struct passdb_ops {
void (*endsmbpwent)(void *);
unsigned long (*getsmbpwpos)(void *);
BOOL (*setsmbpwpos)(void *, unsigned long);
+
/*
* smb password database query functions.
*/
struct smb_passwd *(*getsmbpwnam)(char *);
struct smb_passwd *(*getsmbpwuid)(uid_t);
struct smb_passwd *(*getsmbpwent)(void *);
+
/*
* smb password database modification functions.
*/
@@ -664,11 +677,24 @@ struct passdb_ops {
*/
struct sam_passwd *(*getsam21pwent)(void *);
+ /*
+ * sam password database query functions.
+ */
struct sam_passwd *(*getsam21pwnam)(char *);
- struct sam_passwd *(*getsam21pwuid)(uint32);
+ struct sam_passwd *(*getsam21pwuid)(uid_t);
+ struct sam_passwd *(*getsam21pwrid)(uint32);
+ /*
+ * sam password database modification functions.
+ */
BOOL (*add_sam21pwd_entry)(struct sam_passwd *);
BOOL (*mod_sam21pwd_entry)(struct sam_passwd *, BOOL);
+
+ /*
+ * sam query display info functions.
+ */
+ struct sam_disp_info *(*getsamdisprid)(uint32);
+ struct sam_disp_info *(*getsamdispent)(void *);
};
/* this is used for smbstatus */