summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-04-29 13:43:10 +0200
committerVolker Lendecke <vl@samba.org>2008-05-05 18:28:58 +0200
commitaa2299d42adf4d27e707ac755e07be70d0af1bb4 (patch)
tree762f549e9627f61759d6ffec443f91f5785e9174
parent51d5d512f28eadc74eced43e5e7f4e5bdff3ff69 (diff)
downloadsamba-aa2299d42adf4d27e707ac755e07be70d0af1bb4.tar.gz
samba-aa2299d42adf4d27e707ac755e07be70d0af1bb4.tar.xz
samba-aa2299d42adf4d27e707ac755e07be70d0af1bb4.zip
Remove the unix token info from "struct user_struct"
-rw-r--r--source/include/smb.h7
-rw-r--r--source/smbd/lanman.c10
-rw-r--r--source/smbd/password.c26
-rw-r--r--source/smbd/service.c4
-rw-r--r--source/smbd/session.c4
-rw-r--r--source/smbd/uid.c10
6 files changed, 19 insertions, 42 deletions
diff --git a/source/include/smb.h b/source/include/smb.h
index bad5857520f..c3f8fbddcef 100644
--- a/source/include/smb.h
+++ b/source/include/smb.h
@@ -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.
diff --git a/source/smbd/lanman.c b/source/smbd/lanman.c
index 39d49334e06..7ba4b644776 100644
--- a/source/smbd/lanman.c
+++ b/source/smbd/lanman.c
@@ -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);
diff --git a/source/smbd/password.c b/source/smbd/password.c
index 2636438d5d3..c5c0245444f 100644
--- a/source/smbd/password.c
+++ b/source/smbd/password.c
@@ -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++;
diff --git a/source/smbd/service.c b/source/smbd/service.c
index a286e561c75..43f8699e296 100644
--- a/source/smbd/service.c
+++ b/source/smbd/service.c
@@ -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;
diff --git a/source/smbd/session.c b/source/smbd/session.c
index 000b2f5d9c9..adfc4e300f3 100644
--- a/source/smbd/session.c
+++ b/source/smbd/session.c
@@ -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)));
diff --git a/source/smbd/uid.c b/source/smbd/uid.c
index 866f954436c..0b87b93636c 100644
--- a/source/smbd/uid.c
+++ b/source/smbd/uid.c
@@ -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 "