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

265 Commits

Author SHA1 Message Date
Andrew Tridgell
f007531742 load smb.conf and interfaces in masktest (to allow for netbios name
resolution)
0001-01-01 00:00:00 +00:00
Jeremy Allison
035272e6bc Fixed parsing issue with HP printer defs reported by HP.
Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
f8d3ce0419 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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
54440428e5 Fixed smbpasswd crash bugs found by Giulio.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
9f6ad04676 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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b52e92b09d 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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
ef256de9d9 the beginnings of a fnmatch() based wildcard matching routine 0001-01-01 00:00:00 +00:00
Andrew Tridgell
3609e835d4 update masktest for new make_nmb_name() syntax 0001-01-01 00:00:00 +00:00
Andrew Tridgell
3f77690dad added masktest to head branch, in preparation for another assault on
the wildcard handling code
0001-01-01 00:00:00 +00:00
Luke Leighton
49d7f0afbc 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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
01d4c4784d renamed DENY to DENY1
added DENY2 test that checks all 648 deny combinations for the case
of two opens on the same connection
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d9c3e0e61f use GET_DENY_MODE() macro 0001-01-01 00:00:00 +00:00
Andrew Tridgell
5f02262914 added code to allow traversal of the byte range lock database
this is used with "smbstatus -B" to dump the lock list
0001-01-01 00:00:00 +00:00
Andrew Tridgell
77cf152c02 casts and defines to make solaris happy 0001-01-01 00:00:00 +00:00
Andrew Tridgell
1b54cb4a33 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
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f8bebf91ab 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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
23bb936e1f greatly expanded the lock4 locking test. we now pass all but one test
- that should be fixed soon.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
49637936b6 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
0001-01-01 00:00:00 +00:00
Andrew Tridgell
dd2ce57504 extent smbtorture to test with both an exe file and a dat file 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e21aa4cb08 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
0001-01-01 00:00:00 +00:00
Andrew Tridgell
2071105b43 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 :)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
b563be824b 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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
280e6359d3 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 :)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
00e9da3ca5 - 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
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f4ecc5a8e3 improved error message in case the lock list is truncated 0001-01-01 00:00:00 +00:00
Andrew Tridgell
835b9881c0 changed message is connections.tdb doesn't exist 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e48c2d9937 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
0001-01-01 00:00:00 +00:00
Andrew Tridgell
4951755413 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!
0001-01-01 00:00:00 +00:00
Andrew Tridgell
7067aeecab this was left out from the 2.0.6 merge 0001-01-01 00:00:00 +00:00
Andrew Tridgell
4a20579571 more files from 2.0.6 0001-01-01 00:00:00 +00:00
Andrew Tridgell
d7b2087865 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 0001-01-01 00:00:00 +00:00
Andrew Tridgell
453a822a76 first pass at updating head branch to be to be the same as the SAMBA_2_0 branch 0001-01-01 00:00:00 +00:00
Luke Leighton
caa5052522 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.
0001-01-01 00:00:00 +00:00
Gerald Carter
e1d2b174ca 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
0001-01-01 00:00:00 +00:00
Luke Leighton
30c7fdd6ef 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
a3af3b4312 created create_pipe_socket() function. 0001-01-01 00:00:00 +00:00
Luke Leighton
43e158c426 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
49c157eae4 even more cool! nmb-agent moved over to new vagent style, too! 0001-01-01 00:00:00 +00:00
Luke Leighton
7bb2e55d0d cool! created higher-order function table for agent redirection. 0001-01-01 00:00:00 +00:00
Luke Leighton
2c778313b8 more similar agent code 0001-01-01 00:00:00 +00:00
Luke Leighton
b4306cbf06 nmb agent memory free problems 0001-01-01 00:00:00 +00:00
Luke Leighton
9ba9df453a trying to make redirector agent code same base. 0001-01-01 00:00:00 +00:00
Luke Leighton
d923bc8da2 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).
0001-01-01 00:00:00 +00:00
Luke Leighton
06390e792c 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!
0001-01-01 00:00:00 +00:00
Luke Leighton
e9e5a34de8 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!
0001-01-01 00:00:00 +00:00
Luke Leighton
d54a64ae3a starting "connection reuse" system in smb-agent. added version number
which isn't actually used right now :-)
0001-01-01 00:00:00 +00:00
Luke Leighton
5af076e4b7 smb-agent improvements. added -D (daemon) option. smb agent is
restricted to connections from the current user (socket is created
with current user uid).
0001-01-01 00:00:00 +00:00
Luke Leighton
294b653f2e cool! a unix socket smb redirector. code based on smbfilter and
ideas from ssh-agent.

the intent is to be able to share smb sessions using cli_net_use_add()
across multiple processes, where one process knows the target server
name, user name and domain, but not the smb password.
0001-01-01 00:00:00 +00:00
Luke Leighton
cef258f1c9 fixing joining to domain plus something weird going down with nt logins... 0001-01-01 00:00:00 +00:00
Luke Leighton
e4d92ff9df sys_select added one more argument (read, write selectors). 0001-01-01 00:00:00 +00:00