summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-04-23 08:13:12 +0000
committerAndrew Tridgell <tridge@samba.org>2000-04-23 08:13:12 +0000
commit31446a98a3c39eb0e48ba056fe07832e807d91fe (patch)
tree50f1228669b86d4b494c2bff975c527efc0f9d54 /source3/printing
parenta32420e5b79126002b74b78d69c010043b7bd299 (diff)
downloadsamba-31446a98a3c39eb0e48ba056fe07832e807d91fe.tar.gz
samba-31446a98a3c39eb0e48ba056fe07832e807d91fe.tar.bz2
samba-31446a98a3c39eb0e48ba056fe07832e807d91fe.zip
check for a valid snum when running a printing command
(This used to be commit 381ddb464fd0da671d567177f1ded10f67952692)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 6e9482ad4e..2f36cf2f3f 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -140,6 +140,11 @@ static int print_run_command(int snum,char *command,
if (!command || !*command) return -1;
+ if (!VALID_SNUM(snum)) {
+ DEBUG(0,("Invalid snum %d for command %s\n", snum, command));
+ return -1;
+ }
+
pstrcpy(syscmd, command);
if (a1) pstring_sub(syscmd, a1, v1);
if (a2) pstring_sub(syscmd, a2, v2);