cldap: move out cldap object to fix the build.
authorGünther Deschner <gd@samba.org>
Wed, 7 May 2008 19:31:59 +0000 (21:31 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 9 May 2008 12:59:19 +0000 (14:59 +0200)
Guenther

source/Makefile.in
source/libads/cldap.c
source/libsmb/dsgetdcname.c

index 3ad631589f33fa5ed830d9a7c047d12e40fae7c9..7e316ee886a1962c8680d3710d37227fda4526a2 100644 (file)
@@ -393,7 +393,7 @@ LIBADS_OBJ = libads/ldap.o libads/ldap_printer.o \
             libads/krb5_setpw.o libads/ldap_user.o \
             libads/ads_struct.o libads/kerberos_keytab.o \
              libads/disp_sec.o libads/ads_utils.o libads/ldap_utils.o \
-            libads/cldap.o libads/ldap_schema.o libads/util.o libads/ndr.o
+            libads/ldap_schema.o libads/util.o libads/ndr.o
 
 LIBADS_SERVER_OBJ = libads/kerberos_verify.o libads/authdata.o \
                    librpc/ndr/ndr_krb5pac.o \
@@ -428,6 +428,8 @@ LIBSMB_OBJ0 = \
 LIBSAMBA_OBJ = $(LIBSMB_OBJ0) \
               $(LIBSMB_ERR_OBJ)
 
+CLDAP_OBJ = libads/cldap.o
+
 LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \
             libsmb/clikrb5.o libsmb/clispnego.o libsmb/asn1.o \
             libsmb/clirap.o libsmb/clierror.o libsmb/climessage.o \
@@ -439,7 +441,8 @@ LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \
             libsmb/smb_seal.o libsmb/async_smb.o \
             $(LIBSAMBA_OBJ) \
             $(LIBNMB_OBJ) \
-            $(LIBNBT_OBJ)
+            $(LIBNBT_OBJ) \
+            $(CLDAP_OBJ)
 
 RPC_CLIENT_OBJ1 = rpc_client/cli_netlogon.o
 
index e4fa965a0f0e0bf14fd0cc50bf1217e14ee10ce7..3a5a8b0647ac08d9bc56317f8e4294a80c2064f1 100644 (file)
@@ -281,3 +281,87 @@ bool ads_cldap_netlogon_5(TALLOC_CTX *mem_ctx,
 
        return true;
 }
+
+/****************************************************************
+****************************************************************/
+
+bool pull_mailslot_cldap_reply(TALLOC_CTX *mem_ctx,
+                              const DATA_BLOB *blob,
+                              union nbt_cldap_netlogon *r,
+                              uint32_t *nt_version)
+{
+       enum ndr_err_code ndr_err;
+       uint32_t nt_version_query = ((*nt_version) & 0x000000ff);
+       uint16_t command = 0;
+
+       ndr_err = ndr_pull_struct_blob(blob, mem_ctx, &command,
+                       (ndr_pull_flags_fn_t)ndr_pull_uint16);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               return false;
+       }
+
+       switch (command) {
+               case 0x13: /* 19 */
+               case 0x15: /* 21 */
+               case 0x17: /* 23 */
+                        break;
+               default:
+                       DEBUG(1,("got unexpected command: %d (0x%08x)\n",
+                               command, command));
+                       return false;
+       }
+
+       ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
+                      (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
+       if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               goto done;
+       }
+
+       /* when the caller requested just those nt_version bits that the server
+        * was able to reply to, we are fine and all done. otherwise we need to
+        * assume downgraded replies which are painfully parsed here - gd */
+
+       if (nt_version_query & NETLOGON_VERSION_WITH_CLOSEST_SITE) {
+               nt_version_query &= ~NETLOGON_VERSION_WITH_CLOSEST_SITE;
+       }
+       ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
+                      (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
+       if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               goto done;
+       }
+       if (nt_version_query & NETLOGON_VERSION_5EX_WITH_IP) {
+               nt_version_query &= ~NETLOGON_VERSION_5EX_WITH_IP;
+       }
+       ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
+                      (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
+       if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               goto done;
+       }
+       if (nt_version_query & NETLOGON_VERSION_5EX) {
+               nt_version_query &= ~NETLOGON_VERSION_5EX;
+       }
+       ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
+                      (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
+       if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               goto done;
+       }
+       if (nt_version_query & NETLOGON_VERSION_5) {
+               nt_version_query &= ~NETLOGON_VERSION_5;
+       }
+       ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
+                      (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
+       if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               goto done;
+       }
+
+       return false;
+
+ done:
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_UNION_DEBUG(nbt_cldap_netlogon, nt_version_query, r);
+       }
+
+       *nt_version = nt_version_query;
+
+       return true;
+}
index 208daf334c70fb2dffa4f0a53d139d7b2da723e1..0db457a45af8366b4cb1a25589baaeaa8ab00ffd 100644 (file)
@@ -1299,87 +1299,3 @@ NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx,
 
        return status;
 }
-
-/****************************************************************
-****************************************************************/
-
-bool pull_mailslot_cldap_reply(TALLOC_CTX *mem_ctx,
-                              const DATA_BLOB *blob,
-                              union nbt_cldap_netlogon *r,
-                              uint32_t *nt_version)
-{
-       enum ndr_err_code ndr_err;
-       uint32_t nt_version_query = ((*nt_version) & 0x000000ff);
-       uint16_t command = 0;
-
-       ndr_err = ndr_pull_struct_blob(blob, mem_ctx, &command,
-                       (ndr_pull_flags_fn_t)ndr_pull_uint16);
-       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-               return false;
-       }
-
-       switch (command) {
-               case 0x13: /* 19 */
-               case 0x15: /* 21 */
-               case 0x17: /* 23 */
-                        break;
-               default:
-                       DEBUG(1,("got unexpected command: %d (0x%08x)\n",
-                               command, command));
-                       return false;
-       }
-
-       ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
-                      (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
-       if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-               goto done;
-       }
-
-       /* when the caller requested just those nt_version bits that the server
-        * was able to reply to, we are fine and all done. otherwise we need to
-        * assume downgraded replies which are painfully parsed here - gd */
-
-       if (nt_version_query & NETLOGON_VERSION_WITH_CLOSEST_SITE) {
-               nt_version_query &= ~NETLOGON_VERSION_WITH_CLOSEST_SITE;
-       }
-       ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
-                      (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
-       if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-               goto done;
-       }
-       if (nt_version_query & NETLOGON_VERSION_5EX_WITH_IP) {
-               nt_version_query &= ~NETLOGON_VERSION_5EX_WITH_IP;
-       }
-       ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
-                      (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
-       if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-               goto done;
-       }
-       if (nt_version_query & NETLOGON_VERSION_5EX) {
-               nt_version_query &= ~NETLOGON_VERSION_5EX;
-       }
-       ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
-                      (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
-       if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-               goto done;
-       }
-       if (nt_version_query & NETLOGON_VERSION_5) {
-               nt_version_query &= ~NETLOGON_VERSION_5;
-       }
-       ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
-                      (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
-       if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-               goto done;
-       }
-
-       return false;
-
- done:
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_UNION_DEBUG(nbt_cldap_netlogon, nt_version_query, r);
-       }
-
-       *nt_version = nt_version_query;
-
-       return true;
-}