1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

3174 Commits

Author SHA1 Message Date
Andrew Tridgell
6d506ee641 changed %g to %3.1f to be friendly to our poor snprintf() code -
Andrew Tridgell
835b9881c0 changed message is connections.tdb doesn't exist -
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
-
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!
-
Andrew Tridgell
7067aeecab this was left out from the 2.0.6 merge -
Andrew Tridgell
c89d29cc5e first pass at the database code for Samba. This also includes a test
suite and a very simple tool for manuipulating the databases.

the main code is in tdb/tdb.c and includes both mmap and file based
IO. All databases auto-expand and allow multiple simultaneous writers.

the next step is using this new capability in lots of places in Samba
where we have existing ad-hoc databases
-
Jeremy Allison
023f90e766 Fix based on code from monyo@home.monyo.com to fix multibyte continuation
issues.
Jeremy.
-
Jeremy Allison
886ad59d79 Fix from tulipant-gergely@dbrt.hu for returning incorrect error code
on user auth fail.
Jeremy.
-
Jeremy Allison
8f93c08881 *Finally*. Correct patch to fix timestamp problems from Paul Eggert <eggert@twinsun.com>.
I wish I had written this one :-).
Jeremy.
-
Andrew Tridgell
4058eb5bff added basic nsswitch support - this allows you to use a "wins" entry
in a /etc/nsswitch.conf hosts line.

Only tested on RH6.1, but should work on a broad range of Linux
distributions. It could probably be made to work with Solaris pretty
easily.

It does not build by default. Build it with "make nsswitch"
-
Andrew Tridgell
4a20579571 more files from 2.0.6 -
Andrew Tridgell
c3a30ce459 update version to pre-3.0.0 -
Andrew Tridgell
599a7e7f9e client/smbspool.c from 2.0.6 -
Andrew Tridgell
dadad3ed67 lib/fnmatch.c from 2.0.6 -
Andrew Tridgell
452776a5a7 printing/print_cups.c from 2.0.6 -
Andrew Tridgell
a3d7ec0c9d interfaces.h from 2.0.6 -
Andrew Tridgell
4e1458b8c1 interfaces.c from 2.0.6 -
Andrew Tridgell
955d187139 util_sec.c from 2.0.6 -
Jeremy Allison
decc6ebca2 Unicode conversion fix in Japanese environment from Motonobu TAKAHASHI.
Jeremy.
-
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 -
Andrew Tridgell
453a822a76 first pass at updating head branch to be to be the same as the SAMBA_2_0 branch -
Luke Leighton
054195df9b changed function name of get_home_dir() to get_unixhome_dir(), to stop
clash with gnu readline library.

fixed issue with [homes] service not being there - call lp_add_home()
just before starting the msrpc processing.
-
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.
-
Luke Leighton
aa3c659a8d delineation between smb and msrpc more marked. smbd now constructs
pdus, and then feeds them over either a "local" function call or a "remote"
function call to an msrpc service.  the "remote" msrpc daemon, on the
other side of a unix socket, then calls the same "local" function that
smbd would, if the msrpc service were being run from inside smbd.

this allows a transition from local msrpc services (inside the same smbd
process) to remote (over a unix socket).

removed reference to pipes_struct in msrpc services.  all msrpc processing
functions take rpcsrv_struct which is a structure containing state info
for the msrpc functions to decode and create pdus.

created become_vuser() which does everything not related to connection_struct
that become_user() does.

removed, as best i could, connection_struct dependencies from the nt spoolss
printing code.

todo: remove dcinfo from rpcsrv_struct because this stores NETLOGON-specific
info on a per-connection basis, and if the connection dies then so does
the info, and that's a fairly serious problem.

had to put pretty much everything that is in user_struct into parse_creds.c
to feed unix user info over to the msrpc daemons.  why?  because it's
expensive to do unix password/group database lookups, and it's definitely
expensive to do nt user profile lookups, not to mention pretty difficult
and if you did either of these it would introduce a complication /
unnecessary interdependency.  so, send uid/gid/num_groups/gid_t* +
SID+num_rids+domain_group_rids* + unix username + nt username + nt domain
+ user session key etc.  this is the MINIMUM info identified so far that's
actually implemented.  missing bits include the called and calling
netbios names etc.  (basically, anything that can be loaded into
standard_sub() and standard_sub_basic()...)
-
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
-
Luke Leighton
631814302d jerry spotted that get_domain_sids() was being called with the wrong
arguments: get_any_dc_name() was being called with a server name
not a domain name.  oops.
-
Luke Leighton
b2ea37a8f1 moved sys/un.h to after sys/socket.h. done a gnu autoconf around sys/un.h -
Luke Leighton
5e68403bbb parsing code for transferring unix and nt security credentials over-the-wire.
at present, a unix password is missing from the unix credentials, but is
not _actually_ expected to be needed.  weeelll... maybe :-)

this is used to transfer credentials between smbd and msrpc daemons, down
a unix socket, so that the unix and nt credentials can be inherited by
an msrpc daemon called up from smbd.
-
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.
-
Luke Leighton
2245b0c6d1 the first independent msrpc daemon - lsarpcd.
one horrible cut / paste job from smbd, plus a code split of shared
components between the two.

the job is not _yet_ complete, as i need to be able to do a become_user()
call for security reasons.  i picked lsarpcd first because you don't
_need_ security on it (microsoft botched so badly on this one, it's not
real.  at least they fixed this in nt5 with restrictanonymous=0x2).
fixing this involves sending the current smb and unix credentials down
the unix pipe so that the daemon it eventually goes to can pick them
up at the other end.

i can't believe this all worked!!!
-
Luke Leighton
bf9422832c reenabled retry_time (commented out accidentally in name_status) -
Luke Leighton
5e5a1dceee first version of msrpc agent redirector code. client-side only. -
Luke Leighton
a3af3b4312 created create_pipe_socket() function. -
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.
-
Luke Leighton
84d7cc6323 argh. trying to get the nmb agent code to filter out "self" packets. -
Luke Leighton
49c157eae4 even more cool! nmb-agent moved over to new vagent style, too! -
Luke Leighton
7bb2e55d0d cool! created higher-order function table for agent redirection. -
Luke Leighton
2c778313b8 more similar agent code -
Luke Leighton
b4306cbf06 nmb agent memory free problems -
Luke Leighton
9ba9df453a trying to make redirector agent code same base. -
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).
-
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!
-
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!
-
Luke Leighton
d54a64ae3a starting "connection reuse" system in smb-agent. added version number
which isn't actually used right now :-)
-
Luke Leighton
a47cc64470 i always get caught out with non-gnu-readline code mods :-) -
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).
-
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.
-
Luke Leighton
f33e4ca930 promptline undefined (pline) -
Luke Leighton
dd3ccdd7d9 new get_any_dc_name() function allows lookups of trusted domains from
lp_trusted_domains() parameter, so trusted domain logins should work,
right, if you put user = TRUSTED_DOMAIN\NTuser in "domain name map", right?

right - as _long_ as you're not using NTLMv2, because the damn NT username
gets mapped to the damn unix name too early, and NTLMv2 challenge-responses
are based on the client's user name, client's domain name, client's host name
etc damn etc.

so it becomes necessary to stop using char* username because this allows
for massive amounts of confusion as to which username is being referred to.
the underlying unix username on the local unix system that is associated with
the smbd process that represents the NT username?  or the NT username itself?
-
Luke Leighton
e21367c0eb domain_client_validate() no longer takes serverlist, it calls
get_any_dc_name().
-