Remove the unix token info from "struct user_struct"
authorVolker Lendecke <vl@samba.org>
Tue, 29 Apr 2008 11:43:10 +0000 (13:43 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 5 May 2008 16:28:58 +0000 (18:28 +0200)
(This used to be commit aa2299d42adf4d27e707ac755e07be70d0af1bb4)

source3/include/smb.h
source3/smbd/lanman.c
source3/smbd/password.c
source3/smbd/service.c
source3/smbd/session.c
source3/smbd/uid.c

index bad5857520f5ec7c8bc2b5731b40995c98423a38..c3f8fbddcef58431b5635254db27a04cc5ca9181 100644 (file)
@@ -1777,18 +1777,11 @@ struct pending_auth_data {
 typedef struct user_struct {
        struct user_struct *next, *prev;
        uint16 vuid; /* Tag for this entry. */
-       uid_t uid; /* uid of a validated user */
-       gid_t gid; /* gid of a validated user */
 
        userdom_struct user;
 
        bool guest;
 
-       /* following groups stuff added by ih */
-       /* This groups info is needed for when we become_user() for this uid */
-       int n_groups;
-       gid_t *groups;
-
        DATA_BLOB session_key;
 
        char *session_keystr; /* used by utmp and pam session code.  
index 39d49334e0613baaa3ed6f1915db6ccb65688021..7ba4b64477676c69d17c59b0b1692fd1e3d064d9 100644 (file)
@@ -3338,8 +3338,9 @@ static bool api_RNetUserGetInfo(connection_struct *conn, uint16 vuid,
           Don't depend on vuser being non-null !!. JRA */
        user_struct *vuser = get_valid_user_struct(vuid);
        if(vuser != NULL) {
-               DEBUG(3,("  Username of UID %d is %s\n", (int)vuser->uid,
-                       vuser->user.unix_name));
+               DEBUG(3,("  Username of UID %d is %s\n",
+                        (int)vuser->server_info->uid,
+                        vuser->user.unix_name));
        }
 
        if (!str1 || !str2 || !UserName || !p) {
@@ -3589,8 +3590,9 @@ static bool api_WWkstaUserLogon(connection_struct *conn,uint16 vuid,
        }
 
        if(vuser != NULL) {
-               DEBUG(3,("  Username of UID %d is %s\n", (int)vuser->uid, 
-                       vuser->user.unix_name));
+               DEBUG(3,("  Username of UID %d is %s\n",
+                        (int)vuser->server_info->uid,
+                        vuser->user.unix_name));
        }
 
        uLevel = get_safe_SVAL(param,tpscnt,p,0,-1);
index 2636438d5d31420b3fe10a17ce4283036213cfab..c5c0245444f265f6a1405dd7d558f01de2ebeb73 100644 (file)
@@ -269,24 +269,6 @@ int register_existing_vuid(uint16 vuid,
 
        talloc_steal(vuser, vuser->server_info);
 
-       /* the next functions should be done by a SID mapping system (SMS) as
-        * the new real sam db won't have reference to unix uids or gids
-        */
-
-       vuser->uid = server_info->uid;
-       vuser->gid = server_info->gid;
-
-       vuser->n_groups = server_info->n_groups;
-       if (vuser->n_groups) {
-               if (!(vuser->groups = (gid_t *)talloc_memdup(vuser,
-                                       server_info->groups,
-                                       sizeof(gid_t)*vuser->n_groups))) {
-                       DEBUG(0,("register_existing_vuid: "
-                               "failed to talloc_memdup vuser->groups\n"));
-                       goto fail;
-               }
-       }
-
        vuser->guest = server_info->guest;
        fstrcpy(vuser->user.unix_name, server_info->unix_name);
 
@@ -301,8 +283,8 @@ int register_existing_vuid(uint16 vuid,
        vuser->session_key = session_key;
 
        DEBUG(10,("register_existing_vuid: (%u,%u) %s %s %s guest=%d\n",
-                       (unsigned int)vuser->uid,
-                       (unsigned int)vuser->gid,
+                       (unsigned int)vuser->server_info->uid,
+                       (unsigned int)vuser->server_info->gid,
                        vuser->user.unix_name, vuser->user.smb_name,
                        vuser->user.domain, vuser->guest ));
 
@@ -317,8 +299,8 @@ int register_existing_vuid(uint16 vuid,
        }
 
        DEBUG(3,("register_existing_vuid: UNIX uid %d is UNIX user %s, "
-               "and will be vuid %u\n",
-               (int)vuser->uid,vuser->user.unix_name, vuser->vuid));
+               "and will be vuid %u\n", (int)vuser->server_info->uid,
+                vuser->user.unix_name, vuser->vuid));
 
        next_vuid++;
        num_validated_vuids++;
index a286e561c7575bfaee93aa148ee67f55cab87d95..43f8699e2965baa4a4d00230dc5831abfb079979 100644 (file)
@@ -736,8 +736,8 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
                        }
                }
                conn->vuid = vuser->vuid;
-               conn->uid = vuser->uid;
-               conn->gid = vuser->gid;
+               conn->uid = vuser->server_info->uid;
+               conn->gid = vuser->server_info->gid;
                string_set(&conn->user,vuser->user.unix_name);
                fstrcpy(user,vuser->user.unix_name);
                guest = vuser->guest; 
index 000b2f5d9c9fc28bdf61e76b8bee28469b1b3978..adfc4e300f3806a24c957d1ac7e28c53f6741af2 100644 (file)
@@ -168,8 +168,8 @@ bool session_claim(user_struct *vuser)
        fstrcpy(sessionid.hostname, hostname);
        sessionid.id_num = i;  /* Only valid for utmp sessions */
        sessionid.pid = pid;
-       sessionid.uid = vuser->uid;
-       sessionid.gid = vuser->gid;
+       sessionid.uid = vuser->server_info->uid;
+       sessionid.gid = vuser->server_info->gid;
        fstrcpy(sessionid.remote_machine, get_remote_machine_name());
        fstrcpy(sessionid.ip_addr_str,
                client_addr(get_client_fd(),addr,sizeof(addr)));
index 866f954436cc79604194eed32db0f7113b81a9ff..0b87b93636c2d65e59e5136d341da569bcb30160 100644 (file)
@@ -177,7 +177,7 @@ bool change_to_user(connection_struct *conn, uint16 vuid)
                return(True);
        } else if ((current_user.conn == conn) && 
                   (vuser != 0) && (current_user.vuid == vuid) && 
-                  (current_user.ut.uid == vuser->uid)) {
+                  (current_user.ut.uid == vuser->server_info->uid)) {
                DEBUG(4,("change_to_user: Skipping user change - already "
                         "user\n"));
                return(True);
@@ -200,10 +200,10 @@ bool change_to_user(connection_struct *conn, uint16 vuid)
                num_groups = conn->ngroups;
                token = conn->nt_user_token;
        } else if (vuser) {
-               uid = conn->admin_user ? 0 : vuser->uid;
-               gid = vuser->gid;
-               num_groups = vuser->n_groups;
-               group_list  = vuser->groups;
+               uid = conn->admin_user ? 0 : vuser->server_info->uid;
+               gid = vuser->server_info->gid;
+               num_groups = vuser->server_info->n_groups;
+               group_list  = vuser->server_info->groups;
                token = vuser->server_info->ptok;
        } else {
                DEBUG(2,("change_to_user: Invalid vuid used %d in accessing "