summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-03-01 02:39:12 +0000
committerJeremy Allison <jra@samba.org>2003-03-01 02:39:12 +0000
commitba3ccc2928f0178034b48e27383e57a8cf1a4f21 (patch)
tree82f9e137b3195e6fce6f43f0f65d8b53b49f71e8 /source3/rpc_server
parent0bf15545dd1ee7d0fd8b16a5523e85343765a123 (diff)
downloadsamba-ba3ccc2928f0178034b48e27383e57a8cf1a4f21.tar.gz
samba-ba3ccc2928f0178034b48e27383e57a8cf1a4f21.tar.bz2
samba-ba3ccc2928f0178034b48e27383e57a8cf1a4f21.zip
Added limit to number of jobs enumerated. Set to 0 (means no limit).
Yes I will add the docs.... Jeremy. (This used to be commit e1b0001c8df9e9823b42a372ca675188570b252a)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 4006d0c08e..b321832930 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -6323,6 +6323,7 @@ WERROR _spoolss_enumjobs( pipes_struct *p, SPOOL_Q_ENUMJOBS *q_u, SPOOL_R_ENUMJO
int snum;
print_status_struct prt_status;
print_queue_struct *queue=NULL;
+ int max_rep_jobs;
/* that's an [in out] buffer */
spoolss_move_buffer(q_u->buffer, &r_u->buffer);
@@ -6336,6 +6337,8 @@ WERROR _spoolss_enumjobs( pipes_struct *p, SPOOL_Q_ENUMJOBS *q_u, SPOOL_R_ENUMJO
if (!get_printer_snum(p, handle, &snum))
return WERR_BADFID;
+ max_rep_jobs = lp_max_reported_jobs(snum);
+
*returned = print_queue_status(snum, &queue, &prt_status);
DEBUGADD(4,("count:[%d], status:[%d], [%s]\n", *returned, prt_status.status, prt_status.message));
@@ -6344,6 +6347,9 @@ WERROR _spoolss_enumjobs( pipes_struct *p, SPOOL_Q_ENUMJOBS *q_u, SPOOL_R_ENUMJO
return WERR_OK;
}
+ if (max_rep_jobs && (*returned > max_rep_jobs))
+ *returned = max_rep_jobs;
+
switch (level) {
case 1:
return enumjobs_level1(queue, snum, buffer, offered, needed, returned);