diff options
author | Günther Deschner <gd@samba.org> | 2009-09-30 20:00:52 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-10-01 11:40:30 +0200 |
commit | ad836c4d48e7c7a8a6f1d240f20cca730487a651 (patch) | |
tree | aeab897279f88524727cc4c7703ff5e1dca77938 /source3/printing/nt_printing.c | |
parent | 98245727c9a314849248e5419b347b444e79a2f7 (diff) | |
download | samba-ad836c4d48e7c7a8a6f1d240f20cca730487a651.tar.gz samba-ad836c4d48e7c7a8a6f1d240f20cca730487a651.tar.bz2 samba-ad836c4d48e7c7a8a6f1d240f20cca730487a651.zip |
s3-registry: use pull_reg_sz() where appropriate.
(and move away from rpcstr_pull and rpcstr_pull_talloc).
Guenther
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r-- | source3/printing/nt_printing.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 3c7f053ff2..9995dfe472 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -3436,6 +3436,7 @@ bool is_printer_published(Printer_entry *print_hnd, int snum, WERROR win_rc; int i; bool ret = False; + DATA_BLOB blob; win_rc = get_a_printer(print_hnd, &printer, 2, lp_servicename(snum)); @@ -3452,16 +3453,18 @@ bool is_printer_published(Printer_entry *print_hnd, int snum, /* fetching printer guids really ought to be a separate function. */ if ( guid ) { - fstring guid_str; + char *guid_str; /* We used to store the guid as REG_BINARY, then swapped to REG_SZ for Vista compatibility so check for both */ switch ( regval_type(guid_val) ){ case REG_SZ: - rpcstr_pull( guid_str, regval_data_p(guid_val), - sizeof(guid_str)-1, -1, STR_TERMINATE ); + blob = data_blob_const(regval_data_p(guid_val), + regval_size(guid_val)); + pull_reg_sz(talloc_tos(), &blob, (const char **)&guid_str); ret = NT_STATUS_IS_OK(GUID_from_string( guid_str, guid )); + talloc_free(guid_str); break; case REG_BINARY: if ( regval_size(guid_val) != sizeof(struct GUID) ) { |