summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-05-08 16:06:42 +0200
committerVolker Lendecke <vl@samba.org>2008-05-10 11:17:01 +0200
commit5bda9a8af02c7889e15e580a5620689aa312a16a (patch)
tree598d0b811b48bedca3140ac43fad2ec5aa999dcc /source3
parent66835ba2b70935be226e9049cf82182719ffa4bf (diff)
downloadsamba-5bda9a8af02c7889e15e580a5620689aa312a16a.tar.gz
samba-5bda9a8af02c7889e15e580a5620689aa312a16a.tar.bz2
samba-5bda9a8af02c7889e15e580a5620689aa312a16a.zip
Remove "user" from connection_struct
(This used to be commit 368454a27cb53a408ec416cbf37235b304592fb5)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/smb.h1
-rw-r--r--source3/lib/substitute.c2
-rw-r--r--source3/modules/vfs_expand_msdfs.c2
-rw-r--r--source3/modules/vfs_full_audit.c3
-rw-r--r--source3/modules/vfs_recycle.c2
-rw-r--r--source3/smbd/close.c2
-rw-r--r--source3/smbd/conn.c2
-rw-r--r--source3/smbd/fake_file.c3
-rw-r--r--source3/smbd/lanman.c8
-rw-r--r--source3/smbd/nttrans.c10
-rw-r--r--source3/smbd/open.c5
-rw-r--r--source3/smbd/service.c25
-rw-r--r--source3/smbd/trans2.c9
-rw-r--r--source3/torture/vfstest.c1
14 files changed, 42 insertions, 33 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 6ef45070aa..1d6aba9b69 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -630,7 +630,6 @@ typedef struct connection_struct {
*/
struct auth_serversupplied_info *server_info;
- char *user; /* name 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 */
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index 5be5af6637..17bcbcac9d 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -905,7 +905,7 @@ char *standard_sub_conn(TALLOC_CTX *ctx, connection_struct *conn, const char *st
{
return talloc_sub_advanced(ctx,
lp_servicename(SNUM(conn)),
- conn->user,
+ conn->server_info->unix_name,
conn->connectpath,
conn->server_info->gid,
get_smb_user_name(),
diff --git a/source3/modules/vfs_expand_msdfs.c b/source3/modules/vfs_expand_msdfs.c
index 62222c48ff..133c5eb28b 100644
--- a/source3/modules/vfs_expand_msdfs.c
+++ b/source3/modules/vfs_expand_msdfs.c
@@ -145,7 +145,7 @@ static char *expand_msdfs_target(TALLOC_CTX *ctx,
targethost = talloc_sub_advanced(ctx,
lp_servicename(SNUM(conn)),
- conn->user,
+ conn->server_info->unix_name,
conn->connectpath,
conn->server_info->gid,
get_current_username(),
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 1b44e02375..31069c1669 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -693,7 +693,8 @@ static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn)
return NULL;
}
return talloc_sub_advanced(ctx,
- lp_servicename(SNUM(conn)), conn->user,
+ lp_servicename(SNUM(conn)),
+ conn->server_info->unix_name,
conn->connectpath,
conn->server_info->gid,
get_current_username(),
diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c
index 27700367e6..abfae78b72 100644
--- a/source3/modules/vfs_recycle.c
+++ b/source3/modules/vfs_recycle.c
@@ -432,7 +432,7 @@ static int recycle_unlink(vfs_handle_struct *handle, const char *file_name)
int rc = -1;
repository = talloc_sub_advanced(NULL, lp_servicename(SNUM(conn)),
- conn->user,
+ conn->server_info->unix_name,
conn->connectpath,
conn->server_info->gid,
get_current_username(),
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index e27d5c44fa..df188bafe1 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -581,7 +581,7 @@ static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_
}
DEBUG(2,("%s closed file %s (numopen=%d) %s\n",
- conn->user,fsp->fsp_name,
+ conn->server_info->unix_name,fsp->fsp_name,
conn->num_files_open,
nt_errstr(status) ));
diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c
index ce3512c4ec..e899af1319 100644
--- a/source3/smbd/conn.c
+++ b/source3/smbd/conn.c
@@ -151,7 +151,6 @@ find_again:
num_open++;
- string_set(&conn->user,"");
string_set(&conn->dirpath,"");
string_set(&conn->connectpath,"");
string_set(&conn->origpath,"");
@@ -283,7 +282,6 @@ void conn_free_internal(connection_struct *conn)
free_namearray(conn->veto_oplock_list);
free_namearray(conn->aio_write_behind_list);
- string_free(&conn->user);
string_free(&conn->dirpath);
string_free(&conn->connectpath);
string_free(&conn->origpath);
diff --git a/source3/smbd/fake_file.c b/source3/smbd/fake_file.c
index 31fe030f46..0a54c85cd0 100644
--- a/source3/smbd/fake_file.c
+++ b/source3/smbd/fake_file.c
@@ -113,7 +113,8 @@ NTSTATUS open_fake_file(connection_struct *conn,
if (current_user.ut.uid != 0) {
DEBUG(3, ("open_fake_file_shared: access_denied to "
"service[%s] file[%s] user[%s]\n",
- lp_servicename(SNUM(conn)),fname,conn->user));
+ lp_servicename(SNUM(conn)), fname,
+ conn->server_info->unix_name));
return NT_STATUS_ACCESS_DENIED;
}
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 4309622b26..413b916f7b 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -101,7 +101,7 @@ static int CopyExpanded(connection_struct *conn,
}
buf = talloc_sub_advanced(ctx,
lp_servicename(SNUM(conn)),
- conn->user,
+ conn->server_info->unix_name,
conn->connectpath,
conn->server_info->gid,
get_current_username(),
@@ -152,7 +152,7 @@ static int StrlenExpanded(connection_struct *conn, int snum, char *s)
}
buf = talloc_sub_advanced(ctx,
lp_servicename(SNUM(conn)),
- conn->user,
+ conn->server_info->unix_name,
conn->connectpath,
conn->server_info->gid,
get_current_username(),
@@ -182,7 +182,7 @@ static char *Expand(connection_struct *conn, int snum, char *s)
}
return talloc_sub_advanced(ctx,
lp_servicename(SNUM(conn)),
- conn->user,
+ conn->server_info->unix_name,
conn->connectpath,
conn->server_info->gid,
get_current_username(),
@@ -3000,7 +3000,7 @@ static bool api_RNetServerGetInfo(connection_struct *conn,uint16 vuid,
SIVAL(p,6,PTR_DIFF(p2,*rdata));
comment = talloc_sub_advanced(ctx,
lp_servicename(SNUM(conn)),
- conn->user,
+ conn->server_info->unix_name,
conn->connectpath,
conn->server_info->gid,
get_current_username(),
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index bd34b5a361..b5546ea1e1 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -2037,8 +2037,9 @@ static void call_nt_transact_get_user_quota(connection_struct *conn,
/* access check */
if (current_user.ut.uid != 0) {
- DEBUG(1,("get_user_quota: access_denied service [%s] user [%s]\n",
- lp_servicename(SNUM(conn)),conn->user));
+ DEBUG(1,("get_user_quota: access_denied service [%s] user "
+ "[%s]\n", lp_servicename(SNUM(conn)),
+ conn->server_info->unix_name));
reply_doserror(req, ERRDOS, ERRnoaccess);
return;
}
@@ -2303,8 +2304,9 @@ static void call_nt_transact_set_user_quota(connection_struct *conn,
/* access check */
if (current_user.ut.uid != 0) {
- DEBUG(1,("set_user_quota: access_denied service [%s] user [%s]\n",
- lp_servicename(SNUM(conn)),conn->user));
+ DEBUG(1,("set_user_quota: access_denied service [%s] user "
+ "[%s]\n", lp_servicename(SNUM(conn)),
+ conn->server_info->unix_name));
reply_doserror(req, ERRDOS, ERRnoaccess);
return;
}
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 5c860f891d..546128c0e5 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -400,8 +400,9 @@ static NTSTATUS open_file(files_struct *fsp,
fsp->wcp = NULL; /* Write cache pointer. */
DEBUG(2,("%s opened file %s read=%s write=%s (numopen=%d)\n",
- *current_user_info.smb_name ?
- current_user_info.smb_name : conn->user,fsp->fsp_name,
+ *current_user_info.smb_name
+ ? current_user_info.smb_name : conn->server_info->unix_name,
+ fsp->fsp_name,
BOOLSTR(fsp->can_read), BOOLSTR(fsp->can_write),
conn->num_files_open + 1));
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index fd072135e8..c90d4d16bc 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -820,7 +820,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
if (*lp_force_group(snum)) {
status = find_forced_group(
- conn->force_user, snum, conn->user,
+ conn->force_user, snum, conn->server_info->unix_name,
&conn->server_info->ptok->user_sids[1],
&conn->server_info->gid);
@@ -833,11 +833,10 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
conn->vuid = (vuser != NULL) ? vuser->vuid : UID_FIELD_INVALID;
- string_set(&conn->user, conn->server_info->unix_name);
-
{
char *s = talloc_sub_advanced(talloc_tos(),
- lp_servicename(SNUM(conn)), conn->user,
+ lp_servicename(SNUM(conn)),
+ conn->server_info->unix_name,
conn->connectpath,
conn->server_info->gid,
get_current_username(),
@@ -958,7 +957,8 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
/* execute any "root preexec = " line */
if (*lp_rootpreexec(snum)) {
char *cmd = talloc_sub_advanced(talloc_tos(),
- lp_servicename(SNUM(conn)), conn->user,
+ lp_servicename(SNUM(conn)),
+ conn->server_info->unix_name,
conn->connectpath,
conn->server_info->gid,
get_current_username(),
@@ -996,7 +996,8 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
/* execute any "preexec = " line */
if (*lp_preexec(snum)) {
char *cmd = talloc_sub_advanced(talloc_tos(),
- lp_servicename(SNUM(conn)), conn->user,
+ lp_servicename(SNUM(conn)),
+ conn->server_info->unix_name,
conn->connectpath,
conn->server_info->gid,
get_current_username(),
@@ -1029,7 +1030,8 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
to allow any filesystems needing user credentials to initialize
themselves. */
- if (SMB_VFS_CONNECT(conn, lp_servicename(snum), conn->user) < 0) {
+ if (SMB_VFS_CONNECT(conn, lp_servicename(snum),
+ conn->server_info->unix_name) < 0) {
DEBUG(0,("make_connection: VFS make connection failed!\n"));
*pstatus = NT_STATUS_UNSUCCESSFUL;
goto err_root_exit;
@@ -1096,7 +1098,8 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
conn->client_address );
dbgtext( "%s", srv_is_signing_active() ? "signed " : "");
dbgtext( "connect to service %s ", lp_servicename(snum) );
- dbgtext( "initially as user %s ", conn->user );
+ dbgtext( "initially as user %s ",
+ conn->server_info->unix_name );
dbgtext( "(uid=%d, gid=%d) ", (int)geteuid(), (int)getegid() );
dbgtext( "(pid %d)\n", (int)sys_getpid() );
}
@@ -1316,7 +1319,8 @@ void close_cnum(connection_struct *conn, uint16 vuid)
if (*lp_postexec(SNUM(conn)) &&
change_to_user(conn, vuid)) {
char *cmd = talloc_sub_advanced(talloc_tos(),
- lp_servicename(SNUM(conn)), conn->user,
+ lp_servicename(SNUM(conn)),
+ conn->server_info->unix_name,
conn->connectpath,
conn->server_info->gid,
get_current_username(),
@@ -1331,7 +1335,8 @@ void close_cnum(connection_struct *conn, uint16 vuid)
/* execute any "root postexec = " line */
if (*lp_rootpostexec(SNUM(conn))) {
char *cmd = talloc_sub_advanced(talloc_tos(),
- lp_servicename(SNUM(conn)), conn->user,
+ lp_servicename(SNUM(conn)),
+ conn->server_info->unix_name,
conn->connectpath,
conn->server_info->gid,
get_current_username(),
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 4d60eecda9..d5435533f9 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -2826,8 +2826,10 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
/* access check */
if (current_user.ut.uid != 0) {
- DEBUG(0,("set_user_quota: access_denied service [%s] user [%s]\n",
- lp_servicename(SNUM(conn)),conn->user));
+ DEBUG(0,("set_user_quota: access_denied "
+ "service [%s] user [%s]\n",
+ lp_servicename(SNUM(conn)),
+ conn->server_info->unix_name));
reply_doserror(req, ERRDOS, ERRnoaccess);
return;
}
@@ -3267,7 +3269,8 @@ cap_low = 0x%x, cap_high = 0x%x\n",
/* access check */
if ((current_user.ut.uid != 0)||!CAN_WRITE(conn)) {
DEBUG(0,("set_user_quota: access_denied service [%s] user [%s]\n",
- lp_servicename(SNUM(conn)),conn->user));
+ lp_servicename(SNUM(conn)),
+ conn->server_info->unix_name));
reply_doserror(req, ERRSRV, ERRaccess);
return;
}
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index 7e4ee624a1..56e27eec1d 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -563,7 +563,6 @@ int main(int argc, char *argv[])
sec_init();
conn_init();
vfs.conn = conn_new();
- string_set(&vfs.conn->user,"vfstest");
for (i=0; i < 1024; i++)
vfs.files[i] = NULL;