From 674174fcca234a44d1778ee092998338cbd7a553 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Fri, 25 Apr 2003 21:51:26 +0000 Subject: [PATCH] Get credentials before publishing printers. --- source/printing/nt_printing.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c index 266b63f7110..685f5ff4999 100644 --- a/source/printing/nt_printing.c +++ b/source/printing/nt_printing.c @@ -2607,6 +2607,10 @@ static WERROR publish_it(NT_PRINTER_INFO_LEVEL *printer) DEBUG(3, ("ads_init() failed\n")); return WERR_SERVER_UNAVAILABLE; } + setenv("KRB5CCNAME", "MEMORY:prtpub_cache", 1); + SAFE_FREE(ads->auth.password); + ads->auth.password = secrets_fetch_machine_password(lp_workgroup(), + NULL, NULL); ads_rc = ads_connect(ads); if (!ADS_ERR_OK(ads_rc)) { DEBUG(3, ("ads_connect failed: %s\n", ads_errstr(ads_rc))); @@ -2664,6 +2668,10 @@ WERROR unpublish_it(NT_PRINTER_INFO_LEVEL *printer) DEBUG(3, ("ads_init() failed\n")); return WERR_SERVER_UNAVAILABLE; } + setenv("KRB5CCNAME", "MEMORY:prtpub_cache", 1); + SAFE_FREE(ads->auth.password); + ads->auth.password = secrets_fetch_machine_password(lp_workgroup(), + NULL, NULL); ads_rc = ads_connect(ads); if (!ADS_ERR_OK(ads_rc)) { DEBUG(3, ("ads_connect failed: %s\n", ads_errstr(ads_rc))); -- 2.11.4.GIT