The branch, master has been updated
       via  ce2ff557bda5560cb9b614313d9ee0adbd57633d (commit)
      from  cb5db966e34310af16499b657c83f30a1758fc06 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ce2ff557bda5560cb9b614313d9ee0adbd57633d
Author: Volker Lendecke <[email protected]>
Date:   Tue Dec 30 22:49:01 2008 +0100

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

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

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


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index 7c00d7b..b187a66 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4896,7 +4896,8 @@ bool sysv_cache_reload(void);
 
 NTSTATUS print_fsp_open(struct smb_request *req, 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/source3/printing/printfsp.c b/source3/printing/printfsp.c
index 5481d95..b485711 100644
--- a/source3/printing/printfsp.c
+++ b/source3/printing/printfsp.c
@@ -27,10 +27,10 @@ print_job_start().
 
 NTSTATUS print_fsp_open(struct smb_request *req, 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;
 
@@ -74,9 +74,9 @@ NTSTATUS print_fsp_open(struct smb_request *req, 
connection_struct *conn,
        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/source3/smbd/open.c b/source3/smbd/open.c
index f003619..8fe20f9 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1360,7 +1360,7 @@ static NTSTATUS open_file_ntcreate(connection_struct 
*conn,
 
                DEBUG(10, ("open_file_ntcreate: printer open fname=%s\n", 
fname));
 
-               return print_fsp_open(req, conn, fname, req->vuid, fsp);
+               return print_fsp_open(req, conn, fname, req->vuid, fsp, psbuf);
        }
 
        if (!parent_dirname_talloc(talloc_tos(), fname, &parent_dir,
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index b8be3ed..e2a7afe 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -4594,6 +4594,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);
@@ -4618,7 +4619,7 @@ void reply_printopen(struct smb_request *req)
        }
 
        /* Open for exclusive use, write only. */
-       status = print_fsp_open(req, conn, NULL, req->vuid, fsp);
+       status = print_fsp_open(req, conn, NULL, req->vuid, fsp, &sbuf);
 
        if (!NT_STATUS_IS_OK(status)) {
                reply_nterror(req, status);


-- 
Samba Shared Repository

Reply via email to