summaryrefslogtreecommitdiffstats
path: root/source/libsmb/namequery.c
Commit message (Collapse)AuthorAgeFilesLines
* beginning to sync up for 2.2.5 release....Gerald Carter2002-06-171-15/+54
|
* Start of merge to 2_2_RELEASE branch for release.Jeremy Allison2002-04-301-17/+89
| | | | Jeremy.
* Move over to RELEASE branch.Jeremy Allison2002-02-011-53/+117
| | | | Jeremy.
* Sync-up with SAMBA_2_2 branch.Jeremy Allison2001-10-111-130/+146
| | | | Jeremy.
* Syncup getting ready for release.Jeremy Allison2001-07-061-1/+150
| | | | Jeremy.
* Fix from "Darrin B. Jewell" <jewell@bdi.com> to allow anything other thanJeremy Allison2001-04-151-4/+12
| | | | | nmbd to talk to nmbd if it's a WINS server. Jeremy.
* Got "medieval on our ass" about adding the -1 to slprintf.Jeremy Allison2001-04-081-1/+1
| | | | Jeremy.
* Merges from appliance-head for I18N fixes from Tim.Jeremy Allison2001-02-141-0/+2
| | | | Jeremy.
* Fixes from appliance-head for pdc searches.Jeremy Allison2001-01-251-18/+1
| | | | Jeremy.
* Big merge to sync up appliance-head and 2.2.Jeremy Allison2001-01-081-171/+126
| | | | Jeremy.
* Fixed bug found by Gerald. If a Samba server joins a domain and is setJeremy Allison2000-12-201-2/+2
| | | | | | | | to search for a DC to authenticate to using the "*" syntax than ensure that for the first hour after the password change is searches for the PDC using the 1B name not the 1C name as domain replication may not have occured. Jeremy.
* Rolled back find NetBIOS name of PDC/BDC code as a temp fix. ThisJeremy Allison2000-10-271-1/+60
| | | | | code works :-). Jeremy.
* Fix to allow smbd to call winbindd if it is running for all group enumeration,Jeremy Allison2000-10-131-1/+1
| | | | | | | | falling back to the UNIX calls on error. This should fix all problems with smbd enumerating all users in all groups in all trusted domains via winbindd. Also changed GETDC to query 1C name rather than 1b name as only the PDC registers 1b. Jeremy.
* Replaced "\\MAILSLOT\\NET\\NETLOGON" with NET_LOGON_MAILSLOT constant.Tim Potter2000-08-251-1/+1
|
* First shot at actually *doing* WINS failover.Christopher R. Hertel2000-08-111-1/+8
| | | | | | | | | | | | | | | | | | If libsmb/namequery.c:name_query() times out while doing a non-broadcast query, I mark that WINS server 'dead'. Note that I don't try the new WINS server. I think I can get that working too. This is only for queries, not registrations. The biggest problem is that I may have to fiddle with the UNICAST SUBNET, but I need to check talk that over with someone (Jeremy?) before I hack at it. I can't actually test the above change, I'm 'fraid. I'm getting: 4 errors detected in the compilation of "rpc_server/srv_spoolss_nt.c". in head branch. Chris -)-----
* Instead of handing back a string (which might be a DNS name or an IPChristopher R. Hertel2000-07-191-1/+1
| | | | | | | | | | | | | | | | | | string), the wins_srv module now hands back a struct in_addr when it's called. It caches the IP address once it has been looked up. The IP is cleared (and must be looked up again) if the 'wins server' parameter is reread, or if the node is marked 'dead'. A dead node will not be re-tried for 10 minutes (per a #define in wins_srv.c). As it was, the code was reading the WINS server name or IP directly from lp_wins_server. That's okay, except that if the value was expressed as a name, then a DNS lookup would be done every time the client wanted to talk to the server. I still need to work out the implications of failover regarding the 'unicast subnet' list. Chris -)-----
* First cut toward adding WINS server failover.Christopher R. Hertel2000-07-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | *Note: failover doesn't actually work yet!* It's just that the code I'm adding provides all of the pieces necessary. I do have one big question. Something that I'll have to ask Jeremy, I'm thinkin'. In nmbd/nmbd_subnetdb.c the IP of the WINS server is used to set up the Unicast subnet. ...so what happens if the WINS server changes? My guess is either: a) nothing. b) I'd have to change the unicast subnet entry whenever the WINS server changes. Urq. BTW, the lp_wins_server() function no longer returns the WINS server name or IP. It returns the list of WINS servers entered in smb.conf. To get the currently 'live' WINS server, use the wins_srv() function. Fun, eh? Chris -)-----
* An improved version of the Negative Query Response fix. The earlier fixChristopher R. Hertel2000-07-121-10/+37
| | | | | | | | only did a short-cut on an rcode of 3, which is 'name not found'. This does a short-cut on any non-zero rcode. It also puts out a DEBUG message (if DEBUGLEVEL is >= 3) detailing the error. Chris -)-----
* Quick change to short-circuit WINS queries if the WINS server returns aChristopher R. Hertel2000-07-091-6/+20
| | | | | Negative Name Query Response. We should't wait through the timeouts and retry twice if we've been told "No Such Entry".
* first pass at merging rpcclient from TNG to HEAD. You can get aGerald Carter2000-07-031-0/+63
| | | | | | | | | | semi-connection and a rpcclient prompt, but no functionality there yet. Will be a few more days on that. These files changed only with the addition of some support functions from TNG --jerry
* Getting back to a compilable state (not there yet but close).Jeremy Allison2000-06-011-2/+2
| | | | | | | Added patches for random -> sys_random. Added set_effective_xxx patches for AFS code. Memory allocation changes in spoolss code. Jeremy.
* Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison2000-05-021-1/+1
| | | | | of doing a system call every time we want to just get our pid. Jeremy.
* include/byteorder.h: ALIGN4/ALIGN2 macros.Jeremy Allison2000-04-111-1/+1
| | | | | | | | | | | | include/includes.h: Added SMB_BIG_UINT_BITS. lib/util.c: Removed align2/align4 - use macros. libsmb/namequery.c: Use ALIGN2. locking/locking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. Needed to move to hiding POSIX locks at a lower layer. nmbd/nmbd_processlogon.c: Use ALIGN2/ALIGN4 macros. smbd/blocking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. smbd/reply.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. Jeremy.
* changed the definition of dos_PutUniCodeAndrew Tridgell2000-03-271-2/+1
| | | | | | | | | the previous definition could result is us overflowing a buffer. The null termination was always added yet the size returned did not include the null termination. the new function takes a BOOL null_terminate, and always returns the total number of bytes consumed by the string.
* this looks like a big commit, but it isn't really :)Andrew Tridgell2000-01-071-5/+4
| | | | | | | | This fixes our netbios scope handling. We now have a 'netbios scope' option in smb.conf and the scope option is removed from make_nmb_name() this was prompted by a bug in our PDC finding code where it didn't append the scope to the query of the '*' name.
* added suppport for unexpected udp/138 packetsAndrew Tridgell2000-01-031-236/+166
| | | | | | | | | | | | | | I also fixed up the lookup_pdc_name() code so that it now works, even with a NT server that insists on replying to udp/138. The method I used to match packets was to use the mailslot string as a datagram ID. The true dgm_id doesn't work as NT doesn't set it correctly. uggh. PS: Jeremy, I had to change your code quite a bit, are you sure this worked with a Samba PDC?? The code looked broken, it got the offsets wrong in the SMB portion of the packet and filled in the IP incorrectly.
* added the unexpected packet database (unexpected.tdb)Andrew Tridgell2000-01-031-144/+113
| | | | | | | | | | | | this means "nmblookup -S" now always works, even with broken servers the database stores all unexpected replies and these can be accessed by any client. while doing this I cleaned up a couple of functions, and put in place a better trn_id generator. in most places the code got quite a bit simpler due to the addition of simple helper functions. I haven't yet put the code in to take advantage of this for pdc replies - that will be next. Jeremys pdc finding code will then work :)
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-279/+548
|
* reenabled retry_time (commented out accidentally in name_status)Luke Leighton1999-12-051-1/+1
|
* argh! how horrible! spent ages working out why packets weren't beingLuke Leighton1999-12-041-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | received properly when a UDP "retry" occurs. it's because reads and writes must be interleaved / matched. scenario: nmblookup connects to agent, sends request. agent receives request, broadcasts it on 137. agent RECEIVES 137 broadcast, sends it to nmblookup agent receives RESPONSE to 137 broadcast, sends it to nmblookup. if reads are not equally interspersed with writes, then second send will fail. if you think this is odd behaviour and that the agent should be filtering its own UDP traffic, think again. agent will be, potentially, redirecting nmbd traffic (including WINS server) not just client programs.
* argh. trying to get the nmb agent code to filter out "self" packets.Luke Leighton1999-12-041-9/+3
|
* jeremy is going to hate me for this.Luke Leighton1999-12-041-18/+56
| | | | | | | | | | | created an "nmb-agent" utility that, yes: it connects to the 137 socket and accepts unix socket connections which it redirects onto port 137. it uses the name_trn_id field to filter requests to the correct location. name_query() and name_status() are the first victims to use this feature (by specifying a file descriptor of -1).
* default SID map now reads in "trusted domains" from smb.conf.Luke Leighton1999-12-021-3/+5
|
* updated \PIPE\wkssvc commands to use new abstracted connection system.Luke Leighton1999-11-271-8/+26
| | | | | modified resolve_srv_name() to return dest host of *SMBSERVER if server name is \\ip.add.ress.format
* whoa. _major_ restructure of rpcclient. fixed some buuugs, created a few.Luke Leighton1999-11-261-0/+24
| | | | | | found out that getopt() _must_ have optind set to 0 before reuse. still haven't decided what to do with the net* api yet...
* Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.Jeremy Allison1998-11-171-1/+1
| | | | | | | | | | 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.
* fixed lmhosts parsing. We were using sizeof(name) where name was char*Andrew Tridgell1998-11-161-3/+2
|
* largely rewrote smbpasswd so that the code is understandable. ThisAndrew Tridgell1998-11-121-6/+6
| | | | | | | | | | | | | should allow us to call a function in swat rather than piping to smbpasswd. while doing this I also fixed quite a few "const char *" versus "char *" issues that cropped up while using const to track down bugs in the code. This led to changes in several generic functions. The smbpasswd changes should be correct but they have not been extensively tested. At least if I have introduced bugs then we should be able to fix them more easily than before.
* lib/charcnv.c: Improved debug comment.Jeremy Allison1998-11-061-48/+69
| | | | | | | | | | | libsmb/namequery.c: Fix to remove 2 second wait is we are doing a unicast and got a reply. smbd/dfree.c: smbd/noquotas.c: smbd/quotas.c: Fixes from Dejan Ilic <svedja@lysator.liu.se> for the quota code. utils/smbpasswd.c: Fixes to allow smbpasswd to be called from swat. Jeremy.
* set recursion desired for bcast name queryAndrew Tridgell1998-10-141-1/+1
|
* - fixed a bunch of warnings and minor errorsAndrew Tridgell1998-10-081-1/+1
| | | | | | - got smbtorture to compile - removed %D from some of lukes code - Luke, what is %D? it ain't portable anyway
* - modified resolve_name() to take a name_typeAndrew Tridgell1998-10-041-148/+173
| | | | | | - cleaned up resolve_name() (split into separate functions for each resolver) - if can't find local master then use #1B name - support listing of foreign workgroups in /smb/
* support NetServerEnum in smbwrapper. You can now do a ls in /smb/ andAndrew Tridgell1998-10-041-1/+40
| | | | | it will list all servers in your workgroup. You can set your workgroup with the SMBW_WORKGROUP environment variable.
* Changes to test in configure if capabilities are enabled on a system.Jeremy Allison1998-09-281-4/+4
| | | | | | | | | | 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.
* bounds check next_token() to prevent possible buffer overflowsAndrew Tridgell1998-08-311-5/+5
|
* configure: Changes for extra headers.Jeremy Allison1998-08-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* merge from the autoconf2 branch to the main branchAndrew Tridgell1998-07-291-1/+1
|
* namequery.c: Fixed SGI IRIX 5.x compiler problem.Jeremy Allison1998-05-141-1/+3
| | | | | | server.c: Added MACHINE.SID file generation - use lp_domain_sid() be default. smbpass.c: Exposed do_file_lock() as I now use it in server.c Jeremy.
* This is a security audit change of the main source.Jeremy Allison1998-05-121-12/+12
| | | | | | | | | | | | | | | | | | 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.
* Changes to allow Samba to be compiled with -Wstrict-prototypesJeremy Allison1998-04-131-4/+3
| | | | | | with gcc. (Not a big change although it looks like it :-). Jeremy.