summaryrefslogtreecommitdiff
path: root/source3/smbd/fileio.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-12-05 03:59:56 +0000
committerJeremy Allison <jra@samba.org>2002-12-05 03:59:56 +0000
commit76e685e628ef2c7bf12d378d992d465525c309e5 (patch)
treeb474ba0845cb25146dee73d98fee293d61fe3477 /source3/smbd/fileio.c
parentc77586e2978f0f8c56e7c893e389571ae6106d8a (diff)
downloadsamba-76e685e628ef2c7bf12d378d992d465525c309e5.tar.gz
samba-76e685e628ef2c7bf12d378d992d465525c309e5.tar.bz2
samba-76e685e628ef2c7bf12d378d992d465525c309e5.zip
The element in fsp->print_job should be a RAP jobid, not a uint32 RPC
jobid. This was causing Win9x client "set name" calls to fail. Still need one cleanup fix to finish. Jeremy. (This used to be commit 15f0bad1fc72ff44cd195d34fd530c25a739f42d)
Diffstat (limited to 'source3/smbd/fileio.c')
-rw-r--r--source3/smbd/fileio.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 9e37b951e5..b612b1a451 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -158,8 +158,19 @@ ssize_t write_file(files_struct *fsp, char *data, SMB_OFF_T pos, size_t n)
ssize_t total_written = 0;
int write_path = -1;
- if (fsp->print_file)
- return print_job_write(SNUM(fsp->conn), fsp->print_jobid, data, n);
+ if (fsp->print_file) {
+ int snum;
+ uint32 jobid;
+
+ if (!rap_to_pjobid(fsp->rap_print_jobid, &snum, &jobid)) {
+ DEBUG(3,("write_file: Unable to map RAP jobid %u to jobid.\n",
+ (unsigned int)fsp->rap_print_jobid ));
+ errno = EBADF;
+ return -1;
+ }
+
+ return print_job_write(SNUM(fsp->conn), jobid, data, n);
+ }
if (!fsp->can_write) {
errno = EPERM;