1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-30 08:23:49 +03:00
Commit Graph

86 Commits

Author SHA1 Message Date
Jelmer Vernooij
566aa14139 r25554: Convert last instances of BOOL, True and False to the standard types. 2007-10-10 15:07:55 -05:00
Jelmer Vernooij
08bb1ef643 r25000: Fix some more C++ compatibility warnings. 2007-10-10 15:05:27 -05:00
Andrew Tridgell
fcf38a38ac r23792: convert Samba4 to GPLv3
There are still a few tidyups of old FSF addresses to come (in both s3
and s4). More commits soon.
2007-10-10 14:59:12 -05:00
Andrew Tridgell
26cf849408 r23036: error checking on asn1_init() failure 2007-10-10 14:52:43 -05:00
Andrew Tridgell
3db49c2ec9 r23030: finally fixed up our asn1 code to use better memory allocation. This
should allow us to fix some long standing memory leaks.
2007-10-10 14:52:42 -05:00
Andrew Bartlett
eef710668f r21806: I've been working over the last week to fix up the LDAP backend for
Samba4.  This only broke on global catalog queries, which turned out to
be due to changes in the partitions module that metze needed for his
DRSUAPI work.

I've reworked partitions.c to always include the 'problematic' control,
and therefore demonstrated that this is the issue.  This ensures
consistency, and should help with finding issues like this in future.

As this control (DSDB_CONTROL_CURRENT_PARTITION_OID) is not intended to
be linearised, I've added logic to allow it to be skipped when creating
network packets.

I've likewise make our LDAP server skip unknown controls, when marked
'not critical' on it's input, rather than just dropping the entire
request.  I need some help to generate a correct error packet when it is
marked critical.

Further work could perhaps be to have the ldap_encode routine return a
textual description of what failed to encode, as that would have saved
me a lot of time...

Andrew Bartlett
2007-10-10 14:49:29 -05:00
Stefan Metzmacher
d40465470f r21511: this seems to be the nicer fix for the problem with
the windows 2000 LDAP client

metze
2007-10-10 14:48:47 -05:00
Stefan Metzmacher
f17da75754 r21501: ugly but the windows 2000 mmc deturns decoding error without this
metze
2007-10-10 14:48:45 -05:00
Andrew Bartlett
441a4f6262 r18989: Fixes found by these two LDAP testsuites:
- http://www.ee.oulu.fi/research/ouspg/protos/testing/c06/ldapv3/
- http://gleg.net/protover_ldap_sample.shtml

Also fixes found by a subsequent audit of the code for similar issues.
2007-10-10 14:20:26 -05:00
Andrew Bartlett
36aa839080 r16073: On an incoming wildcard search, it is critical that the size be
correct, or we try and do a memcmp on the trailing '\0'.

This happens because we now use memcmp for the prefix matching.

I just wish I had a test other than a particular invocation of the OSX
client.  (I've tried and failed so far)

Andrew Bartlett
2007-10-10 14:08:57 -05:00
Jelmer Vernooij
aa6d66fda6 r15573: Fix build of systems that have iconv headers in non-standard locations
Split of system/locale.h header from system/iconv.h

Previously, iconv wasn't being used on these systems
2007-10-10 14:05:58 -05:00
Andrew Tridgell
9787fb8e91 r14423: don't die on no controls 2007-10-10 13:57:21 -05:00
Simo Sorce
1e2c13b2d5 r13609: Get in the initial work on making ldb async
Currently only ldb_ildap is async, the plan
is to first make all backend support the async calls,
and then remove the sync functions from backends and
keep the only in the API.

Modules will need to be transformed along the way.

Simo
2007-10-10 13:51:59 -05:00
Stefan Metzmacher
54f0b19c55 r13508: some ASN.1 element in LDAP are optional,
make it possible to code the difference between a zero length and a NULL DATA_BLOB...

metze
2007-10-10 13:51:56 -05:00
Andrew Bartlett
0cbe18211a r13344: Trust SASL to have subtle distinctions between NULL and zero-length
responses...

Also trust OpenLDAP to be pedantic about it, breaking connections to AD.

In any case, we now get this 'right' (by nasty overloading hacks, but
hey), and we can now use system-supplied OpenLDAP libs and SASL/GSSAPI
to talk to Samba4.

Andrew Bartlett
2007-10-10 13:51:46 -05:00
Simo Sorce
a7e2fe3cb3 r12917: fix decoding of ldap controls
some more work on timeouts
2007-10-10 13:51:02 -05:00
Simo Sorce
77125feaff r12733: Merge ldap/ldb controls into main tree
There's still lot of work to do but the patch is stable
enough to be pushed into the main samba4 tree.

Simo.
2007-10-10 13:49:47 -05:00
Jelmer Vernooij
c722f665c9 r12694: Move some headers to the directory of the subsystem they belong to. 2007-10-10 13:49:39 -05:00
Andrew Tridgell
1d29ad2a27 r11620: switch the ldap client code over to using the generic packet code 2007-10-10 13:45:59 -05:00
Andrew Bartlett
eba652ecc8 r11523: Working towards having Samba3 join Samba4, this allows the SASL
credentials to be NULL, where the client is requesting a CIFS style
server-first negTokenInit.

Andrew Bartlett
2007-10-10 13:45:48 -05:00
Andrew Tridgell
f6818daecc r10913: This patch isn't as big as it looks ...
most of the changes are fixes to make all the ldb code compile without
warnings on gcc4. Unfortunately That required a lot of casts :-(

I have also added the start of an 'operational' module, which will
replace the timestamp module, plus add support for some other
operational attributes

In ldb_msg_*() I added some new utility functions to make the
operational module sane, and remove the 'ldb' argument from the
ldb_msg_add_*() functions. That argument was only needed back in the
early days of ldb when we didn't use the hierarchical talloc and thus
needed a place to get the allocation function from. Now its just a
pain to pass around everywhere.

Also added a ldb_debug_set() function that calls ldb_debug() plus sets
the result using ldb_set_errstring(). That saves on some awkward
coding in a few places.
2007-10-10 13:39:41 -05:00
Andrew Tridgell
09948a5933 r10213: fixed a memory leak in the ldap client and server code spotted by Karl
Melcher. ldap_encode() now takes a memory context to use for the data
blob
2007-10-10 13:38:09 -05:00
Simo Sorce
d844d45d87 r8917: Better support for extended ldap search operations
Try to follow the RFC where possible and adapt to
  openLdap and AD way of handling this structure
2007-10-10 13:30:57 -05:00
Simo Sorce
a9e8cd0bad r8585: add to ldb and ldap comparison functionality
better pares filters
Approx is currently only a stub need to dig more info to
understand what it really means and how it works exactly
2007-10-10 13:29:41 -05:00
Simo Sorce
a910671bd8 r8530: Now our ldap server is able to fullfill present and substring searches 2007-10-10 13:29:35 -05:00
Tim Potter
bcfb3a45e4 r8414: Some C++ friendlyness fixes - 'not' is apparently a keyword in C++. 2007-10-10 13:23:00 -05:00
Andrew Tridgell
f22c3b84c8 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
2007-10-10 13:18:30 -05:00
Andrew Tridgell
82b1feeafe r7724: added encoding of LDB_OP_NOT search components 2007-10-10 13:18:26 -05:00
Andrew Tridgell
25d500b6e5 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
2007-10-10 13:18:26 -05:00
Andrew Tridgell
09060994c1 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
2007-10-10 13:18:26 -05:00
Andrew Tridgell
2e3c660b2f 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
2007-10-10 13:18:14 -05:00
Andrew Tridgell
bcd4671aca r7598: take advantage of struct data_blob and struct ldb_val being the same
structure in a couple of places
2007-10-10 13:18:13 -05:00
Andrew Tridgell
87fc307339 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)
2007-10-10 13:18:12 -05:00
Andrew Tridgell
912d0427f5 r7593: simplified the memory management in the ldap code. Having a mem_ctx
element in a structure is not necessary any more.
2007-10-10 13:18:12 -05:00
Andrew Tridgell
041bce5913 r7567: added wire parsing of NOT and extended ldap search requests. This
allows us to parse and handle the complex queries we are getting from
w2k, such as

(|(|(&(!(groupType:1.2.840.113556.1.4.803=1))(groupType:1.2.840.113556.1.4.803=2147483648)(groupType:1.2.840.113556.1.4.804=6))(samAccountType=805306368))(samAccountType=805306369))
2007-10-10 13:18:10 -05:00
Andrew Tridgell
96620ab2ee r7527: - added a ldb_search_bytree() interface, which takes a ldb_parse_tree
instead of a search expression. This allows our ldap server to pass
  its ASN.1 parsed search expressions straight to ldb, instead of going
  via strings.

- updated all the ldb modules code to handle the new interface

- got rid of the separate ldb_parse.h now that the ldb_parse
  structures are exposed externally

- moved to C99 structure initialisation in ldb

- switched ldap server to using ldb_search_bytree()
2007-10-10 13:18:06 -05:00
Andrew Tridgell
235cf625e2 r7524: make the ldap ASN.1 filter parse code go via a struct
ldb_parse_tree. This also fixes the error handling.

next step will be to pass the parse tree straight into ldb, avoiding
the string encoding completely.
2007-10-10 13:18:06 -05:00
Andrew Tridgell
0e9f18c448 r7519: rip the copy of the ldap expression parser out of libcli/ldap/ and use
the original one in lib/ldb/ instead. Having two copies of this code
is silly.
2007-10-10 13:18:04 -05:00
Andrew Tridgell
eb7979d9de r6817: - fixed empty ldap search elements in filters
- added support for guids in cldap netlogon searches.

the cldap server now passes the LDAP-CLDAP torture test
2007-10-10 13:16:47 -05:00
Andrew Tridgell
8890dd3ac3 r6763: added functions in libcli/ldap/ to binary encode some NDR structures into
ldap friendly filter strings
2007-10-10 13:16:42 -05:00
Andrew Tridgell
b644ff6fe1 r6745: - escape spaces in binary ldap blobs
- expose the ldap filter string parsing outside of ldap.c
2007-10-10 13:16:40 -05:00
Andrew Tridgell
2b36f1dfdd r6726: support binary search elements in ldap_decode() 2007-10-10 13:16:38 -05:00
Andrew Tridgell
d5353b6342 r6689: minor ldap client library work
- added support for binary encoded search filters
 - fixed some const handling
 - changed the message type to an enum, to help debugging
2007-10-10 13:16:34 -05:00
Andrew Tridgell
80ffcc650c r5322: removed a whole bunch of #include lines that minimal_includes.pl
thinks are not needed. Now to see how this fares on the build farm :)
2007-10-10 13:09:41 -05:00
Andrew Tridgell
0df3fdd817 r5305: removed libcli/ldap/ldap.h from includes.h 2007-10-10 13:09:39 -05:00
Andrew Tridgell
9db6c79e90 r5298: - got rid of pstring.h from includes.h. This at least makes it a bit
less likely that anyone will use pstring for new code

 - got rid of winbind_client.h from includes.h. This one triggered a
   huge change, as winbind_client.h was including system/filesys.h and
   defining the old uint32 and uint16 types, as well as its own
   pstring and fstring.
2007-10-10 13:09:38 -05:00
Stefan Metzmacher
add1c57937 r5137: fix types
metze
2007-10-10 13:09:26 -05:00
Andrew Tridgell
ec32b22ed5 r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the
large commit. I thought this was worthwhile to get done for
consistency.
2007-10-10 13:09:15 -05:00
Andrew Tridgell
89b74b5354 r4549: got rid of a lot more uses of plain talloc(), instead using
talloc_size() or talloc_array_p() where appropriate.

also fixed a memory leak in pvfs_copy_file() (failed to free a memory
context)
2007-10-10 13:08:25 -05:00
Andrew Tridgell
eec698254f r4055: fixed more places to use type safe allocation macros 2007-10-10 13:06:20 -05:00