diff options
author | Volker Lendecke <vl@samba.org> | 2008-06-15 13:37:53 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-06-15 13:37:53 +0200 |
commit | d49de28f1154140f63670cfbf5093cdee6f16eb0 (patch) | |
tree | a0307d31c687482458946b0e3c86e8383d72ca74 | |
parent | 3a5e1cacf1495a37143b15725c5d226088b2473a (diff) | |
download | samba-d49de28f1154140f63670cfbf5093cdee6f16eb0.tar.gz samba-d49de28f1154140f63670cfbf5093cdee6f16eb0.tar.bz2 samba-d49de28f1154140f63670cfbf5093cdee6f16eb0.zip |
Remove the current_user reference from fake_file.c
The current vuid is not only available there, it is also in the current
smb_request structure.
(This used to be commit c8fd5eef32a86888c7a28317f0fdf717a26b7d4c)
-rw-r--r-- | source3/include/proto.h | 1 | ||||
-rw-r--r-- | source3/smbd/fake_file.c | 7 | ||||
-rw-r--r-- | source3/smbd/open.c | 3 |
3 files changed, 6 insertions, 5 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index dfde0c750a..4bdf808ff7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -9629,6 +9629,7 @@ void reply_unix_error(struct smb_request *req, uint8 defclass, uint32 defcode, enum FAKE_FILE_TYPE is_fake_file(const char *fname); NTSTATUS open_fake_file(connection_struct *conn, + uint16_t current_vuid, enum FAKE_FILE_TYPE fake_file_type, const char *fname, uint32 access_mask, diff --git a/source3/smbd/fake_file.c b/source3/smbd/fake_file.c index 565b557dd3..47982d4f00 100644 --- a/source3/smbd/fake_file.c +++ b/source3/smbd/fake_file.c @@ -19,8 +19,6 @@ #include "includes.h" -extern struct current_user current_user; - struct fake_file_type { const char *name; enum FAKE_FILE_TYPE type; @@ -101,6 +99,7 @@ enum FAKE_FILE_TYPE is_fake_file(const char *fname) ****************************************************************************/ NTSTATUS open_fake_file(connection_struct *conn, + uint16_t current_vuid, enum FAKE_FILE_TYPE fake_file_type, const char *fname, uint32 access_mask, @@ -110,7 +109,7 @@ NTSTATUS open_fake_file(connection_struct *conn, NTSTATUS status; /* access check */ - if (current_user.ut.uid != 0) { + if (conn->server_info->uid != 0) { DEBUG(3, ("open_fake_file_shared: access_denied to " "service[%s] file[%s] user[%s]\n", lp_servicename(SNUM(conn)), fname, @@ -129,7 +128,7 @@ NTSTATUS open_fake_file(connection_struct *conn, fsp->conn = conn; fsp->fh->fd = -1; - fsp->vuid = current_user.vuid; + fsp->vuid = current_vuid; fsp->fh->pos = -1; fsp->can_lock = False; /* Should this be true ? - No, JRA */ fsp->access_mask = access_mask; diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 546128c0e5..9b847ec877 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2990,7 +2990,8 @@ NTSTATUS create_file(connection_struct *conn, * also tries a QUERY_FILE_INFO on the file and then * close it */ - status = open_fake_file(conn, fake_file_type, fname, + status = open_fake_file(conn, req->vuid, + fake_file_type, fname, access_mask, &fsp); if (!NT_STATUS_IS_OK(status)) { goto fail; |