Remove the "current_user" arg from check_fsp
authorVolker Lendecke <vl@samba.org>
Thu, 19 Jun 2008 14:31:59 +0000 (16:31 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 19 Jun 2008 16:51:37 +0000 (18:51 +0200)
check_fsp only used the vuid struct member anyway, and this is available in the
smb_request structure as well.
(This used to be commit 8d364c4c3311b406847158fc37e9208d298cf8ba)

source3/include/proto.h
source3/smbd/nttrans.c
source3/smbd/reply.c
source3/smbd/trans2.c

index 70eaf325bee158cb1e89797f289a2d43c6dc3da8..0ca8693e576dce5b79e5221b5e8da6356e120ada 100644 (file)
@@ -10089,9 +10089,9 @@ size_t srvstr_get_path(TALLOC_CTX *ctx,
                        int flags,
                        NTSTATUS *err);
 bool check_fsp_open(connection_struct *conn, struct smb_request *req,
-              files_struct *fsp, struct current_user *user);
+                   files_struct *fsp);
 bool check_fsp(connection_struct *conn, struct smb_request *req,
-              files_struct *fsp, struct current_user *user);
+              files_struct *fsp);
 bool fsp_belongs_conn(connection_struct *conn, struct smb_request *req,
                      files_struct *fsp, struct current_user *user);
 void reply_special(char *inbuf);
index cbe1299cf713c5ad5116ebf0775e08a28591abad..61562b2de24089d485e64751908f5b8f52a25ae5 100644 (file)
@@ -1520,7 +1520,7 @@ static void call_nt_transact_rename(connection_struct *conn,
        }
 
        fsp = file_fsp(SVAL(params, 0));
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                return;
        }
        srvstr_get_path_wcard(ctx, params, req->flags2, &new_name, params+4,
index 2506ff97e9c4c24ba4539cada9e6ea33534b0f6a..4427ba2ebd965d87c1ab2315b5c5c3a98c63d3bc 100644 (file)
@@ -327,13 +327,13 @@ size_t srvstr_get_path(TALLOC_CTX *ctx,
 ****************************************************************************/
 
 bool check_fsp_open(connection_struct *conn, struct smb_request *req,
-              files_struct *fsp, struct current_user *user)
+                   files_struct *fsp)
 {
        if (!(fsp) || !(conn)) {
                reply_nterror(req, NT_STATUS_INVALID_HANDLE);
                return False;
        }
-       if (((conn) != (fsp)->conn) || user->vuid != (fsp)->vuid) {
+       if (((conn) != (fsp)->conn) || req->vuid != (fsp)->vuid) {
                reply_nterror(req, NT_STATUS_INVALID_HANDLE);
                return False;
        }
@@ -346,9 +346,9 @@ bool check_fsp_open(connection_struct *conn, struct smb_request *req,
 ****************************************************************************/
 
 bool check_fsp(connection_struct *conn, struct smb_request *req,
-              files_struct *fsp, struct current_user *user)
+              files_struct *fsp)
 {
-       if (!check_fsp_open(conn, req, fsp, user)) {
+       if (!check_fsp_open(conn, req, fsp)) {
                return False;
        }
        if ((fsp)->is_directory) {
@@ -2924,7 +2924,7 @@ void reply_lockread(struct smb_request *req)
 
        fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
 
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                END_PROFILE(SMBlockread);
                return;
        }
@@ -3032,7 +3032,7 @@ void reply_read(struct smb_request *req)
 
        fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
 
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                END_PROFILE(SMBread);
                return;
        }
@@ -3287,7 +3287,7 @@ void reply_read_and_X(struct smb_request *req)
                return;
        }
 
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                END_PROFILE(SMBreadX);
                return;
        }
@@ -3425,7 +3425,7 @@ void reply_writebraw(struct smb_request *req)
        }
 
        fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                error_to_writebrawerr(req);
                END_PROFILE(SMBwritebraw);
                return;
@@ -3631,7 +3631,7 @@ void reply_writeunlock(struct smb_request *req)
        
        fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
 
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                END_PROFILE(SMBwriteunlock);
                return;
        }
@@ -3738,7 +3738,7 @@ void reply_write(struct smb_request *req)
 
        fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
 
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                END_PROFILE(SMBwrite);
                return;
        }
@@ -3968,7 +3968,7 @@ void reply_write_and_X(struct smb_request *req)
        startpos = IVAL_TO_SMB_OFF_T(req->inbuf,smb_vwv3);
        write_through = BITSETW(req->inbuf+smb_vwv7,0);
 
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                END_PROFILE(SMBwriteX);
                return;
        }
@@ -4087,7 +4087,7 @@ void reply_lseek(struct smb_request *req)
 
        fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
 
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                return;
        }
 
@@ -4173,7 +4173,7 @@ void reply_flush(struct smb_request *req)
        fnum = SVAL(req->inbuf,smb_vwv0);
        fsp = file_fsp(fnum);
 
-       if ((fnum != 0xFFFF) && !check_fsp(conn, req, fsp, &current_user)) {
+       if ((fnum != 0xFFFF) && !check_fsp(conn, req, fsp)) {
                return;
        }
        
@@ -4320,7 +4320,7 @@ void reply_writeclose(struct smb_request *req)
 
        fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
 
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                END_PROFILE(SMBwriteclose);
                return;
        }
@@ -4407,7 +4407,7 @@ void reply_lock(struct smb_request *req)
 
        fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
 
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                END_PROFILE(SMBlock);
                return;
        }
@@ -4466,7 +4466,7 @@ void reply_unlock(struct smb_request *req)
 
        fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
 
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                END_PROFILE(SMBunlock);
                return;
        }
@@ -4650,7 +4650,7 @@ void reply_printclose(struct smb_request *req)
 
        fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
 
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                END_PROFILE(SMBsplclose);
                 return;
         }
@@ -4790,7 +4790,7 @@ void reply_printwrite(struct smb_request *req)
   
        fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
 
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                END_PROFILE(SMBsplwr);
                 return;
         }
@@ -6624,7 +6624,7 @@ void reply_lockingX(struct smb_request *req)
        lock_timeout = IVAL(req->inbuf,smb_vwv4);
        large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES)?True:False;
 
-       if (!check_fsp(conn, req, fsp, &current_user)) {
+       if (!check_fsp(conn, req, fsp)) {
                END_PROFILE(SMBlockingX);
                return;
        }
index 72688bbd66b5db913bbe60dee0b5802c6bcdb77a..3a59be115ecdb8fa1549e3f7a9e04e0cbb940df6 100644 (file)
@@ -3871,7 +3871,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
                }
 
                /* Initial check for valid fsp ptr. */
-               if (!check_fsp_open(conn, req, fsp, &current_user)) {
+               if (!check_fsp_open(conn, req, fsp)) {
                        return;
                }
 
@@ -3914,7 +3914,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
                        /*
                         * Original code - this is an open file.
                         */
-                       if (!check_fsp(conn, req, fsp, &current_user)) {
+                       if (!check_fsp(conn, req, fsp)) {
                                return;
                        }
 
@@ -6568,7 +6568,7 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
 
                fsp = file_fsp(SVAL(params,0));
                /* Basic check for non-null fsp. */
-               if (!check_fsp_open(conn, req, fsp, &current_user)) {
+               if (!check_fsp_open(conn, req, fsp)) {
                        return;
                }
                info_level = SVAL(params,2);
@@ -6621,7 +6621,7 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
                        /*
                         * Original code - this is an open file.
                         */
-                       if (!check_fsp(conn, req, fsp, &current_user)) {
+                       if (!check_fsp(conn, req, fsp)) {
                                return;
                        }