summaryrefslogtreecommitdiff
path: root/source3/libsmb/namequery.c
AgeCommit message (Collapse)AuthorFilesLines
2003-02-17Correctly check for inet_addr fail. Patch from gregor.7@osu.edu.Jeremy Allison1-2/+5
Jeremy. (This used to be commit fb3548e5080812c037c2c134504cc9af4ecbfedd)
2003-01-15small merges from SAMBA_3_0; mostly typos, renames, etc...Gerald Carter1-0/+179
(This used to be commit 9ac196dad4893b0ceef13281a140be5d85391e6c)
2002-12-04[merge] remove assert(count ==1) for multi-homed PDCs; CR 1277Gerald Carter1-182/+22
(This used to be commit 157b5ab198670c6999f22d6b49072fdebc84be0d)
2002-12-04Doing janitorial duty for tpot - memory leak fix.Jeremy Allison1-0/+2
Jeremy. (This used to be commit c6da50def80e64226c7e5b310dce30d0490512cb)
2002-12-01Dereference the correct thing here, so we don't segfaultAndrew Bartlett1-1/+1
(This used to be commit ea18d02036b4e0502e5ecb057c9fe381709a07d8)
2002-12-01Fixup of ordered cleanup of get_dc_list - bug found by Dominik 'Aeneas' ↵Jeremy Allison1-27/+10
Schnitzer <dominik@schnitzer.at> Jeremy. (This used to be commit 7ba051a830a7dc96e3860a87643a3ac99cdf5836)
2002-11-26Having waited for *way* too long, this is mimir's namecache and trusted domainAndrew Bartlett1-6/+4
cache code. This uses gencache, mimir's new caching code that stores at text-based cache of various data. Mimir has done a *lot* of work on this patch, and it is finally time to get it in CVS. Andrew Bartlett (This used to be commit 47f3bfe9564e7f3aff60cefaefd599e0abb30a31)
2002-11-23[merge from APP_HEAD]Gerald Carter1-22/+104
90% fix for CR 1076. The password server parameter will no take things like password server = DC1 * which means to contact DC1 first and the go to auto lookup if it fails. jerry (This used to be commit c31a17889e3e4daf7c1e807038efc2c0fba78be3)
2002-11-12Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison1-8/+9
dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy. (This used to be commit 82b8f749a36b42e22186297482aad2abb04fab8a)
2002-11-06Merge of get_dc_list() api change. This was slightly more intrusiveTim Potter1-13/+46
than the version in APPLIANCE so watch out for boogs. (This used to be commit 1e054e3db654801fbb5580211529cdfdea9ed686)
2002-08-16Merge of netbios namecache code from APPLIANCE_HEAD.Tim Potter1-4/+24
Tridge suggested a generic caching mechanism for Samba to avoid the proliferation of little cache files hanging around limpet like in the locks directory. Someone should probably implement this at some stage. (This used to be commit dad31483b3bd1790356ef1e40ac62624a403bce8)
2002-08-05This fixes a number of ADS problems, particularly with netbioslessAndrew Tridgell1-1/+1
setups. - split up the ads structure into logical pieces. This makes it much easier to keep things like the authentication realm and the server realm separate (they can be different). - allow ads callers to specify that no sasl bind should be performed (used by "net ads info" for example) - fix an error with handing ADS_ERROR_SYSTEM() when errno is 0 - completely rewrote the code for finding the LDAP server. Now try DNS methods first, and try all DNS servers returned from the SRV DNS query, sorted by closeness to our interfaces (using the same sort code as we use in replies from WINS servers). This allows us to cope with ADS DCs that are down, and ensures we don't pick one that is on the other side of the country unless absolutely necessary. - recognise dnsRecords as binary when displaying them - cope with the realm not being configured in smb.conf (work it out from the LDAP server) - look at the trustDirection when looking up trusted domains and don't include trusts that trust our domains but we don't trust theirs. - use LDAP to query the alternate (netbios) name for a realm, and make sure that both and long and short forms of the name are accepted by winbindd. Use the short form by default for listing users/groups. - rescan the list of trusted domains every 5 minutes in case new trust relationships are added while winbindd is running - include transient trust relationships (ie. C trusts B, B trusts A, so C trusts A) in winbindd. - don't do a gratuituous node status lookup when finding an ADS DC (we don't need it and it could fail) - remove unused sid_to_distinguished_name function - make sure we find the allternate name of our primary domain when operating with a netbiosless ADS DC (using LDAP to do the lookup) - fixed the rpc trusted domain enumeration to support up to approx 2000 trusted domains (the old limit was 3) - use the IP for the remote_machine (%m) macro when the client doesn't supply us with a name via a netbios session request (eg. port 445) - if the client uses SPNEGO then use the machine name from the SPNEGO auth packet for remote_machine (%m) macro - add new 'net ads workgroup' command to find the netbios workgroup name for a realm (This used to be commit e358d7b24c86a46d8c361b9e32a25d4f71a6dc00)
2002-08-03fixed a bug where we were truncating the returned names in a netbiosAndrew Tridgell1-1/+1
name status query to 14 bytes, so we could not join a DC who had a netbios name of 15 bytes in length. (This used to be commit a7588f21c24dac833f098c48e2337c100cf75ba4)
2002-07-31added 'disable netbios = yes/no' option, default is noAndrew Tridgell1-2/+31
When this option is disabled we should not do *any* netbios operations. You should also not start nmbd at all. I have put initial checks in at the major points we do netbios operations in smbd but there are bound to be more needed. Right now I've disabled all netbios name queries, all WINS lookups and node status queries in smbd and winbindd. I've been testing this option and the most noticable thing is how much more responsive things are! wthout those damn netbios timeouts things certainly are much slicker. (This used to be commit 12e7953bf2497eeb7c0bc6585d9fe58b3aabc240)
2002-07-20Try to fix up warnings - particularly on the IRIX 64 bit compiler (which had aAndrew Bartlett1-1/+1
distinction between uchar and char). Lots of const etc. Andrew Bartlett (This used to be commit 8196ee908e10db2119e480fe1b0a71b31a16febc)
2002-07-09fix declaration of global_in_nmbdAndrew Tridgell1-1/+1
(This used to be commit 07de8418369dad1f015369e70e9303fea4130295)
2002-07-01used findstatic.pl to make some variables static and remove some deadAndrew Tridgell1-99/+0
code (This used to be commit 91ad9041e9507d36eb3f40c23c5d4df61f139ef0)
2002-07-01bias the lookup sorting towards directly reachable IPsAndrew Tridgell1-0/+8
(This used to be commit 514b91827a970a0041314af341b8c66a01668e4a)
2002-07-01sort name query responses by how far they are from our interfaceAndrew Tridgell1-0/+41
broadcast addresses. This makes it far more likely that we will try to talk to an interface that is routable from one of our interfaces. (This used to be commit bc1a0506868266088ae585a7a5dcb1ac8ca3474d)
2002-06-27fixed a link problem with global_in_nmbdAndrew Tridgell1-1/+1
(This used to be commit 9a3e323ec261a1ee3a83f8c558583c3d4a53e06a)
2002-06-27The next phase in the WINS rewrite!Andrew Tridgell1-6/+10
We now cope wiith multiple WINS groups and multiple failover servers for release and refresh as well as registration. We also do the regitrations in the same fashion as W2K does, where we don't try to register the next IP in the list for a name until the WINS server has acked the previos IP. This prevents us flooding the WINS server and also seems to make for much more reliable multi-homed registration. I also changed the dead WINS server code to mark pairs of IPs dead, not individual IPs. The idea is that a WINS server might be dead from the point of view of one of our interfaces, but not another, so we need to keep talking to it on one while moving onto a failover WINS server on the other interface. This copes much better with partial LAN outages and weird routing tables. (This used to be commit 313f2c9ff7a513802e4f893324865e70912d419e)
2002-06-26resolve_wins() now needs to be a public functionAndrew Tridgell1-2/+2
(This used to be commit 0bce9af615db2eb7e95887ab6b95655d7771dac2)
2002-06-26This commit finally gives us multiple wins server groups. We nowAndrew Tridgell1-43/+68
accept an extended syntax for 'wins server' like this: wins server = group1:192.168.2.10 group2:192.168.3.99 group1:192.168.0.1 The tags before the IPs don't mean anything, they are just a way of grouping IPs together. If you use the old syntax (ie. no ':') then an implicit group name of '*' is used. In general I'd recommend people use interface names for the group names, but it doesn't matter much. When we register in nmbd we try to register all our IPs with each group of WINS servers. We keep trying until all of them are registered with every group, falling back to the failover WINS servers for each group as we go. When we do a WINS lookup we try each of the WINS servers for each group. If a WINS server for a group gives a negative answer then we give up on that group and move to the next group. If it times out then we move to the next failover wins server in the group. In either case, if a WINS server doesn't respond then we mark it dead for 10 minutes, to prevent lengthy waits for dead servers. (This used to be commit e125f06058b6b51382cf046b1dbb30728b8aeda5)
2002-06-26removed the wins name registration code from libsmbclientAndrew Tridgell1-227/+158
it is *completely* bogus for our client code to be doing wins registrations. Not only is it slow as hell (think about when a wins server is down) but how the heck is going to answer the queries that will later come in for our name? And what happens when libsmbclient sends registrations and nmbd then gets the WACK response from the wins server? we end up losing our name! Name registration is a job for nmbd, not for clients. (This used to be commit 62774923ffdce15eded0f37ba99e33e9cd7a358c)
2002-06-26- completely rewrote the wins_srv.c code. It is now much simpler, andAndrew Tridgell1-3/+3
gives us a good grounding to properly support multiple wins servers for different interfaces (which will be coming soon ...) - fixed our wins registration failover code to actually do failover! We were not trying to register with a secondary wins server at all when the primary was down. We now fallback correctly. - fixed the multi-homed name registration packets so that they work even in a non-connected network (ie. when one of our interfaces is not routable from the wins server. Yes, this really happens in the real world). (This used to be commit a049360d5b0d95a935b06aad43efc17d34de46dc)
2002-06-03Removed unused function.Tim Potter1-46/+0
(This used to be commit f7e75952306296b11a859f425ff5ec7082239dc2)
2002-05-17Changes to allow head to translate NMB flags ...Richard Sharpe1-3/+19
(This used to be commit c986a19cde0dfa96b512eb24d873203981e68c48)
2002-04-19fixed a namequery bug caused by my recent string length patchesAndrew Tridgell1-1/+1
(This used to be commit b2329039d255928faf53474ee7ab06b6353b9fbe)
2002-04-04small change in name_resolve_bcast()Jean-François Micouleau1-1/+1
spotted by alexander bokovoy. it shouldn't break anything. if it's wrong, feel free to revert but explain why. J.F. (This used to be commit 638c692525c050ecdf414d461ef6b4aed3ce51db)
2002-03-19Don't try to sort a list of zero length in internal_resolve_name()Tim Potter1-1/+1
(This used to be commit 5387e4046f67a1c6ef9e98268268b06a729d5ca4)
2002-02-28Ensure that winbindd and smbd both use identical logic to find dc's.Jeremy Allison1-8/+8
Fix bug where zeroip addresses were being checked. Jeremy. (This used to be commit 8ed49fe0df201833329c17b2afe1e3aa70646558)
2002-01-30Removed version number from file header.Tim Potter1-2/+1
Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2002-01-20Spelling fixes.Tim Potter1-0/+2
(This used to be commit e67c7c5852624bcdd5c565ea5f00b143aaf7fee4)
2002-01-17Made a debug look nicer.Tim Potter1-1/+2
(This used to be commit aca0edc819e892944c65b3feb60250994a79e88a)
2002-01-16Merge of name_status_find() debugs.Tim Potter1-5/+18
(This used to be commit cfac669017afa763100e335d1516fbed18049e00)
2002-01-11cope with direct IP addresses in resolve_name()Andrew Tridgell1-0/+5
(This used to be commit 73a59170e6fab3b0f91938a74302750915a04a7a)
2002-01-11make sure resolve_name() only returns valid IP addressesAndrew Tridgell1-4/+13
this is actually a workaround for old broken nmbd daemons, especially from Samba 2.0 (This used to be commit 12021a8de6a1dc2e43cc62f094a57c57283dfaf4)
2002-01-09Merge from appliance-head:Tim Potter1-4/+72
- put in some level 10 debugs so we can see what internal_resolve_name() is doing - remove duplicates from returned ip list of internal_resolve_name() (This used to be commit 08d2bcef1a4fc77d28bc0fa9e4ff5f3131cedea5)
2002-01-05Add a touch of constAndrew Bartlett1-1/+1
(This used to be commit b2af4372b1dac2e8f283184191fbb0231409a625)
2001-12-04Fix up funtion name, as this finds local, not domain master browsers.Andrew Bartlett1-2/+2
(as per tridge's instructions) (This used to be commit 0692d792f24f1c82c69532e50a6c4373c9a8b476)
2001-11-29I think the lookup_pdc_name() should be called lookup_dc_name() and theTim Potter1-21/+22
name_status_find() call here should look up a #1c name instead of #1d. This fixes some bugs currently with BDC authentication in winbindd and in smbd as you can't query the #1d name with the ip address of a BDC. Who is Uncle Tom Cobbley anyway? (This used to be commit 4215048f7b20a8f9e5877bdbb2f54841b2f7fa64)
2001-11-28Cross merge to make 2.2 and HEAD closer.Jeremy Allison1-9/+6
Jeremy. (This used to be commit 39f076b56cf457cc780dd30a4d3150d8bfc60d13)
2001-11-26increment the value not the pointerAndrew Tridgell1-1/+1
(This used to be commit e3698259afa79fcd318592b1d628803695406337)
2001-11-25Use "password server" for searching for BDC's also as Tim suggested.Jeremy Allison1-6/+8
Jeremy. (This used to be commit 4aca67761fbe601e27f8f768c28a11241f088bba)
2001-11-21W2K doesn't seem to respond to *#0 names in node status. Ensure nameJeremy Allison1-8/+55
lookup uses password server parameter when looking for PDCs. Jeremy. (This used to be commit 54c968913d6553c6d834b068234ab176917075eb)
2001-11-19LMHOSTSFILE is now dynamically configured too.Martin Pool1-1/+1
(This used to be commit a779710fff5fddcbf65a8ddc8e9169b586b85481)
2001-11-07Add function to add those hosts who have added msbrowse (domain master browsers)Steve French1-0/+8
(This used to be commit 3fd96a47543c268fd2828793df4006cc47a9e95b)
2001-11-04Got serious about const again.Jeremy Allison1-2/+2
REMOVED BZERO CALLS YET AGAIN !!! Why do these keep creeping back in.... They are *NOT* POSIX. I'm also thinking of removing strncpy as I'm sure it's not being used correctly.... Jeremy. (This used to be commit b1930abb35dee74f858a3f7190276c418af2322b)
2001-10-02Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter1-2/+0
(This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
2001-09-17typoSimo Sorce1-5/+2
(This used to be commit 23dc3fc7009ce40064db57d5ec8b720c7d9350a8)