1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

343 Commits

Author SHA1 Message Date
Nadezhda Ivanova
ea365af4f5 Added freeing a successful req so it doesnt croud the ldb context 2009-12-18 17:57:08 +02:00
Nadezhda Ivanova
4330efe0f2 Removed ldb_modify_ctrl from ldb, implemented as a static in ldap_backend. 2009-12-15 20:29:20 +02:00
Nadezhda Ivanova
a760f169f4 Some changes to allow processing of ldap controls on modify requests.
ldap_backend used to filter out ldap controls on modify. Also, modified
python binding for ldap_modify to allow writing tests for such controls.
2009-11-20 13:22:38 +02:00
Andrew Tridgell
54bd30f706 s4-samdb: reduce the number of samdb opens at startup
Using common parameters means that the ldb_wrap code can return a
reference rather than a new database
2009-10-25 17:19:03 +11:00
Andrew Tridgell
4ad0397d8a s4-ldbwrap: added re-use of ldb contexts in ldb_wrap_connect()
This allows us to reuse a ldb context if it is open twice, instead
of going through the expensive process of a full ldb open. We can
reuse it if all of the parameters are the same.

The change relies on callers using talloc_unlink() or free of a parent
to close a ldb context.
2009-10-23 14:52:17 +11:00
Andrew Tridgell
05f93c3e8f s4-dsdb: add a static samdb_credentials
Similarly to system_session(), this creates a static
samdb_credentials()
2009-10-23 14:52:17 +11:00
Andrew Tridgell
98e4393df9 s4-dsdb: create a static system_session context
This patch adds a system_session cache, preventing us from having to
recreate it on every ldb open, and allowing us to detect when the same
session is being used in ldb_wrap
2009-10-23 14:52:17 +11:00
Matthias Dieter Wallnöfer
ee0204cfcc s4:ldap server - remove unused error handlings
Those error cases should be handled by LDB itself to be available on all
connection methods and not only over LDAP.
2009-10-08 00:18:06 +02:00
Matthias Dieter Wallnöfer
767fce6fcc s4:LDB/LDAP - Re-allow renames
The main problem is that the "rdn_name" module launches on a rename request also
a modification one with the "special attributes" which can't be changed directly.
An introduced flag helps to bypass the restriction.
2009-10-02 21:27:46 +02:00
Andrew Bartlett
737f21bd9d s4:ldap_server Ensure we don't segfault when sent a NULL new RDN
The Microsoft testsuite tried to rename
cn=administrator,cn=users,... into "",cn=users... which didn't go so well.

Andrew Bartlett
2009-10-02 12:45:06 +02:00
Andrew Tridgell
46b7374098 s4-ldap: fixed spelling 2009-09-28 10:24:19 +10:00
Jelmer Vernooij
6a79ad7664 gensec: Avoid exposing lp_ctx on the API level. 2009-09-26 20:55:18 +02:00
Andrew Tridgell
e9a589feac s4-server: kill main daemon if a task fails to initialise
When one of our core tasks fails to initialise it can now ask for the
server as a whole to die, rather than limping along in a degraded
state.
2009-09-18 18:05:55 -07:00
Andrew Bartlett
093148c1f0 s4:ldap_server Correct removal of talloc_steal()
This corrects commit 7a82aed71b.  The
steal did not set ent->attributes, so it was incorrect to assign to
ent->attributes.

Andrew Bartlett
2009-08-14 13:12:35 +10:00
Andrew Bartlett
7a82aed71b s4:ldap_server Remove another talloc_steal (with references)
This talloc_steal also conflicts with the ldb_map code, and like the
previous commit, is rudundent given the talloc_steal of the whole msg
above.

Andrew Bartlett
2009-08-14 12:57:46 +10:00
Andrew Bartlett
5c3cf58a84 s4:ldap_server Don't talloc_steal (with references) in ldap_backend
There may or may not be a need to take a reference to the 'name' in
the ldb_map code, but given we seal the whole msg just above here, it
makes no senst to steal the name, but not the values.

Andrew Bartlett
2009-08-14 12:48:10 +10:00
Stefan Metzmacher
f224089138 s4:ldap_server: make sure we shutdown the tls socket before stream_terminate_connection() removes the fd event
This fixes a crash bug where tls_destructor() relies on the fd event still being there.

metze
2009-08-05 10:10:14 +02:00
Günther Deschner
7048165e7a s4-ldap_server: fix generated error string in map_ldb_error().
Guenther
2009-08-04 00:16:37 +02:00
Matthias Dieter Wallnöfer
04ea52f867 s4: Enhances the LDAP server to display error messages like Windows Server
Those error messages also include the WERROR code of the failed operation(s) in this
manner: <error code eight chars in HEX>: <further error message>

This also addresses bug #4949
2009-07-31 17:41:04 +02:00
Stefan Metzmacher
471e67a733 s4:ldap_server: the tls code steals the original socket on its own now
metze
2009-07-31 14:42:04 +02:00
Andrew Tridgell
2d981919b8 use a talloc_unlink() as ops may have a reference 2009-07-01 15:15:37 +10:00
Volker Lendecke
17a65541bd Reenable the LDAPI socket for the merged build
It seems that the samba4 part of the merged build does not pick up the
DEVELOPER flag from the s3 configure.

Jelmer, can you fix that properly?

Thanks,

Volker
2009-06-24 16:30:55 +02:00
Andrew Bartlett
ec47444a7e Allow developers access the the privilaged ldapi socket for the moment
This allows us some time to get the EXTERNAL bind working
2009-06-19 15:31:54 +10:00
Andrew Bartlett
dcc9ae6995 s4:ldapsrv Place the 'privilaged' ldapi socket under an #ifdef
This makes it clear to our users that this particular implementation
isn't final (all parties are agreed that an EXTERNAL bind is the right
way to do this, but it has not been implemented yet).

Andrew Bartlett
2009-06-19 14:36:06 +10:00
Volker Lendecke
256b227b27 Allow access as SYSTEM on a privileged ldapi connection
This patch creates ldap_priv/ as a subdirectory under the private dir with the
appropriate permissions to only allow the same access as the privileged winbind
socket allows. Connecting to ldap_priv/ldapi gives SYSTEM access to the ldap
database.
2009-06-06 13:10:30 +02:00
Volker Lendecke
f6535d3f3f Fix some nonempty blank lines 2009-05-29 09:48:55 +02:00
Stefan Metzmacher
f6b0a99cef libcli/ldap: move generic ldap control encoding code to ldap_message.c
As they can we static there, we pass the specific handlers as parameter
where we need to support controls.

metze
2009-02-24 17:55:41 +01:00
Andrew Tridgell
bb7e6f0f51 Worked around a problem with select/poll/epoll and gnutls
Our packet layer relies on the event system reliably telling us when a
packet is available. When we are using a socket layer like TLS then
things get a bit trickier, as there may be bytes in the encryption
buffer which could be read even if there are no bytes at the socket
level. The GNUTLS library is supposed to prevent this happening by
always leaving some data at the socket level when there is data to be
processed in its buffers, but it seems that this is not always
reliable.

To work around this I have added a new packet option
packet_set_unreliable_select() which tells the packet layer to not
assume that the socket layer has a reliable select, and to instead
keep trying to read from the socket until it gets back no data. This
option is set for the ldap client and server when TLS is negotiated.

This seems to fix the problems with the ldaps tests.
2009-02-18 17:37:45 +11:00
Andrew Bartlett
71632a1697 Remove auth/ntlm as a dependency of GENSEC by means of function pointers.
When starting GENSEC on the server, the auth subsystem context must be
passed in, which now includes function pointers to the key elements.

This should (when the other dependencies are fixed up) allow GENSEC to
exist as a client or server library without bundling in too much of
our server code.

Andrew Bartlett
2009-02-13 10:24:16 +11:00
Stefan Metzmacher
d9c30894a1 s4:service_stream: s/private/private_data
metze
2009-02-02 13:09:00 +01:00
Stefan Metzmacher
0fadddf8d4 s4:ldap_server: s/private/private_data
metze
2009-02-02 13:08:40 +01:00
Stefan Metzmacher
183c379fe5 s4:lib/tevent: rename structs
list=""
list="$list event_context:tevent_context"
list="$list fd_event:tevent_fd"
list="$list timed_event:tevent_timer"

for s in $list; do
	o=`echo $s | cut -d ':' -f1`
	n=`echo $s | cut -d ':' -f2`
	r=`git grep "struct $o" |cut -d ':' -f1 |sort -u`
	files=`echo "$r" | grep -v source3 | grep -v nsswitch | grep -v packaging4`
	for f in $files; do
		cat $f | sed -e "s/struct $o/struct $n/g" > $f.tmp
		mv $f.tmp $f
	done
done

metze
2008-12-29 20:46:40 +01:00
Jelmer Vernooij
928fd47c3d s4: Fix subsystem for various services in samba daemon. 2008-12-22 19:04:55 +01:00
Andrew Bartlett
e4ccd69d49 s4:ldap_server: return the extended dn to the LDAP client if available
This uses an early peek at the extended_dn_control (in the request) to see what output
format to use.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:26 +11:00
Andrew Bartlett
109719de03 Remove restrictions on number of DN components in LDAP server
There is no reason for these restrictions to be in the LDAP server -
they belong in the LDB layer.  When accepting 'extended' or
'alternate' DNs we can't tell anyway.

Andrew Bartlett
2008-11-17 10:06:18 +11:00
Jelmer Vernooij
1e053df95c Remove use of global_loadparm for disabled gensec backends. 2008-11-02 19:28:17 +01:00
Jelmer Vernooij
b034c519f5 Add gensec_settings structure. This wraps loadparm_context for now, but
should in the future only contain some settings required for gensec.
2008-11-02 02:05:48 +01:00
Jelmer Vernooij
9565999755 Fix include paths to new location of libutil. 2008-10-11 21:31:42 +02:00
Simo Sorce
b2901da479 LDB ASYNC: misc changes 2008-09-29 04:22:20 +02:00
Simo Sorce
83b0c5d43f Fix nasty bug that would come up only if a client connection to a remote
ldap server suddenly dies.
We were creating a wrong talloc hierarchy, so the event.fde was not
freed automatically as expected. This in turn made the event system call
the ldap io handlers with a null packet structure, causing a segfault.
Fix also the ordering in ldap_connection_dead()
Thanks to Metze for the huge help in tracking down this one.
2008-09-24 01:43:57 -04:00
Jelmer Vernooij
6a689c23e8 Rename smbd -> samba.
This reverts commit 05ea5e23cf.

Conflicts:

	source4/smbd/server.c
2008-09-24 03:16:15 +02:00
Simo Sorce
508527890a Merge ldb_search() and ldb_search_exp_fmt() into a simgle function.
The previous ldb_search() interface made it way too easy to leak results,
and being able to use a printf-like expression turns to be really useful.
2008-09-23 18:17:46 -04:00
Stefan Metzmacher
1d92b2211c s4: allways initialize the process model before it's used
metze
2008-09-22 18:16:09 +02:00
Jelmer Vernooij
05ea5e23cf Revert "Rename smbd -> samba."
This reverts commit 0e9008be35.
2008-09-21 21:32:40 +02:00
Jelmer Vernooij
0e9008be35 Rename smbd -> samba. 2008-09-21 21:26:40 +02:00
Matthias Dieter Wallnöfer
8ac5db1246 LDAP Server: Don't create the SASL SECBLOB output object twice
Removes one "talloc" creation of the output object.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-09-19 16:33:47 +02:00
Andrew Bartlett
376b2a29d6 Don't keep an extra ldb around forever.
We just open it to figure out if we need to be a Global Catalog server.

Andrew Bartlett
(This used to be commit f13572d9e9)
2008-07-16 11:11:25 +10:00
Andrew Bartlett
532899386b Use secrets.ldb to store credentials to contact LDAP backend.
This makes Samba4 behave much like Samba3 did, and use a single set of
administrative credentials for it's connection to LDAP.

Andrew Bartlett
(This used to be commit e396a59788)
2008-07-15 15:07:13 +10:00
Stefan Metzmacher
0a391223ac ldap_server: allow modifies to the root dse record and pass them to the ldb layer
metze
(This used to be commit 3da6f7f95d)
2008-07-02 10:32:02 +02:00
Jelmer Vernooij
4c70cda986 Fix a couple (well, little more than that..) of typos.
(This used to be commit a6b5211994)
2008-05-18 23:02:47 +02:00