summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1999-07-14 06:54:31 +0000
committerAndrew Tridgell <tridge@samba.org>1999-07-14 06:54:31 +0000
commit2d2961ba090079add917574c04a5857e5b2211a7 (patch)
treed447c0dc5c6f63aa5f5118a3cbe5b9135b799958
parentd39ea03bd4f38699e3f26c4010d90bbc33aa672a (diff)
downloadsamba-2d2961ba090079add917574c04a5857e5b2211a7.tar.gz
transfered nmbd fixes from the 2.0 branch
-rw-r--r--source/nmbd/asyncdns.c4
-rw-r--r--source/nmbd/nmbd.c34
-rw-r--r--source/nmbd/nmbd_become_dmb.c10
-rw-r--r--source/nmbd/nmbd_synclists.c2
4 files changed, 33 insertions, 17 deletions
diff --git a/source/nmbd/asyncdns.c b/source/nmbd/asyncdns.c
index 67e55ebd508..99e697b4705 100644
--- a/source/nmbd/asyncdns.c
+++ b/source/nmbd/asyncdns.c
@@ -52,7 +52,7 @@ static struct name_record *add_dns_result(struct nmb_name *question, struct in_a
#ifndef SYNC_DNS
static int fd_in = -1, fd_out = -1;
-static int child_pid = -1;
+static pid_t child_pid = -1;
static int in_dns;
/* this is the structure that is passed between the parent and child */
@@ -147,7 +147,7 @@ void start_async_dns(void)
fd_out = fd2[1];
close(fd1[1]);
close(fd2[0]);
- DEBUG(0,("started asyncdns process %d\n", child_pid));
+ DEBUG(0,("started asyncdns process %d\n", (int)child_pid));
return;
}
diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c
index c1abca6b412..0dc54d0e492 100644
--- a/source/nmbd/nmbd.c
+++ b/source/nmbd/nmbd.c
@@ -532,20 +532,21 @@ static BOOL init_structs(void)
**************************************************************************** */
static void usage(char *pname)
{
- DEBUG(0,("Incorrect program usage - is the command line correct?\n"));
-
- printf( "Usage: %s [-n name] [-D] [-p port] [-d debuglevel] ", pname );
- printf( "[-l log basename]\n" );
- printf( "Version %s\n", VERSION );
- printf( "\t-D become a daemon\n" );
- printf( "\t-p port listen on the specified port\n" );
- printf( "\t-d debuglevel set the debuglevel\n" );
+
+ printf( "Usage: %s [-DaohV] [-H lmhosts file] [-d debuglevel] [-l log basename]\n", pname );
+ printf( " [-n name] [-p port] [-s configuration file] [-i scope]\n" );
+ printf( "\t-D Become a daemon\n" );
+ printf( "\t-a Append to log file (default)\n" );
+ printf( "\t-o Overwrite log file, don't append\n" );
+ printf( "\t-h Print usage\n" );
+ printf( "\t-V Print version\n" );
+ printf( "\t-H hosts file Load a netbios hosts file\n" );
+ printf( "\t-d debuglevel Set the debuglevel\n" );
printf( "\t-l log basename. Basename for log/debug files\n" );
- printf( "\t-n netbiosname. " );
- printf( "the netbios name to advertise for this host\n");
- printf( "\t-H hosts file load a netbios hosts file\n" );
- printf( "\t-a append to log file (default)\n" );
- printf( "\t-o overwrite log file, don't append\n" );
+ printf( "\t-n netbiosname. Primary netbios name\n" );
+ printf( "\t-p port Listen on the specified port\n" );
+ printf( "\t-s configuration file Configuration file name\n" );
+ printf( "\t-i scope NetBIOS scope\n" );
printf( "\n");
} /* usage */
@@ -615,7 +616,7 @@ static void usage(char *pname)
#endif /* MEM_MAN */
while( EOF !=
- (opt = getopt( argc, argv, "aos:T:I:C:bAi:B:N:Rn:l:d:Dp:hSH:G:f:" )) )
+ (opt = getopt( argc, argv, "Vaos:T:I:C:bAi:B:N:Rn:l:d:Dp:hSH:G:f:" )) )
{
switch (opt)
{
@@ -662,9 +663,14 @@ static void usage(char *pname)
usage(argv[0]);
exit(0);
break;
+ case 'V':
+ printf( "Version %s\n", VERSION );
+ exit(0);
+ break;
default:
if( !is_a_socket(0) )
{
+ DEBUG(0,("Incorrect program usage - is the command line correct?\n"));
usage(argv[0]);
exit(0);
}
diff --git a/source/nmbd/nmbd_become_dmb.c b/source/nmbd/nmbd_become_dmb.c
index cbef1db4b7e..ae809607dc6 100644
--- a/source/nmbd/nmbd_become_dmb.c
+++ b/source/nmbd/nmbd_become_dmb.c
@@ -157,6 +157,16 @@ in workgroup %s on subnet %s\n",
*/
become_domain_master_browser_bcast(work->work_group);
}
+ else
+ {
+ /*
+ * Now we are a domain master on a broadcast subnet, we need to add
+ * the WORKGROUP<1b> name to the unicast subnet so that we can answer
+ * unicast requests sent to this name. This bug wasn't found for a while
+ * as it is strange to have a DMB without using WINS. JRA.
+ */
+ insert_permanent_name_into_unicast(subrec, registered_name, nb_flags);
+ }
}
/****************************************************************************
diff --git a/source/nmbd/nmbd_synclists.c b/source/nmbd/nmbd_synclists.c
index dae25b6eca3..3cdb42d72c0 100644
--- a/source/nmbd/nmbd_synclists.c
+++ b/source/nmbd/nmbd_synclists.c
@@ -40,7 +40,7 @@ struct sync_record {
fstring server;
pstring fname;
struct in_addr ip;
- int pid;
+ pid_t pid;
};
/* a linked list of current sync connections */