summaryrefslogtreecommitdiffstats
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
...
* s3:gencache: don't use transaction non non-persistent gencache_notrans.tdbMichael Adam2014-11-261-8/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gencache_notrans.tdb is a non-persistent cache layer above the persistent gencache.tdb. Despite its name, and despite the nature of non-persistent tdbs, the current stabilization code uses a transaction on gencache_notrans.tdb like this: transaction_start(cache) transaction_start(cache_notrans) traverse(cache_notrans, stabilize_fn) transaction_commit(cache) transaction_commit(cache_notrans) where stabilze_fn does this on a record: 1. store it to or delete it from cache (depending on the timeout) 2. delete it from the cache_notrans This patch changes gencache_notrans.tdb to avoid transactions by using an all-record lock like this: tdb_allrecord_lock(cache_notrans) transaction_start(cache) traverse(cache_notrans, stabilize_fn_mod) transaction_commit(cache) traverse(cache_notrans, wipe_fn) tdb_wipe_all(cache_notrans) tdb_allrecord_unlock(cache_notrans) with stabilize_fn_mod doing only: 1. store the record to or delete it from cache (depending on the timeout) and wipe_fn deleting the records from the gencache_notrans db. This is a step towards making non-persistent-db specific features like mutex locking usable for gencache_notrans.tdb. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3:gencache: simply stabilize() a bit more: remove error from stateMichael Adam2014-11-261-5/+1
| | | | | | | | | | | state.error is set to true if and only if the traverse callback returns error (-1), and hence only if the traverse fails. Hence the the error state is redundant. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3:gencache: fix logic in stabilization when deleting a record from stable cacheMichael Adam2014-11-261-3/+3
| | | | | | | | | | | | | Set state->written = true in the delete case if and only if the record has really been deleted. This does currently not seem to lead to an unneeded write to the DB, since failure to delete the record will cause the traverse and hence the transaction to cancel. But I think this is clearer. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* lib: Use tdb_parse_record in gencache_setVolker Lendecke2014-11-261-7/+15
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Nov 26 14:50:38 CET 2014 on sn-devel-104
* lib: Fix header include protection #defineVolker Lendecke2014-11-251-2/+2
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Nov 25 15:38:22 CET 2014 on sn-devel-104
* s3:wscript_build: remove unused allow_warnings=True for 'KRBCLIENT'Stefan Metzmacher2014-11-251-1/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:winbindd: make use of talloc_string_sub2() in generate_krb5_ccache()Stefan Metzmacher2014-11-251-1/+14
| | | | | | | This way we don't pass a given format string to talloc_asprintf(). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:winbindd: avoid invalid pointer type warningsStefan Metzmacher2014-11-253-3/+11
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:utils: rename variables in regedit_*.c to fix shadow warningsStefan Metzmacher2014-11-254-19/+19
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:utils: add debug functions instead of magic format strings in ↵Stefan Metzmacher2014-11-251-8/+39
| | | | | | | | | net_idmap_check.c This way the compiler can check the format string and doesn't generate warnings. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:torture: avoid nesting of macros and function calls in ↵Stefan Metzmacher2014-11-251-4/+5
| | | | | | | torture_cli_session_setup2() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: avoid a compiler warning in open_sockets_smbd()Stefan Metzmacher2014-11-251-1/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: do casting of dm_sessid_t in stepsStefan Metzmacher2014-11-251-4/+6
| | | | | | | This makes it more explicit and avoids compiler warnings. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:wscript_build: remove unused allow_warnings=True for 'smbregistry'Stefan Metzmacher2014-11-251-1/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:registry: use discard_const_p() to avoid const warning in smb_iconv() defineStefan Metzmacher2014-11-251-1/+1
| | | | | | | | | I'm wondering why we have this in reg_parse_internal.h at all! But for now just fix warnings... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:printing: fix some const warnings in print_iprint.cStefan Metzmacher2014-11-251-6/+6
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:printing: Avoid compiler warning about unused labelKai Blin2014-11-251-0/+4
| | | | | | Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:passdb: avoid invalid pointer type warnings in pdb_wbc_sam.cStefan Metzmacher2014-11-251-6/+13
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:passdb: always copy the history in pdb_set_plaintext_passwd()Stefan Metzmacher2014-11-251-19/+14
| | | | | | | | We should not write to memory marked as const (returned from pdb_get_pw_history())! Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:wscript_build: remove unused allow_warnings=True for 'param'Stefan Metzmacher2014-11-251-1/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:param: fix compiler warningsStefan Metzmacher2014-11-251-12/+12
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:modules: remove unused allow_warnings=True for non_posix_acls, and ↵Stefan Metzmacher2014-11-251-2/+0
| | | | | | | vfs_media_harmony Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:modules: rename variables in vfs_fruit.c to fix shadow warningsStefan Metzmacher2014-11-251-16/+16
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:librpc/idl: mark struct smbXsrv_client as [public]Stefan Metzmacher2014-11-251-1/+1
| | | | | | | | | | This avoids compiler warnings about unused code. We don't use the NDR code for this yet, will be done when we get multi-channel support. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:wscript_build: remove unused allow_warnings=True for 'ads'Stefan Metzmacher2014-11-251-1/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libads: avoid some compiler warnings in ldap.cStefan Metzmacher2014-11-251-15/+19
| | | | | | | | We use helper variables and explicit casts using discard_const_p() to avoid bogus const warnings. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: remove unused variables in cliconnect.cStefan Metzmacher2014-11-251-3/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:lib/netapi/examples: fix pointer from integer error in nltest.cStefan Metzmacher2014-11-251-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:lib/netapi/tests: fix invalid switch enum level warningStefan Metzmacher2014-11-251-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:lib: fix/simplify srprs_hex()Stefan Metzmacher2014-11-251-10/+6
| | | | | | | | | | | | | | | | | | | | | There're a few problems with this function. - it pretends to support values up to UINT64_MAX in it only returns 'unsigned' which support only values up to UINT32_MAX. Currently we only have callers with len=2 and len=8, so it's not a triggered bug. We just allow (len >= 1 && len <= 8) now. - The compiler is not able to inspect the format string to sscanf(). We copy up to 8 bytes into a stack buffer and always pass "%8x" to sscanf. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-smbstatus: Fix exit code of profile output.Andreas Schneider2014-11-241-2/+5
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10961 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Nov 24 21:13:51 CET 2014 on sn-devel-104
* messaging3: Fix sending large messages on FreeBSDVolker Lendecke2014-11-241-0/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* unix_msg: Reformat unix_dgram_send a bitVolker Lendecke2014-11-241-1/+3
| | | | | | | This makes the next commit a bit more readable Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-smbclient: Return success if we listed the shares.Andreas Schneider2014-11-241-1/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10960 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_streams_xattr: check stream typeRalph Boehme2014-11-221-0/+6
| | | | | | | | | | | Only allow access to the stream type "$DATA". vfs_streams_depot does this too and it fixes the failing test "smb2.streams.names". Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Nov 22 01:07:54 CET 2014 on sn-devel-104
* vfs_streams_xattr: initialize pointerRalph Boehme2014-11-211-1/+1
| | | | | | | | Intitialize pointer to NULL, otherwise we talloc_free() an unitialized pointer in the error code path. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_streams_xattr: fix check with samba_private_attr_name()Ralph Boehme2014-11-211-3/+18
| | | | | | | | | | | | | | | We want to check with samba_private_attr_name() whether the xattr name is a private one, unfortunately it flags xattrs that begin with the default streams prefix as private. By only calling samba_private_attr_name() in case the xattr does NOT begin with the default prefix, we know that if it returns 'true' it definitely one of our internal xattr like "user.DOSATTRIB". This fixes a bug introduced in 634bcb09a08b927fd79ae0e16aeee2a123605f94 that denied all access to valid stream xattrs. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: fix some function header comments.Michael Adam2014-11-201-3/+3
| | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Nov 20 18:45:28 CET 2014 on sn-devel-104
* s3:smbprofile: profile async pread/pwrite/fsync syscallsStefan Metzmacher2014-11-192-0/+13
| | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Nov 19 23:13:10 CET 2014 on sn-devel-104
* s3:smbprofile: track connect_count and disconnect_countStefan Metzmacher2014-11-193-0/+5
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbprofile: remove unused {START,END}_PROFILE_STAMP()Stefan Metzmacher2014-11-191-19/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbprofile: report idle state of 'idle_count' and 'idle_time'Stefan Metzmacher2014-11-192-9/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbprofile: improve profiling for the security context switching.Stefan Metzmacher2014-11-192-4/+25
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbprofile: count all SMB1 and SMB2 requests as 'request_count'Stefan Metzmacher2014-11-193-2/+13
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_server: use async smbprofile macrosStefan Metzmacher2014-11-196-113/+97
| | | | | | | | This improves profiling and corrently counts the total and idle time for async requests. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbprofile: rewrite the internal macrosStefan Metzmacher2014-11-193-1728/+686
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now autogenerate a lot of code using SMBPROFILE_STATS_ALL_SECTIONS macro which expands to different SMBPROFILE_STATS_{COUNT,BASIC,BYTES,IOBYTES} macros. This also allows async profiling using: struct mystate { ... SMBPROFILE_BASIC_ASYNC_STATE(profile_state); ... }; ... SMBPROFILE_BASIC_ASYNC_START(SMB2_negotiate, profile_p, mystate->profile_state); ... SMBPROFILE_BYTES_ASYNC_SET_IDLE(mystate->profile_state); ... SMBPROFILE_BYTES_ASYNC_SET_BUSY(mystate->profile_state); ... SMBPROFILE_BASIC_ASYNC_END(mystate->profile_state); The current START_PROFILE*()/END_PROFILE*() are implemented as legacy wrappers. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: Use "smbd profiling level"Volker Lendecke2014-11-191-6/+6
| | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: add "smbd profiling level" optionVolker Lendecke2014-11-191-0/+1
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbprofile: Make "status_profile.h" a proper headerVolker Lendecke2014-11-194-6/+31
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbprofile: Make smbprofile.h includable on its ownVolker Lendecke2014-11-191-0/+2
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>