1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

832 Commits

Author SHA1 Message Date
Volker Lendecke
c687eb15d9 Properly free a downlevel readv request. Metze, please check 2009-06-27 23:17:49 +02:00
Volker Lendecke
22cb9bdfd3 Move asn1_load_nocopy() to lib/util/asn1.c 2009-06-20 18:54:07 +02:00
Volker Lendecke
ecf8cebf32 Move asn1_blob() to lib/util/asn1.c 2009-06-20 18:54:07 +02:00
Andrew Bartlett
17e1cbb6d3 Partially revert restriction of socket_wrapper to 1500 byte writes
This keeps the restriction for stream sockets (where the caller will
retry), without creating problems on datagram sockets (CLDAP is not
defined, as far as I know, across multiple UDP packets).

The commit adding this restriction was
47b106c0ae

Andrew Bartlett
2009-06-19 14:36:06 +10:00
Simo Sorce
c92505817d Revert "For tevent to install tevent_util.h"
This reverts commit b112cc5503.

tevent_util.h is a private header. Must not be installed.
2009-06-18 07:56:51 -04:00
Eric Sandall
b112cc5503 For tevent to install tevent_util.h
Patch for bug #6270

This patch is for the future when samba4 builds using external libraries. With
this patch, tevent now installs tevent_util.h which is required by samba4.
2009-06-18 13:49:26 +10:00
Andrew Kroeger
71515ba190 s4: Call va_end() after all va_start()/va_copy() calls.
This corrects the issues reaised in bug #6129, and some others that were not
originally identified.  It also accounts for some code that was in the original
bug report but appears to have since been made common between S3 and S4.

Thanks to Erik Hovland <erik@hovland.org> for the original bug report.
2009-06-18 13:49:25 +10:00
Jelmer Vernooij
43b7a0e34e tdb: Fix help string in configure flag to enable Python bindings. 2009-06-17 21:12:50 +02:00
Simo Sorce
ac1d311e9c fix release scripts to always git clean
This makes sure we do not include foreign object files or other
build byproducts by mistake.
2009-06-17 14:18:03 -04:00
Simo Sorce
efccef09ae Add exports file and abi checker for tevent
This is a first attempt at exporting symbols only for public functions
We also provide a rudimentary ABI checker that tries to check that
function signatures are not changed by mistake.
Given our use of macros this is not an API checker.
It's all based on tevent.h contents and the gcc -aux-info option
2009-06-15 16:31:13 -04:00
Simo Sorce
e83f4b868b Add exports file and abi checker for talloc
This is a first attempt at exporting symbols only for public functions
We also provide a rudimentary ABI checker that tries to check that
function signatures are not changed by mistake.
Given our use of macros this is not an API checker.
It's all based on talloc.h contents and the gcc -aux-info option
2009-06-15 16:31:12 -04:00
Simo Sorce
7aee9f92e7 Add exports file and abi checker for tdb
This is a first attempt at exporting symbols only for public functions
We also provide a rudimentary ABI checker that tries to check that
function signatures are not changed by mistake.
Given our use of macros this is not an API checker.
It's all based on tdb.h contents and the gcc -aux-info option
2009-06-15 16:31:12 -04:00
Simo Sorce
f518e37c09 Add new replace check for --version-script
Allows us to pass an export files on Linux and Solaris so that we can expose
only symbols that are actually supposed to be global, and keep as local anything
else.
2009-06-15 16:31:12 -04:00
Simo Sorce
57ba31ca96 Add option to --disable-python on build 2009-06-15 16:31:11 -04:00
Volker Lendecke
b706265786 Fix a = vs == error in writev_handler 2009-06-15 07:48:48 +02:00
Andrew Bartlett
9b261c008a s4:heimdal: import lorikeet-heimdal-200906080040 (commit 904d0124b46eed7a8ad6e5b73e892ff34b6865ba)
Also including the supporting changes required to pass make test

A number of heimdal functions and constants have changed since we last
imported a tree (for the better, but inconvenient for us).

Andrew Bartlett
2009-06-12 07:45:48 +10:00
Jelmer Vernooij
68578d6374 selftest: Fix handling of testsuite, reintroduce progress indication. 2009-06-11 19:59:59 +02:00
Andrew Bartlett
223b30f593 Fix build of recurusion fix in reopen_logs() 2009-06-11 19:08:33 +10:00
Andrew Bartlett
e5353ce95b Don't recurse in reopen_logs().
Use the state to avoid recursion in reopen_logs(), as DEBUG() can call
this function.

Andrew Bartlett
2009-06-11 18:54:32 +10:00
Günther Deschner
27bb7ac5d1 lib-util: move set_blocking() call into own file.
Guenther
2009-06-10 21:25:57 +02:00
Andrew Tridgell
d42019644b added asn1 functions for handling booleans in a simple context 2009-06-10 11:45:53 +10:00
Andrew Tridgell
c0965e0eec It seems that IRIX doesn't have IOV_MAX 2009-06-09 14:54:15 +10:00
Andrew Tridgell
f7ba8ba5c3 try to get PICFLAG right for HP-UX with gcc 2009-06-09 14:18:58 +10:00
Andrew Tridgell
03dd06de9a fixed socket wrapper to determine family from the right structure
In convert_in_un_remote() the socket family can be accessed either as
si->family or inaddr->sa_family. We were using the si->family to
determine how to cast the inaddr structure, but if si->family !=
inaddr->sa_family then we will incorrectly be casting a in6 structure
as in4 or vice-versa.
2009-06-09 13:33:09 +10:00
Günther Deschner
7caf51c37a nss_wrapper: fix typo in testsuite.
Guenther
2009-06-08 22:45:16 +02:00
Jelmer Vernooij
7f52c8fb50 libsamba-util: Fix soversion. 2009-06-08 22:43:36 +02:00
Timur I. Bakeyev
40178dd81e Add langinfo.h to the system/locale.h
This patch for Samba4. It's not really inspired by any real need, just
for the consistency. We define replace/system/locale.h as a generic
header, that includes all locale related headers and we are using
nl_langinfo at least in Samba3. So, it would be consistent to add yet
another locale-related header to the set of locale.h headers.

Here is the patch.

With regards,
Timur Bakeyev.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-06-08 13:20:51 +02:00
Günther Deschner
7e8b3d8c06 nss_wrapper: add my copyright.
Guenther
2009-06-08 10:26:39 +02:00
Stefan Metzmacher
bccef82516 replace: add fallback define for IOV_MAX
This hopefully fixes the build on IRIX.

metze
2009-06-08 09:40:11 +02:00
Stefan Metzmacher
eff9bcc9c7 talloc: try to fix the source4 build on AIX
metze
2009-06-08 09:40:11 +02:00
Stefan Metzmacher
faabc97c9a async_sock: try fix the source4 build on FreeBSD, Solaris, SLES8
metze
2009-06-08 09:40:06 +02:00
Slava Semushin
497b9e460b lib/tdb/tools/tdbtorture.c: fixed memory leak.
Found by cppcheck:
[lib/tdb/tools/tdbtorture.c:326]: (error) Memory leak: pids
2009-06-06 22:33:39 +02:00
Volker Lendecke
537b257cca Use data_blob_null instead of data_blob(NULL, 0) 2009-06-06 10:42:55 +02:00
Volker Lendecke
a731eb64d9 Fix an uninitialized variable read in async_connect_send 2009-06-06 10:42:55 +02:00
Günther Deschner
0bf56f5cb3 nss_wrapper: rename nwrap_cache_{re,un}load as per metzes request.
Guenther
2009-06-06 02:00:36 +02:00
Günther Deschner
68a1ef2197 nss_wrapper: add support for loading nss_winbind.so via WINBIND_SO_PATH env.
Guenther
2009-06-06 01:01:25 +02:00
Günther Deschner
a845cb5ed3 nss_wrapper: fill in module nwrap_backend.
Guenther
2009-06-06 00:59:51 +02:00
Günther Deschner
2e78bc7b53 nss_wrapper: add missing return in nwrap_module_init().
Guenther
2009-06-05 23:10:58 +02:00
Günther Deschner
f3aa2a2b73 nss_wrapper: add skeleton for module nwrap_backend.
Guenther
2009-06-05 23:04:14 +02:00
Günther Deschner
6985f3995f nss_wrapper: add capability to load nss modules.
Guenther
2009-06-05 23:04:10 +02:00
Günther Deschner
47b5a55239 nss_wrapper: add struct nwrap_backend.
Guenther
2009-06-05 23:01:05 +02:00
Günther Deschner
61cf117f86 nss_wrapper: add cross checking test to testsuite.
Guenther
2009-06-05 15:58:22 +02:00
Günther Deschner
59ee0a1e8a nss_wrapper: add tests for getgrent_r to testsuite.
Guenther
2009-06-05 15:58:16 +02:00
Günther Deschner
af0b586c74 nss_wrapper: add tests for getpwent_r to testsuite.
Guenther
2009-06-05 15:58:09 +02:00
Stefan Metzmacher
c110e664af nss_wrapper: fix segfault in nwrap_gr_copy_r()
metze
2009-06-05 15:52:20 +02:00
Günther Deschner
5e0f122f7c nss_wrapper: rename test_nwrap_env to test_nwrap_enumeration in testsuite.
Guenther
2009-06-05 13:41:18 +02:00
Günther Deschner
34014f8aa6 nss_wrapper: add more coherency checks for user and group enumeration.
Guenther
2009-06-05 13:40:49 +02:00
Günther Deschner
930ea7c8a8 nss_wrapper: remove getgrouplist from nwrap_ops table.
Guenther
2009-06-04 21:23:39 +02:00
Volker Lendecke
d0aedeb46e Increase tevent version for tevent_req_notify_callback() 2009-06-04 17:50:44 +02:00
Volker Lendecke
c6f39b46a7 Add tevent_req_notify_callback
This is necessary for requests that have multiple results. Examples would be
SMBEcho and ldap_search.
2009-06-04 17:29:48 +02:00
Stefan Metzmacher
9dad0536d6 nss_wrapper: call the nwrap_files_*() from nwrap_files_*_r()
We should not call the public functions, as this could lead
to a recursive loop when we have multiple nwrap backends
in future.

This also fixes the build if --enable-nss-wrapper was not
given to ./configure.

metze
2009-06-04 17:18:12 +02:00
Volker Lendecke
74330085ec Only err on readability if writev_send was explicitly asked to do so
A socket might be readable for other reasons
2009-06-04 12:05:00 +02:00
Günther Deschner
8def5cb352 nss_wrapper: more coherence tests for group membership.
Guenther
2009-06-04 10:30:58 +02:00
Günther Deschner
dc9b705667 nss_wrapper: add coherency tests for get{gr,pw}{nam,id}.
Guenther
2009-06-04 10:30:51 +02:00
Günther Deschner
c49f6b7bc6 nss_wrapper: refactor test_nwrap_membership_user() in testsuite.
Guenther
2009-06-04 10:30:44 +02:00
Günther Deschner
911624567a nss_wrapper: make full talloced copies of struct passwd and group in testsuite.
Guenther
2009-06-04 10:30:36 +02:00
Andrew Bartlett
4c70a5b405 socket_wrapper Cope with SOCK_CLOEXEC and SOCK_NONBLOCK flags
Heimdal will, on supporting systems, set these flags in the type
argument of socket(), causing breakage when combined with
socket_wrapper.

For background on these flags, see http://lwn.net/Articles/281965/

Andrew Bartlett
2009-06-04 14:19:17 +10:00
Andrew Tridgell
8ca8dabe46 add gendb_search_single_extended_dn()
This function searches for a single record using a given filter,
adding the extended-dn control so that any returned DNs will have the
GUID and SID fields returned. This will be used in the sam auth code
to prevent us doing a member= search for the groups, which invokes an
unindexed search.
2009-06-04 14:10:11 +10:00
Jelmer Vernooij
87bbae7b07 Rename harness2subunit.pl -> tap2subunit to be consistent with the
subunit tools.
2009-06-03 16:26:29 +02:00
Jelmer Vernooij
4602cc0ac1 Build libsamba-util as a shared library. 2009-06-02 18:05:40 +02:00
Günther Deschner
011a505800 nss_wrapper: prefix function pointer names in struct nwrap_ops.
Guenther
2009-06-02 14:52:53 +02:00
Günther Deschner
68bb2d2e80 torture: minor fixes to torture macro text output.
Guenther
2009-06-02 13:12:09 +02:00
Günther Deschner
8684911bda nss_wrapper: resort calls to move public calls to the end.
Guenther
2009-06-02 13:11:57 +02:00
Günther Deschner
81e820c1aa nss_wrapper: add nwrap_ops function pointer table.
Guenther
2009-06-02 13:11:49 +02:00
Günther Deschner
9a7a97856a nss_wrapper: make sure to return after calling real_{set,end}{gr,pw}ent.
Guenther
2009-06-02 13:11:42 +02:00
Günther Deschner
94f2ef4f72 nss_wrapper: fix typo while checking for getgrid_r support.
Metze, this has been in here for a long time, please check.

Guenther
2009-06-02 13:11:33 +02:00
Andrew Tridgell
a6cc04a200 overallocate all records by 25%
This greatly reduces the fragmentation of databases where records
tend to grow slowly by a small amount each time. The case where this
is most seen is the ldb index records. Adding this overallocation
reduced the size of the resulting database by more than 20x when
running a test that adds 10k users.
2009-06-01 13:13:07 +10:00
Andrew Tridgell
a386173fa1 auto-repack in transactions that expand the tdb
The idea behind this is to recover from badly fragmented free
lists. Choosing the point where the file expands is fairly arbitrary,
but seems to work well.
2009-06-01 13:11:39 +10:00
Andrew Tridgell
ba95882155 Merge branch 'master' of ssh://git.samba.org/data/git/samba 2009-06-01 10:39:30 +10:00
Volker Lendecke
3984b76498 Fix a C++ warning 2009-05-31 12:16:34 +02:00
Günther Deschner
241db90c31 nss_wrapper: try to fix the build of nss_wrapper on solaris.
Guenther
2009-05-30 23:08:12 +02:00
Volker Lendecke
625851a50f Handle EINTR in async_sock.c 2009-05-30 09:51:02 +02:00
Kai Blin
57ea909b32 libwbclient: Add async call framework. 2009-05-30 09:17:37 +02:00
Günther Deschner
2be289c68d nss_wrapper: add test_nwrap_membership to testsuite.
Guenther
2009-05-30 01:46:22 +02:00
Günther Deschner
62d1cd6375 nss_wrapper: restructure parts of the testsuite.
Guenther
2009-05-30 01:45:58 +02:00
Günther Deschner
8db4917290 nss_wrapper: add support for getgrouplist.
Guenther
2009-05-30 00:06:00 +02:00
Volker Lendecke
3d9e1f605c util: Change license on tevent_unix to LGPLv3+ 2009-05-29 18:31:30 +02:00
Volker Lendecke
9d8766e176 async_sock: Change license to LGPLv3+ 2009-05-29 18:17:38 +02:00
Günther Deschner
36fc0b961f s4-smbtorture: add a very basic NSS-WRAPPER testsuite.
Guenther
2009-05-29 13:50:09 +02:00
Günther Deschner
bff54b90c3 util: move add_gid_to_array_unique to toplevel and add add_uid_to_array_unique.
Guenther
2009-05-29 13:49:58 +02:00
Andrew Tridgell
67b83d2489 Merge branch 'master' of ssh://git.samba.org/data/git/samba 2009-05-28 22:12:00 +10:00
Günther Deschner
136b2a3eb2 nss_wrapper: fix nss_wrapper build for solaris.
Guenther
2009-05-28 11:53:51 +02:00
Günther Deschner
37e4c92b38 nss_wrapper: remove re-structuring leftovers (unused variables).
Guenther
2009-05-28 11:53:51 +02:00
Günther Deschner
ebf8df35c9 nss_wrapper: support member add and delete for groups in nss_wrapper.pl.
Guenther
2009-05-28 10:39:37 +02:00
Günther Deschner
7bb9e08d7e nss_wrapper: split out passwd and group paths in nss_wrapper.pl.
Guenther
2009-05-28 10:32:21 +02:00
Günther Deschner
ec9a091705 nss_wrapper: restructure nwrap calls.
Guenther
2009-05-28 10:32:21 +02:00
Andrew Tridgell
08be1420ba fixed tdbbackup to give tdb error messages 2009-05-28 17:35:12 +10:00
Andrew Tridgell
5ab03dbecc Merge branch 'master' of ssh://git.samba.org/data/git/samba 2009-05-28 16:12:34 +10:00
Andrew Tridgell
4b4fec65db make TDB_NOSYNC affect all the fsync/msync calls in transactions
During a transaction commit tdb normally uses fsync/msync calls to
make it crash safe. This can be disabled using the TDB_NOSYNC flag,
but it wasn't disabling all the code paths that caused a fsync/msync.
2009-05-28 16:08:28 +10:00
Tim Prouty
c299833bf8 tdb: Fix some recently introduced warnings in tdbtool 2009-05-27 13:18:12 -07:00
Andrew Tridgell
0299609308 Merge branch 'master' of ssh://git.samba.org/data/git/samba 2009-05-26 14:18:16 +10:00
Andrew Bartlett
8603985575 Add support for sendmsg() in socket_wrapper
This is required because the deferred connect code skips the connect()
until sending the packet, but unless we catch this call, the connect()
never happens.

Andrew Bartlett
2009-05-26 12:37:09 +10:00
Andrew Tridgell
e15027155d added some more speed tests to tdbtool
This adds 3 simple speed tests to tdbtool, for transaction store,
store and fetch.

On my laptop this shows transactions costing about 10ms
2009-05-26 09:24:37 +10:00
Volker Lendecke
9de2efaa5b Change async_connect to use connect instead of getsockopt to get the error
On my Linux box, this is definitely the more reliable strategy with unix domain
sockets, and according to my tests it also works correctly with TCP sockets.
2009-05-24 13:50:54 +02:00
Volker Lendecke
a8e02b591b Add "err_on_readability" to writev_send
A socket where the other side has closed only becomes readable. To catch
errors early when sitting in a pure writev, we need to also test for
readability.
2009-05-24 13:47:29 +02:00
Volker Lendecke
1a69ba8945 Allow NULL queue to writev_send 2009-05-24 13:45:35 +02:00
Stefan Metzmacher
edd9bd9b16 tsocket: allow empty vectors at the end for tstream_writev()/readv()
metze
2009-05-22 14:01:22 +02:00
Jim McDonough
a91bcbccf8 Detect tight loop in tdb_find() 2009-05-21 16:29:48 -04:00
Günther Deschner
3bd360c73d nsswrapper: implement group_del() in nss_wrapper.pl.
Guenther
2009-05-20 12:37:37 +02:00
Günther Deschner
b3cc01fd68 nsswrapper: implement group_add() in nss_wrapper.pl.
Guenther
2009-05-20 12:37:31 +02:00
Volker Lendecke
ac65ae9b1d Set errno=ENOMEM if tevent_add_fd fails
tevent_add_fd does not properly set that. At least in epoll and select this is
the only error condition.

Metze, please check!
2009-05-19 23:51:22 +02:00
Volker Lendecke
f9d00fb58e Simplify the logic of tsocket_bsd_pending
Remove two indentation levels by returning early on error.

Metze, please check!
2009-05-19 23:35:16 +02:00
Jelmer Vernooij
cf9636ea99 tevent/python: Makefile was still trying to build some non AC_SUBST python targets
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
2009-05-19 23:33:00 +02:00
Jelmer Vernooij
72b744f38e tevent: Define TALLOC_FREE() if it's not defined yet, to allow building
with released versions of talloc.
2009-05-16 20:31:59 +02:00
Jelmer Vernooij
5065cf70f8 tevent: Remove python module.
This module didn't have any functionality that we actually used yet, and
it was quite small.

Tevent is quite low level and perhaps doesn't make much sense to expose
directly as a Python module. It was also causing build problems when used with a
system-tevent. We can always back later if necessary.
2009-05-16 14:56:37 +02:00
Jelmer Vernooij
857c3f8322 tevent: Install tevent_internal.h in the standalone build.
This is not ideal, but at least it fixes the build of samba-gtk for now.
I've also added a warning about API guarantees at the top of the header.
2009-05-16 04:14:21 +02:00
Samuel Thibault
a0caffd446 Fix linker flags on non-Linux GNU platforms.
(e.g. Debian GNU/kFreeBSD)

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2009-05-16 04:05:53 +02:00
Jelmer Vernooij
6230eb94af Update copies of config.guess and config.sub. 2009-05-16 04:03:12 +02:00
Jelmer Vernooij
06864b4469 tevent: Don't install headers, since we don't install a shared lib
either (from Samba).
2009-05-16 01:54:10 +02:00
Andrew Bartlett
d73eab2b33 Add extensive tests for str_list function behaviour 2009-05-15 01:50:06 +10:00
Volker Lendecke
074890b39e Remove two unused variables 2009-05-14 15:40:57 +02:00
Andrew Bartlett
a89bee4c98 Add new functions and tests: str_list_make_empty(), str_list_make_single() 2009-05-14 05:56:58 +10:00
Derrell Lipman
045af600f2 Take advantage of the easier-to-use thread macros
- Now that we initialize for the non-thread-safe case in the macro, there's no
  need to do it here too.

Derrell
2009-05-13 14:37:28 -04:00
Derrell Lipman
088906b064 Make the thread functions a bit easier to use
- Create separate macros for lock and unlock so that it's easier to identify
  which request is being made.

- Initialize *ponce in the SMB_THREAD_ONCE macro in the non-thread-safe case,
  rather than requiring each init function to determine if it's in the
  non-thread-safe case and manually initialize.

Derrell
2009-05-13 14:37:28 -04:00
Derrell Lipman
e03b9ae609 Allow a parameter to smb_thread_once's initialization function
- This should make life easier for ourselves. We're no longer constrained to
  the semantics of pthread_once, so let's allow passing a parameter to the
  initialization function. Some of Samba's init functions return a
  value. Although I haven't searched, I suspect that some of the init
  functions require in input parameters. The parameter added here can be used
  for input, output, or both, as necessary... or ignored, as is now done in
  talloc_stackframe_init().

Derrell
2009-05-13 09:50:17 -04:00
Derrell Lipman
7c39e450fc Fix broken smb_thread_once function (again)
- It would help if smb_thread_once did, eventually, set the variable that
  prevents the init function from being run again. Sigh. It must be getting
  late.

Derrell
2009-05-12 21:32:33 -04:00
Derrell Lipman
8a60c26c7c Fix broken smb_thread_once function
- We can't set *ponce=true before running the function because although other
  threads wouldn't re-run the initialization function, they could potentially
  proceed beyond the initialization point while the first thread was still
  running the initialization function. If a second thread gets to an
  SMB_THREAD_ONCE() call while one with the same ponce is running, we need to
  ensure that it enters smb_thread_once() to await the mutex and then recheck
  whether *ponce is set or not.  My original comment about other "once"
  functions possibly being called from within this "once" function is
  irrelevant since those other ones would have their own unique ponce.

Derrell
2009-05-12 21:24:34 -04:00
Jeremy Allison
6bc1ce996d Fix definition of smb_thread_once - must return int not void as
it's used in a ? : comparison macro.
Jeremy.
2009-05-11 22:33:32 -07:00
Jeremy Allison
d0865aeb5d Ensure documentation matches the tdb_util function usage.
Jeremy.
2009-05-11 17:29:16 -07:00
Derrell Lipman
915518c0db Use bool instead of int for a boolean variable 2009-05-10 23:04:00 -04:00
Derrell Lipman
9a93dc092c Optimize smb_thread_once usage by not calling it if known already called
- The macro SMB_THREAD_ONCE now tests whether the "once" variable is already
  set, and if so avoids calling smb_thread_once().

Derrell
2009-05-10 22:58:12 -04:00
Derrell Lipman
404327ad41 Panic upon mutex lock or unlock failure
- It's a serious error if we can't lock or unlock a mutex in
  smb_thread_once(). Panic instead of just displaying a DEBUG message.

Derrell
2009-05-10 22:45:12 -04:00
Derrell Lipman
418a2eeae8 Don't require external use of internal enum smb_thread_lock_type
- Internally, when locking or unlocking a mutex, we'll pass one of the
  values of enum smb_thread_lock_type. That enum is not available to users
  providing a thread implementation. Externally, we'll document the integer
  values which will be passed to their lock_mutex function, but not require
  them to access our internal header file.

Derrell
2009-05-10 22:45:12 -04:00
Derrell Lipman
d3434477e6 Replace external thread "once" with an internal implementation
Jeremy, please check...

- I'm in the process of providing an interface in libsmbclient to the
  recently-added threading capabilities. In the process, I discovered that
  different thread implementations have varying types for the variable passed
  to the thread_impl_once() function. pthreads, for example, uses type
  pthread_once_t. Since Samba needs to internally declare these variables, it
  would need to know the exact type required by each thread implementation's
  function. After considering multiple methods of obtaining an appropriately
  sized variable, I decided that for the basic "once" functionality required
  by Samba, it would be much simpler to just implement our own "once"
  functionality. We don't require cancellation points et all. This commit adds
  an smb_thread_once() function that is implemented using an internal
  mutex. The mutex itself uses the implementation's create_mutex
  function. This eliminates the need for the user to provide a smb_thread_once
  function pointer and the entire issue of that function's first parameter.

Derrell
2009-05-10 22:45:12 -04:00
Stefan Metzmacher
6f7cd213dd tevent: fix typo async_req_done() => tevent_req_done()
metze
2009-05-07 08:09:56 +02:00
Jelmer Vernooij
730c91aaaa Avoid --nonet when building manpages; xsltproc will already prefer local
stylesheets if they are installed.
2009-05-06 17:48:01 +02:00
Simo Sorce
d52172654c Update tdb and talloc web pages 2009-05-05 19:04:39 -04:00
Simo Sorce
b58abb262c Add release scripts for talloc and tdb 2009-05-05 09:51:00 -04:00
Volker Lendecke
2467ae1b6a Clean up after Tridge's util_strlist changes 2009-05-03 13:46:44 +02:00
Volker Lendecke
6ca4d727c4 Attempt to the build on NetBSD5 and a few others 2009-05-01 23:26:22 +02:00
Stefan Metzmacher
6ac61e6707 tsocket: add tstream_readv_pdu_queue_send/recv()
metze
2009-05-01 17:42:01 +02:00
Stefan Metzmacher
eb723c2061 tsocket: add tstream_writev_queue_send/recv()
metze
2009-05-01 17:42:00 +02:00
Stefan Metzmacher
a0830f4cb9 tsocket: add tstream_readv_pdu_send/recv()
metze
2009-05-01 17:41:56 +02:00
Stefan Metzmacher
ee6d796c19 tsocket: add tstream implementation for bsd sockets (inet and unix)
metze
2009-05-01 17:41:55 +02:00
Stefan Metzmacher
8a090c4b8b tsocket: add tstream_context infrastructure similar to tdgram_context
metze
2009-05-01 17:41:53 +02:00
Stefan Metzmacher
182a4b30de tsocket: rename tdgram_unix_dgram_socket() => tdgram_unix_socket()
metze
2009-05-01 17:41:38 +02:00
Stefan Metzmacher
b46599590f tsocket: move tsocket_simple_int_recv() to tsocket.c
metze
2009-05-01 17:38:27 +02:00
Stefan Metzmacher
0db3b944bd tsocket: move tsocket_sendto_queue_send/recv() to tsocket_helpers.c
metze
2009-05-01 17:38:26 +02:00
Stefan Metzmacher
b4c5387e9f tsocket: tdgram move input checks to the common code as there're needed for all backends
We need to make sure that we free the sendto and recvfrom requests before
the tdgram_context

metze
2009-05-01 17:38:25 +02:00
Stefan Metzmacher
cc75ff1a37 tsocket: for unix domain sockets we need to use sizeof(struct sockaddr_un)
sizeof(struct sockaddr_storage) generates EINVAL.

metze
2009-05-01 17:38:24 +02:00
Stefan Metzmacher
66a2cd36c6 tsocket: return EINVAL when tdgram_sendto_send() is used with len == 0
metze
2009-05-01 17:38:23 +02:00
Stefan Metzmacher
997eb9eb43 tsocket: fix dependecies
metze
2009-05-01 17:38:22 +02:00
Stefan Metzmacher
9dbb535aa5 tsocket: remove tsocket_context related stuff
It will be replaced by tdgram_context and tstream_context.

metze
2009-05-01 17:38:21 +02:00
Volker Lendecke
46bbdbd8c7 Fix a missing prototype warning 2009-04-28 15:34:22 +02:00
Michael Adam
664da577f9 pm_process():raise level of debug message
Michael
2009-04-28 12:20:38 +02:00
Jelmer Vernooij
3cf48ee05a Fix push_codepoint function without iconv_convenience. 2009-04-23 17:50:18 +02:00
Jelmer Vernooij
80420745ff Add a new non-convenience version of push_codepoint. 2009-04-23 17:50:18 +02:00
Simo Sorce
b029e0edcf Prevent reallocs of the talloc pool itself 2009-04-22 09:58:06 -04:00
Brad Hards
703d589770 Avoid using deprecated form of AC_CHECK_TYPE.
libreplace makes use of an older form of AC_CHECK_TYPE which basically
provides a fallback definition for the type if it isn't available.
http://www.gnu.org/software/hello/manual/autoconf/Obsolete-Macros.html#Obsolete-Macros
shows why this isn't a good idea (its not so important, except for pointer types).
This patch partly addresses the issue.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2009-04-22 10:36:47 +02:00
Jelmer Vernooij
bb0f430064 Error out at runtime when seteuid/setresuid or setegid/setresgid are not
available. This means it's possible to compile libreplace when these
functions are not available and use it, as long as this particular
function is not used.
2009-04-20 16:25:17 +02:00
Jelmer Vernooij
20e1ba1c09 Only define waitpid replacement if wait4 is available. (It isn't on
Windows.)
2009-04-20 16:25:16 +02:00
Jelmer Vernooij
e5233ccf9e Cope with the fact that only _mkdir() exists on Windows and that it
doesn't take a mode argument.
2009-04-20 16:25:16 +02:00
Jelmer Vernooij
fbf4293d7e Move check for syslog out of libreplace to source3/ and source4/.
This should help compiling talloc on Windows.
2009-04-20 16:25:16 +02:00
Jeremy Allison
5cbd7556c2 Ensure we have all the definitions needed in both threaded and non-threaded versions.
Jeremy.
2009-04-20 04:25:26 -07:00
Jeremy Allison
399c765538 Attempt to fix build farm on platforms where pthread_once_t is a struct.
Jeremy.
2009-04-20 04:00:06 -07:00
Jeremy Allison
3d2e95c296 Fix the pthread_once initialization issue. Make talloc_stackframe use
this.
Jeremy.
2009-04-20 03:04:42 -07:00
Stefan Metzmacher
56aae35a23 tsocket: fix the build without ipv6 support
metze
2009-04-16 09:31:14 +02:00
Jeremy Allison
d9804ae3cc Fix bug #6089 - Winbind samr_OpenDomain not possible with Samba 3.2.6+
What a difference a name makes... :-). Just because something is missnamed
SAMR_ACCESS_OPEN_DOMAIN, when it should actually be SAMR_ACCESS_LOOKUP_DOMAIN,
don't automatically use it for a security check in _samr_OpenDomain().
Jeremy.
2009-04-15 15:40:00 -07:00
Jeremy Allison
8e06e945b6 Ensure a tls key is only generated once - wrap create & destroy in a mutex.
Change the function names to add _once to the tls_create & tls_destroy to
make this obvious.
Jeremy.
2009-04-14 15:19:39 -07:00
Jeremy Allison
27a3118bcf Make talloc_stack threadsafe using TLS. Volker please
check. Passes make test and basic valgrind testing.
Jeremy.
2009-04-14 12:23:22 -07:00
Stefan Metzmacher
74707e8e8e socket_wrapper: fix the build on systems without ipv6 support
metze
2009-04-14 12:47:18 +02:00
Stefan Metzmacher
f20f5ae8e6 socket_wrapper: fix crash bug in swrap_readv/writev
metze
2009-04-10 19:38:29 +02:00
Andrew Tridgell
65ad2ced60 Merge branch 'wspp-schema' 2009-04-09 14:40:19 +10:00
Andrew Tridgell
fd7c52231f added _const versions of some of the str_list_*() functions
These const versions don't copy the strings themselves, which
is useful when those strings point at known constant data (into the
schema in this case)
2009-04-09 14:28:38 +10:00
Andrew Tridgell
4f69d7067d added str_list_unique() and str_list_show()
I also undid some of the const changes from Andrew, as
they didn't in fact resolve the const warnings.
2009-04-09 13:44:27 +10:00
Jeremy Allison
e5702da72c Add the thread functions to top level lib/util.
Not yet used, that's the next step.
Jeremy.
2009-04-08 15:46:49 -07:00
Volker Lendecke
ccd293ba0e Remove async_req 2009-04-08 23:11:59 +02:00
Andrew Bartlett
54f7523db1 Rework util_strlist prototypes to use a bit more and less const
Hopefully this produces less warnings, but it might produce more...

Andrew Bartlett
2009-04-08 23:18:13 +10:00
Karolin Seeger
8da2fa36b4 s3/popt.h: Fix typo.
Karolin
2009-04-07 20:05:21 +02:00
Andrew Tridgell
ef6c6ab4c6 added a str_list_append() function 2009-04-07 16:33:26 +10:00
Stefan Metzmacher
522bdea1f3 tsocket: reduce size of dummy variable
metze
2009-04-06 16:37:18 +02:00
Stefan Metzmacher
9d9f945281 tsocket: use the correct 'ret' variable for tdgram_disconnect_send/recv()
metze
2009-04-06 15:49:08 +02:00
Volker Lendecke
d3825d5d10 Use recv instead of read in read_packet_handler
This way the socket wrapper pcap file also sees the replies :-)
2009-04-05 13:45:15 +02:00
Stefan Metzmacher
3bbad34a02 tsocket: remove DGRAM support from tsocket_context
metze
2009-04-02 21:54:08 +02:00
Stefan Metzmacher
c59ee5a139 tsocket: optimize tdgram_bsd a lot
The desire is to do as less syscalls during the
tdgram_sendto_send/recv() and tdgram_recvfrom_send/recv()
operations.

1. we first try the sendto()/recvfrom() syscall and
   only use a fd event if we got EAGAIN.

2. we cache the fd event and only change it's flags
   if really needed.

For the highload case we do almost no epoll_ctl() and epoll_wait()/select()
syscalls anymore. This speeds up the LDAP-BENCH-CLDAP test
by more than 20%. (With a modified version of this test
which let the server skip any ldb calls and just return success
I'm getting about 8000 requests per second, while I'm getting
just about 6000 requests per second without optimization)

metze
2009-04-02 21:54:00 +02:00
Stefan Metzmacher
85742dbc06 tsocket: add tdgram_sendto_queue_send/recv()
metze
2009-04-02 21:53:59 +02:00
Stefan Metzmacher
8d98070a9f tsocket: split out a smaller tdgram_context abstraction
The idea is to have a tdgram and a tstream abstraction
which only provide tevent_req based io functions.

metze
2009-04-02 21:53:03 +02:00
Stefan Metzmacher
7ce1356c9f lib/util: fallback to any id in idr_get_new_random()
metze
2009-04-01 16:41:15 +02:00
Tim Prouty
42c0931441 tdb: Remove unused variable 2009-03-31 16:24:07 -07:00
Stefan Metzmacher
c200e8632f tsocket: try to fix the build on solaris FIONREAD was missing
metze
2009-03-31 20:33:33 +02:00
Andrew Tridgell
7a5e6940cf up the version to 1.1.4 with the addition of
tdb_transaction_prepare_commit()
2009-03-31 15:06:23 +11:00
Andrew Tridgell
84547b8dba added basic testing of tdb_transaction_prepare_commit() in tdbtorture 2009-03-31 13:59:03 +11:00
Howard Chu
b90863c0b7 Add tdb_transaction_prepare_commit()
Using tdb_transaction_prepare_commit() gives us 2-phase commits. This
allows us to safely commit across multiple tdb databases at once, with
reasonable transaction semantics

Signed-off-by: tridge@samba.org
2009-03-31 13:15:54 +11:00
Stefan Metzmacher
23bb1eedf6 tsocket: more s/sun/un to make the build on solaris happy
metze
2009-03-28 23:50:56 +01:00
Stefan Metzmacher
cacfae159f tsocket: try to fix the build on solaris systems
It seems that 'sun' is somewhere defined and we can
use it as name for variables or struct/union members.

metze
2009-03-27 11:40:36 +01:00
Jelmer Vernooij
1e200c1952 Merge branch 'master' of git://git.samba.org/samba 2009-03-26 15:31:02 +01:00
Volker Lendecke
6a2e71b12d Add tevent_req_simple_recv_ntstatus() 2009-03-24 13:23:40 +01:00
Michael Adam
33d9f46674 libreplace: use libreplace_SAVE_CPPFLAGS instead of SAVE_CPPFLAGS
This fixes Samba3's double listing of -I options in CFLAGS,
since samba3's configure wraps the call to AC_LIBREPLACE_NETWORK_CHECKS
into a SAVE_CPPFLAGS="${CPPFLAGS}" .. CPPFLAGS="${SAVE_CPPFLAGS}"
sequence... :-)

Michael
2009-03-23 17:48:23 +01:00
Stefan Metzmacher
435a0a5a3b socket_wrapper: fix connect() for dgram sockets, if the destination isn't there yet
Now we defer the real_connect() for dgram sockets to the first send()/sendto() call,
as the destination might not be there at connect time.

Commit 66dc53ee01 was an incomplete fix for this
problem.

metze
2009-03-23 12:19:29 +01:00
Volker Lendecke
979a1b06d0 talloc_array_length: talloc_get_size deals fine with NULL 2009-03-22 22:10:09 +01:00
Stefan Metzmacher
1f72e4abfd Revert "socket_wrapper: fix connect() for dgram sockets, if the destination isn't there yet"
This reverts commit 66dc53ee01.

Somehow this leads to timeouts in some tests, samba4.ldb.ldapi
and samba4.rpc.schannel. I need to look at it more closely later...

metze
2009-03-22 12:36:38 +01:00
Volker Lendecke
f590915fe5 Revert "Add a basic Doxyfile for talloc"
This reverts commit f55e84e904.
2009-03-22 09:48:54 +01:00
Volker Lendecke
a83c18062a Revert "Convert the contents of talloc_guide.txt to doxygen-style talloc.h comments"
This reverts commit d21212c919.
2009-03-22 09:48:48 +01:00
Volker Lendecke
c3df040699 Revert "Delete talloc_guide.txt"
This reverts commit 3f9c30022a.
2009-03-22 09:48:41 +01:00
Volker Lendecke
b7fb083dd7 Revert "Add a default "undocumented" module"
This reverts commit ba42320c7e.
2009-03-22 09:48:34 +01:00
Volker Lendecke
790326cc38 Revert "Add some initial hook to the front page"
This reverts commit cfce2d3611.
2009-03-22 09:48:27 +01:00
Volker Lendecke
5098f4625e Revert "Reformatting"
This reverts commit db447d0c47.
2009-03-22 09:48:19 +01:00
Volker Lendecke
c67ea37d62 Revert "Document talloc_pool()"
This reverts commit 27944ed745.
2009-03-22 09:48:14 +01:00
Volker Lendecke
6b1a5bbf02 Revert "Add a talloc_internal "module""
This reverts commit 02662d56c6.
2009-03-22 09:48:06 +01:00
Volker Lendecke
cce595d1fc Revert "Document _talloc"
This reverts commit 2ce70d4f5a.
2009-03-22 09:47:59 +01:00
Volker Lendecke
f15a0305f3 Revert "Document TALLOC_FREE()"
This reverts commit 3f81649b8d.
2009-03-22 09:47:51 +01:00
Volker Lendecke
c086c26ffb Revert "Document talloc_parent, talloc_parent_name and talloc_is_parent"
This reverts commit 986c2e01cc.
2009-03-22 09:47:44 +01:00
Volker Lendecke
257ea7e6f1 Revert "Document talloc_zero_array()"
This reverts commit 59dff57455.
2009-03-22 09:47:37 +01:00
Volker Lendecke
59dff57455 Document talloc_zero_array() 2009-03-21 23:57:24 +01:00
Volker Lendecke
986c2e01cc Document talloc_parent, talloc_parent_name and talloc_is_parent 2009-03-21 23:50:33 +01:00
Volker Lendecke
3f81649b8d Document TALLOC_FREE() 2009-03-21 20:04:17 +01:00
Volker Lendecke
2ce70d4f5a Document _talloc 2009-03-21 20:04:17 +01:00
Volker Lendecke
02662d56c6 Add a talloc_internal "module" 2009-03-21 20:04:17 +01:00
Volker Lendecke
27944ed745 Document talloc_pool() 2009-03-21 19:49:40 +01:00
Volker Lendecke
db447d0c47 Reformatting 2009-03-21 19:02:02 +01:00
Volker Lendecke
cfce2d3611 Add some initial hook to the front page 2009-03-21 19:02:02 +01:00
Volker Lendecke
ba42320c7e Add a default "undocumented" module 2009-03-21 19:02:02 +01:00
Volker Lendecke
3f9c30022a Delete talloc_guide.txt 2009-03-21 19:02:02 +01:00
Volker Lendecke
d21212c919 Convert the contents of talloc_guide.txt to doxygen-style talloc.h comments
talloc_guide.txt was partly outdated, and as going through talloc.h now shows
it was incomplete.
2009-03-21 19:02:01 +01:00
Volker Lendecke
f55e84e904 Add a basic Doxyfile for talloc 2009-03-21 19:02:01 +01:00
Stefan Metzmacher
66dc53ee01 socket_wrapper: fix connect() for dgram sockets, if the destination isn't there yet
metze
2009-03-21 10:44:40 +01:00
Jelmer Vernooij
ca202cf464 Merge branch 'master' of ssh://git.samba.org/data/git/samba into displaysec 2009-03-20 16:40:09 +01:00
Stefan Metzmacher
b69e72deda lib/util: build tevent_unix.o and tevent_ntstatus.o as UTIL_TEVENT subsystem
metze
2009-03-19 16:25:58 +01:00
Stefan Metzmacher
4e18c24e2e lib/tsocket: add tsocket_guide.txt section with specific details about bsd style sockets
metze
2009-03-19 16:25:58 +01:00
Stefan Metzmacher
f6efec5dd4 lib/tsocket: add a fast path to tsocket_writev_send/recv()
This is similar to the tsocket_sendto_send/recv() fast path.

metze
2009-03-19 16:25:57 +01:00
Stefan Metzmacher
b900e92425 lib/tsocket: add a fast path to tsocket_sendto_send/recv()
By first trying to send data without waiting for the socket
to become writeable we gain about 10-20% performance in the
LDAP-BENCH-CLDAP test.

metze
2009-03-19 16:25:57 +01:00
Stefan Metzmacher
235a7a420b lib/tsocket: add tsocket_guide.txt section about the async _send/recv() helper functions
metze
2009-03-19 16:25:56 +01:00
Stefan Metzmacher
a27c6eb8e2 lib/tsocket: add tsocket_readv_send/recv()
metze
2009-03-19 16:25:56 +01:00
Stefan Metzmacher
6c8bd1005d lib/tsocket: add tsocket_writev_queue_send/recv()
metze
2009-03-19 16:25:55 +01:00
Stefan Metzmacher
2e44ceaea8 lib/tsocket: add tsocket_writev_send/recv()
metze
2009-03-19 16:25:55 +01:00
Stefan Metzmacher
a140823cc9 lib/tsocket: add tsocket_connect_send/recv()
metze
2009-03-19 16:25:54 +01:00
Stefan Metzmacher
4002b7bdc1 lib/tsocket: add tsocket_sendto_queue_send/recv()
metze
2009-03-19 16:25:54 +01:00
Stefan Metzmacher
9ed7a45c88 lib/tsocket: add tsocket_sendto_send/recv()
metze
2009-03-19 16:25:54 +01:00
Stefan Metzmacher
ccfd6a6e39 lib/tsocket: add tsocket_recvfrom_send/recv()
metze
2009-03-19 16:25:53 +01:00
Stefan Metzmacher
6c88d61bdd lib/tsocket: add an implementation for bsd style sockets.
metze
2009-03-19 16:25:53 +01:00
Stefan Metzmacher
c00126e609 lib/tsocket: add a tsocket_guide.txt with a description of the design
metze
2009-03-19 16:25:52 +01:00
Stefan Metzmacher
d848d517b5 lib/tsocket: add some useful helper functions
metze
2009-03-19 16:20:22 +01:00
Stefan Metzmacher
2e0e416676 lib/tsocket: add generic socket abstraction layer
This will replace source4/lib/socket/.

metze
2009-03-19 15:01:12 +01:00
Stefan Metzmacher
36e7045340 tevent: fix the nesting logic
Only tevent_loop_once and tevent_loop_until() should care
about the nesting level.

This fixes the samba3 printing code where we use tevent_loop_wait()
and don't allow nested events.

We still call the nesting hook for all levels, we need to decide
if we really want this...

metze
2009-03-19 14:39:22 +01:00
Andrew Tridgell
13b6663e23 fixed a logic bug in the tevent nesting code
The event nesting code never triggered as nesting.level was never
greater than 1. The main event loop needs to increase the nesting
level by 1.

I also added a paranoia check to the nesting setup call. The API as
currently written cannot support multiple nesting hooks, so we need to
abort if multiple hooks are tried.
2009-03-19 11:21:36 +11:00
Timur
a3d04991ef build: fix detection of netinet/ip.h on FreeBSD
Signed-off-by: Michael Adam <obnox@samba.org>
2009-03-17 23:09:00 +01:00
Timur
e8aa7169a6 build: format the header check for netinet/ip.h more nicely
Signed-off-by: Michael Adam <obnox@samba.org>
2009-03-17 23:09:00 +01:00
Stefan Metzmacher
7d07266ca2 tevent: change version to 0.9.5 after the ABI has changed
metze
2009-03-17 20:19:11 +01:00
Stefan Metzmacher
9eaf53d98e tevent: store the location where a request was finished
This is very useful to find bugs.
You can use 'p *req' in gdb to show where
tevent_req_done(), tevent_req_error() or tevent_req_nomem()
was called.

metze
2009-03-17 20:17:01 +01:00
Stefan Metzmacher
3a831e4620 tevent: use an immediate event as trigger for tevent_queue
metze
2009-03-17 19:59:09 +01:00
Stefan Metzmacher
4bdf299385 tevent: use an immediate event fot tevent_req_post()
Now tevent_req_post() never fails

metze
2009-03-17 19:59:08 +01:00
Stefan Metzmacher
a78cd2a24b tevent: use TALLOC_FREE() in tevent_req.c
metze
2009-03-17 19:59:08 +01:00
Stefan Metzmacher
66886f8966 tevent: add support for immediate events
They're like directly triggered timed events,
but you can preallocated them and scheduling them
will not fail.

metze
2009-03-17 19:59:00 +01:00
Stefan Metzmacher
940e61846e tevent: add tevent_common_loop_wait() helper function and use it
tevent_loop_wait should do the same for all backends.
It should loop as long as we have pending events.

metze
2009-03-17 19:58:57 +01:00
Stefan Metzmacher
0139befb91 tevent: check signal events first in event_loop_once
We also check for signal events directly before and after
the select/epoll calls.

metze
2009-03-17 19:58:56 +01:00
Stefan Metzmacher
3af7db3dce tevent: let tevent_loop_once() just run one fd event
This makes the logic much simpler for the callers,
and matches the samba3 behavior.

If needed we can add performance tunning for tevent_loop_wait()
later.

metze
2009-03-17 19:58:55 +01:00
Volker Lendecke
b693f7f067 Remove some transitional code in writev_send 2009-03-17 17:31:22 +01:00
Volker Lendecke
54b9ad4f1f Remove some unused code from async_req.[ch] 2009-03-16 20:45:55 +01:00
Stefan Metzmacher
752cf03bf7 talloc: change version to 1.3.0
metze
2009-03-16 11:14:54 +01:00
Stefan Metzmacher
6d4a13241a talloc: add useful talloc_array_length() macro
metze
2009-03-16 11:14:53 +01:00