summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-07-16 00:06:29 +0000
committerJeremy Allison <jra@samba.org>1998-07-16 00:06:29 +0000
commitf1cd3cb54c6495db2a91c473f91c78d24622d98e (patch)
treeebcd5c9128b1025fbe19f1bb4911f9e6b47af286 /source3/smbd
parent7ade0aa1d22367cb0d998d35573dc5e333a41f75 (diff)
downloadsamba-f1cd3cb54c6495db2a91c473f91c78d24622d98e.tar.gz
samba-f1cd3cb54c6495db2a91c473f91c78d24622d98e.tar.bz2
samba-f1cd3cb54c6495db2a91c473f91c78d24622d98e.zip
Makefile: Added CC=gcc to DGUX on Intel. Comment from ross@filmworks.com.
ipc.c: loadparm.c: printing.c: Added code from <Dirk.DeWachter@rug.ac.be> to implement print queue pausing. New parameters are "queuepause command" and "queueresume command". util.c: Added fix for mount options in autmount map. lib/rpc/include/rpc_misc.h: Removed duplicate pipe names for Jean-Francois. Jeremy. (This used to be commit 559a9bf2bbdeae3e76ba9178779cd3a9537c4e91)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/ipc.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 9c48951e35..cbacca3b83 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -1821,11 +1821,15 @@ static BOOL api_RDosPrintJobDel(int cnum,uint16 vuid, char *param,char *data,
return(True);
}
+/****************************************************************************
+ Purge a print queue - or pause or resume it.
+ ****************************************************************************/
static BOOL api_WPrintQueuePurge(int cnum,uint16 vuid, char *param,char *data,
int mdrcnt,int mprcnt,
char **rdata,char **rparam,
int *rdata_len,int *rparam_len)
{
+ int function = SVAL(param,0);
char *str1 = param+2;
char *str2 = skip_string(str1,1);
char *QueueName = skip_string(str2,1);
@@ -1853,19 +1857,30 @@ static BOOL api_WPrintQueuePurge(int cnum,uint16 vuid, char *param,char *data,
}
if (snum >= 0 && VALID_SNUM(snum)) {
- print_queue_struct *queue=NULL;
- int i, count;
lpq_reset(snum);
- count = get_printqueue(snum,cnum,&queue,NULL);
- for (i = 0; i < count; i++)
- del_printqueue(cnum,snum,queue[i].job);
-
- if (queue) free(queue);
+ switch (function) {
+ case 74: /* Pause queue */
+ case 75: /* Resume queue */
+ status_printqueue(cnum,snum,(function==74?LPSTAT_STOPPED:LPSTAT_OK));
+ DEBUG(3,("Print queue %s, queue=%s\n",
+ (function==74?"pause":"resume"),QueueName));
+ break;
+ case 103: /* Purge */
+ {
+ print_queue_struct *queue=NULL;
+ int i, count;
+ count = get_printqueue(snum,cnum,&queue,NULL);
+ for (i = 0; i < count; i++)
+ del_printqueue(cnum,snum,queue[i].job);
+
+ if (queue) free(queue);
+ DEBUG(3,("Print queue purge, queue=%s\n",QueueName));
+ break;
+ }
+ }
}
- DEBUG(3,("Print queue purge, queue=%s\n",QueueName));
-
return(True);
}
@@ -3490,6 +3505,8 @@ struct
{"NetWkstaGetInfo", 63, api_NetWkstaGetInfo,0},
{"DosPrintQEnum", 69, api_DosPrintQEnum,0},
{"DosPrintQGetInfo", 70, api_DosPrintQGetInfo,0},
+ {"WPrintQueuePause", 74, api_WPrintQueuePurge,0},
+ {"WPrintQueueResume", 75, api_WPrintQueuePurge,0},
{"WPrintJobEnumerate",76, api_WPrintJobEnumerate,0},
{"WPrintJobGetInfo", 77, api_WPrintJobGetInfo,0},
{"RDosPrintJobDel", 81, api_RDosPrintJobDel,0},