diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/smb.h | 8 | ||||
-rw-r--r-- | source3/lib/substitute.c | 2 | ||||
-rw-r--r-- | source3/modules/vfs_expand_msdfs.c | 2 | ||||
-rw-r--r-- | source3/modules/vfs_full_audit.c | 3 | ||||
-rw-r--r-- | source3/modules/vfs_recycle.c | 3 | ||||
-rw-r--r-- | source3/smbd/connection.c | 4 | ||||
-rw-r--r-- | source3/smbd/lanman.c | 8 | ||||
-rw-r--r-- | source3/smbd/service.c | 17 | ||||
-rw-r--r-- | source3/smbd/uid.c | 16 |
9 files changed, 30 insertions, 33 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h index e1f17a178a..5248fd2725 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -627,18 +627,10 @@ typedef struct connection_struct { struct auth_serversupplied_info *server_info; char *user; /* name of user who *opened* this connection */ - uid_t uid; /* uid of user who *opened* this connection */ - gid_t gid; /* gid of user who *opened* this connection */ char client_address[INET6_ADDRSTRLEN]; /* String version of client IP address. */ uint16 vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */ - /* following groups stuff added by ih */ - - /* This groups info is valid for the user that *opened* the connection */ - size_t ngroups; - gid_t *groups; - time_t lastused; time_t lastused_count; bool used; diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index c8ad6199e8..5be5af6637 100644 --- a/source3/lib/substitute.c +++ b/source3/lib/substitute.c @@ -907,7 +907,7 @@ char *standard_sub_conn(TALLOC_CTX *ctx, connection_struct *conn, const char *st lp_servicename(SNUM(conn)), conn->user, conn->connectpath, - conn->gid, + conn->server_info->gid, get_smb_user_name(), "", str); diff --git a/source3/modules/vfs_expand_msdfs.c b/source3/modules/vfs_expand_msdfs.c index 9d4883c085..62222c48ff 100644 --- a/source3/modules/vfs_expand_msdfs.c +++ b/source3/modules/vfs_expand_msdfs.c @@ -147,7 +147,7 @@ static char *expand_msdfs_target(TALLOC_CTX *ctx, lp_servicename(SNUM(conn)), conn->user, conn->connectpath, - conn->gid, + conn->server_info->gid, get_current_username(), current_user_info.domain, targethost); diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 19a1d02de4..1b44e02375 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -694,7 +694,8 @@ static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn) } return talloc_sub_advanced(ctx, lp_servicename(SNUM(conn)), conn->user, - conn->connectpath, conn->gid, + conn->connectpath, + conn->server_info->gid, get_current_username(), current_user_info.domain, prefix); diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c index da1716719a..27700367e6 100644 --- a/source3/modules/vfs_recycle.c +++ b/source3/modules/vfs_recycle.c @@ -433,7 +433,8 @@ static int recycle_unlink(vfs_handle_struct *handle, const char *file_name) repository = talloc_sub_advanced(NULL, lp_servicename(SNUM(conn)), conn->user, - conn->connectpath, conn->gid, + conn->connectpath, + conn->server_info->gid, get_current_username(), current_user_info.domain, recycle_repository(handle)); diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c index d7063c9989..97f36971c8 100644 --- a/source3/smbd/connection.c +++ b/source3/smbd/connection.c @@ -152,8 +152,8 @@ bool claim_connection(connection_struct *conn, const char *name, crec.pid = procid_self(); crec.cnum = conn?conn->cnum:-1; if (conn) { - crec.uid = conn->uid; - crec.gid = conn->gid; + crec.uid = conn->server_info->uid; + crec.gid = conn->server_info->gid; strlcpy(crec.servicename, lp_servicename(SNUM(conn)), sizeof(crec.servicename)); } diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c index a233893482..4309622b26 100644 --- a/source3/smbd/lanman.c +++ b/source3/smbd/lanman.c @@ -103,7 +103,7 @@ static int CopyExpanded(connection_struct *conn, lp_servicename(SNUM(conn)), conn->user, conn->connectpath, - conn->gid, + conn->server_info->gid, get_current_username(), current_user_info.domain, buf); @@ -154,7 +154,7 @@ static int StrlenExpanded(connection_struct *conn, int snum, char *s) lp_servicename(SNUM(conn)), conn->user, conn->connectpath, - conn->gid, + conn->server_info->gid, get_current_username(), current_user_info.domain, buf); @@ -184,7 +184,7 @@ static char *Expand(connection_struct *conn, int snum, char *s) lp_servicename(SNUM(conn)), conn->user, conn->connectpath, - conn->gid, + conn->server_info->gid, get_current_username(), current_user_info.domain, buf); @@ -3002,7 +3002,7 @@ static bool api_RNetServerGetInfo(connection_struct *conn,uint16 vuid, lp_servicename(SNUM(conn)), conn->user, conn->connectpath, - conn->gid, + conn->server_info->gid, get_current_username(), current_user_info.domain, comment); diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 77ed320e07..fd072135e8 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -833,14 +833,13 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, conn->vuid = (vuser != NULL) ? vuser->vuid : UID_FIELD_INVALID; - conn->uid = conn->server_info->uid; - conn->gid = conn->server_info->gid; string_set(&conn->user, conn->server_info->unix_name); { char *s = talloc_sub_advanced(talloc_tos(), lp_servicename(SNUM(conn)), conn->user, - conn->connectpath, conn->gid, + conn->connectpath, + conn->server_info->gid, get_current_username(), current_user_info.domain, lp_pathname(snum)); @@ -960,7 +959,8 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, if (*lp_rootpreexec(snum)) { char *cmd = talloc_sub_advanced(talloc_tos(), lp_servicename(SNUM(conn)), conn->user, - conn->connectpath, conn->gid, + conn->connectpath, + conn->server_info->gid, get_current_username(), current_user_info.domain, lp_rootpreexec(snum)); @@ -997,7 +997,8 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, if (*lp_preexec(snum)) { char *cmd = talloc_sub_advanced(talloc_tos(), lp_servicename(SNUM(conn)), conn->user, - conn->connectpath, conn->gid, + conn->connectpath, + conn->server_info->gid, get_current_username(), current_user_info.domain, lp_preexec(snum)); @@ -1316,7 +1317,8 @@ void close_cnum(connection_struct *conn, uint16 vuid) change_to_user(conn, vuid)) { char *cmd = talloc_sub_advanced(talloc_tos(), lp_servicename(SNUM(conn)), conn->user, - conn->connectpath, conn->gid, + conn->connectpath, + conn->server_info->gid, get_current_username(), current_user_info.domain, lp_postexec(SNUM(conn))); @@ -1330,7 +1332,8 @@ void close_cnum(connection_struct *conn, uint16 vuid) if (*lp_rootpostexec(SNUM(conn))) { char *cmd = talloc_sub_advanced(talloc_tos(), lp_servicename(SNUM(conn)), conn->user, - conn->connectpath, conn->gid, + conn->connectpath, + conn->server_info->gid, get_current_username(), current_user_info.domain, lp_rootpostexec(SNUM(conn))); diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 8a4a54f867..004e48a44f 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -157,7 +157,7 @@ bool change_to_user(connection_struct *conn, uint16 vuid) */ if((lp_security() == SEC_SHARE) && (current_user.conn == conn) && - (current_user.ut.uid == conn->uid)) { + (current_user.ut.uid == conn->server_info->uid)) { DEBUG(4,("change_to_user: Skipping user change - already " "user\n")); return(True); @@ -186,10 +186,10 @@ bool change_to_user(connection_struct *conn, uint16 vuid) */ if (conn->force_user) /* security = share sets this too */ { - uid = conn->uid; - gid = conn->gid; - group_list = conn->groups; - num_groups = conn->ngroups; + uid = conn->server_info->uid; + gid = conn->server_info->gid; + group_list = conn->server_info->groups; + num_groups = conn->server_info->n_groups; } else if (vuser) { uid = conn->admin_user ? 0 : vuser->server_info->uid; gid = conn->server_info->gid; @@ -220,15 +220,15 @@ bool change_to_user(connection_struct *conn, uint16 vuid) int i; for (i = 0; i < num_groups; i++) { - if (group_list[i] == conn->gid) { - gid = conn->gid; + if (group_list[i] == conn->server_info->gid) { + gid = conn->server_info->gid; gid_to_sid(&conn->server_info->ptok ->user_sids[1], gid); break; } } } else { - gid = conn->gid; + gid = conn->server_info->gid; gid_to_sid(&conn->server_info->ptok->user_sids[1], gid); } |