1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

270 Commits

Author SHA1 Message Date
Andrew Tridgell
3727e4aaac changed masktest to test the internal algorithm against one server,
rather than 2 servers
(This used to be commit 0e63b4b36334aeb6de6691436b82e1d9784b1541)
2000-04-30 11:11:19 +00:00
Andrew Tridgell
71e7974f3f YIPEE!!!!!
We finally have a perfect emulation of Microsoft wildcard
matching. The routine ms_fnmatch() does wildcard matching with all MS
wildcards (including the unicode wildcards), and masktest against a
NT4 workstation with hundreds of thousands of random exmaples has not
found a single error.

amazingly it is only about 60 lines of code, but it has taken us years
to get it right. I didn't sleep much last night :)
(This used to be commit cc9e007cdfdd300189f89e2a55e4234e47fa842d)
2000-04-30 04:45:16 +00:00
Jeremy Allison
36db78feda Fixed subtle unlocking bug when a file is closed. We need to store the
smbpid used when a file was opened in the files_struct. Else we use
the wrong global_smbpid when we are closing the file and trying to
remove the brl locks - this causes the brl locks to be left when the
file is closed as the samba_context check fails.
Jeremy.
(This used to be commit 2746e5602e493e5b022764b4b839eb4d2f14363b)
2000-04-27 22:23:04 +00:00
Andrew Tridgell
65ec80c51d quick hack to get smbtorture working again
(This used to be commit 2d37c1f98f45646546ee76743f9df90b1c0b01ae)
2000-04-27 07:36:06 +00:00
Andrew Tridgell
59c8a608c2 fixed a memory leak in nmblookup
(This used to be commit 49865ea06c96b01a5e5dec84d64b78bf26129be3)
2000-04-25 00:46:46 +00:00
Andrew Tridgell
da2da10117 load smb.conf and interfaces in masktest (to allow for netbios name
resolution)
(This used to be commit f007531742f5570d5b9b8cb20cab19cd1ab1bfed)
2000-03-26 09:20:47 +00:00
Jeremy Allison
08607c3e0c Fixed parsing issue with HP printer defs reported by HP.
Jeremy.
(This used to be commit 035272e6bcc8c43bf4521e4a20b0c35b0901e904)
2000-03-14 22:04:35 +00:00
Luke Leighton
3958c39106 added a tcon test: make two tconXs with the same user/pass, open a file
with one of them and try to write to the file with the other.
(This used to be commit f8d3ce0419aee44e4d5efe1257ce4b27f7511ceb)
2000-03-07 21:55:42 +00:00
Jeremy Allison
50444a0b5f Fixed smbpasswd crash bugs found by Giulio.
Jeremy.
(This used to be commit 54440428e5dbf5c1e673e881d3a9364e64ad2ad7)
2000-03-01 18:58:50 +00:00
Jeremy Allison
0f1eee5c7a client/client.c:
libsmb/clientgen.c: Fixes for Win2k smbclient browsing.
Other fixes implement smbpasswd -x user to delete users. Also allows swat
to do the same.
Jeremy.
(This used to be commit 9f6ad046761adecafba59040baa3abc9f0959e65)
2000-02-25 22:25:25 +00:00
Jeremy Allison
3cf31a194f Added replacement functions sys_popen and sys_pclose. These are based
on the glibc source code and are safer than the traditional popen as
they don't use a shell to exec the requested command. Now we have
these functions they can be tightened up (environment etc.) as required
to make a safe popen. It should now be safe to add the environement
variable loading code to loadparm.c
Jeremy.
(This used to be commit b52e92b09d4ca3b66e534f520468dee27065d048)
2000-02-15 19:36:47 +00:00
Andrew Tridgell
dacbb15e9f the beginnings of a fnmatch() based wildcard matching routine
(This used to be commit ef256de9d9a204cf91fe8b636d07400cd0648d1e)
2000-02-10 13:43:59 +00:00
Andrew Tridgell
94d68eb808 update masktest for new make_nmb_name() syntax
(This used to be commit 3609e835d4f938190f43b958403978c892b4bc9b)
2000-02-09 14:17:12 +00:00
Andrew Tridgell
74f0d16da4 added masktest to head branch, in preparation for another assault on
the wildcard handling code
(This used to be commit 3f77690dade57f4ae9da7196b0aa7a3a43afcc46)
2000-02-09 14:10:08 +00:00
Luke Leighton
bbe275e95b 1) added void* state argument to tdb_traverse. guess what! there were
two places i found where it was appropriate to _use_ that third argument,
in locking.c and brlock.c!  there was a static traverse_function and
i removed the static variable, typecast it to a void*, passed it to
tdb_traverse and re-cast it back to the traverse_function inside the
tdb_traverse function.  this makes the use of tdb_traverse() reentrant,
which is never going to happen, i know, i just don't like to see
statics lying about when there's no need for them.

as i had to do in samba-tng, all uses of tdb_traverse modified to take
the new void* state argument.

2) disabled rpcclient: referring people to use SAMBA_TNG rpcclient.
i don't know how the other samba team members would react if i deleted
rpcclient from cvs main.  damn, that code's so old, it's unreal.
20 rpcclient commands, instead of about 70 in SAMBA_TNG.
(This used to be commit 49d7f0afbc1c5425d53019e234d54ddf205c8e9a)
2000-02-04 04:59:31 +00:00
Andrew Tridgell
6389b81f9d renamed DENY to DENY1
added DENY2 test that checks all 648 deny combinations for the case
of two opens on the same connection
(This used to be commit 01d4c4784dd26bdfc9883907b3170e8b0ea0cd6f)
2000-01-16 12:28:43 +00:00
Andrew Tridgell
b09e4c370e use GET_DENY_MODE() macro
(This used to be commit d9c3e0e61f315ad4d9c3ea6bb6acc8500befe6b4)
2000-01-16 12:27:20 +00:00
Andrew Tridgell
54e1176ba1 added code to allow traversal of the byte range lock database
this is used with "smbstatus -B" to dump the lock list
(This used to be commit 5f022629146701e6d543f77007dc944e4277ab0c)
2000-01-16 11:14:44 +00:00
Andrew Tridgell
1359195c50 casts and defines to make solaris happy
(This used to be commit 77cf152c02b445f4b6e9de393936dd6e54e6f442)
2000-01-14 08:33:20 +00:00
Andrew Tridgell
82af221e4a we now pass all byte range locking tests
the last piece was to use a smb timeout slightly larger than the
locking timeout in bloking locks to prevent a race
(This used to be commit 1b54cb4a33a65e62c2e3189b78ef073869a60c75)
2000-01-14 04:32:57 +00:00
Andrew Tridgell
2afd5d5eb5 some more work on the byte range locking
note the ugly global_smbpid - I hope that won't bethere for long, I
just didn't want to do two lots of major surgery at the one time.
Using global_smbpid avoids the big change of getting rid of our
inbuf/outbuf interface to reply routines. I'll do that once the
locking stuff passes all tests.
(This used to be commit f8bebf91abcaa5bda3ec8701f9242f220da8943a)
2000-01-14 00:50:48 +00:00
Andrew Tridgell
cdb8c99fce greatly expanded the lock4 locking test. we now pass all but one test
- that should be fixed soon.
(This used to be commit 23bb936e1fdeab2ad697ed946c945ef5ce87357d)
2000-01-13 12:11:30 +00:00
Andrew Tridgell
0af00edf67 I'm currently designing a new locking system (using a tdb database!)
that will make us match NT semantics exactly and do away with the
horrible fd multiplexing in smbd.

this is some diag stuff to get me started.

- added the ability to do read or write locks in clientgen.c

- added a LOCK4 test to smbtorture. This produces a report on the server
and its locking capabilities. For example, NT4 gives this:

the same process cannot set overlapping write locks
the same process can set overlapping read locks
a different connection cannot set overlapping write locks
a different connection can set overlapping read locks
a different pid cannot set overlapping write locks
a different pid can set overlapping read locks
the same process can set the same read lock twice
the same process cannot set the same write lock twice
the same process cannot override a read lock with a write lock
the same process can override a write lock with a read lock
a different pid cannot override a write lock with a read lock
the same process cannot coalesce read locks
this server does strict write locking
this server does strict read locking


whereas Samba currently gives this:

the same process can set overlapping write locks
the same process can set overlapping read locks
a different connection cannot set overlapping write locks
a different connection can set overlapping read locks
a different pid can set overlapping write locks
a different pid can set overlapping read locks
the same process can set the same read lock twice
the same process can set the same write lock twice
the same process can override a read lock with a write lock
the same process can override a write lock with a read lock
a different pid can override a write lock with a read lock
the same process can coalesce read locks
this server does strict write locking
this server does strict read locking


win95 gives this - I don't understand why!

the same process cannot set overlapping write locks
the same process cannot set overlapping read locks
a different connection cannot set overlapping write locks
a different connection cannot set overlapping read locks
a different pid cannot set overlapping write locks
a different pid cannot set overlapping read locks
the same process cannot set the same read lock twice
the same process cannot set the same write lock twice
the same process cannot override a read lock with a write lock
the same process cannot override a write lock with a read lock
a different pid cannot override a write lock with a read lock
the same process cannot coalesce read locks
this server does strict write locking
this server does strict read locking
(This used to be commit 49637936b6e9478df248c4ef73d818870c73b597)
2000-01-10 14:41:20 +00:00
Andrew Tridgell
c01663c1a9 extent smbtorture to test with both an exe file and a dat file
(This used to be commit dd2ce575047eb57288bff11669512132fd347fda)
2000-01-08 11:37:45 +00:00
Andrew Tridgell
e8b5cb4515 cli_open() wasn't handling DENY_FCB or O_WRONLY correctly.
After fixing that I needed to use O_RDWR instead of O_WRONLY in
several places to avoid the silly bug in MS servers that doesn't allow
getattrE on a file opened with O_WRONLY
(This used to be commit e21aa4cb088f348139309d29c85c48c8b777cff5)
2000-01-08 10:15:53 +00:00
Andrew Tridgell
6ba295ce0b added a DENY test that tests deny mode handling. It produces a matrix
of 324 lines (6*6*3*3) of all possible deny mode behaviour. This
allows us to compare with NT. We currently don't match :)
(This used to be commit 2071105b439e87cb1c7c3a8c1b2046441eb46270)
2000-01-08 09:49:52 +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 b563be824b8c3141c49558eced7829b48d4ab26f)
2000-01-07 06:55:36 +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 280e6359d36c9bc8dcded302f15c3a1db8e3feeb)
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 00e9da3ca577527db392aced62f02c69cfee8f4f)
2000-01-02 23:00:27 +00:00
Andrew Tridgell
fc4e722127 improved error message in case the lock list is truncated
(This used to be commit f4ecc5a8e39ee69c59123b7b3ffbd081f69824ca)
1999-12-22 01:36:27 +00:00
Andrew Tridgell
488115dbce changed message is connections.tdb doesn't exist
(This used to be commit 835b9881c0f04d766545d5e9d2926fbaf8bec904)
1999-12-21 09:33:45 +00:00
Andrew Tridgell
4e1291a83f converted all our existing shared memory code to use a tdb database
instead of either sysv or mmap shared memory or lock files.

this means we can now completely remove
	locking_shm.c
	locking_slow.c
	shmem.c
	shmem_sysv.c
and lots of other things also got simpler

locking.c got a bit larger, but is much better compartmentalised now
(This used to be commit e48c2d9937eea0667b8cd3332e49c06314ef31e7)
1999-12-21 09:25:59 +00:00
Andrew Tridgell
69d24d869b first cut at using the tdb code for the connections structure, the
SWAT status page and smbstatus. It made the code _much_ simpler, I
wish we'd done a database module a long time ago!
(This used to be commit 4951755413c11d4c5b9af4699a6e622056d52433)
1999-12-21 04:54:30 +00:00
Andrew Tridgell
0c4b1ea014 this was left out from the 2.0.6 merge
(This used to be commit 7067aeecabaea8a35f7a27de4b44f1e11afd07b7)
1999-12-21 03:05:38 +00:00
Andrew Tridgell
418ba2933f more files from 2.0.6
(This used to be commit 4a205795710010c58ae14bcb950912727c4de466)
1999-12-17 01:52:05 +00:00
Andrew Tridgell
32a965e09c 2nd phase of head branch sync with SAMBA_2_0 - this delets all the files that were in the head branch but weren't in SAMBA_2_0
(This used to be commit d7b208786590b5a28618590172b8d523627dda09)
1999-12-13 13:35:20 +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 453a822a76780063dff23526c35408866d0c0154)
1999-12-13 13:27:58 +00:00
Luke Leighton
4f8a24522c final part of "first" phase converting over to msrpc daemon architecture.
done a minimal amout of clean-up in the Makefile, removing unnecessary
modules from the link stage.  this is not complete, yet, and will
involve some changes, for example to smbd, to remove dependencies on
the password database API that shouldn't be there.  for example,
smbd should not ever call getsmbpwXXX() it should call the Samr or Lsa
API.

this first implementation has minor problems with not reinstantiating
the same services as the caller.  the "homes" service is a good example.
(This used to be commit caa50525220b0d0250fa139367593c2de2c12135)
1999-12-12 20:03:42 +00:00
Gerald Carter
12ca139d5c OK. This code works on a RedHat 6.0 system. However smbpasswd
time out of sending the session setup on Solaris 2.6.  No idea.
I'll work on it some tomorrow.  This is to fix the "Unable to
setup password vectors" thingy.

Also changed an inet_aton() to inet_addr() as the former is
not very portable :-)

Luke,  I set the redir flag to false because the connection to
the smb-agent was failing and smbpasswd bombed.  Double check me
on this one.



-jc
(This used to be commit e1d2b174caf5f0c48a8fac25778f72a868ec6eb7)
1999-12-09 07:06:12 +00:00
Luke Leighton
4ab9d91428 ABOUT TIME!!!!!!!!
damn, this one is bad.

started, at least two days ago, to add an authentication mechanism to
the smbd<->msrpc redirector/relay, such that sufficient unix / nt
information could be transferred across the unix socket to do a
become_user() on the other side of the socket.

it is necessary that the msrpc daemon inherit the same unix and nt
credentials as the smbd process from which it was spawned, until
such time as the msrpc daemon receives an authentication request
of its own, whereupon the msrpc daemon is responsible for authenticating
the new credentials and doing yet another become_user() etc sequence.
(This used to be commit 30c7fdd6ef10ecd35594311c1b250b95ff895489)
1999-12-08 21:43:03 +00:00
Luke Leighton
854f35e20f created create_pipe_socket() function.
(This used to be commit a3af3b4312144943413894b18b5845b56474ebb5)
1999-12-05 00:13:17 +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 43e158c4261e51678d6e7f77ceb4a1c7281a2525)
1999-12-04 23:40:21 +00:00
Luke Leighton
c41205e28f even more cool! nmb-agent moved over to new vagent style, too!
(This used to be commit 49c157eae4bb24164f0f976d1bf6cf0cfc068863)
1999-12-04 22:05:59 +00:00
Luke Leighton
f6077db317 cool! created higher-order function table for agent redirection.
(This used to be commit 7bb2e55d0d3a00a97bba99ebed722a4adf84093c)
1999-12-04 21:55:39 +00:00
Luke Leighton
9b44e117f9 more similar agent code
(This used to be commit 2c778313b8c2b4535f16e11aea81a61edb3b2d45)
1999-12-04 20:43:45 +00:00
Luke Leighton
4503221852 nmb agent memory free problems
(This used to be commit b4306cbf06f70dd9d2760bb005e15059d6f904f0)
1999-12-04 20:29:03 +00:00
Luke Leighton
409798953d trying to make redirector agent code same base.
(This used to be commit 9ba9df453abab1085b5537580b1da87d1dcdb7de)
1999-12-04 20:11:31 +00:00
Luke Leighton
f521205cb3 jeremy is going to hate me for this.
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-04 19:14:37 +00:00
Luke Leighton
8a8a7da518 argh! you wouldn't believe what i had to do: use the mid (multiplex id)
to redirect multiple socket-based connnections onto a single client state.

argh!
(This used to be commit 06390e792cd8aa57a91c3a3d1d267fd1bcdc17a1)
1999-12-04 00:49:13 +00:00
Luke Leighton
0ca1f87930 argh! smb-agent redirection client reusage is a nightmare!
moved smb-agent over to a single-process model instead of fork()
in order to reuse client connections.  except, of course, you
can't do a select() on the same socket connections!  argh!
(This used to be commit e9e5a34de8e8f9a69e817aceb8c16284334d4642)
1999-12-03 23:36:53 +00:00