summaryrefslogtreecommitdiffstats
path: root/source3/smbd/fileio.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-12-05 04:00:16 +0000
committerJeremy Allison <jra@samba.org>2002-12-05 04:00:16 +0000
commit00a20ce45f11e62470e60a8d5fcacc6b0b1f90a2 (patch)
tree6760f9cc2e88c9a5d91c4893392918d8263abd51 /source3/smbd/fileio.c
parent21e21dfd214727e1705054d374a836b202712f90 (diff)
downloadsamba-00a20ce45f11e62470e60a8d5fcacc6b0b1f90a2.tar.gz
samba-00a20ce45f11e62470e60a8d5fcacc6b0b1f90a2.tar.xz
samba-00a20ce45f11e62470e60a8d5fcacc6b0b1f90a2.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 6c23d2030ab8dddff4c849903c529f0012b94027)
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 9e37b951e50..b612b1a4514 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;