summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-11-21 12:14:53 -0800
committerJeremy Allison <jra@samba.org>2008-11-21 12:14:53 -0800
commit97fb05c2c0d0b08f3ed5aa7358a4d6d8c1725012 (patch)
treeab3142c02ae83f60cd92f2717d567f36612d918c /source3/printing
parent9164b14a9fb1fee9ddec275032bb911d34b683d5 (diff)
downloadsamba-97fb05c2c0d0b08f3ed5aa7358a4d6d8c1725012.tar.gz
samba-97fb05c2c0d0b08f3ed5aa7358a4d6d8c1725012.tar.bz2
samba-97fb05c2c0d0b08f3ed5aa7358a4d6d8c1725012.zip
First part of fix for bug #5903 - vfs_streams_xattr breaks contents of the file.
Restructures parts of open code so that fsp must be allocated before calling open_file_ntcreate(_internal). Also fix up file ref-counting inside files.c. Jeremy.
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printfsp.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c
index a247cd8427..5481d95650 100644
--- a/source3/printing/printfsp.c
+++ b/source3/printing/printfsp.c
@@ -27,19 +27,13 @@ print_job_start().
NTSTATUS print_fsp_open(struct smb_request *req, connection_struct *conn,
const char *fname,
- uint16_t current_vuid, files_struct **result)
+ uint16_t current_vuid, files_struct *fsp)
{
int jobid;
SMB_STRUCT_STAT sbuf;
- files_struct *fsp;
fstring name;
NTSTATUS status;
- status = file_new(req, conn, &fsp);
- if(!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
fstrcpy( name, "Remote Downlevel Document");
if (fname) {
const char *p = strrchr(fname, '/');
@@ -53,7 +47,6 @@ NTSTATUS print_fsp_open(struct smb_request *req, connection_struct *conn,
jobid = print_job_start(conn->server_info, SNUM(conn), name, NULL);
if (jobid == -1) {
status = map_nt_error_from_unix(errno);
- file_free(req, fsp);
return status;
}
@@ -62,7 +55,6 @@ NTSTATUS print_fsp_open(struct smb_request *req, connection_struct *conn,
if (fsp->rap_print_jobid == 0) {
/* We need to delete the entry in the tdb. */
pjob_delete(lp_const_servicename(SNUM(conn)), jobid);
- file_free(req, fsp);
return NT_STATUS_ACCESS_DENIED; /* No errno around here */
}
@@ -81,14 +73,11 @@ NTSTATUS print_fsp_open(struct smb_request *req, connection_struct *conn,
fsp->sent_oplock_break = NO_BREAK_SENT;
fsp->is_directory = False;
string_set(&fsp->fsp_name,print_job_fname(lp_const_servicename(SNUM(conn)),jobid));
- fsp->wcp = NULL;
+ fsp->wcp = NULL;
SMB_VFS_FSTAT(fsp, &sbuf);
fsp->mode = sbuf.st_mode;
fsp->file_id = vfs_file_id_from_sbuf(conn, &sbuf);
- conn->num_files_open++;
-
- *result = fsp;
return NT_STATUS_OK;
}