1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

325 Commits

Author SHA1 Message Date
Andrew Tridgell
4d65bc0949 convert more code to use XFILE
(This used to be commit fd24265c06)
2001-09-10 13:09:54 +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
Andrew Tridgell
b12a4dd9b6 declare dbf in one spot
(This used to be commit f41c3bb80f)
2001-09-10 12:14:18 +00:00
Andrew Tridgell
b30e75692d replaced stdio in many parts of samba with a XFILE. XFILE is a cut-down
replacemnt of stdio that doesn't suffer from the 8-bit filedescriptor
limit that we hit with nasty consequences on some systems

I would eventually prefer us to have a configure test to see if we need
to replace stdio, but for now this code needs to be tested widely so
I'm enabling it by default.
(This used to be commit 1af8bf34f1)
2001-09-10 11:08:57 +00:00
Andrew Tridgell
9a9ac2739b got rid of USE_TDB_MMAP_FLAG as its not needed any more
(This used to be commit c26e0d3f27)
2001-09-06 22:08:19 +00:00
Herb Lewis
7528728071 merge profile data changes from 2.2
(This used to be commit c105859304)
2001-09-05 18:43:55 +00:00
Tim Potter
259d59084d Send a MSG_SMB_SAM_REPL when a UAS/SAM change netlogon message is
received.
(This used to be commit b7cf14bf84)
2001-08-28 06:08:31 +00:00
Christopher R. Hertel
7c09aa553d Same as nmbd.c. These now test wins_srv_count() instead of lp_wins_server
to determine whether the 'wins server' parameter is set.
(This used to be commit 5b975d3a9c)
2001-08-26 06:43:39 +00:00
Christopher R. Hertel
7fed75b4cb Instead of checking lp_wins_server() to see if a WINS server was specified,
nmbd now calls wins_srv_count().  This returns the number of WINS servers
specified in the 'wins server' parameter.  The return value will be zero if
'wins server' is not specified.

Quick change to make room for WINS failover.
(This used to be commit 0777ebc04b)
2001-08-26 06:24:03 +00:00
Tim Potter
c1f0d99013 Process the SAM/UAS change notification message.
(This used to be commit efcbcfaa48)
2001-08-24 19:28:08 +00:00
Tim Potter
2236c671a0 Only register the #1b name if we are ROLE_DOMAIN_PDC rather than
lp_domain_master()
(This used to be commit b8fe147430)
2001-08-24 19:21:40 +00:00
Jeremy Allison
6597e1bd26 Fixes for varargs problems with std c.
Fix from Rick Lake <rwlake@anp.nl> for QNX.
Jeremy.
(This used to be commit c13b77eb35)
2001-07-30 17:52:26 +00:00
Jeremy Allison
c6b51500af Fixes from Jens-Uwe.Walther@force.de to make the -l option behave
consistently.
Jeremy.
(This used to be commit f591ca9f25)
2001-07-17 20:42:59 +00:00
Christopher R. Hertel
bb8c1be67c Andrew B and I were commiting the same fix at the same time in different
trees.  This change simply brings HEAD and 2.2 in line with one another.
Otherwise the code would be differnt but the meaning would be the same,
which is awkward.
Chris 'fifty-seven commits per line changed' Hertel -)-----
(This used to be commit bbf14e2d4e)
2001-07-10 18:05:29 +00:00
Andrew Bartlett
f8f1d9d5c3 Fix tree breakage, the last change was entirly non-portable, and we already
have this nice variable to do exactly this...
(This used to be commit cad6f53433)
2001-07-10 17:14:52 +00:00
Christopher R. Hertel
973a78c2db Fix from John Malmberg. When I added the additional information to the
debug block that reports multiple query responses I did not notice that
the local answer_ip variable was only selectively set.

Chris -)-----
(This used to be commit 22ea0770d8)
2001-07-10 16:10:04 +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
Simo Sorce
89ee12d373 - sorry, forgot to test a pointer
(This used to be commit 1aef522452)
2001-07-03 00:23:38 +00:00
Simo Sorce
ef6c9d7425 "netbios aliases" and "interfaces" options change from P_STRING to P_LIST
(This used to be commit db36ed1d80)
2001-07-01 23:24:08 +00:00
Christopher R. Hertel
9e7896144a Added info to some of the debug messages to get a better handle on a problem
people are reporting regarding multiple responses to queries on <1D> names.

There should only ever be one LMB but some users are seeing multiple replies
to queries for the LMB name.  This is probably due to nodes on the LAN that
have NetBIOS over NetBEUI and/or IPX enabled.  Previously, the debug message
did not include the IP address associated with the name.  It *did* include
the source address of the packet, but in the examples I've seen all of these
were the same, eg:

[2000/06/22 11:58:25, 0] nmbd/nmbd_namequery.c:query_name_response(93)
query_name_response: Multiple (2) responses received for a query on subnet
129.130.10.136 for name NT.CIS.KSU.EDU<1d>. This response was from IP
129.130.10.24
 [2000/06/22 11:58:25, 0] nmbd/nmbd_namequery.c:query_name_response(93)
query_name_response: Multiple (3) responses received for a query on subnet
129.130.10.136 for name NT.CIS.KSU.EDU<1d>. This response was from IP
129.130.10.24
 [2000/06/22 11:58:25, 0] nmbd/nmbd_namequery.c:query_name_response(93)
query_name_response: Multiple (4) responses received for a query on subnet
129.130.10.136 for name NT.CIS.KSU.EDU<1d>. This response was from IP
129.130.10.24
[2000/06/22 11:58:25, 0] nmbd/nmbd_namequery.c:query_name_response(93)
query_name_response: Multiple (5) responses received for a query on subnet
129.130.10.136 for name NT.CIS.KSU.EDU<1d>. This response was from IP
129.130.10.24

Note that all of the above are reported as having come from 129.130.10.24.
This should never happen.  If 129.130.10.24 is a WINS server it should
send a Negative Name Query Response for a <1D> name query (wierd but true).

So, are all of the above coming from different systems, all of which
think are the LMB?  Are they all coming from one system that is, for some
strange reason, replying five times to the same query?

Anyway, I needed more info so I've changed the debug messages.

Chris -)-----
(This used to be commit 8f2f09af0a)
2001-06-28 20:49:47 +00:00
Andrew Tridgell
b95a294a08 fixed usage of socklen_t and also tidied up SIG_ATOMIC_T, using a typedef instead of a define
(This used to be commit e2ecff419f)
2001-06-25 02:53:13 +00:00
Jeremy Allison
7d72ec3eda Mismatched format and args.
Jeremy.
(This used to be commit d57feb2c85)
2001-04-27 22:19:25 +00:00
Jeremy Allison
30c02f9871 More paranioa fixes against nmbd lengths.
Jeremy.
(This used to be commit 53f35a71c6)
2001-04-25 01:07:33 +00:00
Jeremy Allison
a7e07d149d Fix bad length in dgram.
Jeremy.
(This used to be commit 8bd27845f0)
2001-04-24 23:51:57 +00:00
Jeremy Allison
38227191ed Patch for nmbd core dump in printing debug packets. No length check.
Jeremy.
(This used to be commit eacb96396d)
2001-04-24 18:01:40 +00:00
Jeremy Allison
2ef68c7e92 Merge of Andrew's changes in 2.2.
Jeremy.
(This used to be commit fc76681812)
2001-04-13 19:12:06 +00:00
Jeremy Allison
50e78a9ac8 As Andrew suggested, make smbrun return a fd for a deleted file which can then
be read.
Jeremy.
(This used to be commit e7d59d6de8)
2001-04-13 00:37:00 +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
370664344a Fix insure-found parameter size missmatch.
Jeremy.
(This used to be commit 2f658691e4)
2001-03-23 19:01:27 +00:00
Andrew Tridgell
0f2b15707a added option "enhanced browsing"
this allows users to disable the cross-subnet browse extensions that I
added to Samba a couple of years ago. This may be useful for getting
rid of empty workgroups.
(This used to be commit 978980050e)
2001-03-21 04:12:36 +00:00
Jeremy Allison
4ab6182a0f AS/U on a sparc now joins and authenticates against a Samba PDC !
Jeremy.
(This used to be commit 28a0bc5f57)
2001-03-15 00:49:13 +00:00
Jeremy Allison
6c99c38cbf Fixed double fclose() call (I love insure :-).
Jeremy.
(This used to be commit 0a84839dc0)
2001-03-08 22:29:39 +00:00
Herb Lewis
a82df9c673 samba/source/nmbd/nmbd.c change remote_machine name to nmbd instead
of nmb so we write to same log file that
				was originally created as log.nmbd
samba/source/smbd/server.c	change remote_machine name to smbd instead
				of smb so we write to same log file that
				was originally created as log.smbd
samba/source/lib/interface.c	allow binding to all interface IP addresses
				even if on same subnet. This allows you to
				specify which IP's you want in interfaces
				line and use bind interfaces only
(This used to be commit 01dfd59712)
2001-02-15 19:50:34 +00:00
David O'Neill
fcfaebda7f Changes from APPLIANCE_HEAD:
source/smbd/server.c
    source/nmbd/nmbd.c
        - Fixed a very subtle bug with signals. Seems that POSIX requires
          that the signal mask be inhereted. So, if you happen to kick off
          smbd/nmbd from code that has the mask set on SIGUSR1, you lose
          messages.
(This used to be commit b4c98196fc)
2001-01-25 16:36:42 +00:00
Richard Sharpe
92ebc81734 I need a callback arg for cli_NetServerEnum and cli_RNetShareEnum, so I had
to modifiy any routine that calls it to pass NULL and so forth.

Should have no impact. It compiles OK.
(This used to be commit 7f862e387f)
2001-01-04 11:35:55 +00:00
Richard Sharpe
79ad1926d0 We only want to mark mailslot packets as loopback packets if they are to
the DGRAM_PORT, since we want to actually send those to other ports.

They might be for the client library running on the Samba server!
(This used to be commit 05e2dd5e85)
2001-01-03 01:25:05 +00:00
Richard Sharpe
842589582b Make the use of generate_name_trn_id conform to the usage elsewhere ...
(This used to be commit 46a3a56ecf)
2001-01-02 14:24:46 +00:00
Richard Sharpe
39f0f1120f Comment out unused generate_name_trn_id ...
(This used to be commit fb5798e1d9)
2001-01-02 14:00:27 +00:00
Jeremy Allison
901c3224de John Reillys fix for de-registering broadcast names (NT doesn't do this).
Jeremy.
(This used to be commit 245907f2af)
2000-11-17 00:33:06 +00:00
Jeremy Allison
c56301b1d1 Ignore SIGUSR2. Terminate nmbd if we have no interfaces.
Jeremy.
(This used to be commit 580e2e044c)
2000-10-12 21:19:49 +00:00
Jeremy Allison
8582d42646 Ensure browse.dat is written and read in UNIX character set format.
Jeremy.
(This used to be commit 279d0ec656)
2000-10-07 01:15:07 +00:00
Andrew Tridgell
f0ce4f7ae3 - changed the msg_type to be an int instead of an enum so that it is
easier to add new message types to messages.h without breaking old
binaries

- added a MSG_FORCE_ELECTION message to force nmbd to hold an election
(This used to be commit f1c49ca7ce)
2000-09-12 06:13:25 +00:00
Andrew Tridgell
0b2e454703 debug messages now work for nmbd
(This used to be commit 6a503f95b1)
2000-09-11 07:33:44 +00:00
Andrew Tridgell
3689e4ffc1 the first cut of the internal messaging system.
The motivation for this system is to replace the UDP message for
oplocks, but this commit only does the "set debug level" message.
(This used to be commit 2a34ee95f3)
2000-09-11 07:02:43 +00:00
Jeremy Allison
6e150a7ca5 Fix for bind interfaces only sometimes picking the wrong IP address
for a name query. From Steve Langasek <vorlon@netexpress.net>.
Jeremy.
(This used to be commit 9890740121)
2000-08-30 17:34:35 +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
Andrew Tridgell
8843a6379d Linux kernel oplocks now seem to work, but need a _lot_ of testing
I had to modify sys_select() to not loop on EINTR. I added a wrapper
called sys_select_intr() which gives the old behaviour.
(This used to be commit b28cc4163b)
2000-06-11 05:57:58 +00:00
Andrew Tridgell
ddc9b8b406 more merging
it is now at the stage that winbindd can compile in the head branch,
but not link
(This used to be commit d178c00aae)
2000-05-10 09:49:55 +00:00
Jeremy Allison
a7a4f4f67c Fixed wild pointer diff found by insure.
Jeremy.
(This used to be commit 158d9cada8)
2000-05-02 23:56:24 +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
Andrew Tridgell
84f65e6be6 don't qsort a list less than 2 entries
(This used to be commit 6faa3c23ae)
2000-04-25 00:45:42 +00:00
Andrew Tridgell
f0442220fa fixed a parameter bug found by insure
(This used to be commit a559a8066f)
2000-04-24 11:30:45 +00:00
Jeremy Allison
6259f51dd9 This is a *big* checkin that may break some things, but implements the
new open mechanism Andrew & I discussed.

config.sub:
configure: Included the QNX patch.

include/vfs.h:
smbd/vfs-wrap.c:
smbd/vfs.c: Added ftruncate vfs call (needed).

Note that we will also need locking calls in the vfs (to be added).

lib/util_unistr.c:
nmbd/nmbd_processlogon.c: Fix for NT domain logons causing nmbd to core dump.
                          Also fix for sidsize DOS bug.

locking/locking.c: Check value of ret before using it for memdup.

printing/printing.c: Convert print_fsp_open to return an allocated fsp.

rpc_server/srv_lsa.c: Fix for NT domain logons.

I have removed all use of lp_share_modes() from the code (although I
left the parameter in the table for backwards compatibility). It no longer makes
sense for this to exist.

smbd/close.c: Removed lp_share_modes().
smbd/fileio.c: Fixed parameters to unlock_share_entry call in panic code.
smbd/files.c: Correctly set the unix_ERR_code to ERRnofids on fsp allocation fail.

smbd/nttrans.c:
smbd/reply.c:
smbd/trans2.c: Changed all occurrences of open_file_shared/open_directory/
               open_file_stat to return an fsp from the call.

smbd/open.c: Changed all occurrences of open_file_shared/open_directory/
             open_file_stat to return an fsp from the call.

In addition I have fixed a long standing race condition in the deny mode
processing w.r.t. two smbd's creating a file. Andrew, please note that
your original idea of using open with O_EXCL in this case would not work
(I went over the races very carefully) and so we must re-check deny modes
*after* the open() call returns. This is because there is a race between
the open with O_EXCL and the lock of the share mode entry. Imagine the
case where the first smbd does the open with O_EXCL and a deny mode of DENY_ALL,
but is pre-empted before it locks the share modes and creates the deny
mode entry for DENY_ALL. A second smbd could then come in with O_RDONLY
and a deny mode of DENY_NONE and the two opens would be allowed.

The *only* way to fix this race is to lock the share modes after the
open and then do the deny mode checks *after* this lock in the case
where the file did not originally exist.

This code will need extensive testing but seems to initially work.

Jeremy.
(This used to be commit ab0ecc39d6)
2000-04-22 00:33:16 +00:00
Andrew Tridgell
7b1c5392f7 updates from the TNG branch
(This used to be commit 36fb5bc72f)
2000-04-18 03:34:27 +00:00
Luke Leighton
f5da7470c3 logic for domainsidsize is if size is zero, there's no sid, so don't
advance over it and 4-byte align.

this _used_ to be "regardless of domainsidsize, advance by domainsidsize+3"
which is wrong.
(This used to be commit 5086e6425f)
2000-04-12 05:56:16 +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
420099f96f add a comment
(This used to be commit 0da440c8fe)
2000-04-11 14:25:04 +00:00
Andrew Tridgell
55fa1630e4 some updates to the process logon code to reflect lukes latest
research plus some cleanups
(This used to be commit 1682faa1b0)
2000-04-11 14:11:14 +00:00
Andrew Tridgell
2fa922611b finally got sick of the "extern int Client" code and the stupid
assumption that we have one socket everywhere

while doing so I discovered a few bugs!

1) the clientgen session retarget code if used from smbd or nmbd would
cause a crash as it called close_sockets() which closed our main
socket! fixed by removing close_sockets() completely - it is unnecessary

2) the caching in client_addr() and client_name() was bogus - it could
easily get fooled and give the wrong result. fixed.

3) the retarget could could recurse, allowing an easy denial of
service attack on nmbd. fixed.
(This used to be commit 5937ab14d2)
2000-04-11 13:55:53 +00:00
Jeremy Allison
a49d86ccc1 Additional fix for nmbd and 127.0.0.1 interface.
Jeremy.
(This used to be commit 715fa7ea8c)
2000-04-03 17:12:25 +00:00
Jeremy Allison
9966573076 Cause nmbd to ignore loopback interface when constructing its interface list. This is done by default when interfaces are probed, but if someone
explicitly adds 127.0.0.1 to the interfaces line for smbd, then nmbd would
start to try and register names on it. This was not good :-(.
Jeremy.
(This used to be commit cc3ad82521)
2000-03-29 21:30:52 +00:00
Andrew Tridgell
1bb5664127 damn, the test was the wrong way around for short_resuest
(This used to be commit 1ac46c4011)
2000-03-28 03:03:34 +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
6570b48d73 the final part of the nmbd merge between head and tng - this gets the
GETDC stuff sorted out
(This used to be commit f6b56ae93e)
2000-03-27 12:19:58 +00:00
Andrew Tridgell
61302f54bd fixed the hanlding of recursion desired when sending packets from
nmbd. It does NOT follow the rule that packets to the wins server have
rec_des set (I know that we have postulated this in the past). Please
don't screw with this unless you do careful testing from WinXX
clients.

Luke and I spent a couple of hours today getting this right (it was
wrong in both TNG and HEAD)
(This used to be commit 9eda2e27b7)
2000-03-27 08:34:26 +00:00
Luke Leighton
3a290ce80c rename static reload_services function to reload_nmbd_services because
it clashes with other reload_services definitions.
(This used to be commit affaf9c541)
2000-03-27 00:52:33 +00:00
Andrew Tridgell
4e7af2b3b5 when doing a "secure nbns" wack response and check with owner for a
multihomed registration we were sending the packet to the wrong host!
We sent it to the person trying to register rather than to the person
who currently holds the name. That means we were not secure and we
could allow two people to register the same name.

Jeremy, you may wish to merge this change into 2.0.X
(This used to be commit 94ca1d1250)
2000-03-26 23:16:07 +00:00
Andrew Tridgell
b18791b860 merge from tng ...
reload services can be static
(This used to be commit b13a903720)
2000-03-26 23:13:12 +00:00
Jeremy Allison
9db96b7646 lib/system.c: Fixed gcc warnings.
nmbd/nmbd_processlogon.c: Use "True" and "False" instead of 1 and 0.
Others - preparing for multiple pdu write code.
Jeremy.
(This used to be commit 9f879ec396)
2000-02-23 02:02:33 +00:00
Luke Leighton
f7324464b1 richard got the short request for GETDC right (hooray!) win9x _and_ nt
now work.
(This used to be commit 27ef178926)
2000-02-22 21:00:01 +00:00
Jeremy Allison
40122f6e32 Modified auto alignment of ud[] struct on stack to be declared as an
array of pointers. This should cause alignment on a correct boundary..
Spotted by Darren Reed <darrenr@telnetmedia.com>.
Jeremy.
(This used to be commit 91f4d06753)
2000-01-28 23:47:31 +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
5e9f559187 implemented talloc() as described on samba-technical. This fixes the
lp_string() bug properly.

we still need to add lp_talloc_free() calls in all the main event
loops, I've only put it in smbd and nmbd thus far.
(This used to be commit aa7f815525)
2000-01-05 06:36: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
d705b62141 got rid of mem_man
yamd is much better, and doesn't require any source code changes
if you haven't seen yamd then take a look at
	http://www3.hmc.edu/~neldredge/yamd/
its excellent!
(This used to be commit 25b13f8b79)
2000-01-03 03:31:41 +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
9a781a8c6d - added tdb_flags option to tdb_open()
- added TDB_CLEAR_IF_FIRST flag to clear the database if this is the
  first attached process. Useful for non-persistent databases like our
  locking area (this will also make upgrades to new database layouts easier)
- use lock_path() in a couple of places
- leave connections database open while smbd running
- cleaned up some tdb code a little, using macros for constants
(This used to be commit 00e9da3ca5)
2000-01-02 23:00:27 +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
a76fee7333 more cli_session_setup() calls. what the heck are these doing???
they should all be replaced with cli_establish_connection().

created cli_use_wait_keyboard() which waits on multiple cli_states
and swallows session keepalives.
(This used to be commit fcc39b3f4f)
1999-12-01 22:06:53 +00:00
Luke Leighton
6ddfc68e04 sys_select added one more argument (read, write selectors).
(This used to be commit e4d92ff9df)
1999-12-01 02:15:14 +00:00
Luke Leighton
161c11e4bc - bug in nmbd registering DOMAIN_NAME<1c> to WINS server; recursion
desired flag MUST be set in any NBT UDP packets sent to a WINS
  server, else they will go to the WINS client side of the NT NetBIOS
  kernel instead, and will get trashed.

- added \PIPE\browser server-side code.
(This used to be commit 8e406c1fa2)
1999-11-19 01:01:07 +00:00
Luke Leighton
da517a3ff4 responses to UDP samquery go back to SERVER<00> not DOMAIN<1c>, the
request name.

modified createuser rpcclient command to examine name being added.  if it
ends in a $, assume that a workstation trust account is being added.
(This used to be commit 4aea261cb0)
1999-11-18 23:15:45 +00:00
Luke Leighton
ccc8585567 added regqueryval command (experimental) to get reg_io_q_info() and
reg_io_r_info() working properly.  previously they weren't well
understood (well, they were the first of the registry functions i did,
back in december 97, ok??? :-)

set ntversion to 0x1 in SAMQUERY, so that we reply same as NT4 srv.
(This used to be commit 98ddeaf442)
1999-11-18 00:26:11 +00:00
Luke Leighton
b231d2fafa - added DCE/RPC "fault" PDU support.
- disabled (AGAIN) the GETDC "if (MAILSLOT\NTLOGON)" code that will get
NT5rc2 to work but WILL break win95 (AGAIN).  this needs _not_ to be
re-enabled but to be replaced with a better mechanism.

- added SMBwrite support (note: SMBwriteX already existed) as NT5rc2 is
sending DCE/RPC over SMBwrite not SMBwriteX.
(This used to be commit 25c70e3c98)
1999-11-15 22:11:10 +00:00
Matthew Chapman
8592314480 Fix for Win95 not being able to find PDC (for User/Server Manager, and
password change requests), from Michael Stockman <pgmtekn@algonet.se>.
GETDC on \MAILSLOT\NET\NETLOGON necessarily returns less information
than the NTLOGON version.
(This used to be commit 8a603a8793)
1999-08-08 04:51:13 +00:00
Matthew Chapman
9c2520e6cd Trying to improve DC location & browsing performance for the average user
who doesn't know what an LMB or DMB is.

* check_master_browser_exists now performs the check the first time
around, so if there is indeed no master browser then Samba takes up the job
much faster.

* Upped default OS level to 32. There is no reason why some stupid little
Windows box should become LMB instead of a Samba *server*.

* "domain master" now defaults to "auto". Currently this attempts to
become DMB iff Samba is the PDC (ala Windows NT). "preferred master" also
defaults to "auto", which enables preferred master iff Samba is DMB.

* lp_server_role now just returns the predetermined role, rather than
working it out each time, since the server role is becoming very heavily
used (esp for the BDC code).
(This used to be commit 4a23a358b5)
1999-04-11 10:23:19 +00:00
Luke Leighton
5a6db490ea SAMLOGON query - alignment issue is beginning to get to me.
(This used to be commit baf55934dc)
1999-03-17 21:35:10 +00:00
Luke Leighton
7f913623be alignment issue for UDP SAMLOGON response.
(This used to be commit 9d01e9d86a)
1999-03-17 19:48:29 +00:00
Luke Leighton
60bfe3819e alignment issue in UDP SAMLOGON response.
(This used to be commit de290627f0)
1999-03-09 02:03:39 +00:00
Luke Leighton
a3c6e96a22 mods to allow inter-domain trust accounts to be added to SAM database
using smbpasswd command.
(This used to be commit 62d499f832)
1999-03-09 01:21:57 +00:00
Luke Leighton
aecbc5b5d3 oh dear, it's this one again. removed check for MAILSLOT\NTLOGON because
it's wrong.  i've seen a packet from nt client on MAILSLOT\NETLOGON
with appended undocumented unicode tacked on the end and the response
contained undocumented unicode tacked on the end.
(This used to be commit 74c7d626cd)
1999-03-09 01:20:08 +00:00
Matthew Chapman
2737f26ad6 Always null-terminate strings.
Also some string length and sizeof(pointer) corrections.
(This used to be commit ce24191939)
1999-02-15 05:33:30 +00:00
Matthew Chapman
fd96929ec1 UNICODE cleanup (see lib/util_unistr.c).
No more ugly static library buffers and all functions take a destination
string length (especially unistrcpy was rather dangerous; we were only
saved by the fact that datagrams are limited in size).
(This used to be commit a1d39af1ce)
1999-02-12 00:16:09 +00:00
Jeremy Allison
3e7039349f Fix bug with nmbd running wild due to recursion in retransmit_or_expire_response_records().
Jeremy.
(This used to be commit d5f05b4fae)
1998-12-17 21:41:28 +00:00
Luke Leighton
58a0cbc0c8 oops, util_pwdb.c appears to be included in PASSDB_OBJ not LIB_OBJ.
(This used to be commit ca10eb4490)
1998-12-09 16:30:37 +00:00
Luke Leighton
1f989cda94 need to initialise global_myworkgroup
(This used to be commit 501617307f)
1998-12-09 16:23:57 +00:00
Andrew Tridgell
cfba976fc2 removed the SID stuff from the head branch as well.
This allows the removal of PASSDB_OBJ, RPC_CLIENT_OBJ and
RPC_PARSE_OBJ from nmbd in the head branch.

so nmbd just went on a diet :)
(This used to be commit be697c9ef0)
1998-12-09 06:35:37 +00:00
Luke Leighton
8d08fb7323 jean-f spotted race condition on generation of sam sid, from starting
nmbd and smbd.  nmbd is now client: smbd is solely responsible for
creating sam_name.SID
(This used to be commit 50fa4822df)
1998-12-03 17:38:20 +00:00