The Samba-Bugzilla – Attachment 8464 Details for
Bug 9578
Add extra printer attributes to published AD object
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP: Unfinished patch
0001-WIP-publish-devmode-based-printer-attributes-in-AD.patch (text/plain), 2.17 KB, created by
David Disseldorp
on 2013-01-22 10:04:09 UTC
(
hide
)
Description:
WIP: Unfinished patch
Filename:
MIME Type:
Creator:
David Disseldorp
Created:
2013-01-22 10:04:09 UTC
Size:
2.17 KB
patch
obsolete
>From 82c214d58efba2ff38c3a64298c57237f83039f4 Mon Sep 17 00:00:00 2001 >From: David Disseldorp <ddiss@samba.org> >Date: Tue, 22 Jan 2013 10:56:28 +0100 >Subject: [PATCH] WIP: publish devmode based printer attributes in AD > >Many AD printer attributes defined in MS-ADA3 correspond to device >limits and feature support rather than current settings. Therefore, the >devmode is not an ideal source for these values. >--- > source3/printing/nt_printing_ads.c | 43 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 43 insertions(+) > >diff --git a/source3/printing/nt_printing_ads.c b/source3/printing/nt_printing_ads.c >index b99a972..6273ba5 100644 >--- a/source3/printing/nt_printing_ads.c >+++ b/source3/printing/nt_printing_ads.c >@@ -87,6 +87,41 @@ done: > talloc_free(tmp_ctx); > } > >+static WERROR nt_printer_devmode_to_mods(TALLOC_CTX *ctx, >+ struct spoolss_DeviceMode *devmode, >+ ADS_MODLIST *mods) >+{ >+ if (devmode->fields & DEVMODE_COLOR) { >+ if (devmode->color == DMRES_COLOR) { >+ ads_mod_str(ctx, mods, SPOOL_REG_PRINTCOLOR, "TRUE"); >+ } else { >+ ads_mod_str(ctx, mods, SPOOL_REG_PRINTCOLOR, "FALSE"); >+ } >+ } >+ if (devmode->fields & DEVMODE_DUPLEX) { >+ if (devmode->duplex != DMDUP_SIMPLEX) { >+ ads_mod_str(ctx, mods, SPOOL_REG_PRINTDUPLEXSUPPORTED, >+ "TRUE"); >+ } else { >+ ads_mod_str(ctx, mods, SPOOL_REG_PRINTDUPLEXSUPPORTED, >+ "FALSE"); >+ } >+ } >+ if (devmode->fields & DEVMODE_COLLATE) { >+ if (devmode->collate == DMCOLLATE_TRUE) { >+ ads_mod_str(ctx, mods, SPOOL_REG_PRINTCOLLATE, "TRUE"); >+ } else { >+ ads_mod_str(ctx, mods, SPOOL_REG_PRINTCOLLATE, "FALSE"); >+ } >+ } >+ if (devmode->fields & DEVMODE_FORMNAME) { >+ ads_mod_str(ctx, mods, SPOOL_REG_PRINTFORMNAME, >+ devmode->formname); >+ } >+ >+ return WERR_OK; >+} >+ > static WERROR nt_printer_info_to_mods(TALLOC_CTX *ctx, > struct spoolss_PrinterInfo2 *info2, > ADS_MODLIST *mods) >@@ -164,6 +199,14 @@ static WERROR nt_printer_info_to_mods(TALLOC_CTX *ctx, > info2->attributes)); > } > >+ if (info2->devmode != NULL) { >+ WERROR werr; >+ werr = nt_printer_devmode_to_mods(ctx, info2->devmode, mods); >+ if (!W_ERROR_IS_OK(werr)) { >+ return werr; >+ } >+ } >+ > return WERR_OK; > } > >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 9578
:
8458
|
8459
| 8464