+ * Connect to the LDAP server using anonymous credentials
+ * using a simple bind without username/password
+ *
+ * @param ads Pointer to an existing ADS_STRUCT
+ * @return status of connection
+ **/
+ADS_STATUS ads_connect_simple_anon(ADS_STRUCT *ads)
+{
+ TALLOC_CTX *frame = talloc_stackframe();
+ struct cli_credentials *creds = NULL;
+ ADS_STATUS status;
+
+ creds = cli_credentials_init_anon(frame);
+ if (creds == NULL) {
+ TALLOC_FREE(frame);
+ return ADS_ERROR_SYSTEM(errno);
+ }
+
+ ads->auth.flags |= ADS_AUTH_ANON_BIND;
+ status = ads_connect_creds(ads, creds);
+ TALLOC_FREE(frame);
+ return status;
+}
+
+/**
+ * Connect to the LDAP server using the machine account
+ * @param ads Pointer to an existing ADS_STRUCT
+ * @return status of connection
+ **/
+ADS_STATUS ads_connect_machine(ADS_STRUCT *ads)
+{
+ TALLOC_CTX *frame = talloc_stackframe();
+ struct cli_credentials *creds = NULL;
+ ADS_STATUS status;
+ NTSTATUS ntstatus;
+
+ ntstatus = pdb_get_trust_credentials(ads->server.workgroup,
+ ads->server.realm,
+ frame,
+ &creds);
+ if (!NT_STATUS_IS_OK(ntstatus)) {
+ TALLOC_FREE(frame);
+ return ADS_ERROR_NT(ntstatus);
+ }
+
+ status = ads_connect_creds(ads, creds);
+ TALLOC_FREE(frame);
+ return status;
+}
+
+/*