summaryrefslogtreecommitdiff
path: root/source3/libsmb/namequery.c
AgeCommit message (Collapse)AuthorFilesLines
2001-07-04strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell1-2/+2
can't redefine them. damn. (This used to be commit c41fc06376d1a2b83690612304e85010b5e5f3cf)
2001-07-04The big character set handling changeover!Andrew Tridgell1-4/+3
This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation. (This used to be commit debb471267960e56005a741817ebd227ecfc512a)
2001-06-18Removed silly Get_Hostbyname() wrapper as DNS names are case-insensitiveTim Potter1-1/+1
and the use of this function only increased timeouts when Samba queries a broken DNS server. (This used to be commit 720fea53603b2f99153709e6717ca930ab60ca9f)
2001-04-15Fix from "Darrin B. Jewell" <jewell@bdi.com> to allow anything other thanJeremy Allison1-4/+12
nmbd to talk to nmbd if it's a WINS server. Jeremy. (This used to be commit 0e8147aecaf6941c77fd05b4b705ca31c1ec5760)
2001-04-08Got "medieval on our ass" about adding the -1 to slprintf.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 94747b4639ed9b19f7d0fb896e43aa392a84989a)
2001-02-25Separated reg code into interface & implementation.Jeremy Allison1-5/+1
libsmb/namequery.c: Removed ununsed variables. Jeremy. (This used to be commit b857113f400551c57ac400a9cdc3c752085d107d)
2001-02-18Fixes to libsmbclient so it will work when browsing real Windows systems whichRichard Sharpe1-0/+153
only respond to port 138 when dealing with NetBIOS datagrams. We use the unexpected packed database. (This used to be commit 620cc34015ab16d25f7ef7e13cbc3d0f669da11e)
2001-02-14Merge of i18n fixes from appliance branch. Samba can now talk to a networkTim Potter1-0/+2
with a PDC that has international netbios name and domain name. There's still quite a bit of i18n stuff to fix though... (This used to be commit 79045bd72ace9144e7dd73785b1d10a71b0d15aa)
2001-01-25Fixes from appliance-head for pdc searches.Jeremy Allison1-18/+1
Jeremy. (This used to be commit d04ed97ecab846def8467f313a71ef0e5c4005f6)
2000-12-20implemented a much nicer name_status() interface. It now returns aAndrew Tridgell1-167/+122
list of structures rather than the dodgy parsing code we had before this also gets smbw working correctly with no initial workgroup (using name_status_find on __MSBROWSE__ returns) (This used to be commit f2be88a8738a39ca5c98936edb7537cd701348a1)
2000-12-19Fixed bug found by Gerald. If a Samba server joins a domain and is setJeremy Allison1-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. (This used to be commit c25533de9918ed9b0c79fd039e11d1b79f513db0)
2000-12-11exposed the broadcast name resolution routine outside namequery.cAndrew Tridgell1-4/+4
(This used to be commit 7d1d867acdc0f316d8de787e1f7fa27667ec4a6a)
2000-10-27Rolled back find NetBIOS name of PDC/BDC code as a temp fix. ThisJeremy Allison1-1/+60
code works :-). Jeremy. (This used to be commit 4f66eda11e0dc15ff04893da7b7d6e578a30c4dc)
2000-10-13Fix to allow smbd to call winbindd if it is running for all group enumeration,Jeremy Allison1-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. (This used to be commit 5b0038a2afd8abbd6fd4a58f5477a40d1926d498)
2000-08-25Replaced "\\MAILSLOT\\NET\\NETLOGON" with NET_LOGON_MAILSLOT constant.Tim Potter1-1/+1
(This used to be commit 5764e84c0e01fa4d6ecba410542f6f5c63b9eae6)
2000-08-11First shot at actually *doing* WINS failover.Christopher R. Hertel1-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 -)----- (This used to be commit 40ae638866e3d826ccd5d827672634959c31b039)
2000-07-19Instead of handing back a string (which might be a DNS name or an IPChristopher R. Hertel1-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 -)----- (This used to be commit 73aa188320fd3bf10b5dfc057323f40aff2c13bd)
2000-07-19First cut toward adding WINS server failover.Christopher R. Hertel1-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 -)----- (This used to be commit cc08bdc74f4cd111fdc582ee7babef47ed8a950d)
2000-07-12An improved version of the Negative Query Response fix. The earlier fixChristopher R. Hertel1-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 -)----- (This used to be commit d8656304d51844335e72babe852673f2dececfdc)
2000-07-09Quick change to short-circuit WINS queries if the WINS server returns aChristopher R. Hertel1-6/+20
Negative Name Query Response. We should't wait through the timeouts and retry twice if we've been told "No Such Entry". (This used to be commit 2bbd16903db02aacb729d1ad140056b180e2a776)
2000-07-03first pass at merging rpcclient from TNG to HEAD. You can get aGerald Carter1-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 (This used to be commit a04ea15f723e559db3c60bed03318cc7be851f69)
2000-06-01Getting back to a compilable state (not there yet but close).Jeremy Allison1-2/+2
Added patches for random -> sys_random. Added set_effective_xxx patches for AFS code. Memory allocation changes in spoolss code. Jeremy. (This used to be commit c2099cfb033c2cdb6035f4f7f50ce21b98e1584d)
2000-05-02Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison1-1/+1
of doing a system call every time we want to just get our pid. Jeremy. (This used to be commit 148628b616b5c29ba6340d65fc3ddbcabba6e67a)
2000-04-11include/byteorder.h: ALIGN4/ALIGN2 macros.Jeremy Allison1-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. (This used to be commit 491eea8a20bf80d426625479326211dc975857a6)
2000-03-27changed the definition of dos_PutUniCodeAndrew Tridgell1-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 used to be commit 426c90433396a95033eefcc4af97603abc934221)
2000-01-07this looks like a big commit, but it isn't really :)Andrew Tridgell1-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. (This used to be commit b563be824b8c3141c49558eced7829b48d4ab26f)
2000-01-03added suppport for unexpected udp/138 packetsAndrew Tridgell1-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. (This used to be commit 32f66f4ea63038cb4b3785bdf1762abdde076f5d)
2000-01-03added the unexpected packet database (unexpected.tdb)Andrew Tridgell1-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 :) (This used to be commit 280e6359d36c9bc8dcded302f15c3a1db8e3feeb)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1-279/+548
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-12-05reenabled retry_time (commented out accidentally in name_status)Luke Leighton1-1/+1
(This used to be commit bf9422832c335c8d283273eb1d0008ac15cd3531)
1999-12-04argh! how horrible! spent ages working out why packets weren't beingLuke Leighton1-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. (This used to be commit 43e158c4261e51678d6e7f77ceb4a1c7281a2525)
1999-12-04argh. trying to get the nmb agent code to filter out "self" packets.Luke Leighton1-9/+3
(This used to be commit 84d7cc63239ea67481f6382da58d0678a21011fb)
1999-12-04jeremy is going to hate me for this.Luke Leighton1-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). (This used to be commit d923bc8da2cf996408194d98381409191dd81a16)
1999-12-02default SID map now reads in "trusted domains" from smb.conf.Luke Leighton1-3/+5
(This used to be commit f0946d1ccafeb5f541935b41f2d54bcbc06797ed)
1999-11-27updated \PIPE\wkssvc commands to use new abstracted connection system.Luke Leighton1-8/+26
modified resolve_srv_name() to return dest host of *SMBSERVER if server name is \\ip.add.ress.format (This used to be commit 3204829225792974c8b20efb6ba6e24661a4f658)
1999-11-26whoa. _major_ restructure of rpcclient. fixed some buuugs, created a few.Luke Leighton1-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... (This used to be commit 29c480085e786905bfd92ea3cd93658f94e96e47)
1998-11-17Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.Jeremy Allison1-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. (This used to be commit 18ff93a9abbf68ee8c59c0af3e57c63e4a015dac)
1998-11-16fixed lmhosts parsing. We were using sizeof(name) where name was char*Andrew Tridgell1-3/+2
(This used to be commit 67ba0b1ce335bc80e1c33fa28458ec9ebe5f446a)
1998-11-12largely rewrote smbpasswd so that the code is understandable. ThisAndrew Tridgell1-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. (This used to be commit 713864dd0322ae2ae2d83e333d85be35a7eed4ec)
1998-11-06lib/charcnv.c: Improved debug comment.Jeremy Allison1-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. (This used to be commit b5981c0149ad8c6f13ea87db450080616538b5d5)
1998-10-14set recursion desired for bcast name queryAndrew Tridgell1-1/+1
(This used to be commit 53805112f1a301f77cda93b68e6fa3054895f20f)
1998-10-08- fixed a bunch of warnings and minor errorsAndrew Tridgell1-1/+1
- got smbtorture to compile - removed %D from some of lukes code - Luke, what is %D? it ain't portable anyway (This used to be commit 91597c12fb593f49b23c7cea5b64dbb89a0428b3)
1998-10-04- modified resolve_name() to take a name_typeAndrew Tridgell1-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/ (This used to be commit a4e607c17d1119925c9d0e1d05e0fe81e9a2d1aa)
1998-10-04support NetServerEnum in smbwrapper. You can now do a ls in /smb/ andAndrew Tridgell1-1/+40
it will list all servers in your workgroup. You can set your workgroup with the SMBW_WORKGROUP environment variable. (This used to be commit 64699810e2d94e8648a0a3341b1cc826d4e8bfd9)
1998-09-28Changes to test in configure if capabilities are enabled on a system.Jeremy Allison1-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. (This used to be commit e0567433bd72aec17bf5a54cc292701095d25f09)
1998-08-31bounds check next_token() to prevent possible buffer overflowsAndrew Tridgell1-5/+5
(This used to be commit 3eade55dc7c842bdc50205c330802d211fae54d3)
1998-08-15configure: Changes for extra headers.Jeremy Allison1-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. (This used to be commit 1b9cbcd02e575dc0a95fa589f720df30a4acc46b)
1998-07-29merge from the autoconf2 branch to the main branchAndrew Tridgell1-1/+1
(This used to be commit 3bda7ac417107a7b01d91805ca71c4330657ed21)
1998-05-14namequery.c: Fixed SGI IRIX 5.x compiler problem.Jeremy Allison1-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 used to be commit 5bf17840ac7d65d08dd3fdfe8b789010488f6808)
1998-05-12This is a security audit change of the main source.Jeremy Allison1-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. (This used to be commit 2d774454005f0b54e5684cf618da7060594dfcbb)