1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-18 00:23:50 +03:00
Commit Graph

109 Commits

Author SHA1 Message Date
Andrew Tridgell
756f28ac95 r2159: converted samba4 over to UTF-16.
I had previously thought this was unnecessary, as windows doesn't use
standards compliant UTF-16, and for filesystem operations treats bytes
as UCS-2, but Bjoern Jacke has pointed out to me that this means we
don't correctly store extended UTF-16 characters as UTF-8 on
disk. This can be seen with (for example) the gothic characters with
codepoints above 64k.

This commit also adds a LOCAL-ICONV torture test that tests the first
1 million codepoints against the system iconv library, and tests 5
million random UTF-16LE buffers for identical error handling to the
system iconv library.

the lib/iconv.c changes need backporting to samba3
2007-10-10 12:58:27 -05:00
Andrew Bartlett
86f61568ea r2041: Fix NTLMSSP RPC sealing, client -> win2k3 server.
The bug (found by tridge) is that Win2k3 is being tighter about the
NTLMSSP flags.  If we don't negotiate sealing, we can't use it.

We now have a way to indicate to the GENSEC implementation mechanisms
what things we want for a connection.

Andrew Bartlett
2007-10-10 12:58:19 -05:00
Andrew Tridgell
f6dc62bf11 r2040: fixed a memory handling error in clisocket (caught with valgrind) 2007-10-10 12:58:19 -05:00
Andrew Tridgell
6ffdfd7799 r1985: take advantage of the new talloc in a few more places 2007-10-10 12:58:14 -05:00
Andrew Tridgell
03c341aca7 r1984: this change is what you should read to understand the new talloc()
It simplifies our structure handling a lot, making the code shorter
and easier to understand. Look at the diff carefully and see if you
can understand it. If you're still confused then please ask.
2007-10-10 12:58:14 -05:00
Andrew Tridgell
e35bb094c5 r1983: a completely new implementation of talloc
This version does the following:

  1) talloc_free(), talloc_realloc() and talloc_steal() lose their
     (redundent) first arguments

  2) you can use _any_ talloc pointer as a talloc context to allocate
     more memory. This allows you to create complex data structures
     where the top level structure is the logical parent of the next
     level down, and those are the parents of the level below
     that. Then destroy either the lot with a single talloc_free() or
     destroy any sub-part with a talloc_free() of that part

  3) you can name any pointer. Use talloc_named() which is just like
     talloc() but takes the printf style name argument as well as the
     parent context and the size.

The whole thing ends up being a very simple piece of code, although
some of the pointer walking gets hairy.

So far, I'm just using the new talloc() like the old one. The next
step is to actually take advantage of the new interface
properly. Expect some new commits soon that simplify some common
coding styles in samba4 by using the new talloc().
2007-10-10 12:58:14 -05:00
Andrew Tridgell
8925b8b219 r1941: - fixed an allocation error with querying security descriptors remotely
- print the received security_descriptor in the smbclient "acl" command

- make sure we zero the alignment data in nttrans packet sends
2007-10-10 12:58:12 -05:00
Stefan Metzmacher
0164cac6df r1910: this should not be a local var in this block
metze
2007-10-10 12:58:10 -05:00
Andrew Tridgell
2ce4028842 r1897: added a choose_called_name() function that allows us to more sanely
handle connections using the IP as the server name, while not trying
for NBT name resolution on names like "192" and "192.168.1.2".

also removed the ip address argument to smbcli_socket_connect() as it
isn't used and doesn't really make sense.
2007-10-10 12:58:09 -05:00
Andrew Tridgell
30ab38559e r1896: stricter check on packet parsing for NBT session replies 2007-10-10 12:58:09 -05:00
Andrew Tridgell
cd8887293e r1893: add a commented out lump of code to implement the "by the SPEC"
ALL_INFO queryfileinfo level. It is useful having it here as many
non-Microsoft servers implement it this way, which breaks just about
all the torture tests, so when testing against these broken systems
just change this one #if line and recompile smbtorture.
2007-10-10 12:58:08 -05:00
Stefan Metzmacher
d3123c2e73 r1883: I don't know why this was broken...
tridge: can you please check if this is correct,
        I have only compiled it, but haven'T run it.

metze
2007-10-10 12:58:08 -05:00
Andrew Tridgell
cef94978f4 r1824: nicer handling of NBT session replies, and handling of bad packets
with the async SMB code
2007-10-10 12:58:00 -05:00
Andrew Tridgell
e53d32c65a r1819: changed "smb ports" to be a LIST parameter type in loadparm (its a classic case for a list) 2007-10-10 12:57:59 -05:00
Andrew Bartlett
cb74d52b56 r1796: Enable server-side SPNEGO, now that I have fixed the server-side SMB
signing code to be able to cope.

Andrew Bartlett
2007-10-10 12:57:57 -05:00
Andrew Bartlett
90d70a63ee r1769: Add a new torture test to check vuid properties, and SPNEGO/non-SPNEGO games.
Andrew Bartlett
2007-10-10 12:57:55 -05:00
Andrew Bartlett
32b45fc9e8 r1768: Add some debugs to assist in SMB signing debugging.
Andrew Bartlett
2007-10-10 12:57:55 -05:00
Andrew Bartlett
b176151b72 r1746: Remove more cruft from the SMB signing code.
Andrew Bartlett
2007-10-10 12:57:53 -05:00
Andrew Bartlett
8830603e4b r1745: More work on cleaning up SMB signing.
This removes the function pointer mess from the SMB signing code.

Andrew Bartlett
2007-10-10 12:57:52 -05:00
Andrew Tridgell
fc75dc4902 r1739: fixed the padding in setpathinfo, noticed when forcing negotiated ascii strings 2007-10-10 12:57:51 -05:00
Andrew Tridgell
b6664bdd0f r1738: honor the "unicode=yes/no" option in the SMB client library 2007-10-10 12:57:51 -05:00
Andrew Bartlett
68a6d5aeb3 r1735: Clean up SMB signing - we don't have more than one 'real' way to sign
a packet, so don't pretend we do...

Andrew Bartlett
2007-10-10 12:57:51 -05:00
Andrew Bartlett
b90b04e84b r1729: Make the SMB signing code more generic (to share more between client and servers).
Andrew Bartlett
2007-10-10 12:57:50 -05:00
Andrew Bartlett
4d563d7e4a r1725: Remove a silly 'utility' function.
Andrew Bartlett
2007-10-10 12:57:50 -05:00
Andrew Tridgell
566b7a9ce9 r1712: this should fix a bug with a spinning client when a server dies
unexpectedly. bug found by abartlett.
2007-10-10 12:57:50 -05:00
Andrew Bartlett
64fcd8eceb r1686: Don't use a void* for the context inside the SMB signing code.
Andrew Bartlett
2007-10-10 12:57:48 -05:00
Andrew Tridgell
8685a584c9 r1676: - improved the handling of username/password in locktest and gentest
- use lp_maxprotocol() in the libcli/raw/ negotiate code, so we obey
  the smb.conf "max protocol" option

- better handling of -M option in masktest
2007-10-10 12:57:48 -05:00
Andrew Tridgell
17a3315297 r1674: fixed a bug in the handling of STR_LEN8BIT flagged strings 2007-10-10 12:57:48 -05:00
Stefan Metzmacher
8441750fd9 r1654: rename cli_ -> smbcli_
rename CLI_ -> SMBCLI_

metze
2007-10-10 12:57:47 -05:00
Andrew Tridgell
326fdc8c9d r1635: when a transport dies, setup errors for all pending sends and recvs, plus disalllow any more sends 2007-10-10 12:57:45 -05:00
Andrew Tridgell
81c450b434 r1634: to get signing right for async requests we must send requests in
order. Fixed the linked list add to always add to the end for outgoing
requests.
2007-10-10 12:57:45 -05:00
Andrew Tridgell
d7e2f39b90 r1633: fixed a couple of async oplock handling errors 2007-10-10 12:57:45 -05:00
Andrew Tridgell
35f4ad4700 r1631: don't use req->transport after req has been destroyed 2007-10-10 12:57:45 -05:00
Andrew Tridgell
bd4106a8e5 r1618: fixed the receipt of multi-part replies to SMBtrans2 2007-10-10 12:57:44 -05:00
Andrew Bartlett
9efc94eeaf r1604: Samba4 avoids memcpy() as much as possible - we don't need to make a copy here.
Andrew Bartlett
2007-10-10 12:57:43 -05:00
Andrew Tridgell
6edbc55ddd r1603: fixed in.size to not overstate the packet size by 4 bytes
my apologies to abartlett for thinking this was his bug!
2007-10-10 12:57:43 -05:00
Andrew Tridgell
de764d9004 r1602: make sure we honor the use_spnego flag 2007-10-10 12:57:43 -05:00
Andrew Tridgell
96bf4da3ed r1578: the first stage of the async client rewrite.
Up to now the client code has had an async API, and operated
asynchronously at the packet level, but was not truly async in that it
assumed that it could always write to the socket and when a partial
packet came in that it could block waiting for the rest of the packet.

This change makes the SMB client library full async, by adding a
separate outgoing packet queue, using non-blocking socket IO and
having a input buffer that can fill asynchonously until the full
packet has arrived.

The main complexity was in dealing with the events structure when
using the CIFS proxy backend. In that case the same events structure
needs to be used in both the client library and the main smbd server,
so that when the client library is waiting for a reply that the main
server keeps processing packets. This required some changes in the
events library code.

Next step is to make the generated rpc client code use these new
capabilities.
2007-10-10 12:57:42 -05:00
Stefan Metzmacher
0bb50dcf1c r1547: rename 'enum <bla>_level' -> 'enum smb_<bla>_level'
e.g. we now have 'union smb_mkdir' and 'enum smb_mkdir_level' in sync

we may should also rename 'RAW_MKDIR_*' -> 'SMB_MKDIR_*'

metze
2007-10-10 12:57:41 -05:00
Andrew Bartlett
35b83eb329 r1521: Updates to our SMB signing code.
- This causes our client and server code to use the same core code,
  with the same debugs etc.
- In turn, this will allow the 'mandetory/fallback' signing algorithms
  to be shared, and only written once.

Updates to the SPNEGO code
- Don't wrap an empty token to the server, if we are actually already finished.

Andrew Bartlett
2007-10-10 12:57:39 -05:00
Stefan Metzmacher
463982bf3f r1494: fix debug message
metze
2007-10-10 12:57:35 -05:00
Andrew Bartlett
de5da66939 r1475: More kerberos work
- We can now connect to hosts that follow the SPNEGO RFC, and *do not*
give us their principal name in the mechListMIC.
 - The client code now remembers the hostname it connects to

- We now kinit for a user, if there is not valid ticket already

- Re-introduce clock skew compensation

TODO:
 - See if the username in the ccache matches the username specified
 - Use a private ccache, rather then the global one, for a 'new' kinit
 - Determine 'default' usernames.
  - The default for Krb5 is the one in the ccache, then $USER
  - For NTLMSSP, it's just $USER

Andrew Bartlett
2007-10-10 12:57:34 -05:00
Stefan Metzmacher
ffb7ba35cd r1469: fix a segfault and compiler warning,
introduced by the "compiler warning fix" in rev 1460...

metze
2007-10-10 12:57:33 -05:00
Andrew Bartlett
cea578d6f3 r1462: GENSEC Kerberos and SPENGO work:
- Spelling - it's SPNEGO, not SPENGO
 - SMB signing - Krb5 logins are now correctly signed
 - SPNEGO - Changes to always tell GENSEC about incoming packets, empty or not.

Andrew Bartlett
2007-10-10 12:57:32 -05:00
Andrew Bartlett
10a973da88 r1460: Avoid a compile warning.
Andrew Bartlett
2007-10-10 12:57:32 -05:00
Stefan Metzmacher
e3760fcc17 r1409: if we have no user name don't use extended security
the capabilities in the union smb_sesssetup should be used to decide
if we can use extented security

metze
2007-10-10 12:56:54 -05:00
Stefan Metzmacher
e06898f88c r1406: I got spnego in the smb client working
so I set 'use spnego = True'

metze
2007-10-10 12:56:54 -05:00
Stefan Metzmacher
38e00f8719 r1348: get gensec backend by OID instead of name
metze
2007-10-10 12:56:51 -05:00
Stefan Metzmacher
2445cceba9 r1345: add extended security spnego support to the smb client
code

set lp_use_spnego = False, because I can't get it working yet
but I commit it so others can help me

metze
2007-10-10 12:56:51 -05:00
Tim Potter
de5984c956 r1268: varient -> variant 2007-10-10 12:56:46 -05:00