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

5959 Commits

Author SHA1 Message Date
Andreas Schneider
e136b95af8 s4-lib: Use directory_create_or_exist() to create messaging dir.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-21 13:55:59 +01:00
Andreas Schneider
7dd13503c0 s4-socket: Make sure unix socket addresses are null terminated.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-12 15:00:02 +01:00
Andreas Schneider
7cc108c93c cmdline: Use new samba_getpass() function.
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2012-12-03 14:35:10 +01:00
Karolin Seeger
c86707973d docs: man regtree: 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:42:09 +01:00
Karolin Seeger
53b9e4ba6b docs: man regshell: 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:42:05 +01:00
Karolin Seeger
9678fca3c6 docs: man regpatch: 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:42:00 +01:00
Karolin Seeger
1ad091296d docs: man regdiff: 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:57 +01:00
Karolin Seeger
4ed7803c80 popt_common: Fix typos.
Karolin

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed by: Jelmer Vernooij <jelmer@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Nov 15 01:31:50 CET 2012 on sn-devel-104
2012-11-15 01:31:50 +01:00
Andrew Bartlett
a732f2a621 pymessaging: Add irpc_servers_byname() and irpc_all_servers()
This will allow python scripts to inspect the process list.

Andrew Bartlett
2012-10-31 08:13:56 +11:00
Andrew Bartlett
76b7348299 pymessaging: Use the server_id IDL structure rather than a tuple
This will make it easier to pass this structure in and out.  The tuple is still
accepted as input.

Andrew Bartlett
2012-10-31 08:13:56 +11:00
Andrew Bartlett
3b4ef03097 imessaging: Add irpc_all_servers() to list all available servers
This is implemented with a tdb_traverse_read(), and will allow a tool
to disover the name and server_id of all Samba processes, as each
process registers itself to recieve messages.

Andrew Bartlett
2012-10-31 08:13:56 +11:00
Andrew Bartlett
7e562cf3eb s4-events: 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.

Andrew Bartlett
2012-08-09 20:14:22 +10:00
Stefan Metzmacher
a370792cbc s4:libcli/pyerrors: s/PyErr_WERROR_IS_ERR_RAISE/PyErr_WERROR_NOT_OK_RAISE/
metze
2012-08-06 15:50:16 +02:00
Andrew Bartlett
b181a0b96b lib/param: Remove use of lp{cfg,}_socket_address outside the NBT client and server
In these other cases, control of the sockets to bind to can be obtained using
"bind interfaces only = yes" and "interfaces = ".

Andrew Bartlett
2012-07-27 17:59:51 +10:00
Andrew Bartlett
d0d05f8474 s4-lib/tls: Try socket_send() multiple times to send partial packets
This works around an artificial limitation in socket_wrapper that breaks
some versions of GnuTLS when we return a short write.

Instead, keep pushing until the OS will not take it.

The correct solution will be to use tls_tstream, but the client code
for this is not yet tested and needs the ldap client layer changed
to use it.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jul 18 11:23:55 CEST 2012 on sn-devel-104
2012-07-18 11:23:55 +02:00
Michael Adam
bf650a1b59 s4:registry:regdiff: use existing talloc context for the event context
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jul 13 02:51:44 CEST 2012 on sn-devel-104
2012-07-13 02:51:44 +02:00
Michael Adam
342ab97506 s4:registry:regdiff: add TALLOC_CTX * argument to open_backend() 2012-07-13 00:57:20 +02:00
Michael Adam
6ee16cefc9 s4:registry: add a TALLOC_CTX argument to reg_open_remote() 2012-07-13 00:57:19 +02:00
Michael Adam
acd3a6bb6c s4:registry:testsuite: fix use of non-existent word (existant) 2012-06-12 07:21:44 +02:00
Andrew Bartlett
1e28aa147f build: Add missing deps and make MESSAGING a private library
To remove finddcs_nbt these missing deps need to be added.  These
subsystems linked to to implicit dependencies provided by finddcs.
Due to the new arrangmenet of subsystems, MESSAGING needs to be a
private library to avoid being a source of duplicate symbols.

Andrew Bartlett
2012-06-07 06:45:06 +02:00
Stefan Metzmacher
bf8829b56f s4:lib/events: no longer define TEVENT_COMPAT_DEFINES
metze
2012-05-14 15:12:34 +02:00
Stefan Metzmacher
d41db7247f s4:lib/events: remove unused event_context_find() prototype
metze
2012-05-14 15:12:34 +02:00
Michael Adam
e75a9c1ad8 s4:lib: remove unused wscript_build file
This only contains a "GENCACHE" subsystem that is not
referenced anywhere.
2012-05-11 20:16:38 +02:00
Jelmer Vernooij
d3b4c2c771 UTIL_TDB: lowercase name.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu May  3 20:18:22 CEST 2012 on sn-devel-104
2012-05-03 20:18:22 +02:00
Andrew Bartlett
f10c638100 s4-messaging: Fill in the whole server_id in all use cases
This started per https://bugzilla.samba.org/show_bug.cgi?id=8872#c4
and avoids any possible collision with a different process.

We also need to ensure that across a Samba installation on a single
node that id.vnn is the same.  Samba4 previously used 0, while Samba3
used NONCLUSTER_VNN.  When a message is sent between these 'different'
nodes, the error NT_STATUS_INVALID_DEVICE_REQUEST is raised.

Andrew Bartlett
2012-04-30 17:55:11 +10:00
Andrew Bartlett
b8055132b1 s4-messaging: Use generate_random() to get a unique ID for messaging clients
The call to random() resulted in duplicate values for s3fs configurations
which, due to the forked child, all started with the same random seed.

A future improvement would be to move to a proven unique value.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Apr 25 11:43:40 CEST 2012 on sn-devel-104
2012-04-25 11:43:40 +02:00
Jelmer Vernooij
0c06eb48ab Stop installing popt_common.h as its symbols are in a private library.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Fri Mar 16 17:39:31 CET 2012 on sn-devel-104
2012-03-16 17:39:31 +01:00
Jelmer Vernooij
ce4531ee31 tdb_wrap: Move to specific directory.
It's a bit confusing to mix low-level and high-level libraries.  We had
multiple libraries in one directory, and there were have circular
dependencies with other libraries outside that directory (in this case,
samba-hostconfig).

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 10 23:13:01 CET 2012 on sn-devel-104
2012-03-10 23:13:01 +01:00
Kai Blin
c7f67142c0 s4 dns: Fix TCP handling in the DNS server
Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Tue Mar  6 21:17:19 CET 2012 on sn-devel-104
2012-03-06 21:17:18 +01:00
Jelmer Vernooij
f033c221f8 policy/python: Move python binding tests to standard location.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Tue Mar  6 02:26:29 CET 2012 on sn-devel-104
2012-03-06 02:26:29 +01:00
Matthias Dieter Wallnöfer
32c82fe69b s4:lib/tls - include GNUTLS headers consistently using <...>
These are system-specific.

Reviewed-by: Jelmer

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sat Feb 18 00:43:58 CET 2012 on sn-devel-104
2012-02-18 00:43:58 +01:00
Andrew Bartlett
a74e556a7c s4-lib/samba3: Remove unused smbpasswd_decode_acb_info()
Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html

Andrew Bartlett
2012-02-10 16:45:13 +11:00
Andrew Bartlett
ac57defdb4 s4-lib/tls: remove unused tls_support()
Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html

Andrew Bartlett
2012-02-10 16:45:12 +11:00
Andrew Bartlett
abc90d8f2e s4-cmdline: Remove unused popt_common_dont_ask()
Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html

Andrew Bartlett
2012-02-10 16:45:12 +11:00
Jelmer Vernooij
24ed8c5924 regshell: Fix a counter that can actually be non-zero.
This was a regression caused by one of the unsigned patches.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Wed Feb  8 16:00:22 CET 2012 on sn-devel-104
2012-02-08 16:00:22 +01:00
Andrew Bartlett
76021cc626 s4-messaging: fix pymessaging docstring 2012-02-08 16:29:43 +11:00
David Disseldorp
ec094bf9ac WERROR type variable being incorrectly checked with a NT_STATUS_IS_X
type macro.
2012-01-23 12:18:01 -08:00
Jelmer Vernooij
a108eb4fdb pyregistry: Remove directory support.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu Dec 29 19:59:57 CET 2011 on sn-devel-104
2011-12-29 19:59:57 +01:00
Jelmer Vernooij
af1b7f5575 Remove the 'dir' registry backend.
This backend was incomplete, and we already have plenty of other backends.
2011-12-29 16:45:23 +01:00
Volker Lendecke
79fe4bbf73 s3: Fix the clustering build
ctdb_private.h already defines set_close_on_exec.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sat Dec 17 18:41:39 CET 2011 on sn-devel-104
2011-12-17 18:41:39 +01:00
Andrew Tridgell
9f4c3da734 s4-socket: use set_close_on_exec()
this prevents a fd leak to child processes
2011-12-15 23:36:22 +01:00
Matthias Dieter Wallnöfer
456c69f95e s4:lib/tls - call "gnutls_transport_set_lowat" only on GNUTLS < 3.0
This function call together with the lowat feature has been removed in release
3.0 as described in this mailing list post:
http://old.nabble.com/gnutls_transport_set_lowat-deprecated-td32554230.html.

Since we do not make any use of lowat (esprimed by each function call)
we are free to simply omit it on v3.0 and later.

This addresses bug #8537.

Reviewed by: abartlet + metze

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Wed Nov 30 20:11:14 CET 2011 on sn-devel-104
2011-11-30 20:11:14 +01:00
Stefan Metzmacher
706e10820d s4:lib/socket: add socket_connect_multi_ex_*
This add an async establish hook, that gets called
before a connection success is detected.

This can be used to do a NBT session request
and it makes sure that we don't cancel the connection
on port 445, just because the tcp connect on port
139 worked.

metze
2011-11-30 13:41:08 +01:00
Matthieu Patou
5d18e57bec s4-socket: allow connect_multi_next_socket to try all the IP for a given host
This fix an incorrect behavior which was that if a host has 2 IP but
was listening on only 1 (and the second one) connect_multi_next_socket
was not able to connect because it used only the first result.
2011-11-11 20:28:11 +01:00
Jelmer Vernooij
c2eb036d3f policy/tests: Fix import of TestCase.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Fri Nov 11 01:10:49 CET 2011 on sn-devel-104
2011-11-11 01:10:49 +01:00
Andrew Tridgell
ba41389d3d test: fixed several tests to use samba.tests
this fixes error checking. Test failures were not being detected
otherwise

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-11-10 14:24:21 +11:00
Andrew Tridgell
a7c1add5c4 s4-socket: detect NULL server in socket connection code
return NT_STATUS_NOT_FOUND instead of a segfault

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-11-10 14:24:20 +11:00
Matthias Dieter Wallnöfer
1dbffa70ae s4:lib/registry - enhance registry tests in respect to default values
Reviewed-by: Jelmer

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Thu Nov  3 21:41:17 CET 2011 on sn-devel-104
2011-11-03 21:41:17 +01:00
Matthias Dieter Wallnöfer
7e0bef604a s4:lib/registry/ldb.c - quit the deletion of a not-existing default value with WERR_BADFILE
Reviewed-by: Jelmer
2011-11-03 20:10:06 +01:00
Matthias Dieter Wallnöfer
6b5a296b4a s4:lib/registry/ldb.c - don't use search filters for base searches
They are not necessary in this case.

Reviewed-by: Jelmer
2011-11-03 20:10:06 +01:00
Matthias Dieter Wallnöfer
042372bc20 s4:lib/registry/regf.c - always generate debug messages on error cases
We need to know what is going on.

Reviewed-by: Jelmer
2011-11-03 20:10:06 +01:00
Matthieu Patou
f5fde21ec1 s4-socket: do not segfault if the socket is NULL
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Tue Nov  1 19:02:52 CET 2011 on sn-devel-104
2011-11-01 19:02:52 +01:00
Stefan Metzmacher
8386b20799 s4:lib/socket: don't pass -1 to close()
metze
2011-10-31 16:02:42 +01:00
Andreas Schneider
7b5fb7d9e8 replace: Add don't include unistd.h directly and add uid_wrapper. 2011-10-27 13:32:02 +02:00
Stefan Metzmacher
b0480f26ca s4:lib/stream: make use of smb_len_tcp()
metze
2011-10-19 15:44:29 +02:00
Matthieu Patou
8741b90334 s4-interfaces: allow pure ipv6 to work
This is the complementary part of patch
abe5afc580 for samba4.
2011-10-16 00:01:36 +02:00
Andrew Bartlett
01c934c81e lib/util: Add back control of mmap and hash size in tdb for top level build
This passes down a struct loadparm_context to allow these
parameters to be checked.  This may be s3 or s4 context, allowing the
#if _SAMBA_BUILD_ macro to go away safely.

Andrew Bartlett
2011-10-13 14:06:07 +02:00
Andrew Bartlett
3cdb1fe440 s4-messaging: Pass the loadparm context, not just the messaging path
This will allow the TDB layer to get at the lp_ctx for tdb options.

Andrew Bartlett
2011-10-13 14:06:07 +02:00
Stefan Metzmacher
f007f68f70 s4:lib/wmi: avoid '//' comments
The compiler on openindiana doesn't like them.

metze
2011-10-08 07:24:14 +02:00
Andrew Bartlett
d40fe50a67 build: avoid util.h as a public header name due to conflict with MacOS 2011-09-23 09:24:03 +02:00
Stefan Metzmacher
af2e107d49 s4:lib/messaging: let irpc handles return NT_STATUS_CONNECTION_DISCONNECTED
We should return the same in all places.

metze
2011-09-14 18:03:18 +02:00
Matthias Dieter Wallnöfer
d0df75701e s4:lib/socket/interface.c - "ifaces" strictly needs to be initialised
Please consider a failing "get_interfaces" call and the "talloc_free()"
operation on a possible uninitialised "ifaces" on line 326.

https://bugzilla.samba.org/show_bug.cgi?id=8397

Reviewed-by: Jelmer

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Mon Sep 12 23:49:12 CEST 2011 on sn-devel-104
2011-09-12 23:49:12 +02:00
Andrew Bartlett
9a137311f1 s4-messaging ensure we do not segfault on a NULL msg context in cleanup 2011-08-26 14:06:07 +02:00
Jelmer Vernooij
c0fe5e095d s4/libpolicy: Install header file. 2011-08-21 03:22:05 +02:00
Jelmer Vernooij
292fe74971 credentials: Rename library to samba-credentials to avoid name clashes.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu Aug 18 22:16:38 CEST 2011 on sn-devel-104
2011-08-18 22:16:38 +02:00
Jelmer Vernooij
88ecf1a9b8 Use public pytalloc header file.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Aug 14 17:18:46 CEST 2011 on sn-devel-104
2011-08-14 17:18:46 +02:00
Simo Sorce
15efcbaa09 s4:lib: use tevent_ fns names instead of legcay event_ ones 2011-08-13 09:54:16 -04:00
Simo Sorce
47b64573c0 s4:messaging: use tevent_ function names instead of legacy event_ ones 2011-08-13 09:54:15 -04:00
Jelmer Vernooij
f8ec7f6cb1 pytalloc: Use consistent prefix for functions, add ABI file. 2011-08-10 15:36:21 +02:00
Stefan Metzmacher
3b11ee1db1 s4:pyregistry: PyArg_ParseTuple("z#") requires an 'int' argument instead of 'size_t'
If we pass variables by reference we don't get implicit type casting.

metze
2011-08-08 16:45:27 +02:00
Andrew Bartlett
af5f494bd2 build: provide tevent-util as a public library
This is needed so that OpenChange can get at _tevent_req_nterr(), which is referenced
by generated PIDL output.

Andrew Bartlett
2011-08-08 13:34:06 +02:00
Amitay Isaacs
6cce5fd43e s4-policy: Use the correct local directory for stat.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-03 14:25:57 +10:00
Amitay Isaacs
463ab48868 s4-policy: Add python wrapper for ads_to_dir_access_mask() function
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-03 14:25:50 +10:00
Amitay Isaacs
0c8d742992 s4-policy: Expose gp_ads_to_dir_access_mask() function
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-03 14:25:48 +10:00
Andrew Bartlett
481f1e601d s4-debug: Start with DEBUG_DEFAULT_STDOUT, so we can log to a file in deamons
In commit 3c9d01e3e5 I changed the priority order
and added DEBUG_DEFAULT_STDOUT, but did not check all the callers.

Andrew Bartlett
2011-07-29 04:24:06 +02:00
Jelmer Vernooij
221a79ad00 policy: Rename to samba-policy to avoid name space clashes. 2011-07-26 13:31:09 +02:00
Jelmer Vernooij
47a41c8daf cli_composite: Lowercase name. 2011-07-26 13:31:09 +02:00
Andrew Tridgell
2d21fe079f s4-messaging: fixed the removal of messaging sockets in child tasks
when a child task exits we were firing a destructor on any inherited
messaging contexts, which could trigger a removal of the parents
message socket and messaging database entry.

This adds a new auto_remove flag to imessaging_init(), and exposes the
cleanup code for use by the stream service.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Jul 22 08:09:06 CEST 2011 on sn-devel-104
2011-07-22 08:09:06 +02:00
Stefan Metzmacher
1be5a9b1fd s4:lib/socket: iface_list_wildcard() should only return "::" if we have ipv6 interfaces
If glibc has IPv6 support, but it's not enabled in the running kernel
we should not try to listen on "::".

metze
2011-07-10 17:11:14 +02:00
Andrew Bartlett
8420a36dc7 ldb: make ldb a top level library for Samba 4.0
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-05 17:24:47 +10:00
Andrew Tridgell
505dce2d3a pyldb: added methods to get/set extended components on DNs
this will be used by the dbcheck code

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-06-22 14:47:08 +10:00
Andrew Tridgell
341884c835 ldb: added extended_str() method to pyldb
this gives access to ldb_dn_get_extended_linearized() from python

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-06-22 14:47:08 +10:00
Andrew Tridgell
dd5350b0a8 ldb: expose syntax oids to python
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-06-22 14:47:07 +10:00
Andrew Bartlett
179a3530d7 s4-cmdline: Rename popt tables to avoid symbol conflicts
These same names are use in the source3 popt code, which is called from
in libsmbclient and libnet.  These are then included in the smbtorture
binary for testing

Andrew Bartlett
2011-06-21 09:36:23 +10:00
Volker Lendecke
f0ff6f390a Use tevent_req_oom
This fixes a few Coverity errors
2011-06-20 12:33:24 +02:00
Rusty Russell
985e83ef52 tdb2: tie it into build process if --enable-tdb2-breaks-compat
This is simplistic.  We need to support making TDB2 a standalone library,
but for now, we simply built it in-tree.

Once we have tdb1 compatibility in tdb2, we can rename this option to
--enable-tdb2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:36 +02:00
Rusty Russell
ca1936fbb2 tdb_compat: use tdb_open_compat.
This is a helper for the common case of opening a tdb with a logging
function, but it doesn't do all the work, since TDB1 and TDB2's log
functions are different types.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
4823262439 tdb2: #ifdef out TDB_ERR_NOLOCK and TDB_ERR_LOCK_TIMEOUT.
These don't exist in tdb2.  The former is used in one weird place in
tdb1, and the latter not at all.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
a4993f647c ldb: replace 'struct TDB_DATA' with 'TDB_DATA'
The typedef is TDB2 compatible, the struct isn't.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
2c71e8596b tdb_unlockall/tdb_unlockall_read: ignore return value.
TDB2 returns void here.  tdb_unlockall will *always* return with the
database unlocked, but it will complain via the log function if it wasn't
locked.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
5a7874e119 tdb_traverse/tdb_traverse_read: check returns for negative, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for < 0 instead of == -1.

Also, there's no tdb_traverse_read in TDB2: we don't try to make
traverse reliable any more, so there are no write locks anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
d6251996fa tdb_transaction_cancel: ignore return value.
TDB2 returns void here.  tdb_transaction_cancel will *always* return
with the transaction cancelled, but it will complain via the log
function if a transaction wasn't in progress.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
6bc59d77b6 tdb_store: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
058c4f8492 tdb_fetch_compat: use instead of tdb_fetch.
This is a noop for tdb1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
0e4c358e27 tdb_compat.h: divert every tdb build and includes to tdb_compat
We change all the headers and wscript files to use tdb_compat; this
means we have one place to decide whether to use TDB1 or TDB2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:34 +02:00
Matthieu Patou
29e043a208 pyldb: add unit test for get(myattribute, defVal)
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Mon Jun 20 09:23:15 CEST 2011 on sn-devel-104
2011-06-20 09:23:15 +02:00
Andrew Bartlett
a1f04e8abc libcli/util Rename common map_nt_error_from_unix to avoid duplicate symbol
The two error tables need to be combined, but for now seperate the names.

(As the common parts of the tree now use the _common function,
errmap_unix.c must be included in the s3 autoconf build).

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Jun 20 08:12:03 CEST 2011 on sn-devel-104
2011-06-20 08:12:03 +02:00
Andrew Bartlett
018f4a5889 libcli/util Bring samba4 unix -> nt_status code in common.
Due to library link orders, this is already the function that is being
used.  However we still need to sort out the duplicate symbol issues,
probably by renaming things.

Andrew Bartlett
2011-06-20 14:36:06 +10:00
Matthieu Patou
02970f41a2 py-ldb: allow dictionnary like usage (ie. e.get("myattribute", defVal) 2011-06-19 23:21:07 +02:00
Andrew Tridgell
2320221105 pyldb: make ldb operations more consistent
This changes the controls option on ldb operations to be a keyword
argument, which is more consistent with general python
conventions. This also fixes the pydoc output to include the controls
option.
2011-06-14 09:39:24 +02:00
Andrew Tridgell
8741f03995 pyldb: added validate option to ldb.modify()
This allows validation of ldb messages in a ldb modify operation to be
bypassed, by setting validate=False. This is useful in the dbcheck
tool to allow for removing invalid empty attributes from the database
2011-06-14 09:39:24 +02:00
Andrew Bartlett
16b1c77644 lib/util Bring procid_str() into lib/util as server_id_string()
This is needed for OpenChange, which prints Samba struct server_id
values in debug messages.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
d057116cc2 server_id.idl: Bring server_id.idl in common
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-09 12:40:08 +02:00
Andrew Bartlett
8d803d5a0a s4-cluster Use task_id instead of id2 to clarify server_id structure
This seems a clearer and more acceptable name.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-09 12:40:08 +02:00
Matthias Dieter Wallnöfer
ba5cec5804 ldb:ldb_msg.c - move away from "errno"
Reviewed-by: Tridge
2011-06-09 09:34:55 +02:00
Andrew Tridgell
79ef434b90 s4-interface: raise the debug level for interface discovery 2011-06-08 04:56:04 +02:00
Andrew Tridgell
3ccb72d749 s4-ipv6: fixed iface_list_same_net() for IPv6 2011-06-07 12:55:37 +10:00
Andrew Tridgell
6a6d4d8884 s4-ipv6: fix iface_list_best_ip() for IPv6
return an interface with the same address family as the target
2011-06-07 12:55:37 +10:00
Andrew Bartlett
907cdb5de7 s4-modules Remove lp_ctx from init functions that no longer need it
Now that we don't allow the smb.conf to change the modules dir, many
functions that simply load modules or initialise a subsytem that may
load modules no longer need an lp_ctx.

Andrew Bartlett
2011-06-06 17:37:51 +10:00
Andrew Bartlett
de46ad9084 lib/util use modules_path(), data_path() and shlib_ext() from source3
This brings these helpful utility functions in common, as they are not
based on either loadparm system.

(The 'modules dir' parameter from Samba4 will shortly be removed, so
there is no loss in functionality)

Andrew Bartlett
2011-06-06 17:37:51 +10:00
Andrew Tridgell
d168a5e703 s4-ipv6: fill in family when initialising from sockaddr
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Mon Jun  6 05:35:36 CEST 2011 on sn-devel-104
2011-06-06 05:35:36 +02:00
Andrew Tridgell
25ac58dcce s4-ipv6: fix the address family for IPv6 string addresses 2011-06-06 12:26:11 +10:00
Andrew Tridgell
3736f29696 s4-ipv6: use the server address family
don't force v4 in connect_multi
2011-06-06 12:26:11 +10:00
Andrew Tridgell
dc1e6109c8 s4-ipv6: enable IPv6 by default
it now passes all tests
2011-06-06 12:26:10 +10:00
Andrew Tridgell
40dc94a53f s4-ipv6: update callers to load_interface_list() 2011-06-06 12:26:10 +10:00
Andrew Tridgell
44d47e8515 s4-ipv6: allow ipv6 to be enabled/disabled in smb.conf
this adds the parametric option ipv6:enable=true/false

It defaults to false for now, until the remaining issues with testing
of ipv6 are resolved
2011-06-06 12:26:10 +10:00
Andrew Tridgell
df632483f1 s4-ipv6: fixed ipv6_listen() to use IPV6_V6ONLY
this changes ipv6_listen() to use IPV6_V6ONLY, and to setup the right
scope id for link local IPv6 addresses
2011-06-06 12:26:09 +10:00
Andrew Tridgell
244137b10d s4-ipv6: added socket_address_from_sockaddr_storage()
this converts a struct sockaddr_storage to a struct socket_address
2011-06-06 12:26:09 +10:00
Andrew Tridgell
d8d63b53b7 s4-ipv6: added ipv4 functions to interface code
this adds iface_list_first_v4() and iface_list_n_is_v4(). The NBT
server will use these to allow it to listen only for IPv4 addresses.
2011-06-06 12:26:09 +10:00
Andrew Tridgell
a527b96c96 s4-ipv6: fixed a warning 2011-06-06 12:26:09 +10:00
Andrew Tridgell
62af4a3798 s4-ipv6: allow IPv6 addresses in our interfaces list 2011-06-06 12:26:09 +10:00
Andrew Tridgell
2fc11518b7 s4-ipv6: added iface_list_wildcard()
this returns a list of wildcard address to listen on, when we don't
have 'bind interfaces only' set. It is a list, not a single address,
we need to listen separately for the IPv6 "::" address from the IPv4
0.0.0.0 address.

This also takes account of the loadparm "socket address" option
2011-06-06 12:26:09 +10:00
Rusty Russell
0204ae6229 lib/util/time.c: timeval_current_ofs_usec
Several places want "microseconds from current time", and several were
simply handing "usecs" values which could be over a million.

Using a helper to do this is safer and more readable.

I didn't replace any obviously correct callers (ie. constants).

I also renamed wait_nsec in source3/lib/util_sock.c; it's actually
microseconds not nanoseconds (introduced with this code in Volker's
19b783cc Async wrapper for open_socket_out_send/recv).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01 10:38:47 +02:00
Matthias Dieter Wallnöfer
d34205add3 s4:ldb-samba/ldb_wrap.*-dsdb/samdb/samdb.c - handle LDB connection flags as unsigned
The LDB API ("ldb_connect") prescribes that they should be "unsigned".

Signed-off-by: Metze
2011-05-21 16:21:14 +02:00
Matthias Dieter Wallnöfer
4618a7f3a1 ldb:pyldb.c - all flags should be unsigned
Adapt it to the previous commits

Reviewed-by: Jelmer + Metze
2011-05-21 16:21:13 +02:00
Matthias Dieter Wallnöfer
74b50b47e9 ldb:ldb_sqlite3.c - all LDB flags should be handled as "unsigned"
Signed-off-by: Metze
2011-05-21 16:21:13 +02:00
Matthias Dieter Wallnöfer
3956e6840d ldb:tools/cmdline.c + tools/ldbtest.c - the connection flags are typed as "unsigned"
Signed-off-by: Metze
2011-05-21 16:21:13 +02:00
Matthias Dieter Wallnöfer
e6c5e11116 ldb:ldbtest.c - make more use of LDB constants
Signed-off-by: Metze
2011-05-21 16:21:13 +02:00
Andrew Bartlett
30979f3ea1 build: Expand dcerpc-samba grouping library
This is possible in common now because the generated RPC code does not
rely on a particular dcerpc layer.

Andrew Bartlett
2011-05-18 16:12:07 +02:00
Andrew Tridgell
c596d85afd s4-interfaces: keep interfaces in the order they were declared
the spoolss notify test depends on the interfaces order

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Sun May  8 13:57:58 CEST 2011 on sn-devel-104
2011-05-08 13:57:58 +02:00
Andrew Bartlett
22cb631b4f s4-interfaces Rename interfaces code so not to conflict with source3/
The iface_count, iface_n_bcast, and load_interfaces functions
conflicted with functions of the same name in source3, so the source4
functions were renamed.  Hopefully we can actually wrap one around the
other in future.

Andrew Bartlett
2011-05-08 12:57:04 +02:00
Andrew Bartlett
f346a73785 lib/socket move interfaces code to the top level 2011-05-08 12:57:04 +02:00
Andrew Bartlett
879498b362 s4-lib/socket Samba4 is not IPv6 compatible
Don't add IPv6 interfaces until we actually support them.

I'll soon have IPv6 service at home, and then I'll make it my buisness
to sort this out once and for all.

Andrew Bartlett
2011-05-08 12:57:03 +02:00
Andrew Bartlett
5a8b6ac4c0 s4-lib merge get_interfaces() from Samba3 to Samba4 2011-05-08 12:57:03 +02:00
Andrew Bartlett
ea0ac9cdfc s4-auth Rename auth -> auth4 to avoid conflict with s3 auth 2011-05-08 10:56:26 +02:00
Andrew Bartlett
1475013963 lib/util Move source3 tdb_wrap_open() into the common code.
This #if _SAMBA_BUILD == 3 is very unfortunate, as it means that in
the top level build, these options are not available for these
databases.  However, having two different tdb_wrap lists is a worse
fate, so this will do for now.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Tridgell
b96389d3e1 s4-socket: rename allow_access() to socket_allow_access()
this prevents a symbol collision with s3

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-05-03 07:37:07 +02:00
Andrew Bartlett
cdd802af83 s4-messaging Rename messaging -> imessaging
This avoid symbol and structure conflicts between Samba3 and Samba4,
and chooses a less generic name.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
eea783e04c lib/util Move set_socket_options() into common code. 2011-05-03 07:37:07 +02:00
Andrew Bartlett
4d0268dce4 s4-lib/socket Merge updated set_socket_options from Samba3 -> Samba4 2011-05-03 07:37:07 +02:00
Andrew Bartlett
4c8de5ab13 s4-cluster Rename server_id.node -> vnn to match Samba3 2011-05-03 07:37:07 +02:00
Andrew Bartlett
85eb4377db s4:cluster Rename .id to .pid in server_id
This also changes some DEBUG messages to use cluster_id_string()
rather than .id, to isolate them from this and other changes.

Andrew Bartlett
2011-05-03 07:37:06 +02:00
Matthias Dieter Wallnöfer
e64ffee1c2 ldb:tdb backend - cache - remove unused "last_attribute" structure member
Reviewed-by: abartlet

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Fri Apr 29 20:07:27 CEST 2011 on sn-devel-104
2011-04-29 20:07:27 +02:00
Matthias Dieter Wallnöfer
aec1bc7feb ldb:tools/cmdline.c + tools/ldbtest.c - make use of LDB result constants
Reviewed-by: abartlet
2011-04-29 19:05:04 +02:00
Matthias Dieter Wallnöfer
d4a06d5dac ldb:ldb_controls.c - fix comment indentation
Reviewed-by: abartlet
2011-04-29 19:05:04 +02:00
Andrew Bartlett
67905b41a9 s4-param Rename private_path() -> lpcfg_private_path()
This is consistent with lock_path()

Andrew Bartlett
2011-04-29 16:38:14 +10:00
Jelmer Vernooij
bf3b2e2aee Support the 'PYTHON' environment variable.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Apr 23 04:19:05 CEST 2011 on sn-devel-104
2011-04-23 04:19:04 +02:00
Stefan Metzmacher
ab9d9cfd33 s4:ldb: change version to 1.1.0 after adding new functions:
ldb_ldif_parse_modrdn()
ldb_req_set_custom_flags()
ldb_req_get_custom_flags()

Signed-off-by: Simo Sorce <idra@samba.org>

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Apr 21 17:15:16 CEST 2011 on sn-devel-104
2011-04-21 17:15:16 +02:00
Matthieu Patou
93d5e7a018 ldb: add custom flags and functions for the application that wants to manipulate them
Signed-off-by: Simo Sorce <idra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-04-21 14:41:56 +02:00
Stefan Metzmacher
f04689ae63 s4:ldb/tests: add tests for ldbmodify and 'modrdn'
Signed-off-by: Simo Sorce <idra@samba.org>

metze
2011-04-21 14:41:47 +02:00