The branch, v3-3-test has been updated
       via  b0f293addb93e34107fcfd52170261885104dbb0 (commit)
      from  16bc03070785009b06ee7a1bfea0c54e23bab470 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit b0f293addb93e34107fcfd52170261885104dbb0
Author: Volker Lendecke <[email protected]>
Date:   Tue Dec 30 22:24:04 2008 +0100

    Fix an ancient uninitialized variable read
    
    The callers of open_file_ntcreate expect *psbuf to be filled correctly

-----------------------------------------------------------------------

Summary of changes:
 source/include/proto.h     |    3 ++-
 source/printing/printfsp.c |   10 +++++-----
 source/smbd/open.c         |    2 +-
 source/smbd/reply.c        |    3 ++-
 4 files changed, 10 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/proto.h b/source/include/proto.h
index 76e0d76..95de3f9 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -6625,7 +6625,8 @@ bool sysv_cache_reload(void);
 /* The following definitions come from printing/printfsp.c  */
 
 NTSTATUS print_fsp_open(connection_struct *conn, const char *fname,
-                       uint16_t current_vuid, files_struct *fsp);
+                       uint16_t current_vuid, files_struct *fsp,
+                       SMB_STRUCT_STAT *psbuf);
 void print_fsp_end(files_struct *fsp, enum file_close_type close_type);
 
 /* The following definitions come from printing/printing.c  */
diff --git a/source/printing/printfsp.c b/source/printing/printfsp.c
index 324af18..96d47a4 100644
--- a/source/printing/printfsp.c
+++ b/source/printing/printfsp.c
@@ -26,10 +26,10 @@ print_job_start().
 ***************************************************************************/
 
 NTSTATUS print_fsp_open(connection_struct *conn, const char *fname,
-                       uint16_t current_vuid, files_struct *fsp)
+                       uint16_t current_vuid, files_struct *fsp,
+                       SMB_STRUCT_STAT *psbuf)
 {
        int jobid;
-       SMB_STRUCT_STAT sbuf;
        fstring name;
        NTSTATUS status;
 
@@ -73,9 +73,9 @@ NTSTATUS print_fsp_open(connection_struct *conn, const char 
*fname,
        fsp->is_directory = False;
        
string_set(&fsp->fsp_name,print_job_fname(lp_const_servicename(SNUM(conn)),jobid));
        fsp->wcp = NULL;
-       SMB_VFS_FSTAT(fsp, &sbuf);
-       fsp->mode = sbuf.st_mode;
-       fsp->file_id = vfs_file_id_from_sbuf(conn, &sbuf);
+       SMB_VFS_FSTAT(fsp, psbuf);
+       fsp->mode = psbuf->st_mode;
+       fsp->file_id = vfs_file_id_from_sbuf(conn, psbuf);
 
        return NT_STATUS_OK;
 }
diff --git a/source/smbd/open.c b/source/smbd/open.c
index a465695..3c07dba 100644
--- a/source/smbd/open.c
+++ b/source/smbd/open.c
@@ -1342,7 +1342,7 @@ static NTSTATUS 
open_file_ntcreate_internal(connection_struct *conn,
 
                DEBUG(10, ("open_file_ntcreate: printer open fname=%s\n", 
fname));
 
-               return print_fsp_open(conn, fname, req->vuid, fsp);
+               return print_fsp_open(conn, fname, req->vuid, fsp, psbuf);
        }
 
        if (!parent_dirname_talloc(talloc_tos(), fname, &parent_dir,
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index c0359bc..c23aa4f 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -4658,6 +4658,7 @@ void reply_printopen(struct smb_request *req)
 {
        connection_struct *conn = req->conn;
        files_struct *fsp;
+       SMB_STRUCT_STAT sbuf;
        NTSTATUS status;
 
        START_PROFILE(SMBsplopen);
@@ -4682,7 +4683,7 @@ void reply_printopen(struct smb_request *req)
        }
 
        /* Open for exclusive use, write only. */
-       status = print_fsp_open(conn, NULL, req->vuid, fsp);
+       status = print_fsp_open(conn, NULL, req->vuid, fsp, &sbuf);
 
        if (!NT_STATUS_IS_OK(status)) {
                file_free(fsp);


-- 
Samba Shared Repository

Reply via email to