diff options
author | Jeremy Allison <jra@samba.org> | 2007-12-10 12:11:45 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-12-10 12:11:45 -0800 |
commit | 6dd89174ecef8b68774924de8b94a24c73ea4f44 (patch) | |
tree | 1d66dd78c1cf858996214f20943731321947af84 /source3/rpc_server/srv_spoolss_nt.c | |
parent | 97cbaceec1314b4918488e959c9eff9bb4b99166 (diff) | |
download | samba-6dd89174ecef8b68774924de8b94a24c73ea4f44.tar.gz samba-6dd89174ecef8b68774924de8b94a24c73ea4f44.tar.bz2 samba-6dd89174ecef8b68774924de8b94a24c73ea4f44.zip |
Fix return values for invalid printers. Found by kblin
spoolss test.
Jeremy.
(This used to be commit bb8c044d425cf62b76e487103c8fb0b6cd4c83c2)
Diffstat (limited to 'source3/rpc_server/srv_spoolss_nt.c')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index a17a8ebf26..c1e422657b 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -1530,6 +1530,13 @@ WERROR _spoolss_open_printer(pipes_struct *p, SPOOL_Q_OPEN_PRINTER *q_u, SPOOL_R memcpy(r_u, &r_u_ex, sizeof(*r_u)); + if (W_ERROR_EQUAL(r_u->status, WERR_INVALID_PARAM)) { + /* OpenPrinterEx returns this for a bad + * printer name. We must return WERR_INVALID_PRINTER_NAME + * instead. + */ + r_u->status = WERR_INVALID_PRINTER_NAME; + } return r_u->status; } @@ -1545,8 +1552,9 @@ WERROR _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, int snum; Printer_entry *Printer=NULL; - if ( !q_u->printername ) - return WERR_INVALID_PRINTER_NAME; + if (!q_u->printername) { + return WERR_INVALID_PARAM; + } /* some sanity check because you can open a printer or a print server */ /* aka: \\server\printer or \\server */ @@ -1555,15 +1563,16 @@ WERROR _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, DEBUGADD(3,("checking name: %s\n",name)); - if (!open_printer_hnd(p, handle, name, 0)) - return WERR_INVALID_PRINTER_NAME; + if (!open_printer_hnd(p, handle, name, 0)) { + return WERR_INVALID_PARAM; + } Printer=find_printer_index_by_hnd(p, handle); if ( !Printer ) { DEBUG(0,(" _spoolss_open_printer_ex: logic error. Can't find printer " "handle we created for printer %s\n", name )); close_printer_handle(p,handle); - return WERR_INVALID_PRINTER_NAME; + return WERR_INVALID_PARAM; } /* |