summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-11-30 03:38:59 +0000
committerJeremy Allison <jra@samba.org>2001-11-30 03:38:59 +0000
commit445ab75ec33db60307a373885efe622ed5c65d02 (patch)
tree518e005745b076adc0886142dd6ebcc894feef56 /source3
parent9e88a7ebe9b37d642241f404fb4867ee0239cf6f (diff)
downloadsamba-445ab75ec33db60307a373885efe622ed5c65d02.tar.gz
samba-445ab75ec33db60307a373885efe622ed5c65d02.tar.bz2
samba-445ab75ec33db60307a373885efe622ed5c65d02.zip
Gerald's fix.
Jeremy (This used to be commit b0c1fcfc8bae83788c7595931321833bf177ec4b)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index c64a7a218c..3c7948fd7b 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -5737,7 +5737,6 @@ static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_
POLICY_HND *handle)
{
NT_PRINTER_INFO_LEVEL *printer = NULL;
- NT_PRINTER_INFO_LEVEL *old_printer = NULL;
fstring name;
int snum;
WERROR err = WERR_OK;
@@ -5752,15 +5751,12 @@ static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_
/* convert from UNICODE to ASCII - this allocates the info_2 struct inside *printer.*/
convert_printer_info(info, printer, 2);
-
/* check to see if the printer already exists */
- err = get_a_printer(&old_printer, 2, printer->info_2->sharename);
- /* did we find a printer? */
- if (W_ERROR_IS_OK(err)) {
+ if ((snum = print_queue_snum(printer->info_2->sharename)) != -1) {
DEBUG(5, ("_spoolss_addprinterex: Attempted to add a printer named [%s] when one already existed!\n",
printer->info_2->sharename));
- free_a_printer(&old_printer, 2);
+ free_a_printer(&printer, 2);
return WERR_PRINTER_ALREADY_EXISTS;
}