diff options
author | Jeremy Allison <jra@samba.org> | 2007-12-03 14:54:06 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-12-03 14:54:06 -0800 |
commit | bcf033b38ee2f6c76cd56cae5cd84a6e321ffafa (patch) | |
tree | 4e7fdd5f126bc59d62635bf1060d1fd6ca06aeec /source3/printing/nt_printing.c | |
parent | df141905fa389bc4d86bce33d1a763164e120457 (diff) | |
download | samba-bcf033b38ee2f6c76cd56cae5cd84a6e321ffafa.tar.gz samba-bcf033b38ee2f6c76cd56cae5cd84a6e321ffafa.tar.bz2 samba-bcf033b38ee2f6c76cd56cae5cd84a6e321ffafa.zip |
Change tdb_unpack "P" to return a malloc'ed string rather
than expect a pstring space to put data into.
Fix the (few) callers.
Jeremy.
(This used to be commit 7722a7d2c63f84b8105aa775b39f0ceedd4ed513)
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r-- | source3/printing/nt_printing.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index c55f9f1f91..afa4bc2fd5 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -4017,6 +4017,7 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info, const char *servern TDB_DATA kbuf, dbuf; fstring printername; char adevice[MAXDEVICENAME]; + char *comment = NULL; kbuf = make_printer_tdbkey(talloc_tos(), sharename); @@ -4042,13 +4043,18 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info, const char *servern info->sharename, info->portname, info->drivername, - info->comment, + &comment, info->location, info->sepfile, info->printprocessor, info->datatype, info->parameters); + if (comment) { + strlcpy(info->comment, comment, sizeof(info->comment)); + SAFE_FREE(comment); + } + /* Samba has to have shared raw drivers. */ info->attributes |= PRINTER_ATTRIBUTE_SAMBA; info->attributes &= ~PRINTER_ATTRIBUTE_NOT_SAMBA; |