[SCM] Samba Shared Repository - branch v3-2-test updated -
initial-v3-2-unstable-1188-ga3b348b
Günther Deschner
gd at samba.org
Tue Jan 8 13:14:18 GMT 2008
The branch, v3-2-test has been updated
via a3b348b113f248d2eccffd6073560619a97a2976 (commit)
via 045a69c59c3b0732bb12a8b0efc8c9675e811719 (commit)
via ddc1307844379f99b3dde48fc351d0326d22a7ce (commit)
from 6be1ee8e6fb4e7fd413098c40b40569a980bd7a5 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit a3b348b113f248d2eccffd6073560619a97a2976
Author: Günther Deschner <gd at samba.org>
Date: Tue Jan 8 14:06:18 2008 +0100
Use ads_get_upn() in net_derive_salting_principal().
Guenther
commit 045a69c59c3b0732bb12a8b0efc8c9675e811719
Author: Günther Deschner <gd at samba.org>
Date: Tue Jan 8 14:03:12 2008 +0100
Fix define check s/WITH_LDAP/HAVE_LDAP/ in libnet_join.
Guenther
commit ddc1307844379f99b3dde48fc351d0326d22a7ce
Author: Günther Deschner <gd at samba.org>
Date: Tue Jan 8 13:46:54 2008 +0100
Do not ignore provided machine_name in ads_get_upn().
Guenther
-----------------------------------------------------------------------
Summary of changes:
source/libads/ldap.c | 10 +++++-----
source/libnet/libnet_join.c | 8 ++++----
source/utils/net_ads.c | 16 +---------------
3 files changed, 10 insertions(+), 24 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/libads/ldap.c b/source/libads/ldap.c
index 975e926..28bc779 100644
--- a/source/libads/ldap.c
+++ b/source/libads/ldap.c
@@ -3026,26 +3026,26 @@ char* ads_get_upn( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name )
ADS_STATUS status;
int count = 0;
char *name = NULL;
-
- status = ads_find_machine_acct(ads, &res, global_myname());
+
+ status = ads_find_machine_acct(ads, &res, machine_name);
if (!ADS_ERR_OK(status)) {
DEBUG(0,("ads_get_upn: Failed to find account for %s\n",
global_myname()));
goto out;
}
-
+
if ( (count = ads_count_replies(ads, res)) != 1 ) {
DEBUG(1,("ads_get_upn: %d entries returned!\n", count));
goto out;
}
-
+
if ( (name = ads_pull_string(ads, ctx, res, "userPrincipalName")) == NULL ) {
DEBUG(2,("ads_get_upn: No userPrincipalName attribute!\n"));
}
out:
ads_msgfree(ads, res);
-
+
return name;
}
diff --git a/source/libnet/libnet_join.c b/source/libnet/libnet_join.c
index 05ab184..454c1f2 100644
--- a/source/libnet/libnet_join.c
+++ b/source/libnet/libnet_join.c
@@ -58,7 +58,7 @@ static void libnet_unjoin_set_error_string(TALLOC_CTX *mem_ctx,
r->out.error_string = tmp;
}
-#ifdef WITH_LDAP
+#ifdef HAVE_LDAP
/****************************************************************
****************************************************************/
@@ -964,7 +964,7 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
struct libnet_JoinCtx *r)
{
NTSTATUS status;
-#ifdef WITH_LDAP
+#ifdef HAVE_LDAP
ADS_STATUS ads_status;
if (r->in.account_ou) {
@@ -996,7 +996,7 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
return WERR_SETUP_NOT_JOINED;
}
-#ifdef WITH_LDAP
+#ifdef HAVE_LDAP
ads_status = libnet_join_set_machine_spn(mem_ctx, r);
if (!ADS_ERR_OK(ads_status)) {
libnet_join_set_error_string(mem_ctx, r,
@@ -1084,7 +1084,7 @@ static WERROR libnet_DomainUnjoin(TALLOC_CTX *mem_ctx,
return ntstatus_to_werror(status);
}
-#ifdef WITH_LDAP
+#ifdef HAVE_LDAP
if (r->in.unjoin_flags & WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE) {
ADS_STATUS ads_status;
libnet_unjoin_connect_ads(mem_ctx, r);
diff --git a/source/utils/net_ads.c b/source/utils/net_ads.c
index 141031d..310af82 100644
--- a/source/utils/net_ads.c
+++ b/source/utils/net_ads.c
@@ -1255,7 +1255,6 @@ static bool net_derive_salting_principal( TALLOC_CTX *ctx, ADS_STRUCT *ads )
ADS_STATUS status;
fstring salt;
char *std_salt;
- LDAPMessage *res = NULL;
const char *machine_name = global_myname();
status = ads_domain_func_level( ads, &domain_func );
@@ -1278,24 +1277,11 @@ static bool net_derive_salting_principal( TALLOC_CTX *ctx, ADS_STRUCT *ads )
if ( domain_func == DS_DOMAIN_FUNCTION_2000 ) {
char *upn;
- int count;
-
- status = ads_find_machine_acct(ads, &res, machine_name);
- if (!ADS_ERR_OK(status)) {
- return False;
- }
- if ( (count = ads_count_replies(ads, res)) != 1 ) {
- DEBUG(1,("net_set_machine_spn: %d entries returned!\n", count));
- return False;
- }
-
- upn = ads_pull_string(ads, ctx, res, "userPrincipalName");
+ upn = ads_get_upn(ads, ctx, machine_name);
if ( upn ) {
fstrcpy( salt, upn );
}
-
- ads_msgfree(ads, res);
}
return kerberos_secrets_store_des_salt( salt );
--
Samba Shared Repository
More information about the samba-cvs
mailing list