diff options
author | Jean-François Micouleau <jfm@samba.org> | 2000-03-13 15:53:02 +0000 |
---|---|---|
committer | Jean-François Micouleau <jfm@samba.org> | 2000-03-13 15:53:02 +0000 |
commit | bf5f8bcf70d4bfd530dba82a2ab5503c73932bab (patch) | |
tree | 66118c5a4f9d334eb7719cd37494404d9b071957 | |
parent | 6e11f213782361a6d96d442814f83fc148d331fc (diff) | |
download | samba-bf5f8bcf70d4bfd530dba82a2ab5503c73932bab.tar.gz samba-bf5f8bcf70d4bfd530dba82a2ab5503c73932bab.tar.bz2 samba-bf5f8bcf70d4bfd530dba82a2ab5503c73932bab.zip |
small fix for addprinterex at level 2
I have some network dumps at level 1, but quoting MSDN: "Level [in]
Specifies the version of the structure to which pPrinter points. This
value must be 2."
I like NT so much :-)
J.F.
(This used to be commit fbf40c6a9140a27e773d59eaf056c9e25659d9b8)
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index d0fc839154..340d776493 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -3581,30 +3581,28 @@ uint32 _spoolss_addprinterex( const UNISTR2 *uni_srv_name, uint32 level, /* convert from UNICODE to ASCII */ convert_printer_info(info, &printer, level); - unistr2_to_ascii(share_name, &((info->info_2)->portname), sizeof(share_name)-1); + unistr2_to_ascii(share_name, &((info->info_2)->printername), sizeof(share_name)-1); slprintf(name, sizeof(name)-1, "\\\\%s\\%s", global_myname, share_name); + /* write the ASCII on disk */ + if (add_a_printer(printer, level) != 0x0) + return ERROR_ACCESS_DENIED; + create_printer_hnd(handle); open_printer_hnd(handle); if (!set_printer_hnd_printertype(handle, name)) { close_printer_handle(handle); - return NT_STATUS_ACCESS_DENIED; + return ERROR_ACCESS_DENIED; } - + if (!set_printer_hnd_printername(handle, name)) { close_printer_handle(handle); - return NT_STATUS_ACCESS_DENIED; + return ERROR_ACCESS_DENIED; } - /* write the ASCII on disk */ - if (add_a_printer(printer, level) != 0x0) { - close_printer_handle(handle); - return NT_STATUS_ACCESS_DENIED; - } - return NT_STATUS_NO_PROBLEMO; } |