summaryrefslogtreecommitdiff
path: root/source3/smbd/lanman.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-07-17 19:12:17 +0000
committerJeremy Allison <jra@samba.org>2002-07-17 19:12:17 +0000
commit29426b4a50275e24020ae67898cd7d156a341a7f (patch)
tree60a8ff0974faa1341be98df827146a8ab670320e /source3/smbd/lanman.c
parentcc9511af8c3bb1b805ba34049e7861e226ed5f7d (diff)
downloadsamba-29426b4a50275e24020ae67898cd7d156a341a7f.tar.gz
samba-29426b4a50275e24020ae67898cd7d156a341a7f.tar.bz2
samba-29426b4a50275e24020ae67898cd7d156a341a7f.zip
Gone back to explicit queue number passing as snum - removed encoding of
queueid in job number. This means we must have an internal tdb to store mapping from 16 bit RAP jobid's to 32 bit RPC jobids. Jeremy. (This used to be commit 4ff64f69706cc94d5dba7762754d00790c476963)
Diffstat (limited to 'source3/smbd/lanman.c')
-rw-r--r--source3/smbd/lanman.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 619ecd736a..049dae98e3 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -443,7 +443,7 @@ static void fill_printjob_info(connection_struct *conn, int snum, int uLevel,
/* the client expects localtime */
t -= TimeDiff(t);
- PACKI(desc,"W",pjobid_to_rap(queue->job)); /* uJobId */
+ PACKI(desc,"W",pjobid_to_rap(snum,queue->job)); /* uJobId */
if (uLevel == 1) {
PACKS(desc,"B21",queue->fs_user); /* szUserName */
PACKS(desc,"B",""); /* pad */
@@ -2181,11 +2181,14 @@ static BOOL api_RDosPrintJobDel(connection_struct *conn,uint16 vuid, char *param
char *str1 = param+2;
char *str2 = skip_string(str1,1);
char *p = skip_string(str2,1);
- int jobid, errcode;
+ uint32 jobid;
+ int snum;
+ int errcode;
extern struct current_user current_user;
WERROR werr = WERR_OK;
- jobid = rap_to_pjobid(SVAL(p,0));
+ if(!rap_to_pjobid(SVAL(p,0),&snum,&jobid))
+ return False;
/* check it's a supported varient */
if (!(strcsequal(str1,"W") && strcsequal(str2,"")))
@@ -2195,7 +2198,7 @@ static BOOL api_RDosPrintJobDel(connection_struct *conn,uint16 vuid, char *param
*rparam = REALLOC(*rparam,*rparam_len);
*rdata_len = 0;
- if (!print_job_exists(jobid)) {
+ if (!print_job_exists(snum, jobid)) {
errcode = NERR_JobNotFound;
goto out;
}
@@ -2204,15 +2207,15 @@ static BOOL api_RDosPrintJobDel(connection_struct *conn,uint16 vuid, char *param
switch (function) {
case 81: /* delete */
- if (print_job_delete(&current_user, jobid, &werr))
+ if (print_job_delete(&current_user, snum, jobid, &werr))
errcode = NERR_Success;
break;
case 82: /* pause */
- if (print_job_pause(&current_user, jobid, &werr))
+ if (print_job_pause(&current_user, snum, jobid, &werr))
errcode = NERR_Success;
break;
case 83: /* resume */
- if (print_job_resume(&current_user, jobid, &werr))
+ if (print_job_resume(&current_user, snum, jobid, &werr))
errcode = NERR_Success;
break;
}
@@ -2313,12 +2316,14 @@ static BOOL api_PrintJobInfo(connection_struct *conn,uint16 vuid,char *param,cha
char *str1 = param+2;
char *str2 = skip_string(str1,1);
char *p = skip_string(str2,1);
- int jobid;
+ uint32 jobid;
+ int snum;
int uLevel = SVAL(p,2);
int function = SVAL(p,4);
int place, errcode;
- jobid = rap_to_pjobid(SVAL(p,0));
+ if(!rap_to_pjobid(SVAL(p,0),&snum,&jobid))
+ return False;
*rparam_len = 4;
*rparam = REALLOC(*rparam,*rparam_len);
@@ -2329,7 +2334,7 @@ static BOOL api_PrintJobInfo(connection_struct *conn,uint16 vuid,char *param,cha
(!check_printjob_info(&desc,uLevel,str2)))
return(False);
- if (!print_job_exists(jobid)) {
+ if (!print_job_exists(snum, jobid)) {
errcode=NERR_JobNotFound;
goto out;
}
@@ -2341,14 +2346,14 @@ static BOOL api_PrintJobInfo(connection_struct *conn,uint16 vuid,char *param,cha
/* change job place in the queue,
data gives the new place */
place = SVAL(data,0);
- if (print_job_set_place(jobid, place)) {
+ if (print_job_set_place(snum, jobid, place)) {
errcode=NERR_Success;
}
break;
case 0xb:
/* change print job name, data gives the name */
- if (print_job_set_name(jobid, data)) {
+ if (print_job_set_name(snum, jobid, data)) {
errcode=NERR_Success;
}
break;
@@ -3011,8 +3016,8 @@ static BOOL api_WPrintJobGetInfo(connection_struct *conn,uint16 vuid, char *para
if (strcmp(str1,"WWrLh") != 0) return False;
if (!check_printjob_info(&desc,uLevel,str2)) return False;
- jobid = rap_to_pjobid(SVAL(p,0));
- snum = print_job_snum(jobid);
+ if(!rap_to_pjobid(SVAL(p,0),&snum,&jobid))
+ return False;
if (snum < 0 || !VALID_SNUM(snum)) return(False);