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

1371 Commits

Author SHA1 Message Date
Andrew Tridgell
58d92cefe2 pidl-python: cope with NULL pointers in more places
NULL is converted to Py_None
2010-09-02 13:37:07 +10:00
Andrew Tridgell
e7e39584a9 pytalloc: treat a NULL ptr as Py_None 2010-09-02 13:37:07 +10:00
Björn Jacke
20254221d2 tdb/waf: the deps for rt are provided by libreplace 2010-08-31 13:06:39 +02:00
Björn Jacke
7c88ccde30 replace/waf: add rt to deps at this place 2010-08-31 11:33:22 +02:00
Björn Jacke
73ad77f20a lib/util: add nsec_time_diff to calulate diffs from timespecs 2010-08-31 10:26:23 +02:00
Björn Jacke
c091b3344b lib/util: add function to query the monotonic clock with the required fallback to the realtime clock 2010-08-31 10:25:03 +02:00
Björn Jacke
63b1f2ee81 libreplace: make a define for a best effort monotonic clock 2010-08-31 10:24:37 +02:00
Björn Jacke
3df1037a74 libreplace: add clock_gettime replacement function for systems that don't have it 2010-08-31 09:07:29 +02:00
Björn Jacke
9f87bc4588 libreplace/waf: look for clock_gettime 2010-08-31 09:07:22 +02:00
Björn Jacke
4e104f185e libreplace: move detection of clock_gettime to libreplace 2010-08-31 09:07:13 +02:00
Björn Jacke
e8662248c8 libreplace: move gettimeofday TZ arg check here 2010-08-31 09:07:08 +02:00
Stefan Metzmacher
a6111c2a7b lib/util: remove implicit discard_const_p() from SAFE_FREE()
This should fix a lot of warnings on IRIX.
If callers know what they're doing they can use discard_const_p()
on their own.

metze
2010-08-28 08:41:00 +02:00
Stefan Metzmacher
8494d09b89 Revert "lib/tsocket: sa_socklen is a macro on irix, so better use sasocklen"
This reverts commit 3d4fb698660381e650d7caeb5b7cff12847c0fb8.

This was wrong... The problem was in the caller, sa_len is a macro on irix

metze
2010-08-28 08:28:01 +02:00
Stefan Metzmacher
44b2a7941c lib/tsocket: sa_socklen is a macro on irix, so better use sasocklen
metze
2010-08-27 13:00:26 +02:00
Andrew Tridgell
634e06e465 pytalloc: fixed py_talloc_steal()
py_talloc_steal() was implemented as a macro which evaluated it's 2nd
argument twice. It was often called via a macro with a 2nd argument
that was a function call, for example an allocation in
py_talloc_new(). This meant it allocated memory twice, and leaked one
of them.

This re-implements py_talloc_steal() as a function, so that it only
does the allocation once.
2010-08-25 23:05:05 +10:00
Andrew Tridgell
d78417a5d6 s4-pytalloc: use better names for python talloc objects 2010-08-25 23:05:05 +10:00
Jelmer Vernooij
481044f8b3 replace: Fix ifndefs for formatting defines.
Thanks to Michael Brown for pointing this out.
2010-08-23 15:10:07 +02:00
Andrew Tridgell
0d7557e2dc libreplace: fixed the strptime() waf test
Thanks to Jelmer for pointing this out
2010-08-23 15:55:38 +10:00
Jelmer Vernooij
3dc7203713 Use DocBook DTD rather than Samba one, as no Samba-specific things are
used in the tdb manpages.
2010-08-22 14:05:58 +02:00
James Peach
b7ad0c6e39 smbtorture: Emit correct test results if setup fails.
If the test setup fails, we still need to format the test result for the
UI. At leas in the subunit case, the format doesn't specify what to do
here, so we fail every test manually with the setup failure message.
2010-08-17 20:19:27 -07:00
Volker Lendecke
5f1b120599 s3: Fix a ton of type-punned warnings 2010-08-17 08:53:33 +02:00
Volker Lendecke
f94039a8ea s3: Fix a typo 2010-08-15 09:45:30 +02:00
Matthias Dieter Wallnöfer
2de63aa280 talloc:documentation - explain that "talloc_free" works also with "NULL" pointers
(talloc.c)
...
> static inline int _talloc_free_internal(void *ptr, const char *location)
> {
>        struct talloc_chunk *tc;
>
>        if (unlikely(ptr == NULL)) {
>                return -1;
>        }
>
>        tc = talloc_chunk_from_ptr(ptr);
...

Obviously this never had been documented before.
2010-08-14 18:48:20 +02:00
Rusty Russell
11ab43084b tdb: workaround starvation problem in locking entire database.
We saw tdb_lockall() take 71 seconds under heavy load; this is because Linux
(at least) doesn't prevent new small locks being obtained while we're waiting
for a big log.

The workaround is to do divide and conquer using non-blocking chainlocks: if
we get down to a single chain we block.  Using a simple test program where
children did "hold lock for 100ms, sleep for 1 second" the time to do
tdb_lockall() dropped signifiantly.  There are ln(hashsize) locks taken in
the contended case, but that's slow anyway.

More analysis is given in my blog at http://rusty.ozlabs.org/?p=120

This may also help transactions, though in that case it's the initial
read lock which uses this gradual locking routine; the update-to-write-lock
code is separate and still tries to update in one go.

Even though ABI doesn't change, minor version bumped so behavior change
can be easily detected.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-08-14 02:31:22 +09:30
Björn Jacke
5390baeb6b tdb: add TDB_DEPS variable filled with required libraries
This is required for Solaris, which needs to link in librt to make use of
fdatasync().
2010-08-13 14:57:44 +02:00
Jeremy Allison
bc1c82ea13 Fix tdb_check() to work with read-only tdb databases. The function tdb_lockall() uses F_WRLCK internally, which doesn't work on a fd opened with O_RDONLY. Use tdb_lockall_read() instead.
Jeremy.
2010-07-29 08:56:35 +09:30
Andrew Tridgell
059ad34e0f lib: added samba-util.pc creation
Thanks to Brad Hards for this patch
2010-07-26 11:19:59 +10:00
Matthieu Patou
c55f5f2a35 s4 nss_switch: fix build problem on computer without the iniparser
Although the build was ok on my workstation it appears that on build
server it was not because the include path was not correct.
2010-07-17 20:10:11 +04:00
Matthieu Patou
dbbfad8286 s4-waf: add the missing bits for builing nss_winbind and pam_winbind
This is something that was not picked up during the migration to waf
2010-07-17 18:05:12 +04:00
Andrew Tridgell
6b266b85cf s4-loadparm: 2nd half of lp_ to lpcfg_ conversion
this converts all callers that use the Samba4 loadparm lp_ calling
convention to use the lpcfg_ prefix.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-16 18:24:27 +10:00
Volker Lendecke
77a3858f2f tsocket: Fix some unreachable code 2010-07-11 18:14:33 +02:00
Günther Deschner
f7a3bd4fa4 tdb: fix the build on mac os x 10.6.4.
Guenther
2010-07-01 23:14:57 +02:00
Andreas Schneider
b46eccfb19 nss_wrapper: Fixed a possible NULL pointer problem. 2010-06-28 10:18:12 +02:00
Jelmer Vernooij
e40afe975a Move UCS2 macros to common code 2010-06-25 22:48:59 +02:00
Andrew Tridgell
0be1820718 s4-ldb: use CHECK_XSLTPROC_MANPAGES() 2010-06-24 18:46:57 +10:00
Andrew Tridgell
4cb423f527 s4-python: python is not always in /usr/bin
Using "#!/usr/bin/env python" is more portable. It still isn't ideal
though, as we should really use the python path found at configure
time. We do that in many places already, but some don't.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-24 18:46:57 +10:00
James Peach
9f69790355 smbtorture: Move interactive shell into a separate file. 2010-06-21 08:58:10 -07:00
Volker Lendecke
4b64555d75 tsocket: Fix some type-punned warnings 2010-06-21 15:03:59 +02:00
Jelmer Vernooij
5e67566f5e pytdb: Cleanup formatting. 2010-06-19 22:46:44 +02:00
Jelmer Vernooij
bd1786f7f1 wafsamba: Fix typo: noextenion -> noextension. 2010-06-19 12:10:29 +02:00
Jelmer Vernooij
f2527d217c replace: Avoid hiding symbols when libreplace is builtin, as this
appears to cause unresolved symbols at the moment.
2010-06-18 23:51:40 +02:00
Günther Deschner
aa76e8263d lib/crypto: only include what is needed.
Guenther
2010-06-16 18:58:04 +02:00
Jelmer Vernooij
d319c83f1f librpc: Install the right headers. 2010-06-13 19:55:53 +02:00
Rusty Russell
b53f8c187d Since idtree assigns sequentially, it rarely reaches high numbers.
But such numbers can be forced with idr_get_new_above(), and that
reveals two bugs:

1) Crash in sub_remove() caused by pa array being too short.
2) Shift by more than 32 in _idr_find(), which is undefined, causing
   the "outside the current tree" optimization to misfire and return NULL.
2010-06-10 13:27:51 -07:00
Volker Lendecke
7f29f817fa tevent: Fix maxfd calculation in tevent_select
When doing

        fd1 = tevent_add_fd(ev, ev, 2, 0, NULL, NULL);
        fd2 = tevent_add_fd(ev, ev, 3, 0, NULL, NULL);
        TALLOC_FREE(fd2);
        fd2 = tevent_add_fd(ev, ev, 1, 0, NULL, NULL);

we end up with select_ev->maxfd==1. This is wrong.

An alternative fix might be to make select_ev->maxfd an unsigned int and make
EVENT_INVALID_MAXFD==UINT_MAX. But in theory we might end up with an fd of
UINT_MAX.

std_event_add_fd() contains exactly the same piece of code, so I'm directly
pushing it.

Volker
2010-06-10 11:24:00 +02:00
James Peach
3eac633522 libreplace: Fix readline build with libedit.
libedit on MAc OSX 10.5 does not have the rl_completion_t typedef,
but uses a internal typedef names CPPFunction.

Signed-off-by: Günther Deschner <gd@samba.org>
2010-06-03 16:33:43 +02:00
Günther Deschner
fc9644a7d6 lib/replace: fix some c++ build warnings in testsuite.
Guenther
2010-06-01 16:49:24 +02:00
Jelmer Vernooij
8c017022db talloc: Don't set is_bundled for standalone build. 2010-05-31 13:57:03 +02:00
Jelmer Vernooij
f98bb7ffc3 Add manpages argument to SAMBA_LIBRARY(). 2010-05-31 13:56:25 +02:00
Jelmer Vernooij
04fc459a30 tdb-waf: Don't install binaries when using system tdb. 2010-05-31 04:20:44 +02:00