diff options
author | Volker Lendecke <vl@samba.org> | 2008-12-30 22:24:04 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-01-28 09:39:53 +0100 |
commit | e719e232426063f7ad7b07015001fcf7727f26aa (patch) | |
tree | ddddc31b3c633b44bcdfa35a98e4c34615e636d7 | |
parent | 5a14dee5f005ee4c0b8e0eb1e864589ab23a3ec9 (diff) | |
download | samba-e719e232426063f7ad7b07015001fcf7727f26aa.tar.gz samba-e719e232426063f7ad7b07015001fcf7727f26aa.tar.xz samba-e719e232426063f7ad7b07015001fcf7727f26aa.zip |
Fix an ancient uninitialized variable read
The callers of open_file_ntcreate expect *psbuf to be filled correctly
(cherry picked from commit f9f6bffc3763ddd8e19400616b6e5da962142e5e)
-rw-r--r-- | source/printing/printfsp.c | 9 | ||||
-rw-r--r-- | source/smbd/open.c | 2 | ||||
-rw-r--r-- | source/smbd/reply.c | 3 |
3 files changed, 7 insertions, 7 deletions
diff --git a/source/printing/printfsp.c b/source/printing/printfsp.c index c6652249278..12399b882f7 100644 --- a/source/printing/printfsp.c +++ b/source/printing/printfsp.c @@ -28,10 +28,9 @@ print_job_start(). ***************************************************************************/ NTSTATUS print_fsp_open(connection_struct *conn, const char *fname, - files_struct *fsp) + files_struct *fsp, SMB_STRUCT_STAT *psbuf) { int jobid; - SMB_STRUCT_STAT sbuf; fstring name; NTSTATUS status; @@ -75,9 +74,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 b732c5e3e9d..b82c0362cc0 100644 --- a/source/smbd/open.c +++ b/source/smbd/open.c @@ -1222,7 +1222,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, fsp); + return print_fsp_open(conn, fname, fsp, psbuf); } if (!parent_dirname_talloc(talloc_tos(), fname, &parent_dir, diff --git a/source/smbd/reply.c b/source/smbd/reply.c index 762fab1a030..248596d2c86 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -4633,6 +4633,7 @@ void reply_printopen(struct smb_request *req) connection_struct *conn = req->conn; files_struct *fsp; NTSTATUS status; + SMB_STRUCT_STAT sbuf; START_PROFILE(SMBsplopen); @@ -4656,7 +4657,7 @@ void reply_printopen(struct smb_request *req) } /* Open for exclusive use, write only. */ - status = print_fsp_open(conn, NULL, fsp); + status = print_fsp_open(conn, NULL, fsp, &sbuf); if (!NT_STATUS_IS_OK(status)) { file_free(fsp); |