#include "nmbd/nmbd.h"
#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
-#include "smbprofile.h"
+#include "../libcli/smb/smbXcli_base.h"
struct sync_record {
struct sync_record *next, *prev;
Note sname and comment are in UNIX codepage format.
******************************************************************/
-static void callback(const char *sname, uint32 stype,
+static void callback(const char *sname, uint32_t stype,
const char *comment, void *state)
{
x_fprintf(fp,"\"%s\" %08X \"%s\"\n", sname, stype, comment);
{
fstring unix_workgroup;
struct cli_state *cli;
- uint32 local_type = local ? SV_TYPE_LOCAL_LIST_ONLY : 0;
+ uint32_t local_type = local ? SV_TYPE_LOCAL_LIST_ONLY : 0;
struct sockaddr_storage ss;
NTSTATUS status;
in_addr_to_sockaddr_storage(&ss, ip);
- status = cli_connect_nb(name, &ss, 139, nm_type,
- get_local_machine_name(), Undefined, 0,
- &cli);
+ status = cli_connect_nb(name, &ss, NBT_SMB_PORT, nm_type,
+ get_local_machine_name(), SMB_SIGNING_DEFAULT,
+ 0, &cli);
if (!NT_STATUS_IS_OK(status)) {
return;
}
- status = cli_negprot(cli, PROTOCOL_NT1);
+ status = smbXcli_negprot(cli->conn, cli->timeout, PROTOCOL_CORE,
+ PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(status)) {
cli_shutdown(cli);
return;
}
- if (!NT_STATUS_IS_OK(cli_session_setup(cli, "", "", 1, "", 0,
- workgroup))) {
+ status = cli_session_setup_anon(cli);
+ if (!NT_STATUS_IS_OK(status)) {
cli_shutdown(cli);
return;
}
- if (!NT_STATUS_IS_OK(cli_tcon_andx(cli, "IPC$", "IPC", "", 1))) {
+ if (!NT_STATUS_IS_OK(cli_tree_connect(cli, "IPC$", "IPC", "", 1))) {
cli_shutdown(cli);
return;
}
struct sync_record *s;
static int counter;
- START_PROFILE(sync_browse_lists);
/* Check we're not trying to sync with ourselves. This can
happen if we are a domain *and* a local master browser. */
if (ismyip_v4(ip)) {
done:
- END_PROFILE(sync_browse_lists);
return;
}
unstrcpy(s->server, name);
s->ip = ip;
- if (asprintf(&s->fname, "%s/sync.%d", lp_lockdir(), counter++) < 0) {
+ if (asprintf(&s->fname, "%s/sync.%d", lp_lock_directory(), counter++) < 0) {
SAFE_FREE(s);
goto done;
}
DLIST_ADD(syncs, s);
/* the parent forks and returns, leaving the child to do the
- actual sync and call END_PROFILE*/
+ actual sync */
CatchChild();
- if ((s->pid = sys_fork())) return;
+ if ((s->pid = fork())) return;
BlockSignals( False, SIGTERM );
fp = x_fopen(s->fname,O_WRONLY|O_CREAT|O_TRUNC, 0644);
if (!fp) {
- END_PROFILE(sync_browse_lists);
_exit(1);
}
s->fname);
x_fclose(fp);
- END_PROFILE(sync_browse_lists);
_exit(0);
}
**********************************************************************/
static void complete_one(struct sync_record *s,
- char *sname, uint32 stype, char *comment)
+ char *sname, uint32_t stype, char *comment)
{
struct work_record *work;
struct server_record *servrec;