The Samba-Bugzilla – Attachment 9067 Details for
Bug 7444
nt_printer_publish and check_published_printers should release krb5 cache override
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch for master
patch (text/plain), 2.41 KB, created by
Guenther Deschner
on 2013-07-19 13:10:26 UTC
(
hide
)
Description:
proposed patch for master
Filename:
MIME Type:
Creator:
Guenther Deschner
Created:
2013-07-19 13:10:26 UTC
Size:
2.41 KB
patch
obsolete
>From 7d5c1499ab4af1514a20e873b2dce1efac7d0d52 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org> >Date: Fri, 19 Jul 2013 15:10:05 +0200 >Subject: [PATCH] s3-printing: avoid KRB5CCNAME overwrite in printer publishing > (Bug #7444). >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Guenther > >Signed-off-by: Günther Deschner <gd@samba.org> >--- > source3/printing/nt_printing_ads.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >diff --git a/source3/printing/nt_printing_ads.c b/source3/printing/nt_printing_ads.c >index dcd31b7..5d5f564 100644 >--- a/source3/printing/nt_printing_ads.c >+++ b/source3/printing/nt_printing_ads.c >@@ -417,6 +417,7 @@ WERROR nt_printer_publish(TALLOC_CTX *mem_ctx, > ADS_STATUS ads_rc; > ADS_STRUCT *ads = NULL; > WERROR win_rc; >+ char *old_krb5ccname = NULL; > > sinfo2 = talloc_zero(mem_ctx, struct spoolss_SetPrinterInfo2); > if (!sinfo2) { >@@ -454,6 +455,7 @@ WERROR nt_printer_publish(TALLOC_CTX *mem_ctx, > win_rc = WERR_SERVER_UNAVAILABLE; > goto done; > } >+ old_krb5ccname = getenv(KRB5_ENV_CCNAME); > setenv(KRB5_ENV_CCNAME, "MEMORY:prtpub_cache", 1); > SAFE_FREE(ads->auth.password); > ads->auth.password = secrets_fetch_machine_password(lp_workgroup(), >@@ -479,6 +481,11 @@ WERROR nt_printer_publish(TALLOC_CTX *mem_ctx, > > done: > ads_destroy(&ads); >+ ads_kdestroy("MEMORY:prtpub_cache"); >+ unsetenv(KRB5_ENV_CCNAME); >+ if (old_krb5ccname) { >+ setenv(KRB5_ENV_CCNAME, old_krb5ccname, 0); >+ } > return win_rc; > } > >@@ -493,6 +500,7 @@ WERROR check_published_printers(struct messaging_context *msg_ctx) > struct spoolss_PrinterInfo2 *pinfo2; > NTSTATUS status; > WERROR result; >+ char *old_krb5ccname = NULL; > > tmp_ctx = talloc_new(NULL); > if (!tmp_ctx) return WERR_NOMEM; >@@ -502,6 +510,7 @@ WERROR check_published_printers(struct messaging_context *msg_ctx) > DEBUG(3, ("ads_init() failed\n")); > return WERR_SERVER_UNAVAILABLE; > } >+ old_krb5ccname = getenv(KRB5_ENV_CCNAME); > setenv(KRB5_ENV_CCNAME, "MEMORY:prtpub_cache", 1); > SAFE_FREE(ads->auth.password); > ads->auth.password = secrets_fetch_machine_password(lp_workgroup(), >@@ -546,6 +555,10 @@ WERROR check_published_printers(struct messaging_context *msg_ctx) > done: > ads_destroy(&ads); > ads_kdestroy("MEMORY:prtpub_cache"); >+ unsetenv(KRB5_ENV_CCNAME); >+ if (old_krb5ccname) { >+ setenv(KRB5_ENV_CCNAME, old_krb5ccname, 0); >+ } > talloc_free(tmp_ctx); > return result; > } >-- >1.8.3.1 >
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
Flags:
asn
:
review+
Actions:
View
Attachments on
bug 7444
: 9067 |
9072