summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-09-14tdb2: make tests include a single mega-header to simplify future patchesRusty Russell50-408/+60
This lets us add the new files to a single place. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 476567430be6962625bf399192e20938985232c7)
2011-09-14tdb2: tdb_foreach()Rusty Russell3-0/+117
Create an iterator over every open tdb (not internal TDBs). This is useful for re-establishing the tdb1-style active lock for CLEAR_IF_FIRST. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 1a0c636bc38213bd0322db47529f78f2dc22ffdd)
2011-09-14tdb2: keep link of every non-internal tdb.Rusty Russell2-25/+22
Instead of a per-file linked list, use a per-tdb list. This is needed for tdb_foreach(). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 2414f261918b4fb8a549dd385dba32118e37bf85)
2011-09-14tdb2: save openhook, allow tdb_get_attribute() on it.Rusty Russell4-18/+21
This makes it easy to call it again after a fork(), such as for re-establishing the CLEAR_IF_FIRST files locks. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 937d0babe99dcd315040a9e48430140e63e4a7df)
2011-09-14tdb_compat: make tdb2s temporarily read-only for tdb_traverse_read()Rusty Russell2-2/+27
It doesn't make a difference unless the tdb2 opens a TDB1 on disk, in which case tdb1_traverse() takes a write lock on the entire file. By setting the tdb to read-only first, we simulate the old behaviour. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14tdb2: add TDB_RDONLY flag, allow setting/unsetting it.Rusty Russell8-16/+170
You can only unset it if the TDB was originally opened O_RDWR. Also, cleaned up error handling in tdb_allrecord_lock() so we only get one log message on a r/o database. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit b87e14495d5b07e1b247218a72329f10ecb3da7f)
2011-09-14tdb2: return TDB_ERR_RDONLY if trying to start a transaction on a R/O tdb.Rusty Russell1-2/+11
This is more accurate than returning TDB_ERR_EINVAL. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 91436a25574597dbd1fd2de5bcd5826a234100d6)
2011-09-14tdb2: save open_flags instead of mmap_flags.Rusty Russell3-5/+11
It's more consistent with what tdb1 does, and slightly more encapsulated. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 6b7c3c840eafbec211b9f58751c5ff754302a68e)
2011-09-14tdb_compat: adapt to tdb2 API change.Rusty Russell6-6/+16
Add the ecode arg to all the log functions, and log it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14tdb2: Hand error code to logging function.Rusty Russell10-15/+34
Since we've deprecated tdb_error() function (and it didn't work right from inside the logging function anyway, since we didn't set tdb->ecode yet) we need to hand it to the log function. (Imported from CCAN commit 6e3d9e8a66bf8b45150500f176452ee8e9ee9927) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14tdb2: move transaction lockRusty Russell1-2/+2
Make it the same offset as TDB1. This isn't strictly necessary, but it would allow for total unification later, since TDB1 and TDB2's transaction code is otherwise completely compatible. (Imported from CCAN commit de432e8f857ce23bccde7c6ffa3e7e21456df18b) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14tdb2: enforce TDB_CONVERTRusty Russell4-0/+72
If the caller actually specifies TDB_CONVERT, fail if the TDB does not need conversion. It's unusual for the user to specify TDB_CONVERT (it's auto-detected) but better to be strict. (Imported from CCAN commit 3e3ee8b0c1e77340ab9e8678c2d23646d8cdb627) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14tdb2: cleanup oob handling.Rusty Russell3-25/+30
The tdb_oob() function can fail due to errors, as well as because the length asked for is greater than the size of the file. Clean that up: (1) If probe is true, only fail if there's an error, not if the length is too great. (2) Exit tdb_open() if it tdb_oob() probe fails; this helps cut down test time for failtest. (3) Don't set probe to true in tdb_direct() fail; a minor issue, but it means we log failure. (Imported from CCAN commit 77658070a3e4f712b94d659b2e399031ce3394c8) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14tdb2: fix tdb_lock offset.Rusty Russell1-1/+1
It can be 64 bits, for huge databases. (Imported from CCAN commit 736c033322079baf754261d82b6a83de53b2bb4e) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14tdb2: fix internal tdb_write_convert() error handling in tdb_open()Rusty Russell1-4/+5
As noted, failtest was taking a long time, because a failure injected here was not detected. (Imported from CCAN commit 51f592dfcda4d58d6b9d8134b6e1aff791dc40f2) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14tdb2: Fix to always use 64-bit offset definitionRusty Russell7-11/+627
We use off_t in the tdb2 interface (for tdb_attribute_flock); we need to make sure that all callers agree on the size. This also causes a problem in the tests: it's not enough to include config.h first, we need the _FILE_OFFSET_BITS define from private.h. Otherwise, we can disagree about the definitions of F_SETLK, F_SETLKW and off_t, causing strange problems. (Imported from CCAN commit baa17ee2d5e01a32030f19e566007417d72b4b6e) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14ccan: configure check for HAVE_BUILTIN_CHOOSE_EXPRRusty Russell2-0/+18
We weren't testing for this, and without it, typesafe_cb just casts its function argument. This is why I didn't get a warning when one of my patches amended a function incorrectly. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-13s3:smb2cli: split cli->smb2.gss_blob from cli->secblobStefan Metzmacher2-1/+2
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue Sep 13 23:34:13 CEST 2011 on sn-devel-104
2011-09-13s3:net_time: make use of cli_state_server_time_zone() and ↵Stefan Metzmacher1-2/+2
cli_state_server_time() metze
2011-09-13s3:libsmb: make use of cli_state_server_time_zone()Stefan Metzmacher4-17/+17
metze
2011-09-13s3:libsmb: add cli_state_server_time()Stefan Metzmacher2-0/+6
metze
2011-09-13s3:libsmb: add cli_state_server_time_zone()Stefan Metzmacher2-0/+6
metze
2011-09-13s3:libsmb: make use of cli_state_server_session_key()Stefan Metzmacher1-4/+4
metze
2011-09-13s3:libsmb: add cli_state_server_session_key()Stefan Metzmacher2-0/+6
metze
2011-09-13s3:libsmb: make use of cli_state_security_mode()Stefan Metzmacher1-9/+12
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue Sep 13 19:45:01 CEST 2011 on sn-devel-104
2011-09-13s3:winbindd_cm: make use of cli_state_security_mode()Stefan Metzmacher1-1/+3
metze
2011-09-13s3:auth_server: make use of cli_state_security_mode()Stefan Metzmacher1-3/+9
metze
2011-09-13s3:libsmb: add cli_state_security_mode()Stefan Metzmacher2-0/+6
metze
2011-09-13s3:libsmb: make use of cli_state_max_requests() in cli_push_send()Stefan Metzmacher1-2/+5
metze
2011-09-13s3:libsmb: make use of cli_state_max_requests() in cli_pull_send()Stefan Metzmacher1-1/+4
metze
2011-09-13s3:libsmb: add cli_state_max_requests()Stefan Metzmacher2-0/+6
metze
2011-09-13s3:libsmb: make sure cli->max_mux is valid in the return of the serverStefan Metzmacher1-0/+6
metze
2011-09-13s3:libsmb: set the MID to 0 in cli_setup_packet_buf()Stefan Metzmacher1-1/+1
It's allocated when sending the request. metze
2011-09-13s3:libsmb: check that max_xmit is not less than 1024Stefan Metzmacher1-0/+5
metze
2011-09-13s3:libsmb: better expect a max_xmit of 1024 instead of 0xFFFF for the CORE ↵Stefan Metzmacher1-0/+1
protocol metze
2011-09-13s3:torture: there's no need to alter cli->max_xmit in order to test large writesStefan Metzmacher1-7/+3
metze
2011-09-13s3:libsmb: don't mix smb2 share capabilities with smb1 capabilitiesStefan Metzmacher2-1/+2
metze
2011-09-13s3:libsmb: the smb2 server capabilities from the session setup are 32-bitStefan Metzmacher1-1/+1
metze
2011-09-13ldb:pyldb.c - "py_ldb_rename" remove superflous "ldb" pointerMatthias Dieter Wallnöfer1-4/+2
Reviewed-by: Jelmer Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Tue Sep 13 18:11:18 CEST 2011 on sn-devel-104
2011-09-13s4-s3-upgrade Improve samba-tool domain samba3upgrade behaviourAndrew Bartlett3-17/+38
The --realm argument is again optional (the previous code would take the default from the default smb.conf, not the one specified) and --targetdir is now a named argument much like it is to provision. We now test the --testparm option to ensure it behaves the way we expect. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Sep 13 16:30:31 CEST 2011 on sn-devel-104
2011-09-13s4:upgrade_from_s3 - restore "get_testparm_var" methodMatthias Dieter Wallnöfer1-1/+4
This has accidentally been removed by commit 8268c2d4e231b05b439bc70331b75342b35daa4e. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-09-13s3:torture: use CLI_BUFFER_SIZE instead of cli->max_xmitStefan Metzmacher1-1/+1
The max_data parameter of trans2/nttrans calls are not bound to cli->max_xmit. Even with cli->max_xmit, which means the max size of the whole SMB pdu, we would get fragmented trans2/nttrans replies. That's why we can also use our maximum, which is CLI_BUFFER_SIZE. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue Sep 13 14:52:35 CEST 2011 on sn-devel-104
2011-09-13s3:libsmb: make use of cli_state_available_size() in cli_smbwrite()Stefan Metzmacher1-1/+2
metze
2011-09-13s3:libsmb: make use of cli_state_available_size() in cli_write_max_bufsize()Stefan Metzmacher1-1/+1
metze
2011-09-13s3:libsmb: make use of cli_state_available_size() in cli_read_max_bufsize()Stefan Metzmacher1-1/+1
metze
2011-09-13s3:libsmb: make use of cli_state_available_size() in cli_list_old_send()Stefan Metzmacher1-1/+3
metze
2011-09-13s3:libsmb: make use of cli_state_available_size() in cli_sesssetup_blob_send()Stefan Metzmacher1-6/+8
metze
2011-09-13s3:libsmb: make use of cli_state_available_size() in cli_trans_format()Stefan Metzmacher1-4/+5
metze
2011-09-13s3:libsmb: add cli_state_available_size()Stefan Metzmacher2-0/+14
metze
2011-09-13s3:clitar: remove unused/not existing extern variablesStefan Metzmacher1-3/+0
metze