summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>2000-06-08 13:56:07 +0000
committerLuke Leighton <lkcl@samba.org>2000-06-08 13:56:07 +0000
commit84d40095e1d7ba5c66cabfd2d41012162d652970 (patch)
tree51d7e4ce6b98b55dd044180c7e87a1009bcbc064 /source3/smbd
parent1bdbb4e6012307b366c064554361c59f27b1ae7e (diff)
downloadsamba-84d40095e1d7ba5c66cabfd2d41012162d652970.tar.gz
samba-84d40095e1d7ba5c66cabfd2d41012162d652970.tar.bz2
samba-84d40095e1d7ba5c66cabfd2d41012162d652970.zip
added a NET_USER_INFO_3 struct to user_struct.
register_vuid fills it with constructed info. (This used to be commit b1889e4334012b1b2caa604b859da4271509fc87)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/password.c35
-rw-r--r--source3/smbd/reply.c5
2 files changed, 38 insertions, 2 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index d3a728bf42..5815bbd164 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -214,7 +214,8 @@ has been given. vuid is biased by an offset. This allows us to
tell random client vuid's (normally zero) from valid vuids.
****************************************************************************/
uint16 register_vuid(uid_t uid,gid_t gid, char *unix_name, char *requested_name,
- char *domain,BOOL guest)
+ char *domain,BOOL guest,
+ NET_USER_INFO_3 *usr)
{
user_struct *vuser;
struct passwd *pwfile; /* for getting real name from passwd file */
@@ -274,6 +275,38 @@ uint16 register_vuid(uid_t uid,gid_t gid, char *unix_name, char *requested_name,
&vuser->n_groups,
&vuser->groups);
+ if (usr == NULL)
+ {
+ int i;
+ extern DOM_SID global_sam_sid;
+
+ DEBUG(0,("vuser struct usr being filled in with trash, today\n"));
+ DEBUG(0,("this needs to be replaced with a proper surs impl.\n"));
+ DEBUG(0,("e.g. the one used in winbindd. in fact, all\n"));
+ DEBUG(0,("occurrences of pdb_xxx_to_xxx should be replaced\n"));
+ DEBUG(0,("as soon as possible.\n"));
+ vuser->usr.user_id = pdb_uid_to_user_rid(uid);
+ vuser->usr.group_id = pdb_gid_to_group_rid(gid);
+ vuser->usr.num_groups = vuser->n_groups;
+ for (i = 0; i < vuser->usr.num_groups; i++)
+ {
+ DOM_GID *ntgid = &vuser->usr.gids[i];
+ ntgid->attr = 0x7;
+ ntgid->g_rid = pdb_gid_to_group_rid(vuser->groups[i]);
+ }
+
+ /* this is possibly the worst thing to do, ever. it assumes */
+ /* that all users of this system are in the local SAM database */
+ /* however, because there is no code to do anything otherwise, */
+ /* we have no choice */
+
+ init_dom_sid2(&vuser->usr.dom_sid, &global_sam_sid);
+ }
+ else
+ {
+ vuser->usr = *usr;
+ }
+
DEBUG(3,("uid %d registered to name %s\n",(int)uid,unix_name));
DEBUG(3, ("Clearing default real name\n"));
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 9845853349..f9c0695a39 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1000,7 +1000,10 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int
/* register the name and uid as being validated, so further connections
to a uid can get through without a password, on the same VC */
- sess_vuid = register_vuid(uid,gid,user,sesssetup_user,domain,guest);
+
+ DEBUG(0,("must call domain_client_validate() which returns a "));
+ DEBUG(0,("NET_USER_INFO_3 structure to pass to register_vuid()"));
+ sess_vuid = register_vuid(uid,gid,user,sesssetup_user,domain,guest, NULL);
SSVAL(outbuf,smb_uid,sess_vuid);
SSVAL(inbuf,smb_uid,sess_vuid);