diff options
author | Günther Deschner <gd@samba.org> | 2010-03-26 13:17:49 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-03-26 14:36:46 +0100 |
commit | 3da91b786ef87bd13ae1210a1bf671e2209d9c1f (patch) | |
tree | b6ecdc06ee099325aa3762a3f02bde009ff2a4d6 /source3/printing/nt_printing.c | |
parent | 772839640e11664e1b1304d7f95146613d6ac1ac (diff) | |
download | samba-3da91b786ef87bd13ae1210a1bf671e2209d9c1f.tar.gz samba-3da91b786ef87bd13ae1210a1bf671e2209d9c1f.tar.xz samba-3da91b786ef87bd13ae1210a1bf671e2209d9c1f.zip |
s3-printing: avoid mixing cups backend code with nt_printing code in cups_pull_comment_location.
Guenther
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r-- | source3/printing/nt_printing.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index b29000a2d81..5096ca0599b 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -3831,8 +3831,17 @@ static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 *info, if (get_loc_com && (enum printing_types)lp_printing(snum) == PRINT_CUPS ) { /* Pull the location and comment strings from cups if we don't already have one */ - if ( !strlen(info->location) || !strlen(info->comment) ) - cups_pull_comment_location( info ); + if ( !strlen(info->location) || !strlen(info->comment) ) { + char *comment = NULL; + char *location = NULL; + if (cups_pull_comment_location(info, info->sharename, + &comment, &location)) { + strlcpy(info->comment, comment, sizeof(info->comment)); + fstrcpy(info->location, location); + TALLOC_FREE(comment); + TALLOC_FREE(location); + } + } } #endif @@ -3953,8 +3962,17 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info, if (get_loc_com && (enum printing_types)lp_printing(snum) == PRINT_CUPS ) { /* Pull the location and comment strings from cups if we don't already have one */ - if ( !strlen(info->location) || !strlen(info->comment) ) - cups_pull_comment_location( info ); + if ( !strlen(info->location) || !strlen(info->comment) ) { + char *location = NULL; + comment = NULL; + if (cups_pull_comment_location(info, info->sharename, + &comment, &location)) { + strlcpy(info->comment, comment, sizeof(info->comment)); + fstrcpy(info->location, location); + TALLOC_FREE(comment); + TALLOC_FREE(location); + } + } } #endif |