summaryrefslogtreecommitdiff
path: root/source3/smbd
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
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')
-rw-r--r--source3/smbd/fileio.c15
-rw-r--r--source3/smbd/reply.c3
-rw-r--r--source3/smbd/trans2.c5
3 files changed, 15 insertions, 8 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;
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 6c2698c297..96b7692b1a 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -353,8 +353,7 @@ int reply_ioctl(connection_struct *conn,
switch (ioctl_code) {
case IOCTL_QUERY_JOB_INFO:
{
- uint16 rap_jobid = pjobid_to_rap(SNUM(fsp->conn), fsp->print_jobid);
- SSVAL(p,0,rap_jobid); /* Job number */
+ SSVAL(p,0,fsp->rap_print_jobid); /* Job number */
srvstr_push(outbuf, p+2, global_myname(), 15, STR_TERMINATE|STR_ASCII);
srvstr_push(outbuf, p+18, lp_servicename(SNUM(conn)), 13, STR_TERMINATE|STR_ASCII);
break;
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index d83596d68f..872e33c832 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -3006,8 +3006,6 @@ static int call_trans2ioctl(connection_struct *conn, char* inbuf,
if ((SVAL(inbuf,(smb_setup+4)) == LMCAT_SPL) &&
(SVAL(inbuf,(smb_setup+6)) == LMFUNC_GETJOBID)) {
- uint16 rap_jobid;
-
pdata = Realloc(*ppdata, 32);
if(pdata == NULL)
return ERROR_DOS(ERRDOS,ERRnomem);
@@ -3016,8 +3014,7 @@ static int call_trans2ioctl(connection_struct *conn, char* inbuf,
/* NOTE - THIS IS ASCII ONLY AT THE MOMENT - NOT SURE IF OS/2
CAN ACCEPT THIS IN UNICODE. JRA. */
- rap_jobid = pjobid_to_rap(SNUM(fsp->conn), fsp->print_jobid); /* Job number */
- SSVAL(pdata,0,rap_jobid); /* Job number */
+ SSVAL(pdata,0,fsp->rap_print_jobid); /* Job number */
srvstr_push( outbuf, pdata + 2, global_myname(), 15, STR_ASCII|STR_TERMINATE); /* Our NetBIOS name */
srvstr_push( outbuf, pdata+18, lp_servicename(SNUM(conn)), 13, STR_ASCII|STR_TERMINATE); /* Service name */
send_trans2_replies(outbuf,bufsize,*pparams,0,*ppdata,32);