1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

82 Commits

Author SHA1 Message Date
Andrew Bartlett
7b0b556804 Fix up funtion name, as this finds local, not domain master browsers.
(as per tridge's instructions)
(This used to be commit 0692d792f2)
2001-12-04 04:45:17 +00:00
Tim Potter
ff27a326f1 I think the lookup_pdc_name() should be called lookup_dc_name() and the
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 4215048f7b)
2001-11-29 05:50:32 +00:00
Jeremy Allison
a6b73b9767 Cross merge to make 2.2 and HEAD closer.
Jeremy.
(This used to be commit 39f076b56c)
2001-11-28 02:42:55 +00:00
Andrew Tridgell
df81a6ec23 increment the value not the pointer
(This used to be commit e3698259af)
2001-11-26 09:28:00 +00:00
Jeremy Allison
86dee43f39 Use "password server" for searching for BDC's also as Tim suggested.
Jeremy.
(This used to be commit 4aca67761f)
2001-11-25 06:38:17 +00:00
Jeremy Allison
f146325e7d W2K doesn't seem to respond to *#0 names in node status. Ensure name
lookup uses password server parameter when looking for PDCs.
Jeremy.
(This used to be commit 54c968913d)
2001-11-21 23:00:59 +00:00
Martin Pool
8654a161c8 LMHOSTSFILE is now dynamically configured too.
(This used to be commit a779710fff)
2001-11-19 03:12:10 +00:00
Steve French
2113e2ba08 Add function to add those hosts who have added msbrowse (domain master browsers)
(This used to be commit 3fd96a4754)
2001-11-07 23:01:44 +00:00
Jeremy Allison
30be58a857 Got serious about const again.
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 b1930abb35)
2001-11-04 00:14:08 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Simo Sorce
acc3732971 typo
(This used to be commit 23dc3fc700)
2001-09-17 03:44:52 +00:00
Simo Sorce
bcbd75f7ad move to SAFE_FREE()
(This used to be commit 48fc6a6cd5)
2001-09-17 03:33:37 +00:00
Andrew Tridgell
79139fe8d8 convert more code to use XFILE
(This used to be commit fe6679dffb)
2001-09-10 12:46:42 +00:00
Richard Sharpe
ba8e3e0343 Make sure that if there are no interfaces, name_register_wins does not
segfault.
(This used to be commit a7842fac94)
2001-09-09 09:59:33 +00:00
Christopher R. Hertel
6c38114f57 Fuss, fuss, fuss...
Function name_status_query() performs a node status query, so it really
should be called "node_status_query()" just to be consistent.

Yeah, minor... but it's looking as though an overhaul of namequery.c is in
order and I am trying to do the tiny changes that impact other stuff first.

Chris -)-----
(This used to be commit 3af2de7ed2)
2001-08-29 04:26:27 +00:00
Tim Potter
60519d046b Should be dbgtext, not dbg_text.
(This used to be commit 7a68236c42)
2001-08-29 04:11:11 +00:00
Christopher R. Hertel
7f0b3ec809 Patched to ensure that it won't break HEAD.
This isn't the final version, of course, I still need to get WINS failover
working.  This is just patched so it won't need lp_wins_server() (which I
renamed to lp_wins_server_list()).

I can't compile just now as something else is broken in HEAD.  Let me know
if this version of namequery.c causes trouble down the line.  Shouldn't,
as the changes are very small, but I've been known to rock the boat
before.

Chris -)-----
(This used to be commit 29c6efc956)
2001-08-29 03:30:52 +00:00
Jeremy Allison
9326b82ffa Realloc fix.
Jeremy.
(This used to be commit 9cabc3fd63)
2001-08-19 17:34:37 +00:00
Andrew Tridgell
527e824293 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn.
(This used to be commit c41fc06376)
2001-07-04 07:36:09 +00:00
Andrew Tridgell
87fbb7092b The big character set handling changeover!
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 debb471267)
2001-07-04 07:15:53 +00:00
Tim Potter
7b01c627c6 Removed silly Get_Hostbyname() wrapper as DNS names are case-insensitive
and the use of this function only increased timeouts when Samba queries
a broken DNS server.
(This used to be commit 720fea5360)
2001-06-18 05:42:18 +00:00
Jeremy Allison
452f60e030 Fix from "Darrin B. Jewell" <jewell@bdi.com> to allow anything other than
nmbd to talk to nmbd if it's a WINS server.
Jeremy.
(This used to be commit 0e8147aeca)
2001-04-15 21:22:18 +00:00
Jeremy Allison
f9a15ce1a6 Got "medieval on our ass" about adding the -1 to slprintf.
Jeremy.
(This used to be commit 94747b4639)
2001-04-08 20:22:39 +00:00
Jeremy Allison
1c8eb37534 Separated reg code into interface & implementation.
libsmb/namequery.c: Removed ununsed variables.
Jeremy.
(This used to be commit b857113f40)
2001-02-25 02:14:49 +00:00
Richard Sharpe
0293869b1f Fixes to libsmbclient so it will work when browsing real Windows systems which
only respond to port 138 when dealing with NetBIOS datagrams.

We use the unexpected packed database.
(This used to be commit 620cc34015)
2001-02-18 10:36:03 +00:00
Tim Potter
64172d82fc Merge of i18n fixes from appliance branch. Samba can now talk to a network
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 79045bd72a)
2001-02-14 05:34:50 +00:00
Jeremy Allison
5aef8a21c6 Fixes from appliance-head for pdc searches.
Jeremy.
(This used to be commit d04ed97eca)
2001-01-25 02:59:13 +00:00
Andrew Tridgell
abb9a2de72 implemented a much nicer name_status() interface. It now returns a
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 f2be88a873)
2000-12-20 03:22:51 +00:00
Jeremy Allison
7bf9d8ce4b Fixed bug found by Gerald. If a Samba server joins a domain and is set
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 c25533de99)
2000-12-19 23:57:48 +00:00
Andrew Tridgell
2364d59cdc exposed the broadcast name resolution routine outside namequery.c
(This used to be commit 7d1d867acd)
2000-12-11 00:08:17 +00:00
Jeremy Allison
2e62e34fe4 Rolled back find NetBIOS name of PDC/BDC code as a temp fix. This
code works :-).
Jeremy.
(This used to be commit 4f66eda11e)
2000-10-27 03:02:22 +00:00
Jeremy Allison
330d678fba Fix to allow smbd to call winbindd if it is running for all group enumeration,
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 5b0038a2af)
2000-10-13 01:59:14 +00:00
Tim Potter
c79b92bbd8 Replaced "\\MAILSLOT\\NET\\NETLOGON" with NET_LOGON_MAILSLOT constant.
(This used to be commit 5764e84c0e)
2000-08-25 04:18:50 +00:00
Christopher R. Hertel
726e7e256e First shot at actually *doing* WINS failover.
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 40ae638866)
2000-08-11 22:29:44 +00:00
Christopher R. Hertel
3c9e410c34 Instead of handing back a string (which might be a DNS name or an IP
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 73aa188320)
2000-07-19 05:32:43 +00:00
Christopher R. Hertel
b35f21fb3a First cut toward adding WINS server failover.
*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 cc08bdc74f)
2000-07-19 01:21:30 +00:00
Christopher R. Hertel
8edb4966ae An improved version of the Negative Query Response fix. The earlier fix
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 d8656304d5)
2000-07-12 04:25:12 +00:00
Christopher R. Hertel
119f965f49 Quick change to short-circuit WINS queries if the WINS server returns a
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 2bbd16903d)
2000-07-09 02:10:24 +00:00
Gerald Carter
098b7b378c first pass at merging rpcclient from TNG to HEAD. You can get a
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 a04ea15f72)
2000-07-03 04:24:31 +00:00
Jeremy Allison
f0080e5a39 Getting back to a compilable state (not there yet but close).
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 c2099cfb03)
2000-06-01 17:01:34 +00:00
Jeremy Allison
693ffb8466 Added sys_fork() and sys_getpid() functions to stop the overhead
of doing a system call every time we want to just get our pid.
Jeremy.
(This used to be commit 148628b616)
2000-05-02 02:23:41 +00:00
Jeremy Allison
f6be38cae2 include/byteorder.h: ALIGN4/ALIGN2 macros.
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 491eea8a20)
2000-04-11 19:44:54 +00:00
Andrew Tridgell
18bc76a0c6 changed the definition of dos_PutUniCode
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 426c904333)
2000-03-27 12:38:45 +00:00
Andrew Tridgell
171da4d787 this looks like a big commit, but it isn't really :)
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 b563be824b)
2000-01-07 06:55:36 +00:00
Andrew Tridgell
632b4f806e added suppport for unexpected udp/138 packets
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 32f66f4ea6)
2000-01-03 06:30:50 +00:00
Andrew Tridgell
574788039f added the unexpected packet database (unexpected.tdb)
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 280e6359d3)
2000-01-03 03:17:16 +00:00
Andrew Tridgell
3db52feb1f first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
(This used to be commit 453a822a76)
1999-12-13 13:27:58 +00:00
Luke Leighton
7c53f158ba reenabled retry_time (commented out accidentally in name_status)
(This used to be commit bf9422832c)
1999-12-05 02:22:28 +00:00
Luke Leighton
ddda7722a6 argh! how horrible! spent ages working out why packets weren't being
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 43e158c426)
1999-12-04 23:40:21 +00:00
Luke Leighton
97913d82f5 argh. trying to get the nmb agent code to filter out "self" packets.
(This used to be commit 84d7cc6323)
1999-12-04 22:22:37 +00:00