summaryrefslogtreecommitdiff
path: root/source3/nmbd
AgeCommit message (Collapse)AuthorFilesLines
1998-09-17fixed another potential fork bomb where the wins file becomesAndrew Tridgell2-0/+5
non-writeable for some reason. (This used to be commit 9edd43dcd6cc040416f11e00320c53682558fd8a)
1998-09-17fixed the nmbd fork bomb. It was a silly mistake, asAndrew Tridgell1-0/+3
expected. wins_write_database() didn't exit after doing its stuff, so when it returned you had two copies of nmbd :) (This used to be commit 5e6488d4830016ea720a644c1b1ae25b336d3b8b)
1998-09-17fixed a typo in my last commitAndrew Tridgell1-1/+1
(This used to be commit 31b4048362c63ab19e9ef35453c3763eec8b8f2b)
1998-09-17fixed a potential problem with wins_write_database() child processes.Andrew Tridgell3-13/+13
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. (This used to be commit 1e1a512e3ff59f962fb3de382f671618bed60839)
1998-09-10fixed a bug in the wins database writer that caused the database to beAndrew Tridgell1-3/+11
written continuously rather than once every 5 seconds (at most). also changed it to 20 seconds :) (This used to be commit 1b07de7079e81da9c0b930bdc30ae0451b57d53a)
1998-09-09Copyright notices written to debug logs are now through 1998.Christopher R. Hertel1-1/+1
Chris -)----- (This used to be commit ac13c29d46f564fc340b652b4b71dfa92e4b5b16)
1998-09-05tridge the destroyer returns!Andrew Tridgell6-168/+10
prompted by the interpret_security() dead code that Jean-Francois pointed out I added a make target "finddead" that finds potentially dead (ie. unused) code. It spat out 304 function names ... I went through these are deleted many of them, making others static (finddead also reports functions that are used only in the local file). in doing this I have almost certainly deleted some useful code. I may have even prevented compilation with some compile options. I apologise. I decided it was better to get rid of this code now and add back the one or two functions that are needed than to keep all this baggage. So, if I have done a bit too much "destroying" then let me know. Keep the swearing to a minimum :) One bit I didn't do is the ubibt code. Chris, can you look at that? Heaps of unused functions there. Can they be made static? (This used to be commit 2204475c87f3024ea8fd1fbd7385b2def617a46f)
1998-09-02we are never interested in SIGPIPE so just ignore (block) itAndrew Tridgell1-12/+2
always. Don't even install a handler. (This used to be commit 72c383f4b7bcce5374632dc972df16ab0e2542b9)
1998-08-31I looked at the refresh issue a bit more and discovered that SambaAndrew Tridgell1-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. (This used to be commit 07f825fc9491bb5adac047854e67c63f7757143b)
1998-08-31minor fixes to the DMB<->DMB sync code. We now get the dmb name fromAndrew Tridgell1-5/+10
the local_master name on the unicast subnet if it is unknown. (This used to be commit 222b6d90e09288091028f5e0435f1d4a74153f66)
1998-08-31I realised that my DMB<->DMB sync code has the property that theAndrew Tridgell2-2/+20
amount of network traffic grows as the square of the number of workgroups. It probably wouldn't have caused problems but to be safe I changed the code to use random() to decrease the probability of a DMB<->DMB sync in proportion to the number of known workgroups. This keeps the nice browse connectivity while making the traffic rise only linearly with the number of workgroups. (This used to be commit 685f4ef2e1f83ab39e91229cf53a61eecb6181eb)
1998-08-31set a maximum name refresh time of 20 minutes.Andrew Tridgell2-3/+3
The previous code was strictly correct, but not very practical. self names were only refreshed every 3 days. I hit a situation where the Samba WINS server was restarted after deleting wins.dat and didn't notice some remote subnets (also running Samba). I realised that the complete database wouldn't have been rebuilt for 3 days, which is way too long. In order to recover from WINS restarts we need a much shorter maximum refresh time. (This used to be commit 1d23dd0912e81ff72695bd043e8e2aee32da18a8)
1998-08-31bounds check next_token() to prevent possible buffer overflowsAndrew Tridgell4-16/+16
(This used to be commit 3eade55dc7c842bdc50205c330802d211fae54d3)
1998-08-30added a dest_port parameter to send_mailslot() so we send replies toAndrew Tridgell6-21/+25
the correct port in environments like ip masq. (This used to be commit 7d455ee637b6ff70c95845f89d71573ca07b83f3)
1998-08-30a couple of debug linesAndrew Tridgell1-0/+2
(This used to be commit 03d343ddf5ef672afb3cf1fa65f86eb2c0a48772)
1998-08-30finished the asynchronous browse synchronisation code. It even seemsAndrew Tridgell3-141/+337
to work (not a lot of testing yet though). Now we just need to deal with people worried about having more than two nmbd processes sometimes. (the async processes are created on demand for browse sync, so you'll only see more than 2 occasionally) (This used to be commit a350a54680e4170e2adf571b010ea508e7291780)
1998-08-30we we have successfully done a query on *<1b> from a wins server andAndrew Tridgell1-7/+25
then obtained a node status response we need to remember the server name of the master browser so that other browse clients asking us for a workgroup list will get a entry for the master of that workgroup. (This used to be commit 601f995ffbfa0ee477ea628d92b9660d6bdd8cbc)
1998-08-30changed the way that name query records are sorted in replies. TheyAndrew Tridgell2-36/+9
are now sorted by the number of common leading bits in the IP address with the address of the querying host. (This used to be commit 4460a1bc6aa7666d1c71d32ba73855d6ed32320a)
1998-08-30include our netbios names list and our workgroup in the wins.dat hashAndrew Tridgell1-2/+22
(This used to be commit f555a76df696a0625acc16fa365dc048e0c2447d)
1998-08-30changed the format of the wins.dat file slightly.Andrew Tridgell1-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. (This used to be commit c4a8cdc60a5b01894ab2456e77b6d89d4c16a088)
1998-08-30added some defensive programming to nmbd. This mostly means zeroingAndrew Tridgell9-13/+29
areas of memory before freeing them. While doing this I also found a couple of real bugs. In two places we were freeing some memory that came from the stack, which leads to a certain core dump on many sytems. (This used to be commit c5e5c25c854e54f59291057ba47c4701b5910ebe)
1998-08-29don't exit on a SIGPIPEAndrew Tridgell1-2/+1
(This used to be commit f18b4e95bffb25fa016dd6e7f9a128a9fc69466f)
1998-08-28This checking fixes the statcache bug that stopped NetBench from runningJeremy Allison1-1/+1
correctly. Added new parameter "stat cache size" - set to 50 by default. I now declare the statcache code officially "open" for business :-). It gets a hit rate of 97% with a NetBench run and seems to make using a case insensitive run as efficient as a case sensitive run. Also tidied up our sys_select usage - added a maxfd parameter and also added an implementation of select in terms of poll(), for systems where poll() is much faster. This is disabled by default. Jeremy. (This used to be commit 779b924ec1f6c81ff578d22295b20fece698d1fc)
1998-08-28nmbd would core dump if a large number of netbios aliases is set. TheAndrew Tridgell1-2/+3
problem was a buffer overflow in process_node_status_request(). this really points out a general problem is allocating MAX_DGRAM_SIZE packets on the stack in nmbd. There must be a better way. (This used to be commit 7db45f169c33e0f3a67ba2260049226992de8bdf)
1998-08-21nmbd and smbd had different behavior with respect to log files. nmbd wouldChristopher R. Hertel1-5/+11
default to overwrite and smbd would default to append. Also, the -a option (actually a toggle, such that "-a -a" would set the default) was documented as append mode for nmbd, and *overwrite mode* for smbd. nmbd now defaults to append mode, to match smbd. The -a option now always means append, and I've added the -o option to both, meaning overwrite. Note that the change to nmbd's default behavior may confuse some people. I've not seen anything about 2.0.0 changes in the WHATSNEW.txt file. Where would I document a change like this? Chris -)----- (This used to be commit b1d374fb14b1fb92a84260f1dcc59a39a4b99a3d)
1998-08-15configure: Changes for extra headers.Jeremy Allison2-11/+5
configure.in: Source for header changes. client/clitar.c: Fixed isXXX macros & debugs for gcc pedantic compile. include/config.h.in: Added MEMSET, BZERO, MEMORY, RPCSVC_YPCLNT, STRINGS headers. include/includes.h: Headers for the above. include/smb.h: Made SIGNAL_CAST POSIX by default void (*)(int). lib/access.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/charset.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/debug.c: Fixed signal functs. lib/kanji.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/smbrun.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/util.c: Fixed isXXX macros & debugs for gcc pedantic compile. libsmb/namequery.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem_sysv.c: Fixed error messages in sysV stuff. nmbd/asyncdns.c: Fixed signal functs. nmbd/nmbd.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/passdb.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/smbpassfile.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/chgpasswd.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/ipc.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/nttrans.c: Fixed fsp code path. smbd/password.c: fixed HAVE_YP_GET_DEFAULT_DOMAIN problem. smbd/printing.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/reply.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/server.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/trans2.c: Fixed core dump bug. smbd/uid.c: Fixed isXXX macros & debugs for gcc pedantic compile. Jeremy. (This used to be commit 1b9cbcd02e575dc0a95fa589f720df30a4acc46b)
1998-08-14this is the bug change to using connection_struct* instead of cnum.Andrew Tridgell6-6/+8
Connections[] is now a local array in server.c I might have broken something with this change. In particular the oplock code is suspect and some .dll files aren't being oplocked when I expected them to be. I'll look at it after I've got some sleep. (This used to be commit c7ee025ead4a85b6fa44a832047b878451845fb6)
1998-08-11Quick fix for a small problem. If you run 'nmbd -?' you'd get the usageChristopher R. Hertel1-1/+2
message *but the daemon would start anyway*. I've added a call to exit() in the default: case of the option processing loop. Chris -)----- (This used to be commit c69727bd29c0bf1cded0db84602e791304691e2e)
1998-08-09added ignore rules for the dummy filesAndrew Tridgell1-0/+1
(This used to be commit 687f76a17d6d3ebd33b4d9a848deef56f3c1f56a)
1998-08-09these dummy files are needed for autoconf processingAndrew Tridgell1-0/+0
(This used to be commit be762dc3de6c1ef768790522dfe93007a61ce5d7)
1998-08-03More formatting changes. Mostly converted some DEBUG() calls to DEBUGADD()Christopher R. Hertel3-14/+22
so that we wouldn't get too many timestamps. Chris -)----- (This used to be commit 3e7e5fad378cf144927d9f2ffc82f80e150d44ab)
1998-08-03One more minor change to the format of a DEBUG message. I broke up aChristopher R. Hertel1-4/+9
very long output line in become_domain_master_query_success(). Chris -)----- (This used to be commit 9b5d431661c55056c31bedf9ef3900f27e1c5292)
1998-08-03I finished removing timestring() calls from DEBUG() messages. Also wentChristopher R. Hertel5-18/+47
through and changed some DEBUG() calls to DEBUGADD() to combine output under a single timestamp. There were too many timestamps. Note that Jeremy has told me that he's working on adding a config parameter to turn timestamps off. Cool. Chris -)----- (This used to be commit 247dbc9a24987035a47f1ba4fa143b1e2c050e92)
1998-07-31As per a Andrew's message, I went through and removed the timestring()Christopher R. Hertel2-21/+46
timestamps from several DEBUG messages. The timestamps are redundant now that DEBUG() provides them automatically. There are still a few more files to do, but I've got to get home for dinner. Chris -)----- (This used to be commit 60286ccecaa6028d687e6406755016455e3b3a26)
1998-07-29merge from the autoconf2 branch to the main branchAndrew Tridgell2-14/+12
(This used to be commit 3bda7ac417107a7b01d91805ca71c4330657ed21)
1998-07-27chgpasswd.c: Fixed up debug calls to stop crashes if ptsname failed.Jeremy Allison1-1/+1
local.h: Kept FSTYPE_STRING as Samba for now. nmbd_browsesync.c: Added bugfix from Matt Chapman mattyc@cyberdude.com - lmb_browserlist is now a struct ubi_dlList not a struct browse_cache_record *. server.c: smb.h: uid.c: password.c: Removed attrs code - it is not used anywhere. Jeremy (This used to be commit ef1af7fe6d5c58ae57b8e4efff0729e1a315da43)
1998-07-25Cleaned up some testing code and made it more "permanent" looking. TheChristopher R. Hertel1-38/+32
NetBIOS name lists attached to the subnet records are now managed by the splay tree code. I am still working on the WINS database as a separate issue. Code is written, it's just a matter of incorporating it. CRH (This used to be commit 5ba96ddde4a4b2da2cc09190f5c6f0e633852f12)
1998-07-24Converted the browser database to a ubi_dLinkList. This should reduce codeChristopher R. Hertel2-124/+161
size, etc. Also did a bit of work to add comments. Chris -)----- (This used to be commit d8b0a2104c05df957f0eb49c21388ec5a4858d98)
1998-07-14loadparm.c:Jeremy Allison1-1/+1
With apologies to Charlton Heston and Pierre Boule. "You damn fools, you finally did it". Changed default security mode to be security=user. Yes this is a big (although small in code) change. It's something we've been discussing for a while, to finally wean people off the legacy security=share mode which is *never* what you want. Jeremy. nmbd_incomingrequests.c: Bug fix for nmbd core dumps caused by overrun. Found by <samuel@public.szonline.net>. nttrans.c: More NT smb stuff. reply.c: Unlink will overwrite an existing file. Well you learn something new about POSIX every day. :-). server.c: Tidyup unreadable code. smbpasswd.c: Code to allow -U remote_username to allow ordinary users to change remote passwords if their NT username is different from their UNIX username. Patch from <torbjorn.lindh@allgon.se>. Jeremy. (This used to be commit 4eccb47cfb3c8907a6558b6ea9a02b0184458e34)
1998-07-02chgpasswd.c: Fix from Peter Debus <pdebus@turing.une.edu.au> for Digital UNIXJeremy Allison1-2/+2
password change core dump bug. nmbd_subnetdb.c: Make namelist_entry_compare() static. nttrans.c: More NT SMB stuff. Jeremy. (This used to be commit 1925a29c6b355b8358ee99e5b876b6376aa7d628)
1998-06-29nmbd_elections.c: Removed force elections code to bring into line with 1.9.18.Jeremy Allison3-4/+22
nmbd_namelistdb.c: Added comment for Chris. nmbd_subnetdb.c: Went back to Chris's comparison code as with the make_nmb_name change it all works now. lib/rpc/server/srv_netlog.c: Ensure we return 'account disabled' for disabled accounts, rather than crashing. Jeremy. (This used to be commit 4ab3d1682789319965a55edb37212b7671a743bb)
1998-06-27Added code to do elections when told to do so.Jeremy Allison1-2/+9
Jeremy. (This used to be commit a38d903d2016202d470f1405e593be3c20404d72)
1998-06-27nisppass.c: Fixed incorrect parameter usage.Jeremy Allison7-45/+122
nmbd_become_lmb.c: Add 'force_new_election' parameter to some functions. This allows the start of the election to be done *after* the demotion from local master browser is done. Also changed code so release of 1d name is done immediately to allow other local master to gain it. nmbd_elections.c: Ensured no elections are run until we have registered the WORKGROUP<1e> name that we must listen on to participate in elections. nmbd_incomingdgrams.c: Use force_new_election code. nmbd_namelistdb.c: Make update_name_in_namelist static. nmbd_subnetdb.c: Fix bug in comparison function. We cannot use memcmp as structure packing may make this fail. nmbd_packets.c: Ensure that we only send one release packet when sending a broadcast packet. nmbd_workgroupdb.c: Ensure we put the correct value in the ElectionCriterion field. nmblib.c: Ensure make_nmb_name zero's the struct nmb_name. Jeremy. (This used to be commit 1fcb094ba04f01be1261ac92198c25b21b0d5ad5)
1998-06-25clitar.c: Fixed gcc warning with comment in /* */ code.Jeremy Allison1-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. (This used to be commit 6e995802fecb4474003db55a69c9e1663737aade)
1998-06-23The function add_name_to_subnet(), in file nmbd_namelistdb.c, returns aChristopher R. Hertel6-21/+24
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 -)----- (This used to be commit 384122d165ed6d5d211a29e5a63a63bf5cd82c75)
1998-06-10I've replaced the linked list used to manage the subnet namelists with aChristopher R. Hertel5-181/+229
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 used to be commit 7806c453df02a89f67e7c5c8b91f24aa2274e756)
1998-06-09Fixed compile problem after make proto.Jeremy Allison1-3/+2
Chris's reformating of the (rather long named function) find_name_for_remote_broadcast_subnet (moving the function name onto a line on it's own) caused the proto awk script to miss it. Jeremy. (This used to be commit 17c758687f0ec6040633bc1815a52627b7e15f02)
1998-06-09This is a first step toward moving long namelists into a database. IChristopher R. Hertel11-222/+292
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 -)----- (This used to be commit e420a4bd7d368a0e910893400fb7b46ab8694a08)
1998-06-08Added code to add the Samba names onto the remote_broadcast subnet,Jeremy Allison2-5/+11
as NT 4.x does directed broadcast node status requests for the *<0x0> name. Jeremy. (This used to be commit 8c6fe8870a72271a6acd1633efc362c59e283e19)
1998-06-08Cosmetic. Added a cast to (void) to a call to add_name_to_subnet() sinceChristopher R. Hertel1-5/+5
the return value was being ignored anyway. SGI's lint said: function returns value which is sometimes ignored add_name_to_subnet Chris -)----- (This used to be commit ae706bff10cc77f06b8069e637ec9768d6a46966)