From fda7b4b226d1fb6668006e34b3bfe4ac0f041117 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Fri, 25 Apr 2003 21:51:26 +0000 Subject: Get credentials before publishing printers. (This used to be commit 674174fcca234a44d1778ee092998338cbd7a553) --- source3/printing/nt_printing.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3') diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 266b63f711..685f5ff499 100644 --- a/source3/printing/nt_printing.c +++ b/source3/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))); -- cgit