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

81098 Commits

Author SHA1 Message Date
Rusty Russell
89b0d5ac6c ntdb: simply disallow NULL names.
TDB allows this for internal databases, but it's a bad idea, since the
name is useful for logging.

They're a hassle to deal with, and we'd just end up putting "unnamed"
in there, so let the user deal with it.  If they don't, they get an
informative core dump.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
7fae6c44e2 ntdb: reduce transaction pagesize from 64k to 16k.
The performance numbers for transaction pagesize are indeterminate:
larger pagesizes means a smaller transaction array, and a better
chance of having a contiguous record (more efficient for
ntdb_parse_record and some internal operations inside a transaction).

On the other hand, large pagesize means more I/O even if we change a
few bytes.

But it also controls the multiple by which we will enlarge the file,
and hence the minimum db size.  It's 4k for tdb1, but 16k seems
reasonable in these modern times.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
35381cad1f ntdb: remove last block transactoin logic.
Now our database is always a multiple of NTDB_PGSIZE, we can remove the
special handling for the last block.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
db2508840d ntdb: create initial database to be multiple of NTDB_PGSIZE.
As copied from tdb1, there is logic in the transaction code to handle
a non-PGSIZE multiple db, but in fact this only happens for a
completely unused database: as soon as we add anything to it, it is
expanded to a NTDB_PGSIZE multiple.

If we create the database with a free record which pads it out to
NTDB_PGSIZE, we can remove this last-page-is-different logic.

Of course, the fake ntdbs we create in our tests now also need to be
multiples of NTDB_PGSIZE, so we change some numbers there too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
9396757676 ntdb: make sure file is always a multiple of PAGESIZE (now NTDB_PGSIZE)
ntdb uses tdb's transaction code, and it has an undocumented but implicit
assumption: that the transaction recovery area is always aligned to the
transaction pagesize.  This means that no block will overlap the recovery
area.

This is maintained by rounding the size of the database up, so do the same
for ntdb.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
dd4eed4759 ntdb: fix recovery data write.
We were missing the last few bytes.  Found by 100 runs of ntdbtorture
-t -k.

The transaction test code didn't catch this, because usually those
last few bytes are irrelevant to the actual contents of the database.
We fix the test.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
40cf08823d ntdb: enhance external-helper test code.
Our external test helper is a bit primitive when it comes to doing STORE or
FETCH commands: let us specify the data we expect, instead of assuming it's
the same as the key.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
3bccb610c1 ntdb: use NTDB_LOG_WARNING level for failed open() without O_CREAT.
This is a fairly common pattern in Samba, and if we log an error on
every open it spams the logs.  On the other hand, other errors are
potentially more serious, so we still use NTDB_LOG_ERROR on them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
c7273629a2 ccan: remove bogus debug print.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
8a7c535db1 ntdb: make fork test more thorough.
We document that the child of a fork() can do a brunlock() if the parent
does a brlock: we should not log an error when they do this.

Also, test the case where we fork() and return inside a parse function
(which is allowed).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
d48f6f884b ntdb: print \n at end of log messages in tests.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
5027f9cd02 ntdb: reduce race between creating file and getting open lock.
In tdb, we grab the open lock immediately after we open the file.  In
ntdb, we usually did some work first.  tdbtorture managed to get in
before the creator grabbed the lock:

	testing with 3 processes, 5000 loops, seed=1338246020
	ntdb:torture.ntdb:IO Error:ntdb_open: torture.ntdb is not a ntdb file
	29023:torture.ntdb:db open failed

At cost of a little duplicated code, we can reduce the race.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
1765c0f9ba ntdb: catch any valgrind errors in test
Make --valgrind and --valgrind-log options work!

Amitay figured this out!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
fc9b8ee790 ntdb: catch any valgrind errors in test
We need --error-exitcode=, otherwise valgrind errors don't cause the
test to fail.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
f5e9ed1ea9 ntdb: remove ntdb_error()
It was a hack to make compatibility easier.  Since we're not doing that,
it can go away: all callers must use the return value now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Rusty Russell
16cc345d4f TDB2: Goodbye TDB2, Hello NTDB.
This renames everything from tdb2 to ntdb: importantly, we no longer
use the tdb_ namespace, so you can link against both ntdb and tdb if
you want to.

This also enables building of standalone ntdb by the autobuild script.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:06 +02:00
Kirill Smelkov
76758b9767 tdb2: Fix typo in TDB1_porting.txt
Judging by code it's tdb1, where you needed to free old key's dptr
manually.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:05 +02:00
Rusty Russell
c3dcdf08f3 TDB2: more internal cleanups after TDB1 compatibility removal.
This eliminates the separate tdb2 substructure, and makes some
tdb1-required functions static.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:05 +02:00
Rusty Russell
cab6e11678 TDB2: remove TDB1 compatibility.
This rips out all the TDB1 compatibility from tdb2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:05 +02:00
Rusty Russell
6244f668a3 TDB2: make SAMBA use tdb1 again for the moment.
Otherwise the following surgery will break the SAMBA build and testsuite.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:05 +02:00
Rusty Russell
5bad913938 ccan: check for err.h ourselves
Heimdal does this, but that doesn't help the autoconf build or the standalone
libntdb build.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:05 +02:00
Jelmer Vernooij
85b8439d4a WHATSNEW: Fix typo.
"dcerpc endpoint services" -> "dcerpc endpoint servers"

Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Tue Jun 19 04:40:12 CEST 2012 on sn-devel-104
2012-06-19 04:40:12 +02:00
Jelmer Vernooij
bf5934ca1b tdb/wscript: Remove unecessary semicolons. 2012-06-19 02:43:23 +02:00
Stefan Metzmacher
59daf91f39 wafsamba/irixcc: add '-c99' option to cc
Lets see if this fixes the build on IRIX.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jun 19 02:42:21 CEST 2012 on sn-devel-104
2012-06-19 02:42:20 +02:00
Björn Jacke
26e868bfed Revert "s3: temporary hack to make the waf build work withouth autotools being required"
This reverts commit f1becfa27b. The hack was
actually only required due to a configuration issue in our buildfarm scripts.

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Mon Jun 18 20:07:08 CEST 2012 on sn-devel-104
2012-06-18 20:07:08 +02:00
Stefan Metzmacher
63c2784076 selftest/flapping: samba4.nss.test is also flakey for s3member
[1426/1518 in 1h24m58s] samba4.nss.test using winbind(s3member)
UNEXPECTED(failure): samba4.nss.test using winbind(s3member).run nsstest(s3member)
REASON: _StringException: _StringException: ERROR setpwent: NSS_STATUS=-1  1 (nss_errno=0)
ERROR getpwent: NSS_STATUS=-1  1 (nss_errno=0)
ERROR endpwent: NSS_STATUS=-1  1 (nss_errno=0)
ERROR setgrent: NSS_STATUS=-1  1 (nss_errno=0)
ERROR getgrent: NSS_STATUS=-1  1 (nss_errno=0)
ERROR endgrent: NSS_STATUS=-1  1 (nss_errno=0)
ERROR Non existent user gave error -1
ERROR Non existent uid gave error -1
ERROR Non existent group gave error -1
ERROR Non existent gid gave error -1
total_errors=10

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jun 18 17:59:25 CEST 2012 on sn-devel-104
2012-06-18 17:59:24 +02:00
Stefan Metzmacher
333cee7484 s3:autoconf: add -Iautoconf -Iautoconf/source3 at configure stage
There're some configure tests which require this.

metze
2012-06-18 15:26:45 +02:00
Stefan Metzmacher
a146f0708e s3:Makefile.in: remove pidl generated files with 'make realdistclean'
metze
2012-06-18 15:26:44 +02:00
Stefan Metzmacher
9cbea1f6ed s3:Makefile.in: fix 'make realdistclean' after moving generated files to autoconf/
metze
2012-06-18 15:26:44 +02:00
Stefan Metzmacher
071dfb42f2 s3:Makefile.in: fix 'make clean' after moving generated files to autoconf/
metze
2012-06-18 15:26:43 +02:00
Stefan Metzmacher
9522e853c2 s3:autogen.sh: fix autoconf/lib/param/param_proto.h location
metze
2012-06-18 15:26:43 +02:00
Stefan Metzmacher
da76cda93f lib/param: add missing prototype of lpcfg_parm_long()
metze
2012-06-18 15:26:42 +02:00
Michael Adam
d4912edea6 s3:autoconf-build: build the idmap backends tdb2, rid, and hash by default (shared)
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Jun 18 13:38:50 CEST 2012 on sn-devel-104
2012-06-18 13:38:50 +02:00
Michael Adam
f5b40b1bdd s3:waf-build: build the idmap backends tdb2, rid, and hash by default (shared) 2012-06-18 11:44:50 +02:00
Michael Adam
39b4733073 s3:idmap_tdb: fix miss in rename of dbwrap_trans_store_uint32() to dbwrap_trans_store_uint32_bystring() 2012-06-18 11:44:50 +02:00
Amitay Isaacs
bb96139846 dbwrap: Rename dbwrap_fetch_uint32->dbwrap_fetch_uint32_bystring
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-18 11:44:50 +02:00
Stefan Metzmacher
ad3881b78c s3:configure: check for SPLICE_F_MOVE at configure stage
This should fix the waf build on AIX, which has a splice symbol.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jun 18 11:43:01 CEST 2012 on sn-devel-104
2012-06-18 11:43:00 +02:00
Stefan Metzmacher
ede2fa8e69 heimdal:lib/wind: include <stdlib.h> at the end
This makes sure config.h gets includes first.

This should fix the build on AIX.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Jun 17 16:16:24 CEST 2012 on sn-devel-104
2012-06-17 16:16:23 +02:00
Stefan Metzmacher
326d1749fc heimdal:lib/wind: make sure errorlist_table.c includes config.h as first header
This should fix the build on AIX.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Jun 16 23:59:07 CEST 2012 on sn-devel-104
2012-06-16 23:59:06 +02:00
Jelmer Vernooij
8283d9ec4a attr: Look for attr/attributes.h too.
Fixes finding of ATTR_ROOT on GNU/kFreeBSD.

Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Sat Jun 16 18:54:27 CEST 2012 on sn-devel-104
2012-06-16 18:54:26 +02:00
Stefan Metzmacher
bd45745b09 heimdal:lib/krb5: don't name a struct 'token'
This is a static const struct and the name is never used,
so just make it an anonymous struct.

This hopefully fixes the build on AIX:

"../source4/heimdal/lib/roken/roken-common.h", line 276.9: 1506-236 (W) Macro name __attribute__ has been redefined.
"../source4/heimdal/lib/roken/roken-common.h", line 276.9: 1506-358 (I) "__attribute__" is defined on line 45 of ../source4/heimdal/lib/com_err/com_err.h.
"../source4/heimdal/lib/krb5/expand_path.c", line 331.21: 1506-334 (S) Identifier token has already been defined on line 98 of "/usr/include/net/if_arp.h".
"../source4/heimdal/lib/krb5/expand_path.c", line 390.43: 1506-019 (S) Expecting an array or a pointer to object type.
"../source4/heimdal/lib/krb5/expand_path.c", line 391.31: 1506-019 (S) Expecting an array or a pointer to object type.
"../source4/heimdal/lib/krb5/expand_path.c", line 392.20: 1506-019 (S) Expecting an array or a pointer to object type.
"../source4/heimdal/lib/krb5/expand_path.c", line 392.48: 1506-019 (S) Expecting an array or a pointer to object type.
"../source4/heimdal/lib/krb5/expand_path.c", line 393.39: 1506-019 (S) Expecting an array or a pointer to object type.
Waf: Leaving directory `/opt/home/build/build_farm/samba_4_0_test/bin'
Build failed:  -> task failed (err #1):
	{task: cc expand_path.c -> expand_path_52.o}
gmake: *** [all] Error 1

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Jun 16 15:20:59 CEST 2012 on sn-devel-104
2012-06-16 15:20:58 +02:00
Andrew Bartlett
4edd8b891a s3-auth: Remove auth_netlogond
auth_netlogond was an important module in the development of the
combined Samba 4.0, and was the first module to link smbd with the AD
authentication store, showing that it was possible for NTLM
authentication to be offloaded to the AD server components.

We now have auth_samba4, which provides the full GENSEC stack to smbd,
which also matches exactly the group membership and privileges
assignment and which is supported and tested as part of the official
Samba 4.0 release configuration.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Jun 16 10:13:20 CEST 2012 on sn-devel-104
2012-06-16 10:13:20 +02:00
Andrew Bartlett
9c715da1cb s3-passdb: Remove pdb_ads
pdb_ads was an important module in the development of the combined Samba 4.0, and
was the first module to show that standard samba3 tools such as smbpasswd can be
made to operate on the sam.ldb.

We now have pdb_samba4, which operates directly on the sam.ldb, rather than via
ldapi://, which uses transactions and which is supported and tested as part
of the official Samba 4.0 release configuration.

This module is not as complete (for example, it does not honour the idmap
configuration) and requires that the samba binary be running to operate.

Andrew Bartlett
2012-06-16 08:18:10 +02:00
Andrew Bartlett
d949736f8d s4-classicupgrade: Also ask testparm for 'smb passwd file' 2012-06-16 08:18:10 +02:00
Andrew Bartlett
a0a2f7999e WHATSNEW: Bump the version and announce the s3fs default 2012-06-16 08:18:10 +02:00
Andrew Bartlett
d9f7195a1f s4-classicupgrade: Use "samba classic" description for samba3 NT4-like domains in samba3upgrade 2012-06-16 08:18:10 +02:00
Andrew Bartlett
39766b75a4 s4-lib/param: FLAG DAY for the default FILE SERVER
This commit changes the default file server to be s3fs.  Existing
installs wishing to keep the ntvfs file server need to set this in
their smb.conf:

server services = +smb -s3fs
dcerpc endpoint services = +winreg +srvsvc

Andrew Bartlett
2012-06-16 08:18:10 +02:00
Andrew Bartlett
b58dc1826e s4-s3upgrade: Assert that administrator has a SID of -500, and only skip root if it is -500
Many upgraded installations have root as -1000, and so that account needs to be kept.

Andrew Bartlett
2012-06-16 08:18:10 +02:00
Andrew Bartlett
61f7f01554 s4-s3upgrade: Add my wins.dat and fix the parsing error
The issue was that the numbers at the end of the lines are space
padded.

Andrew Bartlett
2012-06-16 08:18:10 +02:00
Andrew Bartlett
d0b60f02dd s4-s3upgrade: improve idmap import to use posixAccount and posixGroup entries 2012-06-16 08:18:10 +02:00