summaryrefslogtreecommitdiffstats
path: root/source/nmbd/nmbd_winsserver.c
Commit message (Collapse)AuthorAgeFilesLines
* Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison2000-05-021-2/+2
| | | | | of doing a system call every time we want to just get our pid. Jeremy.
* when doing a "secure nbns" wack response and check with owner for aAndrew Tridgell2000-03-261-1/+4
| | | | | | | | | multihomed registration we were sending the packet to the wrong host! We sent it to the person trying to register rather than to the person who currently holds the name. That means we were not secure and we could allow two people to register the same name. Jeremy, you may wish to merge this change into 2.0.X
* Modified auto alignment of ud[] struct on stack to be declared as anJeremy Allison2000-01-281-2/+2
| | | | | | array of pointers. This should cause alignment on a correct boundary.. Spotted by Darren Reed <darrenr@telnetmedia.com>. Jeremy.
* - added tdb_flags option to tdb_open()Andrew Tridgell2000-01-021-8/+2
| | | | | | | | | - added TDB_CLEAR_IF_FIRST flag to clear the database if this is the first attached process. Useful for non-persistent databases like our locking area (this will also make upgrades to new database layouts easier) - use lock_path() in a couple of places - leave connections database open while smbd running - cleaned up some tdb code a little, using macros for constants
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-14/+63
|
* Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.Jeremy Allison1998-11-171-2/+2
| | | | | | | | | | Tidied up some of the mess (no other word for it). Still doesn't compile cleanly. There are calls with incorrect parameters that don't seem to be doing the right thing. This code still needs surgery :-(. Jeremy.
* Removed acconfig.h configure configure.in include/config.h.in: Made ↵Jeremy Allison1998-11-141-35/+35
| | | | | | | | | smbwrapper not made by default. nmbd*: Changed all calls to namestr() to nmbd_namestr() to fix broken FreeBSD include file problem...sigh. Jeremy.
* Another cosmetic change.Christopher R. Hertel1998-10-221-2/+8
| | | | | | | | | | | | | | When dumping the wins.dat, this module will also write the database contents to the log file (don't do this if you have a large wins.dat!). The output was in a sort of tabular format, except that the asctime() function was used and it always terminates its output with a newline. I did a bit of fussing, removed the '\n' character, and did my best to line up the other columns. If the output format of asctime() is different on different systems, then the columns won't line up, but the output will still look better than it did before. Chris -)-----
* Changes to test in configure if capabilities are enabled on a system.Jeremy Allison1998-09-281-13/+1
| | | | | | | | | | Changes to get Samba to compile cleanly with the IRIX compiler with the options : -fullwarn -woff 1209,1174 (the -woff options are to turn off warnings about unused function parameters and controlling loop expressions being constants). Split prototype generation as we hit a limit in IRIX nawk. Removed "." code in smbd/filename.c (yet again :-). Jeremy.
* oops ... I got the filenames wrong in my cleanup of the wins databaseAndrew Tridgell1998-09-181-1/+2
| | | | | | | save, so it started saving weird filenames (from an unitialised fstring). chaos reigns!
* nmbd/nmbd_winsserver.c: Fixed printf style warning.Jeremy Allison1998-09-181-1/+1
| | | | | script/mkproto.awk: Added SMB_BIG_UINT. Jeremy.
* fixed another potential fork bomb where the wins file becomesAndrew Tridgell1998-09-171-0/+3
| | | | non-writeable for some reason.
* fixed the nmbd fork bomb. It was a silly mistake, asAndrew Tridgell1998-09-171-0/+3
| | | | | expected. wins_write_database() didn't exit after doing its stuff, so when it returned you had two copies of nmbd :)
* fixed a typo in my last commitAndrew Tridgell1998-09-171-1/+1
|
* fixed a potential problem with wins_write_database() child processes.Andrew Tridgell1998-09-171-11/+10
| | | | | | | | | In sig_term() we were calling wins_write_database(0) which would fork a child. This child might then get killed by the same process killing off the parent. That process would then fork another child etc. The solution is to pass a "background" flag to wins_write_database(0) and only fork if this is set.
* fixed a bug in the wins database writer that caused the database to beAndrew Tridgell1998-09-101-3/+11
| | | | | | written continuously rather than once every 5 seconds (at most). also changed it to 20 seconds :)
* I looked at the refresh issue a bit more and discovered that SambaAndrew Tridgell1998-08-311-3/+4
| | | | | | | also doesn't switch to a registration if a refresh fails, instead the name is removed! This makes it even more imortant that a Samba WINS server accepts refresh requests as registration requests if the name is not registered. I've gone ahead and implemented this.
* bounds check next_token() to prevent possible buffer overflowsAndrew Tridgell1998-08-311-7/+7
|
* changed the way that name query records are sorted in replies. TheyAndrew Tridgell1998-08-301-36/+6
| | | | | are now sorted by the number of common leading bits in the IP address with the address of the querying host.
* include our netbios names list and our workgroup in the wins.dat hashAndrew Tridgell1998-08-301-2/+22
|
* changed the format of the wins.dat file slightly.Andrew Tridgell1998-08-301-0/+16
| | | | | | | | | | | | | | | | | | | | | | It now has a line like this: VERSION 1 251152 the first number is a version #define in nmbd_winsserver.c and will be used if we ever have to change the format again. The second number is a hash of the current interfaces setting. It is used to detect the case where nmbd is restarted on a machine after the IP of the machine has changed (or the interfaces list has changed in any way). When that happens we need to discard the old wins.dat cache or you end up with chaos. This has bitten quite a few people, they find that when they move a machine it continues using the old IP for some things for the next week until the wins entries time out! I've checked, and the old nmbd can handle the new format, although it does spit out a spurious error message about the VERSION line. So users can safely run 2.0alpha then switch back to 1.9.18 without problems.
* More formatting changes. Mostly converted some DEBUG() calls to DEBUGADD()Christopher R. Hertel1998-08-031-5/+5
| | | | | | so that we wouldn't get too many timestamps. Chris -)-----
* clitar.c: Fixed gcc warning with comment in /* */ code.Jeremy Allison1998-06-251-12/+22
| | | | | | | nmbd_winsserver.c: Remember to free packet in multi-homed register code. Use correct query_name_from_wins_server call instead of query_name call in multihomed code. Jeremy.
* The function add_name_to_subnet(), in file nmbd_namelistdb.c, returns aChristopher R. Hertel1998-06-231-9/+7
| | | | | | | | | | | | | | pointer to the newly constructed name list entry. In most cases, this return value is ignored. The two exceptions are in asyncdns.c and nmbd_winsproxy.c. Most of the calls which ignored the return value were not cast to void, so I added the cast. This helped me sort out which calls really did use the return value. I also discovered one case, in nmbd_winsserver.c, in which the return value was being stored to a variable which, in turn, was not used. Chris -)-----
* I've replaced the linked list used to manage the subnet namelists with aChristopher R. Hertel1998-06-101-4/+11
| | | | | | | | | | | | | | splay tree. For short lists, this will have no noticable effect. As lists (eg. the WINS database) grow longer, the speed improvements should be quite dramatic. This change is an incremental step toward replacing the in-memory namelists with a back-end database. This change is going into the 1.9.19pre-alpha code because...well...it's pre-alpha. Please let me know if there are any problems. (Oh, as a side-effect, the wins.dat will be in sorted order. :) Chris -)-----
* This is a first step toward moving long namelists into a database. IChristopher R. Hertel1998-06-091-54/+67
| | | | | | | | | | | split the name_record structure into pieces. The goal is that the key (the name) be separate from the data associated with the key. Databases such as gdbm store information in [key,content] pairs. There is no functional change in with this update. It's just a step in the direction that Jeremy and I have been discussing. Chris -)-----
* includes.h: SunOS doesn't have strcasecmp, solaris versions prior to 2.6 don'tJeremy Allison1998-05-121-1/+1
| | | | | | | | | | have vsnprintf. locking_slow.c: slight tidy. make_smbcodepage.c: Use safe_strcpy instead of pstrcpy. nmbd_winsserver.c: Use pstrcpy instead of fstrcpy. smbmount.c: Fixed reported bug. util.c: Removed old fstrcpy/fstrcat functions. Jeremy.
* This is a security audit change of the main source.Jeremy Allison1998-05-121-9/+9
| | | | | | | | | | | | | | | | | | It removed all ocurrences of the following functions : sprintf strcpy strcat The replacements are slprintf, safe_strcpy and safe_strcat. It should not be possible to use code in Samba that uses sprintf, strcpy or strcat, only the safe_equivalents. Once Andrew has fixed the slprintf implementation then this code will be moved back to the 1.9.18 code stream. Jeremy.
* Fixed bug that John found in WINS server code. When nmbd as a WINSJeremy Allison1998-04-201-9/+6
| | | | | | | | | | | | | server is sending out a name_query after a WACK, it needs to send a packet with recursion_desired = 0 (yes Luke, you were right all along :-). If it doesn't then if it's talking to itself then the query packet ends up back in the WINS server instead of in the client side code. Makefile: Changed proto generation to stop including NMBDOBJ twice. nmbd_namequery.c nmbd_packets.c nmbd_winsserver.c: Added extra query_name_from_wins_server() code. Jeremy.
* "For I have laboured mightily on Luke's code, and hath brokenJeremy Allison1998-03-111-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | all I saw" - the book of Jeremy, chapter 1 :-). So here is the mega-merge of the NTDOM branch server code. It doesn't include the new client side pieces, we'll look at that later. This should give the same functionality, server wise, as the NTDOM branch does, only merged into the main branch. Any fixes to domain controler functionality should be added to the main branch, not the NTDOM branch. This code compiles without warnings on gcc2.8, but will need further testing before we are sure all the working functionality of the NTDOM server branch has been correctly carried over. I hereby declare the server side of the NTDOM branch dead (and all who sail in her :-). Jeremy.
* Makefile: Fix for OSF1 typo.Jeremy Allison1998-01-291-1/+13
| | | | | | | | | | | | asyncdns.c: Fixes that went into 1.9.18p2 - allow unclocking of sigterm. chgpasswd.c: char -> unsigned char fixes. includes.h: AIX fix to get prototype for inet_ntoa. local.h: Tune size of shared memory based on MAX_OPEN_FILES. nmbd_mynames.c: Fix for nmbd repeated refresh bug. nmbd_responserecordsdb.c: Fix for nmbd repeated refresh bug. nmbd_winsserver.c: Fix for multi-homed registration optimisation. smb.h: Moved default shared memory size to local.h Jeremy.
* This is *not* a big change (although it looks like one).Jeremy Allison1998-01-221-1/+1
| | | | | | | This is merely updating the Copyright statements from 1997 to 1998. It's a once a year thing :-). NO OTHER CHANGES WERE MADE. Jeremy.
* includes.h: Added FreeBSD 3.x fixes. Added HPUX10.x fixes.Jeremy Allison1998-01-071-4/+3
| | | | | | | | | | interface.c: Added netmask fix. nmbd_nameregister.c: Fixed unitialised variable warnings. nmbd_winsproxy.c: Fixed unitialised variable warnings. nmbd_winsserver.c: Fixed DEC warnings. print_svid.c: Fixed DEC warnings. printing.c: Added LPRng fixes. Jeremy.
* fixed another couple of minor type errors (they could cause incorrectAndrew Tridgell1997-12-261-4/+4
| | | | output but not a core dump)
* fixed a couple of illegal uses of scanf() in the nmbd wins code. TheyAndrew Tridgell1997-12-261-6/+6
| | | | | | | | | | caused a core dump under IRIX when compiled with -64. In general you cannot assume things about variable sizes. In particular sizeof(time_t) may not equal sizeof(long) and sizeof(uint16) may not equal sizeof(short). There are probably other bugs like this. We'll need to check all format statements for use of %ld, %hx etc. In general these should not be used unless you have an explicit cast to the appropriate type.
* allow name_type 0x20 as well as name_type 0x0 in dns proxyingAndrew Tridgell1997-12-141-1/+2
|
* This is it ! The mega-merge of the JRA_NMBD_REWRITE branchJeremy Allison1997-12-131-0/+1565
back into the main tree. For the cvs logs of all the files starting nmbd_*.c, look in the JRA_NMBD_REWRITE branch. That branch has now been discontinued. Jeremy.