summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_spoolss_nt.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-02-21 17:08:43 +0000
committerGerald Carter <jerry@samba.org>2003-02-21 17:08:43 +0000
commitab985b983f45a284b2ee9fdd08801989574edf4b (patch)
tree740fdd41d1a89105cc068704ed9163b5c471890c /source3/rpc_server/srv_spoolss_nt.c
parent193f9200aa4ea692e9126f3df68a5cb83e3a4056 (diff)
downloadsamba-ab985b983f45a284b2ee9fdd08801989574edf4b.tar.gz
samba-ab985b983f45a284b2ee9fdd08801989574edf4b.tar.bz2
samba-ab985b983f45a284b2ee9fdd08801989574edf4b.zip
couple of merges from APP_HEAD
* performance optimization in enumprinterdataex() when keyname is empty * fix a few typos in comments * reload services after addprinter_command() dump registry data in ascii when the key is REG_SZ or REG_MULTI_SZ (This used to be commit fde6ef7cc62c58d512dc8053b214f0a3c59a78ab)
Diffstat (limited to 'source3/rpc_server/srv_spoolss_nt.c')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index d94bebf4c1..4c87d0f73d 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -615,7 +615,7 @@ static BOOL is_monitoring_event(Printer_entry *p, uint16 notify_type,
/*
* Flags should always be zero when the change notify
- * is registered by the cliebnt's spooler. A user Win32 app
+ * is registered by the client's spooler. A user Win32 app
* might use the flags though instead of the NOTIFY_OPTION_INFO
* --jerry
*/
@@ -5936,6 +5936,13 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level,
result = WERR_ACCESS_DENIED;
goto done;
}
+
+ /*
+ * make sure we actually reload the services after
+ * this as smb.conf could have a new section in it
+ * .... shouldn't .... but could
+ */
+ reload_services(False);
}
/*
@@ -8871,11 +8878,24 @@ WERROR _spoolss_enumprinterdataex(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATAEX *q_
DEBUG(4,("_spoolss_enumprinterdataex\n"));
if (!Printer) {
- DEBUG(2,("_spoolss_enumprinterdata: Invalid handle (%s:%u:%u1<).\n", OUR_HANDLE(handle)));
+ DEBUG(2,("_spoolss_enumprinterdataex: Invalid handle (%s:%u:%u1<).\n", OUR_HANDLE(handle)));
return WERR_BADFID;
}
- /* first get the printer off of disk */
+ /*
+ * first check for a keyname of NULL or "". Win2k seems to send
+ * this a lot and we should send back WERR_INVALID_PARAM
+ * no need to spend time looking up the printer in this case.
+ * --jerry
+ */
+
+ unistr2_to_dos(key, &q_u->key, sizeof(key) - 1);
+ if ( !strlen(key) ) {
+ result = WERR_INVALID_PARAM;
+ goto done;
+ }
+
+ /* get the printer off of disk */
if (!get_printer_snum(p,handle, &snum))
return WERR_BADFID;
@@ -8971,6 +8991,7 @@ WERROR _spoolss_enumprinterdataex(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATAEX *q_
done:
+ if ( printer )
free_a_printer(&printer, 2);
return result;