summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_synclists.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nmbd/nmbd_synclists.c')
-rw-r--r--source3/nmbd/nmbd_synclists.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/source3/nmbd/nmbd_synclists.c b/source3/nmbd/nmbd_synclists.c
index b9952fb446..6a0576a5a4 100644
--- a/source3/nmbd/nmbd_synclists.c
+++ b/source3/nmbd/nmbd_synclists.c
@@ -31,8 +31,8 @@
struct sync_record {
struct sync_record *next, *prev;
- fstring workgroup;
- fstring server;
+ nstring workgroup;
+ nstring server;
pstring fname;
struct in_addr ip;
pid_t pid;
@@ -47,6 +47,7 @@ static XFILE *fp;
This is the NetServerEnum callback.
Note sname and comment are in UNIX codepage format.
******************************************************************/
+
static void callback(const char *sname, uint32 stype,
const char *comment, void *state)
{
@@ -58,6 +59,7 @@ static void callback(const char *sname, uint32 stype,
Log in on the remote server's SMB port to their IPC$ service,
do a NetServerEnum and record the results in fname
******************************************************************/
+
static void sync_child(char *name, int nm_type,
char *workgroup,
struct in_addr ip, BOOL local, BOOL servers,
@@ -78,10 +80,9 @@ static void sync_child(char *name, int nm_type,
}
make_nmb_name(&calling, local_machine, 0x0);
- make_nmb_name(&called , name , nm_type);
+ make_nmb_name(&called , name, nm_type);
- if (!cli_session_request(&cli, &calling, &called))
- {
+ if (!cli_session_request(&cli, &calling, &called)) {
cli_shutdown(&cli);
return;
}
@@ -120,12 +121,12 @@ static void sync_child(char *name, int nm_type,
cli_shutdown(&cli);
}
-
/*******************************************************************
initialise a browse sync with another browse server. Log in on the
remote server's SMB port to their IPC$ service, do a NetServerEnum
and record the results
******************************************************************/
+
void sync_browse_lists(struct work_record *work,
char *name, int nm_type,
struct in_addr ip, BOOL local, BOOL servers)
@@ -147,8 +148,8 @@ done:
ZERO_STRUCTP(s);
- fstrcpy(s->workgroup, work->work_group);
- fstrcpy(s->server, name);
+ nstrcpy(s->workgroup, work->work_group);
+ nstrcpy(s->server, name);
s->ip = ip;
slprintf(s->fname, sizeof(pstring)-1,
@@ -182,8 +183,9 @@ done:
}
/**********************************************************************
-handle one line from a completed sync file
+ Handle one line from a completed sync file.
**********************************************************************/
+
static void complete_one(struct sync_record *s,
char *sname, uint32 stype, char *comment)
{
@@ -204,8 +206,7 @@ static void complete_one(struct sync_record *s,
sname, lp_max_ttl());
if (work) {
/* remember who the master is */
- fstrcpy(work->local_master_browser_name,
- comment);
+ nstrcpy(work->local_master_browser_name, comment);
}
}
return;
@@ -235,10 +236,10 @@ static void complete_one(struct sync_record *s,
create_server_on_workgroup(work, sname,stype, lp_max_ttl(), comment);
}
-
/**********************************************************************
-read the completed sync info
- **********************************************************************/
+ Read the completed sync info.
+**********************************************************************/
+
static void complete_sync(struct sync_record *s)
{
XFILE *f;
@@ -251,11 +252,13 @@ static void complete_sync(struct sync_record *s)
f = x_fopen(s->fname,O_RDONLY, 0);
- if (!f) return;
+ if (!f)
+ return;
while (!x_feof(f)) {
- if (!fgets_slash(line,sizeof(pstring),f)) continue;
+ if (!fgets_slash(line,sizeof(pstring),f))
+ continue;
ptr = line;
@@ -281,8 +284,9 @@ static void complete_sync(struct sync_record *s)
}
/**********************************************************************
-check for completion of any of the child processes
- **********************************************************************/
+ Check for completion of any of the child processes.
+**********************************************************************/
+
void sync_check_completion(void)
{
struct sync_record *s, *next;