1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

791 Commits

Author SHA1 Message Date
Andrew Tridgell
f4d07d7d3b r6338: ADS style GETDC response now works well enough that WinXP can join
Samba4 without Samba3 nmbd
2007-10-10 13:11:33 -05:00
Andrew Tridgell
c29279355c r6335: at debug level 10, save netlogon and ntlogon packets that fail to parse 2007-10-10 13:11:33 -05:00
Andrew Tridgell
61d65d100d r6333: removed an extraneous line (pointed out by metze) 2007-10-10 13:11:32 -05:00
Andrew Tridgell
1ea4ed4ad1 r6331: added IDL and test suite for the ADS style response to a datagram netlogon query.
Note that this response is almost identical to the CLDAP netlogon
response, so adding that will now be quite easy.
2007-10-10 13:11:32 -05:00
Andrew Tridgell
df146d64eb r6323: added server side support for dgram NTLOGON requests. NT4 workstations can now login
to a Samba4 domain.
2007-10-10 13:11:31 -05:00
Andrew Tridgell
08ded62156 r6321: added IDL and test suite for NBT dgram 'sam logon' request (sent by
clients when a user tries to login)
2007-10-10 13:11:31 -05:00
Andrew Tridgell
4507bdc339 r6320: some minor netlogon datagram fixes - NT4 can now join a Samba4 domain without
Samba3 nmbd
2007-10-10 13:11:31 -05:00
Andrew Tridgell
406217262d r6288: the nbt dgram server now responds to GETDC requests. It works with our
test suite, but doesn't yet seem to satisfy a nt4 client. I'm
investigating.
2007-10-10 13:11:29 -05:00
Andrew Tridgell
f8e77fcdea r6287: sorted out a small but surprisingly tricky dependency problem with the
ndr code for handling sids and security descriptors now that we have a
sid in the nbt IDL
2007-10-10 13:11:29 -05:00
Andrew Tridgell
d7e6e395ce r6248: added parsing of type 10 UAS announce netlogon packets 2007-10-10 13:11:28 -05:00
Andrew Tridgell
3b34df6a67 r6247: added the server side code for receiving mailslot requests, and
parsing incoming netlogon requests. No replies are sent yet.
2007-10-10 13:11:28 -05:00
Andrew Tridgell
52ccdb79bc r6245: receive and parse the GETDC response in the NBT-DGRAM test. The test
now tries to bind to port 138 if possible, so if you run it as root
and smbd/nmbd is not running then it works against windows servers
2007-10-10 13:11:28 -05:00
Andrew Tridgell
a7634625db r6223: added a bit more datagram infrastructure and the beginnings of a test
suite. The NBT-DGRAM test does a UDP/138 netlogon request, to which a
windows server sends a reply, but the windows server sends the reply
to the wrong port (it always sends to 138), so the test suite doesn't
see it.
2007-10-10 13:11:27 -05:00
Andrew Tridgell
f20e7e5200 r6209: started added code to support mailslot requests over UDP/138
datagrams. This adds the IDL to parse mailslot packets, plus mailslot
dispatch and listener registration code.

mailslots are used for UDP/138 browse and netlogon packets
2007-10-10 13:11:26 -05:00
Andrew Tridgell
47e1452da0 r6185: added LIBCLI_DGRAM to the list of libs to be built as part of LIBCLI 2007-10-10 13:11:24 -05:00
Andrew Tridgell
10d64a5253 r6184: the beginnings of the libcli/dgram/ library, and the dgram
server. Currently just listens on port 138 and parses the packets
(using IDL like the rest of NBT). This allows me to develop the
structures and test with real packets
2007-10-10 13:11:24 -05:00
Andrew Bartlett
e074d63f3d r6113: Move GENSEC and the kerberos code out of libcli/auth, and into
auth/gensec and auth/kerberos.

This also pulls the kerberos configure code out of libads (which is
otherwise dead), and into auth/kerberos/kerberos.m4

Andrew Bartlett
2007-10-10 13:11:20 -05:00
Andrew Bartlett
ed5755d9d1 r6094: Work on the Kerberos code recently merged from Samba 3.0. This fixes
up issues I introduced during the merge, that caused a segfault.

I've still not got the keytab code to work for me (using Samba3 to
generate the keytab) so this is still not fully tested, but it's
better than it was.

To add debugging, I now use the krb5_get_error_message() function from
Heimdal when present, to return the custom error string, which
contains far, far more information than the simple error code does.

(This last point may well be worth merging back into 3.0)

Andrew Bartlett
2007-10-10 13:11:18 -05:00
Andrew Bartlett
6439de9ec8 r6078: Correctly fix the failures for NT1 (not SPNEGO) session setups in the
client.  The issue was actually a cut-and-paste bug, I was filling in
the .old not the .nt1 part of the union.

I've also removed the 'error checks' - I'll shortly document the API
for the credentials code to clarify that it will always return a
pointer here, except in cases of programmer error.

Tridge:  I hope this is OK.

Andrew Bartlett
2007-10-10 13:11:17 -05:00
Andrew Tridgell
ff6663aac8 r6074: fixed non-spnego connections for new credentials code 2007-10-10 13:11:17 -05:00
Andrew Bartlett
1e0e66d720 r6030: Missing from previous commit, a small header file to link
libcli/auth/schannel.c and libcli/auth/schannel_sign.c

Andrew Bartlett
2007-10-10 13:11:15 -05:00
Andrew Bartlett
2301a4b38a r6028: A MAJOR update to intergrate the new credentails system fully with
GENSEC, and to pull SCHANNEL into GENSEC, by making it less 'special'.

GENSEC now no longer has it's own handling of 'set username' etc,
instead it uses cli_credentials calls.

In order to link the credentails code right though Samba, a lot of
interfaces have changed to remove 'username, domain, password'
arguments, and these have been replaced with a single 'struct
cli_credentials'.

In the session setup code, a new parameter 'workgroup' contains the
client/server current workgroup, which seems unrelated to the
authentication exchange (it was being filled in from the auth info).

This allows in particular kerberos to only call back for passwords
when it actually needs to perform the kinit.

The kerberos code has been modified not to use the SPNEGO provided
'principal name' (in the mechListMIC), but to instead use the name the
host was connected to as.  This better matches Microsoft behaviour,
is more secure and allows better use of standard kerberos functions.

To achieve this, I made changes to our socket code so that the
hostname (before name resolution) is now recorded on the socket.

In schannel, most of the code from librpc/rpc/dcerpc_schannel.c is now
in libcli/auth/schannel.c, and it looks much more like a standard
GENSEC module.  The actual sign/seal code moved to
libcli/auth/schannel_sign.c in a previous commit.

The schannel credentails structure is now merged with the rest of the
credentails, as many of the values (username, workstation, domain)
where already present there.  This makes handling this in a generic
manner much easier, as there is no longer a custom entry-point.

The auth_domain module continues to be developed, but is now just as
functional as auth_winbind.  The changes here are consequential to the
schannel changes.

The only removed function at this point is the RPC-LOGIN test
(simulating the load of a WinXP login), which needs much more work to
clean it up (it contains copies of too much code from all over the
torture suite, and I havn't been able to penetrate its 'structure').

Andrew Bartlett
2007-10-10 13:11:15 -05:00
Andrew Bartlett
b5260cf0d4 r6027: Add copyright, and add a useful debug message.
Andrew Bartlett
2007-10-10 13:11:15 -05:00
Andrew Bartlett
ef7f9a01b4 r6026: Update the kerberos keytab code to match Samba3 again.
(untested at this point).

Andrew Bartlett
2007-10-10 13:11:15 -05:00
Andrew Bartlett
13d09c8e9a r6025: Remove unused variables. This code will be modified again for the new
cli_credentials code shortly.

Andrew Bartlett
2007-10-10 13:11:15 -05:00
Andrew Bartlett
d6c80ff74b r5992: Rename schannel.c -> schannel_sign.c. The rest of the schannel code
(from librpc) will be moved into schannel.c soon.

Andrew Bartlett
2007-10-10 13:11:13 -05:00
Andrew Bartlett
e13c671619 r5988: Fix the -P option (use machine account credentials) to use the Samba4
secrets system, and not the old system from Samba3.

This allowed the code from auth_domain to be shared - we now only
lookup the secrets.ldb in lib/credentials.c.

In order to link the resultant binary, samdb_search() has been moved
from deep inside rpc_server into lib/gendb.c, along with the existing
gendb_search_v().  The vast majority of this patch is the simple
rename that followed,

(Depending on the whole SAMDB for just this function seemed pointless,
and brought in futher dependencies, such as smbencrypt.c).

Andrew Bartlett
2007-10-10 13:11:12 -05:00
Andrew Bartlett
0453f9d05d r5941: Commit this patch much earlier than I would normally prefer, but metze needs a working tree...
The main volume of this patch was what I started working on today:
 - Cleans up memory handling around DCE/RPC pipes, to have a parent talloc context.
 - Uses sepereate inner loops for some of the DCE/RPC tests

The other and more important part of this patch fixes issues
surrounding the new credentials framwork:

This makes the struct cli_credentials always a talloc() structure,
rather than on the stack.  Parts of the cli_credentials code already
assumed this.

There were other issues, particularly in the DCERPC over SMB handling,
as well as little things that had to be tidied up before test_w2k3.sh
would start to pass.

Andrew Bartlett
2007-10-10 13:11:11 -05:00
Stefan Metzmacher
08d4c3b9f8 r5940: fix schannel against w2k, it skips the confounder in the signature (24 bytes) for singed packets
but it accepts 32 bytes from the client.

(w2k3 accept it the otherway arround too)

metze
2007-10-10 13:11:10 -05:00
Jelmer Vernooij
4ad481cfe5 r5929: Use cli_credentials for the SMB functions as well.
Fix a couple of bugs in the new cli_credentials code
2007-10-10 13:11:09 -05:00
Jelmer Vernooij
ccefd78233 r5928: Use cli_credentials in:
- gtk+ (returned by GtkHostBindingDialog as well now)
 - torture/
 - librpc/
 - lib/com/dcom/
2007-10-10 13:11:08 -05:00
Jelmer Vernooij
1d49b57c50 r5917: First step in using the new cli_credentials structure. This patch
puts support for it into popt_common, adds a few utility functions
(in lib/credentials.c) and the callback functions for the command-line
(lib/cmdline/credentials.c). Comments are welcome :-)
2007-10-10 13:11:08 -05:00
Andrew Bartlett
824289dcc2 r5902: A rather large change...
I wanted to add a simple 'workstation' argument to the DCERPC
authenticated binding calls, but this patch kind of grew from there.

With SCHANNEL, the 'workstation' name (the netbios name of the client)
matters, as this is what ties the session between the NETLOGON ops and
the SCHANNEL bind.  This changes a lot of files, and these will again
be changed when jelmer does the credentials work.

I also correct some schannel IDL to distinguish between workstation
names and account names.  The distinction matters for domain trust
accounts.

Issues in handling this (issues with lifetime of talloc pointers)
caused me to change the 'creds_CredentialsState' and 'struct
dcerpc_binding' pointers to always be talloc()ed pointers.

In the schannel DB, we now store both the domain and computername, and
query on both.  This should ensure we fault correctly when the domain
is specified incorrectly in the SCHANNEL bind.

In the RPC-SCHANNEL test, I finally fixed a bug that vl pointed out,
where the comment claimed we re-used a connection, but in fact we made
a new connection.

This was achived by breaking apart some of the
dcerpc_secondary_connection() logic.

The addition of workstation handling was also propogated to NTLMSSP
and GENSEC, for completeness.

The RPC-SAMSYNC test has been cleaned up a little, using a loop over
usernames/passwords rather than manually expanded tests.  This will be
expanded further (the code in #if 0 in this patch) to use a newly
created user account for testing.

In making this test pass test_rpc.sh, I found a bug in the RPC-ECHO
server, caused by the removal of [ref] and the assoicated pointer from
the IDL.  This has been re-added, until the underlying pidl issues are
solved.
2007-10-10 13:11:07 -05:00
Andrew Bartlett
b484776cc4 r5877: It is not an error to have a zero-length secret, after decryption.
Andrew Bartlett
2007-10-10 13:11:06 -05:00
Jelmer Vernooij
ea61ec1122 r5866: Add InitShutdown IDL and torture test.
Implement push side of NDR_LEN4|NDR_NOTERM strings (pull side was already present)
2007-10-10 13:11:05 -05:00
Stefan Metzmacher
f543eb4ede r5737: add some error codes
metze
2007-10-10 13:11:01 -05:00
Andrew Bartlett
de02c7c222 r5668: Add tests to RPC-SAMLOGON to test for user@REALM style logins. These
need a NULL domain (or a "" domain, except this breaks NTLMv2, and I
need to look into it a bit more).

Add support to the Samba4 server for these logins.  This will need
extension when we handle trusted domains as a DC, as it is a principal
name, not just another format for the username.

Andrew Bartlett
2007-10-10 13:10:58 -05:00
Andrew Bartlett
69114b4a8e r5667: Move schannel state into libcli/auth (as it belongs with schannel,
which will move in with the rest of GENSEC shortly).

Add the RID as another element in the schannel state.

Andrew Bartlett
2007-10-10 13:10:58 -05:00
Alexander Bokovoy
eb57a58788 r5646: state->loadfile might be NULL after allocation so this is really
should be NT_STATUS_HAVE_NO_MEMORY(state->loadfile) instead of
NT_STATUS_NOT_OK_RETURN(status).
2007-10-10 13:10:56 -05:00
Stefan Metzmacher
87ff661703 r5601: add a gsskrb5 backend that uses lorikeet-heimdal's new gssapi with
GSS_C_DCE_STYLE support, it's just a start and does work correctly yet

metze
2007-10-10 13:10:55 -05:00
Tim Potter
c23f767a9f r5551: Protect against falling off the end of the name resolve order list
if a name is not found.
2007-10-10 13:10:54 -05:00
Tim Potter
328f37a3e8 r5550: Initialise retry count - valgrind was freaking out because this value
was not set.
2007-10-10 13:10:54 -05:00
Andrew Tridgell
cec1672662 r5451: - added separate wrepl_associate(), wrepl_pull_table() and wrepl_pull_names() functions, with reasonable
parameters, so callers don't need to deal directly with wins replication packet structures

- converted the NBT-WINSREPLICATION torture test to use the new APIs
2007-10-10 13:10:47 -05:00
Jelmer Vernooij
2e1e8db6dc r5437: Allow Samba4 to be compiled by tcc (www.tinycc.org). It still crashes when linking though. 2007-10-10 13:10:45 -05:00
Andrew Tridgell
bc8d60c918 r5414: - added libcli/wins/, a basic client library for WINS replication
- added a new IDL type "udlongr", which is like udlong, but with the
  two uint32 halves reversed

- modified the winsrepl.idl to cope with a wider range of packets
2007-10-10 13:10:43 -05:00
Andrew Tridgell
6e2feef125 r5405: try to use NBT name pointers when a netbios name is repeated in a NBT
packet. This allows much longer names to fit within the limits of NBT
name packets (rfc1002.txt also says this should be done, although
Samba3 never generates them).

The main reason for doing this is it means that our NBT name pointer
decoding code is tested with the smbtorture tests
2007-10-10 13:10:42 -05:00
Andrew Tridgell
dd3d4ded21 r5404: allow spaces in the string representation of nbt names 2007-10-10 13:10:42 -05:00
Andrew Tridgell
76c49851b9 r5398: fixed encoding of *SMBSERVER name (thanks to Karl Melcher for spotting this) 2007-10-10 13:09:51 -05:00
Andrew Tridgell
666cc65d10 r5396: fixed parsing of NBT type 0xc0 compressed name pointers 2007-10-10 13:09:51 -05:00
Andrew Tridgell
8dc2a028d3 r5392: added "secure" WINS server processing. Send a WACK on name
registrations from anyone who isn't a current owner, then query the
owner addresses to see if they still want it.
2007-10-10 13:09:50 -05:00