1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
Commit Graph

3320 Commits

Author SHA1 Message Date
Tsukasa Hamano
16d725b4f5 Fix bug #9471 - SEGV when using second vfs module.
Don't use default_classname_table when we obviously shoud be using
classname_table.

Reviewed by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Dec  7 17:51:50 CET 2012 on sn-devel-104
2012-12-07 17:51:50 +01:00
Karolin Seeger
4af921fe88 lib/talloc: Move manpage to man/.
Trying to be more consistent.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-12-03 14:35:11 +01:00
Karolin Seeger
ede2aaef28 lib/tdb: Rename manpages/ to man/.
Trying to be more consistent.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-12-03 14:35:11 +01:00
Andreas Schneider
5323508773 replace: Remove deprecated getpass() support.
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2012-12-03 14:35:10 +01:00
Andreas Schneider
27a1327b49 util: Add a UNIX platform independent samba_getpass().
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2012-12-03 14:35:08 +01:00
Michael Adam
8f3f38ece4 ldb: fix a typo in the comment for ldb_req_is_untrusted()
Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Nov 30 15:44:46 CET 2012 on sn-devel-104
2012-11-30 15:44:46 +01:00
Volker Lendecke
e271db4fd8 dbwrap: Remove an unnecessary if-statement
TALLOC_FREE can live with a NULL pointer

Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:27:38 +01:00
Volker Lendecke
c7af12dd30 dbwrap: No need to NULL out a talloc_zero'ed structure element
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:27:37 +01:00
Volker Lendecke
a02251333f dbwrap: Use talloc_zero in db_open_rbt
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:27:37 +01:00
Volker Lendecke
0c0815cfe3 dbwrap: Use talloc_zero in db_open_cache
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:27:36 +01:00
Volker Lendecke
8300791a67 dbwrap: Use dbwrap_parse_record in dbwrap_fetch_uint32_bystring
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:24:35 +01:00
Karolin Seeger
68c6dcb094 docs: man tdbtool: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:49 +01:00
Karolin Seeger
174ab3542d docs: man talloc: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:43 +01:00
Karolin Seeger
0162dd55d3 docs: man ldbsearch: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:39 +01:00
Karolin Seeger
787a58b4a7 docs: man ldbrename: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:36 +01:00
Karolin Seeger
1404a24d3e docs: man ldbmodify: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:32 +01:00
Karolin Seeger
0b900da6ac docs: man ldbedit: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:26 +01:00
Karolin Seeger
1d5ef8931c docs: man ldbdel: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:23 +01:00
Karolin Seeger
08e63057de docs: man ldbadd: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:19 +01:00
Karolin Seeger
ac4881bd01 docs: man ldb.3: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:40:58 +01:00
Andrew Bartlett
c704f0daa5 lib/replace: Do not use STRERROR_R_PROTO_COMPATIBLE as only roken.h sets this
Currently, we put strerror_r into libreplace even on systems with strerror_r.

Andrew Bartlett

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-22 10:21:16 +01:00
Stefan Metzmacher
a15da36258 lib/replace: replace all *printf function if we replace snprintf (bug #9390)
This fixes segfaults in log level = 10 on Solaris.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Björn Jacke <bj@sernet.de>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Wed Nov 14 19:41:14 CET 2012 on sn-devel-104
2012-11-14 19:41:14 +01:00
Jelmer Vernooij
a53caea7a2 subunit: Update to latest upstream version.
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Wed Nov 14 12:11:58 CET 2012 on sn-devel-104
2012-11-14 12:11:57 +01:00
Jelmer Vernooij
7b654a8c18 testtools: Update to latest version. 2012-11-14 09:46:53 +01:00
Andrew Bartlett
d6c7e9b1ed smbd: Remove NT4 compatability handling in posix -> NT ACL conversion
NT4 is long dead, and we should not change which ACL we return based
on what we think the client is.  The reason we should not do this, is
that if we are using vfs_acl_xattr then the hash will break if we do.
Additionally, it would require that the python VFS interface set the
global remote_arch to fake up being a modern client.

This instead seems cleaner and removes untested code (the tests are
updated to then handle the results of the modern codepath).

The supporting 'acl compatability' parameter is also removed.

Andrew Bartlett

Reviewed by: Jeremy Allison <jra@samba.org>
2012-11-13 22:48:19 +01:00
Stefan Metzmacher
6f47497610 lib/ldb: add missing newline in the output of ldb_ldif_write_trace()
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Nov 13 13:53:31 CET 2012 on sn-devel-104
2012-11-13 13:53:31 +01:00
Stefan Metzmacher
1ecc76b248 lib/addns: remove compiler warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-13 22:14:14 +11:00
Stefan Metzmacher
eecc1d2942 lib/addns: don't depend on the order in resp->answers[]
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-13 22:14:13 +11:00
Stefan Metzmacher
b59c5db5f7 lib/addns: remove pointless check for resp->num_additionals != 1
We never use resp->additionals, so there's no reason to check.

This fixes dns updates against BIND9 (used in a Samba4 domain).

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-13 22:14:13 +11:00
Volker Lendecke
647a0fb098 lib/util: Simplify bitmap.c a bit
This avoids the double-talloc for bitmaps

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-07 15:32:24 +01:00
Volker Lendecke
7f4d55d1b8 lib/util: Make "struct bitmap" abstract
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-07 15:32:24 +01:00
Stefan Metzmacher
719595b6f7 lib/tsocket: optimize syscalls in tstream_readv_pdu_send()
Once we've got the first part of a pdu we try to optimize
readv calls for the rest of the pdu.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-11-05 17:13:40 +01:00
Stefan Metzmacher
e42889f83f lib/tsocket: disable the syscall optimization for recvfrom/readv by default
We only do the optimization on recvfrom/readv if the caller asked for it.

This is needed because in most cases we preferr to flush send
buffers before receiving incoming requests.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-11-05 17:13:39 +01:00
Stefan Metzmacher
24f3f87706 lib/krb5_wrap: request enc_types in the correct order (bug #9272)
aes256-cts-hmac-sha1-96 and aes128-cts-hmac-sha1-96
should have a higher priority than arcfour-hmac-md5,
otherwise the KDC still gives us arcfour-hmac-md5 session keys.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-01 16:24:28 +01:00
Andrew Tridgell
30ffdda45b ldb: fixed callers for ldb_pack_data() and ldb_unpack_data()
with ltdb_pack_data() and ltdb_unpack_data() now moved into common, we
need to increase the minor version and fixup callers of the API

Note that this relies on struct ldb_val being the same shape as
TDB_DATA, in much the same way as we rely on ldb_val and DATA_BLOB
being the same shape.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2012-11-01 15:40:41 +11:00
Andrew Tridgell
fc47b0d03c ldb: move ldb_pack.c into common
this code should not be tied to the ldb_tdb backend, both because it
could be used for any record oriented backend, and because it should
be exposed for use by diagnosis/repair tools such as the recently
added ldbdump tool

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2012-11-01 15:40:40 +11:00
Björn Jacke
ffb608b54d util: remove accidently committed hunk
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Wed Oct 31 19:25:30 CET 2012 on sn-devel-104
2012-10-31 19:25:30 +01:00
Andrew Bartlett
a71ad96bd0 ldb: Add ldbdump, based on tdbdump
This uses a tdb_traverse or (more usefully) the tdb_rescue API, like tdbdump.

The difference here is that it uses ldb helper functions to further
eliminate faulty records, which avoids creating duplicates in the output.

(The duplicates come from parts of records that are left in blank space
in the db, which tdb_rescue finds, but which are not actually a full
record).

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Oct 30 23:56:11 CET 2012 on sn-devel-104
2012-10-30 23:56:11 +01:00
Andrew Bartlett
4b2f3c6dec ldb: Remove no-longer-existing ltdb_unpack_data_free from ldb_tdb.h 2012-10-31 08:13:56 +11:00
Andrew Bartlett
cc6d0decc7 ldb: Change ltdb_unpack_data to take an ldb_context
It always de-references the module to find the ldb anyway.

Andrew Bartlett
2012-10-31 08:13:56 +11:00
Björn Jacke
e6643fbf48 wafbuild: use -Wstack-protector if available
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Tue Oct 30 15:04:30 CET 2012 on sn-devel-104
2012-10-30 15:04:30 +01:00
Björn Jacke
fdead585dc ccan/wafbuild: use WERROR_CFLAGS instead of -Werror 2012-10-30 13:18:50 +01:00
Björn Jacke
7fcb2532b9 wafbuild: reorder the Werror checks so that the ambigous w2 option is being checked last 2012-10-30 13:18:50 +01:00
Björn Jacke
51692042d9 wafbuild: merge the missing IBM compiler Werror flag "-qhalt=w" to waf 2012-10-30 13:18:50 +01:00
Björn Jacke
0342ca4062 wfabuild: fix the -errwarn compile flag test
as in the autoconf build this must be "-errwarn=%all"
2012-10-30 13:18:50 +01:00
Michael Adam
88332dfd9f lib/param: fix line length of DEBUG statments touched in previous commit in set_variable()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Mon Oct 29 21:55:35 CET 2012 on sn-devel-104
2012-10-29 21:55:35 +01:00
Michael Adam
b59fed0d5d lib/param: fix function name (set_variable) in debug statements
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2012-10-29 20:14:07 +01:00
Michael Adam
d084f5e6a6 lib/param: fix function name (lpcfg_file_list_changed) in a debug message
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2012-10-29 20:14:07 +01:00
Andrew Bartlett
2756c3ce5c lib/replace: Return size of xattr if size argument is 0
This makes rep_{f,}getxattr a more complete replacement for the linux function.

Andrew Bartlett
2012-10-28 16:32:42 +11:00
Andrew Bartlett
f8e6bb46c0 dbwrap: use talloc_stackframe() in db_tdb_log_key()
We can not be sure that there is already a talloc_stackframe() in place
so we must create one.

Andrew Bartlett
2012-10-25 22:19:59 +11:00
Stefan Metzmacher
d2aa785290 lib/tsocket: fix loop in tdgram_bsd_recvfrom() (bug #9184)
If the socket is not readable yet, we need to retry
if tsocket_bsd_pending() returns 0.

See also
https://lists.samba.org/archive/samba-technical/2012-October/087164.html

metze

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Oct 23 14:44:21 CEST 2012 on sn-devel-104
2012-10-23 14:44:21 +02:00
Andrew Bartlett
6d73fd07f9 lib/replace: Fix configure on FreeBSD: define_ret is not correct here
define_ret is for when the output of the compiled and run program
should be put into the configure define.  This is not the case
here.

Andrew Bartlett
2012-10-23 09:29:19 +02:00
Andrew Bartlett
debb2b2b9e lib/replace: Fix detection of rpcsrv/yp_prot.h on FreeBSD 2012-10-23 09:29:18 +02:00
Rusty Russell
029654897d ccan: check for all the used config.h defines
In particular, not checking for byteswap.h meant we defined duplicates:
https://bugzilla.samba.org/show_bug.cgi?id=9286

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Wed Oct 17 01:55:14 CEST 2012 on sn-devel-104
2012-10-17 01:55:14 +02:00
Matthieu Patou
03c4dceaab lib-addns: ensure that allocated buffer are pre set to 0
It avoid bugs when one of the buffer is supposed to contain a string
that is not null terminated (ie. label->label) and that we don't force
the last byte to 0.
2012-10-07 21:51:02 -07:00
Rusty Russell
899cdc4503 ntdb: remove unused local variable.
Reported-by: Matthieu Patou <mat@samba.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Mon Oct  8 04:43:37 CEST 2012 on sn-devel-104
2012-10-08 04:43:36 +02:00
Volker Lendecke
c62f8baff8 tdb: Make tdb robust against improper CLEAR_IF_FIRST restart
When winbind is restarted, there is a potential crash in tdb. Following
situation: We are in a cluster with ctdb. A winbind child hangs
in a request to the DC. Cluster monitoring decides the node has a
problem. Cluster monitoring decides to kill ctdbd. winbind child
still hangs in a RPC request. winbind parent figures that ctdb is
dead and immediately commits suicide. winbind parent is restarted by
cluster management, overwriting gencache.tdb with CLEAR_IF_FIRST. The
CLEAR_IF_FIRST logic as implemented now will not see that a child still
has the tdb open, only the parent holds the ACTIVE_LOCK due to performance
reasons. During the CLEAR_IF_FIRST logic is done, there is a very small
window where we ftruncate(tfd, 0) the file and re-write a proper header
without a lock. When during this small window the winbind child comes
back, wanting to store something into gencache.tdb, that winbind child
will crash with a SIGBUS.

Sounds unlikely? See:

[2012/09/29 07:02:31.871607,  0] lib/util.c:1183(smb_panic)
  PANIC (pid 1814517): internal error
[2012/09/29 07:02:31.877596,  0] lib/util.c:1287(log_stack_trace)
  BACKTRACE: 35 stack frames:
   #0 winbindd(log_stack_trace+0x1a) [0x7feb7d4ca18a]
   #1 winbindd(smb_panic+0x2b) [0x7feb7d4ca25b]
   #2 winbindd(+0x1a3cc4) [0x7feb7d4bacc4]
   #3 /lib64/libc.so.6(+0x32900) [0x7feb7a929900]
   #4 /lib64/libc.so.6(memcpy+0x35) [0x7feb7a97f355]
   #5 /usr/lib64/libtdb.so.1(+0x6e76) [0x7feb7b0b0e76]
   #6 /usr/lib64/libtdb.so.1(+0x3d37) [0x7feb7b0add37]
   #7 /usr/lib64/libtdb.so.1(+0x863d) [0x7feb7b0b263d]
   #8 /usr/lib64/libtdb.so.1(+0x8700) [0x7feb7b0b2700]
   #9 /usr/lib64/libtdb.so.1(+0x2505) [0x7feb7b0ac505]
   #10 /usr/lib64/libtdb.so.1(+0x25b7) [0x7feb7b0ac5b7]
   #11 /usr/lib64/libtdb.so.1(tdb_fetch+0x13) [0x7feb7b0ac633]
   #12 winbindd(gencache_set_data_blob+0x259) [0x7feb7d4d8449]
   #13 winbindd(gencache_set+0x53) [0x7feb7d4d85b3]
   #14 winbindd(gencache_del+0x5e) [0x7feb7d4d879e]
   #15 winbindd(saf_delete+0x93) [0x7feb7d54b693]
   #16 winbindd(+0xe507e) [0x7feb7d3fc07e]
   #17 winbindd(+0xe85e5) [0x7feb7d3ff5e5]
   #18 winbindd(+0xe65be) [0x7feb7d3fd5be]
   #19 winbindd(+0xe7562) [0x7feb7d3fe562]
   #20 winbindd(init_dc_connection+0x2e) [0x7feb7d3fe5be]
   #21 winbindd(+0xe75d9) [0x7feb7d3fe5d9]
   #22 winbindd(cm_connect_netlogon+0x58) [0x7feb7d3fe658]
   #23 winbindd(_wbint_PingDc+0x61) [0x7feb7d410991]
   #24 winbindd(+0x103175) [0x7feb7d41a175]
   #25 winbindd(winbindd_dual_ndrcmd+0xb7) [0x7feb7d4107d7]
   #26 winbindd(+0xf8609) [0x7feb7d40f609]
   #27 winbindd(+0xf9075) [0x7feb7d410075]
   #28 winbindd(tevent_common_loop_immediate+0xe8) [0x7feb7d4db198]
   #29 winbindd(run_events_poll+0x3c) [0x7feb7d4d93fc]
   #30 winbindd(+0x1c2b52) [0x7feb7d4d9b52]
   #31 winbindd(_tevent_loop_once+0x90) [0x7feb7d4d9f60]
   #32 winbindd(main+0x7b3) [0x7feb7d3e7aa3]
   #33 /lib64/libc.so.6(__libc_start_main+0xfd) [0x7feb7a915cdd]
   #34 winbindd(+0xce2a9) [0x7feb7d3e52a9]

This is in a winbind child, logfiles surrounding indicate the parent
was restarted.

This patch takes all chain locks around the CLEAR_IF_FIRST introduced
tdb_new_database.
2012-10-06 13:23:42 +02:00
Rusty Russell
37fd93194d tdb: Make robust against shrinking tdbs
When probing for a size change (eg. just before tdb_expand, tdb_check,
tdb_rescue) we call tdb_oob(tdb, tdb->map_size, 1, 1).  Unfortunately
this does nothing if the tdb has actually shrunk, which as Volker
demonstrated, can actually happen if a "longlived" parent crashes.

So move the map/update size/remap before the limit check.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-10-06 13:23:41 +02:00
Simo Sorce
36ea39edf8 talloc: Convert error cecking macros into fns
This will avoid 'surprise returns' and makes the code cleare to readers.
These macros were complex enough to warrant a full function anyway not
just for readability but also for debuggability.

Thanks David for pointing out this issue.

Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Fri Oct  5 23:24:17 CEST 2012 on sn-devel-104
2012-10-05 23:24:17 +02:00
Simo Sorce
7d7e33c624 Add tests for talloc_memlimit
Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Fri Oct  5 07:36:38 CEST 2012 on sn-devel-104
2012-10-05 07:36:38 +02:00
Simo Sorce
a33a78c302 Add memory limiting capability to talloc
By calling talloc_set_memlimit() we can now set a max memory limit
for a whole talloc hierarchy.
ANy attempt to allocate memory beyond the max allowed for the whole
hierarchy wil cause an allocation failure.

Stealing memory correctly accounts for used memory in the old and the new
hierarchy but exceeding the memory limit in the new parent will not cause
a failure.
2012-10-05 05:57:17 +02:00
Jeremy Allison
db62a159b8 Remove the parameters:
security mask
force security mode
directory security mask
force directory security mode

and update the docs.
2012-10-04 12:04:21 -07:00
Rusty Russell
100d38d6e0 tdb: add -e option to tdbdump (and docment it).
This allows for an emergency best-effort dump.  It's a little better than
strings(1).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Thu Oct  4 03:16:06 CEST 2012 on sn-devel-104
2012-10-04 03:16:06 +02:00
Rusty Russell
ffde867891 tdb: tdbdump should log errors, and fail in that case.
Dumping a corrupt database should not exit silently with 0 status!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-10-04 09:04:23 +09:30
Rusty Russell
90f463b25f tdb: add tdb_rescue()
This allows for an emergency best-effort dump.  It's a little better than
strings(1).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-10-04 09:04:19 +09:30
Volker Lendecke
a168a7c791 tdb: Fix a typo
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Oct  2 19:52:16 CEST 2012 on sn-devel-104
2012-10-02 19:52:16 +02:00
Günther Deschner
eae33e96fc s3-krb5: use and request AES keys in kerberos operations.
Guenther
2012-10-02 16:22:31 +02:00
Andrew Bartlett
931ed2509d lib/replace: Add test for what flag we need for -Werror behaviour 2012-09-29 14:50:00 +10:00
Andrew Bartlett
3902e7332d lib/util/charset: We do not use fucntions from wchar.h any more
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Sep 26 02:13:10 CEST 2012 on sn-devel-104
2012-09-26 02:13:10 +02:00
Andrew Bartlett
1c5c96d7cd lib/util/charset: Try to find iconv on HP-UX 2012-09-26 00:24:20 +02:00
Pierre Lejeune
809004689a pyntdb: Fix init function for ntdb python module.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>

Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Tue Sep 25 22:40:39 CEST 2012 on sn-devel-104
2012-09-25 22:40:39 +02:00
Volker Lendecke
849648cdb2 lib: Make async_sock includable on its own
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Sep 25 18:03:46 CEST 2012 on sn-devel-104
2012-09-25 18:03:46 +02:00
Jelmer Vernooij
6749cfb418 replace: Avoid returning value in void setproctitle() replacement.
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Tue Sep 25 06:38:40 CEST 2012 on sn-devel-104
2012-09-25 06:38:40 +02:00
Jelmer Vernooij
fd8d4ec347 replace: Support setproctitle().
This uses the setproctitle() from libc, libsetproctitle or libbsd.
If none is available it provides a dummy implementation.
2012-09-24 23:06:07 +02:00
Andrew Bartlett
2e51c386be lib/replace: Look for special flags needed for c99
This is normally handled by the waf core, but for HP-UX we currently fail.

The autoconf code hard-codes a case for HP-UX, but I want to try testing
it using a generic system first.

Andrew Bartlett
2012-09-24 03:51:07 +02:00
Andrew Bartlett
0727ad7321 lib/replace: Improve mkstemp test in autoconf and waf
On the Sernet-solaris8 host, this test passed in the autoconf build,
then failed in the recursive waf build.  This newer test should probe
the behaviour more closely, by checking we get two distinct, secure
files.

Andrew Bartlett
2012-09-24 03:51:07 +02:00
Andrew Bartlett
ffb3f2a19f lib/replace: Remove unused nap and therefore the SCO define
In any case, the Samba Team stopped supporting SCO systems a long time ago.

Andrew Bartlett
2012-09-23 14:52:28 +10:00
Andrew Bartlett
73bdb2a6c2 lib/util: Remove unbuilt file util_getent.c and BROKEN_GETGRNAM
Removing this unbuilt file allows removing BROKEN_GETGRNAM which was only
ever defined per-OS, not based on an actual test.

Andrew Bartlett
2012-09-23 14:45:17 +10:00
Andrew Bartlett
502135df9f lib/replace: Try to fix build on HP-UX for os2_delete test
The issue is that this file is both used in an autoconf test, and
later in a smbtorture test.  Because os2_delete.c does not include
replace.h, bool may not be defined.

So, instead we shift the need for bool to a different header.

(The readdir tests in repdir.m4 are not yet in the waf configure).

Andrew Bartlett
2012-09-23 14:31:01 +10:00
Andrew Bartlett
08d3062fc3 ntdb: Try to fix the build on Solaris which does not have err 2012-09-23 14:31:01 +10:00
Stefan Metzmacher
eacdd9f730 lib/tsocket: fix receiving of udp packets from 0 bytes (bug #9184)
It's possible for a client to send 0 bytes in a UDP packet,
we need still need to call recvfrom() and skip the invalid
packet at a higher level. Otherwise the kernel receive queue
is blocked.

metze
2012-09-22 04:31:06 +02:00
Gregor Beck
160ca49953 libtorture: factor out simple ui backend
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-21 16:26:39 +02:00
Gregor Beck
c3f1aed86f s3:dbwrap: remove unused args from db_open_file()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-21 16:26:38 +02:00
Gregor Beck
fe74b777d2 s3:dbwrap: let dbwrap_fetch_uint32 distinguish between "not found" and "wrong format"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-21 16:26:38 +02:00
Björn Jacke
ea96d79e21 replace: fix 520c9b0b0a
fix typo in ifdef. Thanks to Joachim Schmitz for spotting this!

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Tue Sep 18 16:06:18 CEST 2012 on sn-devel-104
2012-09-18 16:06:18 +02:00
Matthieu Patou
2a7484eb72 panic action is defined as GLOBAL_VAR(szPanicAction) not GLOBAL_VAR(panic_action)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Sep 18 06:12:00 CEST 2012 on sn-devel-104
2012-09-18 06:12:00 +02:00
Joachim Schmitz
7542b63188 libreplace: Bug 8107, Fix poll replacement to become a msleep replacement
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-17 15:01:39 -07:00
Andrew Bartlett
ffd61e2bbf ldb: bump version to 1.1.13 so the 4.0 release can get the isprint fix
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Sep 17 23:47:57 CEST 2012 on sn-devel-104
2012-09-17 23:47:57 +02:00
Björn Jacke
520c9b0b0a replace: add some includes for poll.h
See bug #8107

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Sun Sep 16 04:05:08 CEST 2012 on sn-devel-104
2012-09-16 04:05:07 +02:00
Andrew Bartlett
1627fcda3e dns_server: Remove parameter 'dns recursive queries' and base this on 'dns forwarder'
This simplifies a very common configuration.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-12 16:51:29 +02:00
Stefan Metzmacher
1b848ecbff lib/param: change the default for 'allow dns updates' to 'secure only'
metze
2012-09-12 16:51:29 +02:00
Stefan Metzmacher
ea1841ee10 lib/param: add some more alias for 'allow dns updates' options.
metze
2012-09-12 16:51:29 +02:00
Kai Blin
6ff5884713 loadparm: dns is now a default server service 2012-09-12 16:51:29 +02:00
Alexander Bokovoy
45f8f97937 lib/krb5_wrap: when deleting default realm, pass char*, not char**
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Wed Sep 12 10:33:37 CEST 2012 on sn-devel-104
2012-09-12 10:33:37 +02:00
Jeremy Allison
7c1fd74ba5 At Michael's suggestion, factor common code into a function. My bad :-).
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 11 20:08:37 CEST 2012 on sn-devel-104
2012-09-11 20:08:37 +02:00
Michael Adam
d237427f18 lib/replace: remove duplicate check for inotify 2012-09-11 14:29:54 +02:00
Jeremy Allison
cfeac09fc0 Fix bug #9147 - winbind can't fetch user or group info from AD via LDAP
Don't use "isprint" in ldb_binary_encode(). This is locale specific.
Restrict to ASCII only, hex encode everything else.
2012-09-10 21:56:34 +02:00
Matthieu Patou
f2ec75c7df osX define uint64_t as long long int 2012-09-10 05:57:21 +02:00
Michael Adam
1d012a6780 s3: introduce a new share config option "durable handles" defaulting to "yes"
This is in order to be able to turn durable handles off and on on a per share
basis.

Note: This is only used in combination with:

	kernel share modes = no
	kernel oplocks = no
	posix locking = no

Which means CIFS/SMB2 only access.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-08 19:46:08 +02:00
Michael Adam
da07186962 s3: add an option "kernel share modes" to be able to switch off using kernel flocks
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-08 11:10:54 +02:00
Michael Adam
f2f47b4bae loadparm: remove remnants of removed option "share modes"
(This completes commit d0878b3b81)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-08 11:09:45 +02:00
Björn Jacke
5c3769b056 build: define _BSD_TYPES on IRIX to have types like u_short
why the hell do IRIX systems headers like quota.h use types that are available
only with such a define...?
2012-09-07 16:42:14 +02:00
Björn Jacke
8299bd1814 waf: add check for BSD_STYLE_STATVFS
a leftover from bug #8777
2012-09-07 14:15:56 +02:00
Michael Adam
36ea4ec4eb param: remove unused define FN_LOCAL_PARM_CHAR()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-07 08:46:18 +02:00
Andrew Bartlett
f453117569 s3-printing: Restrict printing=cups to systems with cups development headers at build time
This means that instead of failing due to the default commandline values not being quite correct
that we clearly fail at loadparm and testparm time when parsing the printing= line.

Andrew Bartlett
2012-09-06 11:16:11 +10:00
Andrew Bartlett
fe36bb4bcc lib/krb4_wrap: Add const to kt_copy_one_principal 2012-08-29 23:46:17 +02:00
Andreas Schneider
24356f3cc9 libkrb5: Fix build with MIT Kerberos.
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Aug 29 12:23:37 CEST 2012 on sn-devel-104
2012-08-29 12:23:37 +02:00
Andrew Bartlett
5d96498680 s4-dsdb: Avoid printing secret attributes in ldb trace logs
These are printed when Samba has debug level 10, which is often used for debugging.

To indicate that these attributes are secret, we set an opaque.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Aug 29 06:04:33 CEST 2012 on sn-devel-104
2012-08-29 06:04:33 +02:00
Andrew Bartlett
395b8e4d58 lib/ldb: Avoid printing secret attributes in ldb trace logs
These are printed when Samba has debug level 10, which is often used for debugging.

Instead, print a note to say that this attribute has been skipped.

Andrew Bartlett
2012-08-29 12:28:38 +10:00
Andrew Bartlett
dd21bb0b72 lib/ldb: Bump ldb version to 1.1.11
This will ensure the next Samba release requires an ldb with the recent
fixes.

Andrew Bartlett
2012-08-28 15:47:37 +10:00
Andrew Bartlett
62373b8a50 lib/krb5_wrap: Move enctype conversion functions into a simple helper file 2012-08-28 07:57:29 +10:00
Andrew Bartlett
1ed6070570 lib/krb5_wrap: Move kerberos_enctype_to_bitmap() into krb5_wrap 2012-08-28 07:57:28 +10:00
Andrew Bartlett
0f7aa3db52 lib/krb5_wrap: Bring list of all enc types into krb5_wrap 2012-08-28 07:57:28 +10:00
Stefan Metzmacher
95f3662bbd lib/util: don't SMB_ASSERT() in process_exists_by_pid()
Just return false...

metze
2012-08-24 13:43:32 +02:00
Stefan Metzmacher
f83521a4ca lib/param: fix usage of 'write list = +Group'
metze

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Aug 24 11:28:17 CEST 2012 on sn-devel-104
2012-08-24 11:28:17 +02:00
Björn Jacke
b4252f8fa6 crypto/aes_ccm_128: fix compile warning on openindiana 2012-08-23 16:43:48 +02:00
Matthias Dieter Wallnöfer
32cd618e6c LDB:ldb_tdb.c - deny multi-valued attributes manipulation with doublets
This refers to LDB add operations as well, we have only to be careful on
"@ATTRIBUTES" entries.

E.g.

dn: cn=testperson,cn=users,dc=...,dc=...
objectClass: person
url: www.example.com
url: www.example.com

should not work.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:57 +02:00
Matthias Dieter Wallnöfer
cb63b34b05 LDB:ldbsearch - add search filter tests
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:57 +02:00
Matthias Dieter Wallnöfer
6a8c697954 LDB:ldbsearch - search filters do not only contain "="
Also "<=", ">=", "~"... are allowed as well. Enumeration taken from
ldb_parse_filtertype().
This was the cause of not identifying the search filter as described in bug
https://bugzilla.samba.org/show_bug.cgi?id=8647.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:55 +02:00
Matthias Dieter Wallnöfer
536c082505 LDB:ldif_handlers.c - LDB_OP_GREATER/LDB_OP_LESS are thought as ">=" or "<="
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:55 +02:00
Andrew Bartlett
4d5471f1c6 build: Remove special case for the build farm
Except in the formatting of the selftest output, this removes the special case
of the build farm, so that an autobuild, a manual make test and the build farm
are more similar.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 21 06:39:04 CEST 2012 on sn-devel-104
2012-08-21 06:39:04 +02:00
Michael Adam
471a853e34 lib/util: add server_id_set_disconnected() and server_id_is_disconnected()
Utility functions for handling the special placeholder server-id value
for disconnected clients (to be used for durable handles).

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-08-17 20:07:07 +02:00
Stefan Metzmacher
3cdf441da1 lib/util: let server_id_str() skip the task_id if 0 in the cluster case too
server_id_from_string() already handles that case.

metze
2012-08-17 20:07:07 +02:00
Stefan Metzmacher
d4a0aeb49a lib/util: add server_id_from_string()
metze
2012-08-17 20:07:07 +02:00
Stefan Metzmacher
8149623ad4 lib/util: add server_id_equal()
metze
2012-08-17 20:07:07 +02:00
Stefan Metzmacher
d7d8646e63 tevent: change version to 0.9.17 after adding the "poll_mt" backend
metze
2012-08-16 21:10:32 +02:00
Volker Lendecke
d7af2c842a tevent: Add threaded poll_mt testcase
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-08-16 20:52:17 +02:00
Volker Lendecke
fa71f32411 lib/tevent: Add a thread-safe tevent backend
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-08-16 20:49:11 +02:00
Volker Lendecke
d860aa2cac tevent_poll: Decouple poll_ev->fds handling from adding/removing fds
Step 1 in a python backend for multiple threads

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-08-16 20:48:32 +02:00
Björn Jacke
1f50b6c3ae tdb/test: fix build on OSF/1
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Aug 10 23:33:20 CEST 2012 on sn-devel-104
2012-08-10 23:33:20 +02:00
Björn Jacke
13f8674a15 build: rename security → samba-security
there is a libsecurity on OSF1 which clasheѕ with our security lib. see bug #9023.

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Aug 10 14:22:21 CEST 2012 on sn-devel-104
2012-08-10 14:22:20 +02:00
Andrew Bartlett
1d1bdc315b lib/ldb: Use tdb_parse_record and a callback rather than tdb_fetch()
This avoid allocation at the tdb layer as we will allocate this
with talloc right away anyway.

Andrew Bartlett
2012-08-10 10:18:27 +10:00
Andrew Bartlett
11d60d13dc s4-ldb_wrap: Do not vasprintf() the ldb debug messages that will not be shown
This malloc() and free() actually shows up quite high on a call profile of
provision of the AD DC.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug  9 13:51:06 CEST 2012 on sn-devel-104
2012-08-09 13:51:06 +02:00
Andrew Bartlett
73f0cb5278 lib/ldb: Do not vasprintf() the tevent debug messages that will not be shown
This malloc() and free() actually shows up quite high on a call profile of
provision of the AD DC.

This allows the debug handler to decide if the argument list should be
printed.

Andrew Bartlett
2012-08-09 20:14:23 +10:00
Andrew Bartlett
299fc75228 lib/ldb: Use tdb_exists() rather than tdb_fetch()/talloc_free()
This avoids pulling the record and doing an allocation when we just
want to know if it exists.

Andrew Bartlett
2012-08-09 20:14:22 +10:00
Christian Ambach
0dfc33026e lib/socket_wrapper: writev returns ssize_t, not int 2012-08-06 18:07:52 +02:00
Christian Ambach
18c152f8aa lib/param: move enum dns_update_settings to lib/param 2012-08-06 18:07:52 +02:00
Andrew Bartlett
4e0fb8b4b1 Revert "ldb: Add parameter to avoid NULL format string flagged by -Werror=format"
This reverts commit cddcaf7bd2.

-Werror=format is no longer uses when it would cause this to fail.
 This is a legitimate use of the ldb_search API.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Aug  6 14:47:27 CEST 2012 on sn-devel-104
2012-08-06 14:47:26 +02:00
Andrew Bartlett
49b2720317 lib/param: Also enable vlp when --enable-selftest is specified 2012-08-06 20:51:55 +10:00
Andreas Schneider
41cffa3c8b doc: Remove build/ from doxygen config or it will not work in brew.
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Sat Aug  4 16:31:22 CEST 2012 on sn-devel-104
2012-08-04 16:31:22 +02:00
Gregor Beck
cff3ad4089 lib/dbwrap: rewrite lock order check to ease debugging
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Aug  3 12:52:38 CEST 2012 on sn-devel-104
2012-08-03 12:52:38 +02:00
Andrew Bartlett
8208d7b2c2 lib/ldb: Ensure rename target does not exist before deleting old record
This is all in a transaction, but when we are handling rename errors in the repl_meta_data
module, we key off the error, and do not close the transaction.  We found that the
old record was gone and so could not try renaming it again to a conflict DN.

Andrew Bartlett
2012-07-31 14:15:29 +02:00
Volker Lendecke
c03e9769cd tevent: Refer to the correct header in testsuite.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-07-31 11:40:22 +02:00
Andrew Bartlett
cddcaf7bd2 ldb: Add parameter to avoid NULL format string flagged by -Werror=format
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jul 30 15:48:53 CEST 2012 on sn-devel-104
2012-07-30 15:48:53 +02:00
Andrew Bartlett
ea6b8ee026 lib/tdb: Fix format string errors found by -Werror=format in tdb tests 2012-07-30 14:25:10 +10:00
Andrew Bartlett
17bddd15de lib/ntdb: Fix format string errors found by -Werror=format in ntdb tests 2012-07-30 14:25:10 +10:00
Andrew Bartlett
5b4792d9d2 lib/ccan: Fix format string errors found by -Werror=format in ccan failtest 2012-07-30 14:25:09 +10:00
Andrew Bartlett
dc00df2add lib/param: Rename "socket address" to "nbt client socket address" to clarify role
This parameter is only used in our NBT client code and in nmbd as a
fallback when we fail to select a better interface from "interfaces"
to use directly.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jul 27 12:16:25 CEST 2012 on sn-devel-104
2012-07-27 12:16:25 +02:00
Andrew Bartlett
ec64f7907d lib/param: Mark lpcfg_cachedir and lpcfg_statedir as const char *
This matters as we sync up the declarations with the source3/param code.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jul 27 05:26:45 CEST 2012 on sn-devel-104
2012-07-27 05:26:45 +02:00
Andrew Bartlett
ca24820736 lib/param: Remove unused "paranoid server security"
This became unused when security=server went away.

Andrew Bartlett
2012-07-27 03:34:23 +02:00
Andrew Bartlett
ecb89cebd6 docs: Mark "socket address" as deprecated 2012-07-27 03:34:23 +02:00
Andrew Bartlett
42e405a422 param: Make socket_address common, Revert 611ef42053
This essentially reverts the commit 611ef42053
Author: Yasuma Takeda <yasuma@osstech.co.jp>
Date:   Fri Dec 5 13:37:51 2008 -0800

    Fix bug #5944 - nmbd does not boot if socket adress = "" is defined in smb.conf

Intead, the documentation is fixed so that the correct default is
recorded.  Removing the special case handling here allows this to be
dealt with in the same way as all other parameters.

Andrew Bartlett
2012-07-27 03:34:23 +02:00
Andrew Bartlett
bc1826abd6 lib/param: Merge parameter tables into a common file
This file is then included into both loadparm systems.

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
2012-07-27 03:34:23 +02:00
Andrew Bartlett
c4eeda91b0 lib/param: Merge in source3 parameters into parmeter table
This finishes the series to remove the various warnings from smb.conf
loading when a source3 parameter is used.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-27 03:34:22 +02:00
Andrew Bartlett
081a010f8c lib/param: Merge "Security Options" section from source3/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-27 03:34:22 +02:00
Andrew Bartlett
8cb47eff7e lib/param: Merge "Logging Options" section from source3/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-27 03:34:22 +02:00
Andrew Bartlett
08691f7eaf lib/param: Merge "Protocol Options" section from source3/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-27 03:34:22 +02:00
Andrew Bartlett
97a6447c06 lib/param: Merge "Tuning Options" section from source3/param
This will reduced the weight of the eventual merge of all of source3/param.

Andrew Bartlett
2012-07-27 03:34:22 +02:00
Andrew Bartlett
c5713acf5a lib/param: Merge "Printing Options" section from source3/param
This will reduced the weight of the eventual merge of all of source3/param.

Andrew Bartlett
2012-07-27 03:34:22 +02:00
Björn Jacke
4f0b8f30c9 s3/aio_fork: fix build on irix
IRIX needs _XOPEN_SOURCE defined for SCM_RIGHTS to be available
2012-07-26 18:27:40 +02:00
Andrew Bartlett
115a88e18f lib/param: Merge "Filename Handling" section from source3/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jul 26 14:16:02 CEST 2012 on sn-devel-104
2012-07-26 14:16:01 +02:00
Andrew Bartlett
deb9a05a59 lib/param: Merge "Domain Options" section from source3/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-26 12:23:20 +02:00
Andrew Bartlett
932f0a6af4 lib/param: Merge "Logon Options" section from source3/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-26 12:23:20 +02:00
Andrew Bartlett
b727e706c3 lib/param: Merge "Browse Options" section from source3/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-26 12:23:20 +02:00
Andrew Bartlett
3f1dfdd8b4 lib/param: Merge "WINS Options" section from source3/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-26 12:23:20 +02:00
Andrew Bartlett
ebc2cc7f8a lib/param: Merge "Locking Options" section from source3/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-26 12:23:20 +02:00
Andrew Bartlett
3e9c00112e lib/param: Merge "Ldap Options" section from source3/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-26 12:23:20 +02:00
Andrew Bartlett
8d2ba95c90 lib/param: Merge "EventLog Options" section from source3/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-26 12:23:20 +02:00
Andrew Bartlett
a0e08acbe0 lib/param: Merge "Miscellaneous Options" section from source3/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-26 12:23:20 +02:00
Andrew Bartlett
221a430e22 lib/param: Merge VFS and MSDFS parameters from source3 into lib/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jul 24 12:53:17 CEST 2012 on sn-devel-104
2012-07-24 12:53:17 +02:00
Andrew Bartlett
c7df664448 lib/param: Merge Winbind parameters from source3 into lib/param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-24 11:01:18 +02:00
Andrew Bartlett
19a886724a lib/param: Merge DNS parameters with source3 param
This will make the merge of the whole table smoother.

Based on an earlier patch
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-24 11:01:18 +02:00
Andrew Bartlett
9ee084fd39 lib/param: Rearrange AD DC options to make a merge with the source3 table easier
Andrew Bartlett
2012-07-24 11:01:18 +02:00
Andrew Bartlett
222850bf80 lib/param: Re-arrange TLS parameters into their own section
This makes the merge with the source3 table less disruptive

Based on an earlier patch:
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Andrew Bartlett
2012-07-24 11:01:17 +02:00
Andrew Bartlett
c1065ff073 lib/param: Add handler overrides
These #defines allow us to merge the parameter table without providing the
handler functions quite yet.  This helps us do this task in stages.

Andrew Bartlett
2012-07-24 11:01:17 +02:00
Andrew Bartlett
3367fd01d4 lib/param: Merge handling of security/domain master/domain logons/server role
This ensures that the same input parameters always gives the same
output values in both loadparm systems.

Andrew Bartlett
2012-07-24 11:01:17 +02:00
Andrew Bartlett
b62b031815 lib/param: Make lp_usershare_max_shares() a common parameter
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
2012-07-24 11:01:17 +02:00
Andrew Bartlett
f3562424b6 lib/param: Move all enum declarations to lib/param
This is in preperation for the parameter table being made common.

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
2012-07-24 11:01:17 +02:00
Andrew Bartlett
280d1877fd lib/param: Rename param_enums.c to param_table.c
This is in preperation for the parameter table being merged into this file.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jul 24 09:16:44 CEST 2012 on sn-devel-104
2012-07-24 09:16:44 +02:00
Andrew Bartlett
b94ab3c608 lib/param: Remove 'case insensitive filesystem'
We use the slightly confusing 'case sensitive = yes' option for the same behaviour.

This avoids adding even more confusing documentation for the ntvfs-only option.

Andrew Bartlett
2012-07-24 10:46:12 +10:00
Andrew Bartlett
8b1a9f3ebd lib/param: Remove "ntptr providor" and hard-code in s4 spoolss server
This stub codebase does not justify a merged parameter.

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
2012-07-24 10:46:12 +10:00
Andrew Bartlett
80d3208830 param: Make internal handler for 'server role' common 2012-07-24 10:46:12 +10:00
Andrew Bartlett
9521cd0409 param: Make the 'unicode' parameter common
This parameter is most useful for interop testing, rather than production use.

Andrew Bartlett
2012-07-24 10:46:12 +10:00
Stefan Metzmacher
5adf63fe30 lib/crypto: add aes_ccm_128
metze
2012-07-23 18:19:36 +02:00
Jeremy Allison
3e476e184d Add debugs to functions. Add pidfile_unlink(). 2012-07-19 16:08:16 -07:00
Jeremy Allison
2922fdaaf0 Move source4/smbd/pidfile into lib/util in preparation for making it in common. 2012-07-19 15:41:52 -07:00
Andrew Bartlett
03a6137001 s3-param: Remove special case for lp_ctdbd_socket(), set CTDB_PATH as default
This changes the default based on the #ifdef rather than an override
on a parameter value of ""

The less special override functions we have the easier it is to merge
the loadparm tables.

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jul 19 09:56:01 CEST 2012 on sn-devel-104
2012-07-19 09:56:01 +02:00
Andrew Bartlett
0f57da57e3 lib/param: bring lp_smb_ports() into common by making it a list everywhere 2012-07-19 08:02:32 +02:00
Andrew Bartlett
cf9bd1d9ed s3-param: Make lp_name_resolve_order() return a list
This allows this parameter, one of the few with differing declarations
between the loadparm systems, to be brought into common.

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
2012-07-19 08:02:32 +02:00
Andrew Bartlett
8822b3b662 s4-param: Remove unused "idmap trusted only"
When we revamp the idmap layer, we will end up just following the s3
options, and this option is not used there either.

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
2012-07-19 08:02:32 +02:00
Andrew Bartlett
d2ae8179ea lib/param: Add my copyright 2012-07-19 08:02:32 +02:00
Andrew Bartlett
1cbbd2d980 lib/param: bring lp_time_server() into common 2012-07-19 08:02:32 +02:00
Rusty Russell
1f8b574adb talloc_stack: abort in developer me if no stackframe on talloc_tos()
Don't tolerate leaks in developer mode.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 15:07:27 +09:30
Rusty Russell
fe72740e82 loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.
They use talloc_tos() internally: hoist that up to the callers, some
of whom don't want to us talloc_tos().

A simple patch, but hits a lot of files.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 15:07:23 +09:30
Rusty Russell
a620fc0372 lib/util/modules.c: fix stackframe leak.
do_smb_load_module() doesn't free its stackframe on success.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 05:02:31 +09:30
Rusty Russell
84fb37fe37 talloc_stack: report lazy freeing (panic if DEVELOPER).
talloc_stackframe() stacks, so if you forget to free one, the outer
one will free it.  However, it's not a good idea to rely too heavily
on this behaviour: it can lead to delays in the release of memory or
destructors.

I had an elaborate hack to make sure every talloc_stackframe() was
freed in the exact same function it was allocated, however all bugs it
caught were simply lazy freeing, so this patch just checks for that.

This doesn't check for stackframes we don't free up on exit: that would
be nice, but uncovers some uncomfortable (but probably harmless) cases.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 04:57:31 +09:30
Rusty Russell
f9b51ff33e talloc_stack: always include the location when creating a talloc_stackframe().
Much better for debugging.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 04:56:31 +09:30
Rusty Russell
311281c2c5 talloc_stack: handle more than one talloc_stackframe_pool()
The only reason we make one stackframe parent of the next is so we use
our parent's pool.  That doesn't make sense if we're a new pool, and
wouldn't work anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 04:55:31 +09:30
Rusty Russell
4f331872bc talloc: don't allow a talloc_pool inside a talloc_pool.
We explicitly call free() on a pool which falls to zero, assuming it's
not inside another pool (we crash).  Check on creation and explicitly
document this case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 04:54:31 +09:30
Rusty Russell
8893215aaf talloc: use a struct for pool headers.
This neatens the code a bit (we should do a similar thing for all the
TALLOC_CHUNK macros).

Two subtler changes:
(1) As a result of the struct, we actually pack object_count into the 
    talloc header on 32-bit platforms (since the header is 40 bytes, but
    needs to be 16-byte aligned).
(2) I avoid VALGRIND_MAKE_MEM_UNDEFINED on memmove when we resize the
    only entry in a pool; that's done later anyway.

With -O2 on my 11.04 Ubuntu 32-bit x86 laptop, the talloc_pool speed as
measured by testsuite.c actually increases 10%.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 04:53:31 +09:30
Andrew Bartlett
c92a5670e3 pytdb: Check if the database is closed before we touch it
If .close() has already been called, we have to play dead - the
self->ctx is just not valid any more, as we have been shut down to
allow some other part of Samba to open the tdb.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jul 16 13:51:52 CEST 2012 on sn-devel-104
2012-07-16 13:51:51 +02:00
Andrew Bartlett
a8e88332a3 pytdb: Check for errors parsing strings into TDB_DATA
The call to PyStringAsString() can raise an exception, and we
want to return that rather than following a NULL pointer later.

Andrew Bartlett
2012-07-16 11:58:21 +02:00
Andrew Bartlett
1013fab5f8 lib/util: Allocate enough space to reference blob->data[len]
Found by Thomas Hood <jdthood@gmail.com> using valgrind.

Thanks!

Andrew Bartlett
2012-07-13 08:12:17 +02:00
Andrew Bartlett
7b1fb36ad0 lib/ldb: Bump ldb release due to pyldb changes
We strictly need these changes to pass make test, and the concat change is
backwards incompatible, so we really want to use the right version.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jul  9 04:34:06 CEST 2012 on sn-devel-104
2012-07-09 04:34:06 +02:00
Andrew Bartlett
979215ad59 pyldb: Add bindings for ldb_dn_remove_base_components 2012-07-06 22:55:49 +10:00
Andrew Bartlett
8d99b398d9 pyldb: Fix dn concat operation to be the other way around
This now concatonates Dn(ldb, "cn=config") + Dn(ldb, "dc=samba,dc=org") as "cn=config,dc=samba,dc=org"

Andrew Bartlett
2012-07-06 22:45:33 +10:00
Andrew Bartlett
2908bbe06a s4-selftest: Test samba-tool domain dcpromo
This needs a new environment to test it properly.  This requires a raise in the
number of socket wrapper interfaces.

Andrew Bartlett
2012-07-06 08:10:18 +02:00
Björn Jacke
7abe51f840 talloc: remove unused variables
found by the IRIX compiler

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Thu Jul  5 23:50:54 CEST 2012 on sn-devel-104
2012-07-05 23:50:54 +02:00
Björn Jacke
a79496d90c lib/addns: remove defines we don't need or have for sure via libreplace 2012-07-05 22:00:52 +02:00
Björn Jacke
4b83d61e7d lib/addns: remove use of uint8 uint16 and uint32 in favour of C99 types 2012-07-05 22:00:52 +02:00
Björn Jacke
fa98ef112b replace: make the INT64_MAX define more portable 2012-07-04 12:01:20 +02:00
Rusty Russell
74bf0c6ec6 ntdb: make --disable-ntdb work properly.
As per bug #9024, make --disable-ntdb work again.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Wed Jul  4 08:11:33 CEST 2012 on sn-devel-104
2012-07-04 08:11:33 +02:00
Andrew Bartlett
a8acaeebb6 ldb: bump version due to header and internal implementation changes
We need this version, not the previous release, for Samba.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jul  3 17:20:32 CEST 2012 on sn-devel-104
2012-07-03 17:20:32 +02:00
Jeremy Allison
ec9aae6251 Ensure we select the correct syscall numbers on a 32-bit Linux system. 2012-07-02 18:38:14 -07:00
Rusty Russell
8150f69dc4 ccan: make it a grouping library.
Andrew Bartlett pointed out that making CCAN a non-library will break
the build in a different way in future: when two separate private
libraries start using the same CCAN module, the symbol duplicate
detection will fire (since private libaries don't use any symbol
hiding).  That doesn't happen yet, but it will surely happen
eventually.

So, for now at least, we build as a private library again.  This
unfortunately means the top-level build creates a libccan.so, which
contains all the ccan modules whether you need them or not.  Given the
size of the library, I don't think this is a win.  But it's simple.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Sat Jun 30 11:19:04 CEST 2012 on sn-devel-104
2012-06-30 11:19:03 +02:00
Jeremy Allison
f81fd1ccc3 Try and fix the autoconf build on Solaris/Nexenta/etc.
Their AC_TRY_RUN doesn't include any current CPPFLAGS. Make
the set[res]uid checks independent of this. Needs a small
change to the waf build in order to code with the change.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jun 30 00:32:36 CEST 2012 on sn-devel-104
2012-06-30 00:32:36 +02:00
Stefan Metzmacher
19941a9054 lib/ccan: readd execinfo dependency to failtest
metze

Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-29 15:21:15 +02:00
Stefan Metzmacher
3c3ed70690 lib/util: fix fd leak in anonymous_shared_allocate() if MAP_ANON is not available
metze
2012-06-29 15:21:10 +02:00
Rusty Russell
f3862b9171 ccan: we're subsystems, not a library.
Don't expose a libccan.so; it would produce clashes if someone else
does the same thing.  Unfortunately, if we just change it from a
SAMBA_LIBRARY to a SAMBA_SUBSYSTEM, it doesn't create a static library
as we'd like, but links all the object files in.  This means we get
many duplicates (eg. everyone gets a copy of tally, even though only
ntdb wants it).

So, the solution is twofold:
1) Make the ccan modules separate.
2) Make the ccan modules SAMBA_SUBSYSTEMs not SAMBA_LIBRARYs so we don't
   build shared libraries which we can't share.
3) Make the places which uses ccan explicit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Fri Jun 29 06:22:44 CEST 2012 on sn-devel-104
2012-06-29 06:22:44 +02:00
Jeremy Allison
485787f0df Move back to using per-thread credentials on Linux. Fixes the glibc native AIO lost wakeup problem.
See this post:

https://lists.samba.org/archive/samba-technical/2012-June/085101.html

for details.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun 29 03:57:45 CEST 2012 on sn-devel-104
2012-06-29 03:57:45 +02:00
Jeremy Allison
821bd95156 Replace all uses of setXX[ug]id() and setgroups with samba_setXX[ug]id() calls.
Will allow thread-specific credentials to be added by modifying
the central definitions. Deliberately left the setXX[ug]id()
call in popt as this is not used in Samba.
2012-06-28 17:15:16 -07:00
Jeremy Allison
7630fe50bd Add missing setresgid() wrapper. 2012-06-28 17:15:16 -07:00
Stefan Metzmacher
a5b62a60cc lib/param: let "SMB2" select PROTOCOL_SMB2_10
metze
2012-06-29 00:14:57 +02:00
Björn Jacke
0a1aaca1bd replace: define INT64_MAX when not defined
Tru64 doesn't have any stdint.h

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Thu Jun 28 00:45:58 CEST 2012 on sn-devel-104
2012-06-28 00:45:58 +02:00
Andrew Bartlett
666dba3353 s3-param: Rename loadparm_s3_context -> loadparm_s3_helpers
This helps clarify the role of this structure and wrapper function.

The purpose here is to provide helper functions to the lib/param
loadparm_context that point back at the s3 lp_ functions.  This allows
a struct loadparm_context to be passed to any point in the code, and
always refer to the correct loadparm system.  If this has not been
set, the variables loaded in the lib/param code will be returned.

As requested by Michael Adam.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jun 27 17:11:16 CEST 2012 on sn-devel-104
2012-06-27 17:11:16 +02:00
Andrew Bartlett
46db466372 lib/ldb: Print trace messages for modify correctly 2012-06-27 11:29:17 +02:00
Rusty Russell
66f59f0409 tdb: finish weaning off err.h.
Commit 3c4263e758 said it removed err.h
from tdb, unfortuntely it didn't: tap-interface.h still included it.

This finishes it properly!

Reported-by:Stefan Metzmacher <metze@samba.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Tue Jun 26 10:22:03 CEST 2012 on sn-devel-104
2012-06-26 10:22:03 +02:00
Stefan Metzmacher
97981491eb lib/param: add "SMB3" as alias for PROTOCOL_SMB3_00
metze
2012-06-25 20:55:06 +02:00
Matthieu Patou
1c850b2f17 ldb: lay foundation for proper utc/generalized time handling
We use to handle UTCtime and generalized time the same way. The thing is
that it's not the case, they are different in the way they are set (most
of the time) with different format and also stored and return in
different format too.
2012-06-22 23:22:03 -07:00
Matthieu Patou
9ebb081cce ldb: add the VERIFY_NAME control 2012-06-22 23:22:02 -07:00
Stefan Metzmacher
4676e7f65d dbwrap: don't ignore the result of dbwrap_parse_record in dbwrap_fetch_int32()
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 22 17:10:52 CEST 2012 on sn-devel-104
2012-06-22 17:10:52 +02:00
Stefan Metzmacher
0f25bd78ca dbwrap: intialize state.status in dbwrap_fetch_int32()
This might not be needed, but it makes it more clear that
we won't use uninitialized memory, it the callback was not triggered.

metze
2012-06-22 15:16:53 +02:00
Volker Lendecke
d7b9e0d19a dbwrap: Convert fetch_int32 to dbwrap_parse_record
Now dbwrap_fetch_int32 is used in smbd/locking/posix.c is used a
lot more often than before.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-22 15:16:52 +02:00
Volker Lendecke
e0abd1938a dbwrap: Add dbwrap_fetch_int32
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-22 15:16:47 +02:00
Volker Lendecke
ce7b0b9906 dbwrap: Add dbwrap_change_int32_atomic
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-22 15:16:45 +02:00
Rusty Russell
3c4263e758 tdb: don't use err.h in tests.
It's not portable.  While we could use ccan/err, it seems overkill since
we actually only use it in one test (I obviously cut & paste the #include).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Fri Jun 22 09:22:28 CEST 2012 on sn-devel-104
2012-06-22 09:22:28 +02:00
Rusty Russell
1783fe3443 tdb: make TDB_NOSYNC merely disable sync.
(As suggested by Stefan Metzmacher, based on the change to ntdb.)

Since commit ec96ea690e, we handle the case
where a process dies during a transaction commit.  Unfortunately, TDB_NOSYNC
means this no longer works, as it disables the recovery area as well as the
actual msync/fsync.  We should do everything except the syncs.

This also means we can do a complete test with $TDB_NO_FSYNC set; just
to get more complete coverage, we disable it explicitly for one test
(where we override the actual sync calls anyway).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
945473aac0 dbwrap: dbwrap_hash_size().
Implemented for ntdb and tdb; falls back to 0 for others.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
e92cb556fd dbwrap: dbwrap_name().
Useful for debug messages: particularly once we start switching between .tdb
and .ntdb files.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
41f799d877 dbwrap: dbwrap_transaction_start_nonblock().
Implemented for ntdb and tdb; falls back to the blocking variant
for others.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
f6eb187fda dbwrap: dbwrap_fetch_locked_timeout().
Implemented for ntdb and tdb; falls back to the non-timeout variant
for others.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
431667b47c dbwrap: add dbwrap_check() function.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
9d97bf3f47 dbwrap: dbwrap_local_open()
This simply opens a tdb: it will eventually switch depending on the
extension.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
1acf548eb7 dbwrap: remove get_flags().
The flags returned were TDB-specific: this was only used for detecting
the endianness of obsolete databases (the conversion code was put in in
2003, with reference to Samba 2.3).

It's easier to remove it than to translate the NTDB flags to TDB flags,
and it's a really weird thing to ask for anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
fc9b298761 util_tdb: move timeout chainlock variants from source3/lib/util/util_tdb.c
We're about to use them for dbwrap.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
02bacf1f95 util: util_ntdb ntdb_fetch_int32/ntdb_store_int32 and ntdb_add_int32_atomic
Similar to the util_tdb versions, but return the error code.

ntdb_add_int32_atomic seems a clearer name than tdb_change_int32_atomic.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
348159d1e4 util: util_ntdb.c gets NTDB_ERROR => NTSTATUS map.
Very similar to the tdb version.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
88ad365caf util: util_ntdb.c gains bystring functions.
Very similar to the util_tdb versions, but these return the error.
I've only implemented those functions actually used.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
8113d53bb4 util: ntdb_new() supports NTDB_CLEAR_IF_FIRST.
There are various issues with NTDB_CLEAR_IF_FIRST which makes it
better if we don't have to use it, but much of the code does, so
we fake up support here.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
735290f474 util: util_ntdb.c
The first function is ntdb_new: this is preferred over ntdb_open, as
it makes the ntdb_context returned (and all NTDB_DATA returned from
ntdb_fetch) valid talloc pointers.

The API is very similar to tdb_wrap_open().

Note that we handle $TDB_NO_FSYNC here, since ntdb doesn't do that
hack (and it's great for speeding up testing!).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00