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

784 Commits

Author SHA1 Message Date
Andrew Tridgell
bde98850be r8247: remove the free of fullname in nbtname.c for now.
Metze, the ndr_token_store() code is storing temporary pointers into
this string in the token list, which means we are referring to freed
memory when we scan the token list. A better key might be a pointer
into the ndr buffer?
(This used to be commit 6a4e8cc991)
2007-10-10 13:19:25 -05:00
Stefan Metzmacher
e296c8de6e r8212: fix pushing of nbt_string's:
- we now use an ndr_token_list, for the nbt string label pointer offsets
  this avoids to scan the whole buffer

- we need to check for already send string on a per component basis
  not only for the fullname

e.g.
w2k3 response this in the CLDAP netlogon replies

forest: w2k3.vmnet1.vm.base
dns_name: sub1.
pdc_dns_name: w2k3-104.

and this will be interpreted like

forest: w2k3.vmnet1.vm.base
dns_name: sub1.w2k3.vmnet1.vm.base
pdc_dns_name: w2k3-104.w2k3.vmnet1.vm.base

metze
(This used to be commit d18303a0e2)
2007-10-10 13:19:20 -05:00
Jeremy Allison
3de3d6a02d r8174: Check DOS error codes in torture chkpath test.
Jeremy.
(This used to be commit ff58ecad04)
2007-10-10 13:19:17 -05:00
Stefan Metzmacher
cf601f71aa r8134: remove unused var
metze
(This used to be commit f308b72b19)
2007-10-10 13:19:12 -05:00
Andrew Tridgell
65ae28dfa7 r8125: fixed an error code mapping based on the updated torture tests
(This used to be commit a3b8a00d7f)
2007-10-10 13:19:11 -05:00
Andrew Tridgell
934831686c r8115: added support for 2 more dos error codes found during testing
(This used to be commit 97cb705713)
2007-10-10 13:19:10 -05:00
Andrew Tridgell
950f662484 r8111: fixed the client library to work against w2k3 with nt status codes
disabled. The main change is to turn off spnego, which cannot work at
all without nt status codes (w2k3 gives a ERRHRD:ERRgeneral error when
you try)

I also modified NT_STATUS_EQUAL() to allow for nt->dos code equality,
but only when nt status codes are disabled in smb.conf. That keeps all
the existing torture code working, while still allowing us to
correctly catch the cases where forced dos error codes are needed

The dos->ntstatus mapping table has been removed completely, as it
doesn't really make sense, is impossible to get right, and with the
new dos status handling isn't needed. When matching a nt status code
to a dos status code it makes far more sense to map from the nt code
to the dos code and compare, rather than the reverse, as the nt->dos
mapping is what windows has to do internally, so there really is a
valid mapping table.
(This used to be commit f21274e07b)
2007-10-10 13:19:09 -05:00
Andrew Tridgell
b3383236a2 r8106: the use of a static string for dos error codes was causing problems in
the torture code. To fix this, get rid of dos_errstr() and instead
move the strings into the nt_errstr() table, using cpp to generate the
strings
(This used to be commit 3136ad9634)
2007-10-10 13:19:08 -05:00
Andrew Tridgell
e0d521ca79 r8104: - added support for our client library to not negotiate nt status codes, controlled
with 'nt status support' option.

- make nt_errstr() display nice strings for dos status codes encoded
  using NT_STATUS_DOS()

- no longer map between dos and nt status codes in the client library,
  instead return using NT_STATUS_DOS()

- fixed the RAW-CONTEXT test to look for
  NT_STATUS_DOS(ERRSRV, ERRbaduid) instead of NT_STATUS_INVALID_HANDLE
(This used to be commit ff5549e87f)
2007-10-10 13:19:08 -05:00
Andrew Tridgell
1050a54a3b r8003: ensure that we don't try to send a trans request with more than 64k data or params
(This used to be commit b4f2d17ace)
2007-10-10 13:18:57 -05:00
Andrew Tridgell
c58c7c4164 r8002: favor addresses on our local interfaces in NBT name resolution if
possible. This is needed because w2k3 will return bogus IPs in its
name resolution replies when it has an unplugged network interface.
(This used to be commit 2fafc23052)
2007-10-10 13:18:57 -05:00
Andrew Bartlett
025e03de54 r7970: This SMB signing code (merged from 3.0) turned out to be bogus.
Andrew Bartlett
(This used to be commit 817160ec1a)
2007-10-10 13:18:55 -05:00
Andrew Tridgell
d6c1ad5c17 r7941: fixed handling of ASN.1 objects bigger than 64k
(This used to be commit f88a601882)
2007-10-10 13:18:53 -05:00
Andrew Tridgell
152a6a00c3 r7865: changed pidl to take a "const void *" instead of a "void *" for the
structure in ndr_push_*() and ndr_print_*(). The push and print
functions really should not modify the structure.

metze, to make this work I had to change your spoolss hand
marshaller. Can you please check it is OK? I think that the IN and OUT
sides of that function are not ever called on the same structure, so I
think that attempt at remembering the value by assigning to
r->in._offered was not doing anything anyway, but please correct me if
I have misunderstood it.

If you really do need to remember something on those structures I'd
suggest the ndr_token_store() and ndr_token_retrieve() functions,
which are used by pidl for just this sort of thing.
(This used to be commit eee528be97)
2007-10-10 13:18:44 -05:00
Andrew Tridgell
bdee131f30 r7860: switch our ldb storage format to use a NDR encoded objectSid. This is
quite a large change as we had lots of code that assumed that
objectSid was a string in S- format.

metze and simo tried to convince me to use NDR format months ago, but
I didn't listen, so its fair that I have the pain of fixing all the
code now :-)

This builds on the ldb_register_samba_handlers() and ldif handlers
code I did earlier this week. There are still three parts of this
conversion I have not finished:

 - the ltdb index records need to use the string form of the objectSid
   (to keep the DNs sane). Until that it done I have disabled indexing on
   objectSid, which is a big performance hit, but allows us to pass
   all our tests while I rejig the indexing system to use a externally
   supplied conversion function

 - I haven't yet put in place the code that allows client to use the
   "S-xxx-yyy" form for objectSid in ldap search expressions. w2k3
   supports this, presumably by looking for the "S-" prefix to
   determine what type of objectSid form is being used by the client. I
   have been working on ways to handle this, but am not happy with
   them yet so they aren't part of this patch

 - I need to change pidl to generate push functions that take a
   "const void *" instead of a "void*" for the data pointer. That will
   fix the couple of new warnings this code generates.

Luckily it many places the conversion to NDR formatted records
actually simplified the code, as it means we no longer need as many
calls to dom_sid_parse_talloc(). In some places it got more complex,
but not many.
(This used to be commit d40bc2fa8d)
2007-10-10 13:18:44 -05:00
Andrew Tridgell
21d6a163a3 r7856: fixed warning of 'methods' shadowed variable
(This used to be commit c435843c66)
2007-10-10 13:18:43 -05:00
Andrew Tridgell
acd04c9281 r7855: fixed a typo
(This used to be commit a1155651e7)
2007-10-10 13:18:43 -05:00
Rafal Szczesniak
49417aaed7 r7814: Propagate the change in resolve_name_send function.
(This used to be commit 7abd634701)
2007-10-10 13:18:40 -05:00
Rafal Szczesniak
338bc0f58a r7813: Make async request independent from config file routines.
rafal
(This used to be commit 84315cdf0d)
2007-10-10 13:18:38 -05:00
Andrew Tridgell
bec0058124 r7810: don't give errors when the ldap server sends us reference replies
(This used to be commit f2b2d2626f)
2007-10-10 13:18:38 -05:00
Andrew Tridgell
5eccf719fb r7770: added ldaps support to our ldap client library
(This used to be commit 8f5c2e8682)
2007-10-10 13:18:34 -05:00
Andrew Tridgell
a40d966ff5 r7763: fixed some circular dependencies
(This used to be commit 3bdf89b0f7)
2007-10-10 13:18:32 -05:00
Andrew Bartlett
e578c33c2c r7757: Add NTLMv2 support to the NT1 Session setup (ie, not SPNEGO/NTLMSSP)
Session Setup code.

Add a mem_ctx argument to a few of the NTLMv2 support functions, and
add smb.conf options to control client NTLMv2 behaviour.

Andrew Bartlett
(This used to be commit 3f35cdb218)
2007-10-10 13:18:32 -05:00
Andrew Tridgell
7267cb3312 r7749: some bug fixes from testing with socket:testnonblock
- fixed some infinite loops in asn1.c

- ensure asn1 callers know if an error is end of buffer or bad data

- handle npending 0 in ldap server
(This used to be commit f22c3b84c8)
2007-10-10 13:18:30 -05:00
Andrew Tridgell
c7496c6cdb r7747: - simplified the ldap server buffer handling
- got rid of the special cases for sasl buffers

- added a tls_socket_pending() call to determine how much data is waiting on a tls connection

- removed the attempt at async handling of ldap calls. The buffers/sockets are all async, but the calls themselves
  are sync.
(This used to be commit 73cb4aad22)
2007-10-10 13:18:30 -05:00
Andrew Tridgell
68853a1c7b r7746: - added TLS support to our ldap server
- this involved changing the buffer handling in the ldap server quite a
  lot, as it didn't handle partial packets at all

- removed completely bogus asn1_object_length() function. You can't
  do that with BER/DER
(This used to be commit fed6f4cc6c)
2007-10-10 13:18:30 -05:00
Rafal Szczesniak
7a8315bddc r7736: Propagate change in resolve_name function. Let's use default methods
in this case.

rafal
(This used to be commit b0bae584a4)
2007-10-10 13:18:28 -05:00
Rafal Szczesniak
b773ca709a r7735: Extend resolve_name function so that it's possible to pass resolve
methods explicitly or NULL for defaults saved in smb.conf.

rafal
(This used to be commit 121cf5ec3e)
2007-10-10 13:18:28 -05:00
Stefan Metzmacher
d52ce8ff0c r7731: change debug level to not spam the build-farm smbd log
metze
(This used to be commit 3a1ed83fd0)
2007-10-10 13:18:27 -05:00
Andrew Tridgell
e2bb0d0ba7 r7725: fixed a bug with partial asn1 frames in the ldap client
(This used to be commit 0f22306a9c)
2007-10-10 13:18:26 -05:00
Andrew Tridgell
be19641f30 r7724: added encoding of LDB_OP_NOT search components
(This used to be commit 82b1feeafe)
2007-10-10 13:18:26 -05:00
Andrew Tridgell
2a0a0f2551 r7723: - fix a mismatched asn1 push/pop on bind
- add error checking to ldap_encode()

- fixed the asn1 codes for extended search

- use asn1 context macros
(This used to be commit 25d500b6e5)
2007-10-10 13:18:26 -05:00
Andrew Tridgell
91a79f2b24 r7722: when we get a zero read, the connection is dead
(This used to be commit 0603235304)
2007-10-10 13:18:26 -05:00
Andrew Tridgell
b4eee348c4 r7720: - simplify the asn1 decode of ldap_search() a lot, taking advantage of
the fact that the ldap data structures now use ldb_message_element.

- fixed null termination of elements in ildap
(This used to be commit 09060994c1)
2007-10-10 13:18:26 -05:00
Andrew Tridgell
ca91a8a691 r7717: fixed some typos
(This used to be commit fc8feee560)
2007-10-10 13:18:25 -05:00
Andrew Tridgell
1e99722d02 r7716: a single wrapped ldap blob can contain multiple ldap messages
(This used to be commit de5f265b6c)
2007-10-10 13:18:25 -05:00
Andrew Tridgell
90cf33953d r7715: ensure we don't print null strings in ldap_errstr()
(This used to be commit dc419fc899)
2007-10-10 13:18:25 -05:00
Andrew Tridgell
56b79e945f r7713: fixed error display in ildap_search()
(This used to be commit abc9f4bd89)
2007-10-10 13:18:25 -05:00
Andrew Tridgell
777b4b0214 r7705: prevent SIGPIPE. this is what causes BASE-NEGNOWAIT to sometimes fail
(This used to be commit 0163d7fe99)
2007-10-10 13:18:24 -05:00
Andrew Tridgell
ee57c76a68 r7704: - fixed open_nbt_connection() to return NULL when the connection failed
- got rid of smbcli_shutdown() and use talloc_free() instead.
(This used to be commit 1011b1bf51)
2007-10-10 13:18:23 -05:00
Stefan Metzmacher
fca7031da9 r7679: update the documentation of security_description_create()
metze
(This used to be commit 6ad7ffab04)
2007-10-10 13:18:21 -05:00
Andrew Tridgell
ab1e121b76 r7665: - added a ildap_*() interface to our internal ldap library. This
interface is very similar to the traditional ldap interface, and will
  be used as part of a ldb backend based on the current ldb_ldap backend

- fixed some allocation issues in ldb_msg.c
(This used to be commit b34a29dcf2)
2007-10-10 13:18:19 -05:00
Andrew Tridgell
d13e788f20 r7654: - add a timeout to all smb requests (default 60 seconds)
- add a request destructor, to make it safe to destroy a pending
   request with talloc_free()
(This used to be commit 72c6988767)
2007-10-10 13:18:17 -05:00
Andrew Tridgell
af237084ec r7633: this patch started as an attempt to make the dcerpc code use a given
event_context for the socket_connect() call, so that when things that
use dcerpc are running alongside anything else it doesn't block the
whole process during a connect.

Then of course I needed to change any code that created a dcerpc
connection (such as the auth code) to also take an event context, and
anything that called that and so on .... thus the size of the patch.

There were 3 places where I punted:

  - abartlet wanted me to add a gensec_set_event_context() call
    instead of adding it to the gensec init calls. Andrew, my
    apologies for not doing this. I didn't do it as adding a new
    parameter allowed me to catch all the callers with the
    compiler. Now that its done, we could go back and use
    gensec_set_event_context()

  - the ejs code calls auth initialisation, which means it should pass
    in the event context from the web server. I punted on that. Needs fixing.

  - I used a NULL event context in dcom_get_pipe(). This is equivalent
    to what we did already, but should be fixed to use a callers event
    context. Jelmer, can you think of a clean way to do that?

I also cleaned up a couple of things:

 - libnet_context_destroy() makes no sense. I removed it.

 - removed some unused vars in various places
(This used to be commit 3a3025485b)
2007-10-10 13:18:15 -05:00
Andrew Tridgell
bab977dad7 r7626: a new ldap client library. Main features are:
- hooked into events system, so requests can be truly async and won't
   interfere with other processing happening at the same time

 - uses NTSTATUS codes for errors (previously errors were mostly
   ignored). In a similar fashion to the DOS error handling, I have
   reserved a range of the NTSTATUS code 32 bit space for LDAP error
   codes, so a function can return a LDAP error code in a NTSTATUS

 - much cleaner packet handling
(This used to be commit 2e3c660b2f)
2007-10-10 13:18:14 -05:00
Andrew Tridgell
ec4a99ffe8 r7599: it turns out we were not using the ldif code in libcli/ldap/ at all,
so best to just remove it. If we need it again, then it will be easy
to just use a wrapper around the ldb code.
(This used to be commit b316e1c2d3)
2007-10-10 13:18:13 -05:00
Andrew Tridgell
49bc2672f8 r7598: take advantage of struct data_blob and struct ldb_val being the same
structure in a couple of places
(This used to be commit bcd4671aca)
2007-10-10 13:18:13 -05:00
Andrew Tridgell
3e92471d4c r7596: next step in ldap cleanup. I'm aiming to get rid of the cut&pasted
ldif parsing code in libcli/ldap/ldap_ldif.c, and instead use the ldb
ldif code. To do that I have changed the ldap code to use 'struct
ldb_message_element' instead of 'struct ldap_attribute'. They are
essentially the same structure anyway, so by making them really the
same it will be much easier to use the ldb code in libcli/ldap/

I have also made 'struct ldb_val' the same as a DATA_BLOB, which will
simplify data handling in quite a few places (I haven't yet removed
all the code that maps between these two, that will come later)
(This used to be commit 87fc307339)
2007-10-10 13:18:12 -05:00
Andrew Tridgell
c0947b0d7f r7593: simplified the memory management in the ldap code. Having a mem_ctx
element in a structure is not necessary any more.
(This used to be commit 912d0427f5)
2007-10-10 13:18:12 -05:00
Tim Potter
26d35d90a2 r7569: Fix typo in comments.
(This used to be commit 64fb327ccf)
2007-10-10 13:18:10 -05:00