summaryrefslogtreecommitdiffstats
path: root/source/smbd/ipc.c
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
commit559a9bf2bbdeae3e76ba9178779cd3a9537c4e91 (patch)
tree5281ddf2ca348d31ad4c752ee6df10c25978af1f /source/smbd/ipc.c
parent7f7e265ab457d046441d502d4b8447bc2c966675 (diff)
downloadsamba-559a9bf2bbdeae3e76ba9178779cd3a9537c4e91.tar.gz
samba-559a9bf2bbdeae3e76ba9178779cd3a9537c4e91.tar.xz
samba-559a9bf2bbdeae3e76ba9178779cd3a9537c4e91.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.
Diffstat (limited to 'source/smbd/ipc.c')
-rw-r--r--source/smbd/ipc.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/source/smbd/ipc.c b/source/smbd/ipc.c
index 9c48951e353..cbacca3b832 100644
--- a/source/smbd/ipc.c
+++ b/source/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},