struct cli_state **cli = (struct cli_state **)private_data_pointer;
if (*cli && (*cli)->initialised) {
cli_shutdown(*cli);
-
- SAFE_FREE(*cli);
}
}
if (!send_keepalive((*cli)->fd)) {
DEBUG( 2, ( "password server keepalive failed.\n"));
cli_shutdown(*cli);
- SAFE_FREE(*cli);
}
}
}
if (locally_made_cli) {
cli_shutdown(cli);
- SAFE_FREE(cli);
}
return(nt_status);
d_printf("session request to %s failed (%s)\n",
called.name, cli_errstr(c));
cli_shutdown(c);
- SAFE_FREE(c);
if ((p=strchr_m(called.name, '.'))) {
*p = 0;
goto again;
if (!cli_negprot(c)) {
d_printf("protocol negotiation failed\n");
cli_shutdown(c);
- SAFE_FREE(c);
return NULL;
}
!cli_session_setup(c, "", "", 0, "", 0, workgroup)) {
d_printf("session setup failed: %s\n", cli_errstr(c));
cli_shutdown(c);
- SAFE_FREE(c);
return NULL;
}
d_printf("Anonymous login successful\n");
password, strlen(password)+1)) {
d_printf("tree connect failed: %s\n", cli_errstr(c));
cli_shutdown(c);
- SAFE_FREE(c);
return NULL;
}
DEBUG(0,("%d: Connection to %s failed\n", getpid(), server_n));
if (c) {
cli_shutdown(c);
- SAFE_FREE(c);
}
return NULL;
}
DEBUG(0,("%d: session request to %s failed (%s)\n",
getpid(), called.name, cli_errstr(c)));
cli_shutdown(c);
- SAFE_FREE(c);
if ((p=strchr_m(called.name, '.'))) {
*p = 0;
goto again;
if (!cli_negprot(c)) {
DEBUG(0,("%d: protocol negotiation failed\n", getpid()));
cli_shutdown(c);
- SAFE_FREE(c);
return NULL;
}
DEBUG(0,("%d: session setup failed: %s\n",
getpid(), cli_errstr(c)));
cli_shutdown(c);
- SAFE_FREE(c);
return NULL;
}
DEBUG(0,("Anonymous login successful\n"));
DEBUG(0,("%d: tree connect failed: %s\n",
getpid(), cli_errstr(c)));
cli_shutdown(c);
- SAFE_FREE(c);
return NULL;
}
If we don't do this we will "leak" sockets and memory on
each reconnection we have to make. */
cli_shutdown(c);
- SAFE_FREE(c);
if (!closed) {
/* redirect stdout & stderr since we can't know that
asprintf(&new_dn, "cn=%s,cn=Computers,%s", hostname, ads->bind_path);
asprintf(&samAccountName, "%s$", hostname);
asprintf(&controlstr, "%u",
- UF_DONT_EXPIRE_PASSWD | UF_WORKSTATION_TRUST_ACCOUNT |
+ UF_DONT_EXPIRE_PASSWD | UF_WORKSTATION_TRUST_ACCOUNT |
UF_TRUSTED_FOR_DELEGATION | UF_USE_DES_KEY_ONLY);
ret = ads_gen_add(ads, new_dn,
return ret;
}
+/* find the update serial number - this is the core of the ldap cache */
+BOOL ads_USN(ADS_STRUCT *ads, unsigned *usn)
+{
+ const char *attrs[] = {"highestCommittedUSN", NULL};
+ int rc;
+ void *res;
+
+ rc = ldap_search_s(ads->ld, ads->bind_path,
+ LDAP_SCOPE_BASE, "(objectclass=*)", (char **)attrs, 0, (LDAPMessage *)&res);
+ if (rc || ads_count_replies(ads, res) != 1) return False;
+ return False;
+}
+
#endif
{
DEBUG(1,("failed tcon_X\n"));
if (do_shutdown)
- cli_shutdown(cli);
+ cli_shutdown(cli);
return False;
}
}
DEBUG(0,("attempt_netbios_session_request: %s rejected the session for name *SMBSERVER \
with error %s.\n", desthost, cli_errstr(cli) ));
- cli_shutdown(cli);
- return False;
- }
+ cli_shutdown(cli);
+ return False;
+ }
cli_shutdown(cli);
}
cli_ulogoff(cli[server][conn]);
cli_shutdown(cli[server][conn]);
- SAFE_FREE(cli[server][conn]);
}
cli[server][conn] = connect_one(share[server]);
if (!cli[server][conn]) {
}
cli_ulogoff(cli[server][conn]);
cli_shutdown(cli[server][conn]);
- SAFE_FREE(cli[server][conn]);
}
cli[server][conn] = connect_one(share[server]);
if (!cli[server][conn]) {
DEBUG(1,("session request to %s failed (%s)\n",
called.name, cli_errstr(c)));
cli_shutdown(c);
- SAFE_FREE(c);
if ((p=strchr(called.name, '.'))) {
*p = 0;
goto again;
if (!cli_negprot(c)) {
DEBUG(1,("protocol negotiation failed\n"));
cli_shutdown(c);
- SAFE_FREE(c);
return NULL;
}
if (!cli_session_setup(c, "", "", 0, "", 0, opt_workgroup)) {
DEBUG(1,("session setup failed: %s\n", cli_errstr(c)));
cli_shutdown(c);
- SAFE_FREE(c);
return NULL;
}
DEBUG(3,("Anonymous login successful\n"));
opt_password, strlen(opt_password)+1)) {
DEBUG(1,("tree connect failed: %s\n", cli_errstr(c)));
cli_shutdown(c);
- SAFE_FREE(c);
return NULL;
}
if (!(c=cli_initialise(NULL)) || !cli_connect(c, server, &ip)) {
DEBUG(0,("Connection to %s failed\n", server));
cli_shutdown(c);
- SAFE_FREE(c);
return NULL;
}
if (!cli_session_request(c, &calling, &called)) {
DEBUG(0,("session request to %s failed\n", called.name));
cli_shutdown(c);
- SAFE_FREE(c);
if (strcmp(called.name, "*SMBSERVER")) {
make_nmb_name(&called , "*SMBSERVER", 0x20);
goto again;
if (!cli_negprot(c)) {
DEBUG(0,("protocol negotiation failed\n"));
cli_shutdown(c);
- SAFE_FREE(c);
return NULL;
}
lp_workgroup())) {
DEBUG(0,("session setup failed: %s\n", cli_errstr(c)));
cli_shutdown(c);
- SAFE_FREE(c);
return NULL;
}
password, strlen(password)+1)) {
DEBUG(0,("tree connect failed: %s\n", cli_errstr(c)));
cli_shutdown(c);
- SAFE_FREE(c);
return NULL;
}
if (cli && cli->initialised)
cli_shutdown(cli);
- SAFE_FREE(cli);
return NULL;
}