summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 34daf40d8f..66eb59bd40 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -7145,6 +7145,28 @@ static WERROR spoolss_addprinterex_level_2(pipes_struct *p,
return WERR_PRINTER_ALREADY_EXISTS;
}
+ /* validate printer info struct */
+ if (!info_ctr->info.info2->printername ||
+ strlen(info_ctr->info.info2->printername) == 0) {
+ free_a_printer(&printer,2);
+ return WERR_INVALID_PRINTER_NAME;
+ }
+ if (!info_ctr->info.info2->portname ||
+ strlen(info_ctr->info.info2->portname) == 0) {
+ free_a_printer(&printer,2);
+ return WERR_UNKNOWN_PORT;
+ }
+ if (!info_ctr->info.info2->drivername ||
+ strlen(info_ctr->info.info2->drivername) == 0) {
+ free_a_printer(&printer,2);
+ return WERR_UNKNOWN_PRINTER_DRIVER;
+ }
+ if (!info_ctr->info.info2->printprocessor ||
+ strlen(info_ctr->info.info2->printprocessor) == 0) {
+ free_a_printer(&printer,2);
+ return WERR_UNKNOWN_PRINTPROCESSOR;
+ }
+
/* FIXME!!! smbd should check to see if the driver is installed before
trying to add a printer like this --jerry */