Try to compile as much as possible with only ldap, but not kerberos.
authorAndrew Bartlett <abartlet@samba.org>
Sat, 28 Sep 2002 14:42:32 +0000 (14:42 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 28 Sep 2002 14:42:32 +0000 (14:42 +0000)
source/libads/disp_sec.c
source/libads/krb5_setpw.c
source/libads/ldap.c
source/libads/sasl.c

index a930fd6fe09b0530f66b6dae81bf7385bbb8a2e6..a7b0bf6f07ca35c37323e447460763c98f257331 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "includes.h"
 
-#ifdef HAVE_ADS
-
 static struct perm_mask_str {
        uint32  mask;
        char   *str;
@@ -158,5 +156,4 @@ void ads_disp_sd(SEC_DESC *sd)
        printf("-------------- End Of Security Descriptor\n");
 }
 
-#endif
 
index a49b6cbe3b0ee8a01ed6ec30286544d0e175921c..8079c0953fc65391ce936228bb6e715d23b21dd8 100644 (file)
@@ -471,4 +471,35 @@ ADS_STATUS kerberos_set_password(const char *kpasswd_server,
 }
 
 
+/**
+ * Set the machine account password
+ * @param ads connection to ads server
+ * @param hostname machine whose password is being set
+ * @param password new password
+ * @return status of password change
+ **/
+ADS_STATUS ads_set_machine_password(ADS_STRUCT *ads,
+                                   const char *hostname, 
+                                   const char *password)
+{
+       ADS_STATUS status;
+       char *host = strdup(hostname);
+       char *principal; 
+
+       strlower(host);
+
+       /*
+         we need to use the '$' form of the name here, as otherwise the
+         server might end up setting the password for a user instead
+        */
+       asprintf(&principal, "%s$@%s", host, ads->auth.realm);
+       
+       status = krb5_set_password(ads->auth.kdc_server, principal, password, ads->auth.time_offset);
+       
+       free(host);
+       free(principal);
+
+       return status;
+}
+
 #endif
index 1004ea229c6c8cdca915434654f968d6371256f9..2133bf0719d291661475c2e7f1fdd1a7e62a1f3e 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "includes.h"
 
-#ifdef HAVE_ADS
+#ifdef HAVE_LDAP
 
 /**
  * @file ldap.c
@@ -1443,37 +1443,6 @@ ads_set_sd_error:
        return ret;
 }
 
-/**
- * Set the machine account password
- * @param ads connection to ads server
- * @param hostname machine whose password is being set
- * @param password new password
- * @return status of password change
- **/
-ADS_STATUS ads_set_machine_password(ADS_STRUCT *ads,
-                                   const char *hostname, 
-                                   const char *password)
-{
-       ADS_STATUS status;
-       char *host = strdup(hostname);
-       char *principal; 
-
-       strlower(host);
-
-       /*
-         we need to use the '$' form of the name here, as otherwise the
-         server might end up setting the password for a user instead
-        */
-       asprintf(&principal, "%s$@%s", host, ads->auth.realm);
-       
-       status = krb5_set_password(ads->auth.kdc_server, principal, password, ads->auth.time_offset);
-       
-       free(host);
-       free(principal);
-
-       return status;
-}
-
 /**
  * pull the first entry from a ADS result
  * @param ads connection to ads server
index f7dd01084a2f9c1fc70ec685522200ac39dd97dd..aa7d99a5f7c9579dd2647405da5c9f3f2197681c 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "includes.h"
 
-#ifdef HAVE_ADS
+#ifdef HAVE_LDAP
 
 /* 
    perform a LDAP/SASL/SPNEGO/NTLMSSP bind (just how many layers can
@@ -190,10 +190,12 @@ static ADS_STATUS ads_sasl_spnego_bind(ADS_STRUCT *ads)
        }
        DEBUG(3,("got principal=%s\n", principal));
 
+#ifdef HAVE_KRB5
        if (!(ads->auth.flags & ADS_AUTH_DISABLE_KERBEROS) &&
            got_kerberos_mechanism && ads_kinit_password(ads) == 0) {
                return ads_sasl_spnego_krb5_bind(ads, principal);
        }
+#endif
 
        /* lets do NTLMSSP ... this has the big advantage that we don't need
           to sync clocks, and we don't rely on special versions of the krb5