summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2003-04-25 21:51:26 +0000
committerJim McDonough <jmcd@samba.org>2003-04-25 21:51:26 +0000
commitfda7b4b226d1fb6668006e34b3bfe4ac0f041117 (patch)
tree7be096b63e7008a13e91b9e134f2eef1dfe13427 /source3
parentea77c02b6ffc1c82db7f94611864adb878e3ee2a (diff)
downloadsamba-fda7b4b226d1fb6668006e34b3bfe4ac0f041117.tar.gz
samba-fda7b4b226d1fb6668006e34b3bfe4ac0f041117.tar.bz2
samba-fda7b4b226d1fb6668006e34b3bfe4ac0f041117.zip
Get credentials before publishing printers.
(This used to be commit 674174fcca234a44d1778ee092998338cbd7a553)
Diffstat (limited to 'source3')
-rw-r--r--source3/printing/nt_printing.c8
1 files changed, 8 insertions, 0 deletions
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)));