summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* s3: VFS: change connection_struct cwd_fname to cwd_fspRalph Boehme2019-08-1614-42/+64
| | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_full_audit: pass conn to smb_fname_str_do_log()Ralph Boehme2019-08-161-18/+18
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: modernize conn_new()Ralph Boehme2019-08-161-7/+27
| | | | | | | | Split the monstrous if into individual allocations. I'm going to add more talloc allocations in a subsequent commit, so it's time to split this up. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd: Reformatting. Use helper variable for SMB_VFS_RENAME call.Jeremy Allison2019-08-161-1/+5
| | | | | | | Will make replacement with renameat() clearer later. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* vfs_glusterfs: initialize st_ex_file_id, st_ex_itime and st_ex_iflagsRalph Boehme2019-08-161-0/+4
| | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14090 RN: vfs_glusterfs: initialize st_ex_file_id, st_ex_itime and st_ex_iflags 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): Fri Aug 16 01:07:23 UTC 2019 on sn-devel-184
* vfs_default: use correct flag in vfswrap_fs_file_idRalph Boehme2019-08-151-1/+1
| | | | | | | | | | | | Luckily using the wrong flag ST_EX_IFLAG_CALCULATED_ITIME currently results in the same semantics as using the correct ST_EX_IFLAG_CALCULATED_FILE_ID, as in vfs_default the non-calculated file_id is based a non-calculated itime. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14089 RN: vfs_default: use correct flag in vfswrap_fs_file_id Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Make sys_disk_free staticChristof Schmitt2019-08-142-4/+5
| | | | | | | | | | The function is only called from the same file. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Wed Aug 14 17:47:33 UTC 2019 on sn-devel-184
* selftest: Add test for quota query on directory with SGIDChristof Schmitt2019-08-141-0/+9
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* vfs_fake_dfq: Add option to fake stat informationChristof Schmitt2019-08-141-0/+79
| | | | | | | | | Add an option to allow faking the gid and the SGID bit in the returned stat buffer. That will be used to verify quota queries on folders with SGID set. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* vfs_gpfs: Check group quota for directory when SGID is setChristof Schmitt2019-08-141-2/+18
| | | | | | | | | | | | | | | On directories with the "set group id" (SGID) bit is set, new files and subfolders will be created with the group of the directory, and not with the primary group of the user. Checking for free space in this case should query the group quota for the gid of the directory. This is the same change as the common smbd code, but since vfs_gpfs still has its own check for available space and quotas, add it here as well. A future goal would be to use the common free space check instead of duplicating code in vfs_gpfs. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* quotas: Check group quota for directory when SGID is setChristof Schmitt2019-08-141-4/+19
| | | | | | | | | | On directories with the "set group id" (SGID) bit is set, new files and subfolders will be created with the group of the directory, and not with the primary group of the user. Checking for free space in this case should query the group quota for the gid of the directory. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* auth:ntlmssp: Use generate_random_buffer() for session keysAndreas Schneider2019-08-141-1/+1
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Wed Aug 14 16:26:47 UTC 2019 on sn-devel-184
* s3:passdb: Use generate_secret_buffer() for generating passwordsAndreas Schneider2019-08-141-1/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* s4:samdb: Use generate_nonce_buffer() for AEC GCM nonceAndreas Schneider2019-08-141-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* lib:util: Use generate_secret_buffer() for long term passwordsAndreas Schneider2019-08-141-3/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* Revert "s4:rpc_server: Use generate_secret_buffer() to create a session key"Andreas Schneider2019-08-141-3/+2
| | | | | | This reverts commit 4b2480518bd3887be3a6cfb713523ac084e09fd5. Reviewed-by: Alexander Bokovoy <ab@samba.org>
* Revert "s4:rpc_server: Use generate_secret_buffer() for backupkey wap_key"Andreas Schneider2019-08-141-2/+1
| | | | | | This reverts commit 5a62056b4530e4c509444be9164a1fca1dce193f. Reviewed-by: Alexander Bokovoy <ab@samba.org>
* Revert "s4:rpc_server: Use generate_secret_buffer() for netlogon challange"Andreas Schneider2019-08-141-2/+1
| | | | | | This reverts commit a21770cfdffd2a21045a1bc87e489af0f4c6f130. Reviewed-by: Alexander Bokovoy <ab@samba.org>
* Revert "libcli:auth: Use generate_secret_buffer() for netlogon challenge"Andreas Schneider2019-08-141-2/+1
| | | | | | This reverts commit c3ba556f52b15dd80efc26e4fb8f43ce2ee3a7f0. Reviewed-by: Alexander Bokovoy <ab@samba.org>
* lib:util: Fix documentation for random number functionsAndreas Schneider2019-08-142-4/+13
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* smbtorture: extend rpc.lsa to lookup machine over forest-wide LookupNamesAlexander Bokovoy2019-08-141-1/+7
| | | | | | | | | | | | Add a simple test to resolve DOMAIN\MACHINE$ via LSA LookupNames3 using LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 level. This level would pass zero lookup flags to lookup_name(). Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Wed Aug 14 13:07:42 UTC 2019 on sn-devel-184
* lookup_name: allow own domain lookup when flags == 0Alexander Bokovoy2019-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2007, we've added support for multiple lookup levels for LSA LookupNames family of calls. However, forest-wide lookups, as described in MS-LSAT 2.2.16, never worked because flags passed to lookup_name() were always set to zero, expecting at least default lookup on a DC to apply. lookup_name() was instead treating zero flags as 'skip all checks'. Allow at least own domain lookup in case domain name is the same. This should allow FreeIPA DC to respond to LSA LookupNames3 calls from a trusted AD DC side. For the reference, below is a request Windows Server 2016 domain controller sends to FreeIPA domain controller when attempting to look up a user from a trusted forest root domain that attemps to login to the domain controller. Notice the level in the lsa_LookupNames3 call and resulting flags in lookup_name(). [2019/08/03 07:14:24.156065, 1, pid=23639, effective(967001000, 967001000), real(967001000, 0), class=rpc_parse] ../../librpc/ndr/ndr.c:471(ndr_print_function_debug) lsa_LookupNames3: struct lsa_LookupNames3 in: struct lsa_LookupNames3 handle : * handle: struct policy_handle handle_type : 0x00000000 (0) uuid : 0000004c-0000-0000-455d-3018575c0000 num_names : 0x00000001 (1) names: ARRAY(1) names: struct lsa_String length : 0x000a (10) size : 0x000c (12) string : * string : 'XS\ab' sids : * sids: struct lsa_TransSidArray3 count : 0x00000000 (0) sids : NULL level : LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 (6) count : * count : 0x00000000 (0) lookup_options : LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES (0) client_revision : LSA_CLIENT_REVISION_2 (2) [2019/08/03 07:14:24.156189, 6, pid=23639, effective(967001000, 967001000), real(967001000, 0), class=rpc_srv] ../../source3/rpc_server/rpc_handles.c:339(find_policy_by_hnd_internal) Found policy hnd[0] [0000] 00 00 00 00 4C 00 00 00 00 00 00 00 45 5D 30 18 ....L... ....E]0. [0010] 57 5C 00 00 W\.. [2019/08/03 07:14:24.156228, 4, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../source3/smbd/sec_ctx.c:215(push_sec_ctx) push_sec_ctx(967001000, 967001000) : sec_ctx_stack_ndx = 2 [2019/08/03 07:14:24.156246, 4, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../source3/smbd/uid.c:552(push_conn_ctx) push_conn_ctx(0) : conn_ctx_stack_ndx = 0 [2019/08/03 07:14:24.156259, 4, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../source3/smbd/sec_ctx.c:319(set_sec_ctx_internal) setting sec ctx (0, 0) - sec_ctx_stack_ndx = 2 [2019/08/03 07:14:24.156273, 5, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../libcli/security/security_token.c:53(security_token_debug) Security token: (NULL) [2019/08/03 07:14:24.156285, 5, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../source3/auth/token_util.c:865(debug_unix_user_token) UNIX token of user 0 Primary group is 0 and contains 0 supplementary groups [2019/08/03 07:14:24.156311, 5, pid=23639, effective(0, 0), real(0, 0), class=rpc_srv] ../../source3/rpc_server/lsa/srv_lsa_nt.c:244(lookup_lsa_sids) lookup_lsa_sids: looking up name XS\ab [2019/08/03 07:14:24.156327, 10, pid=23639, effective(0, 0), real(0, 0)] ../../source3/passdb/lookup_sid.c:112(lookup_name) lookup_name: XS\ab => domain=[XS], name=[ab] [2019/08/03 07:14:24.156340, 10, pid=23639, effective(0, 0), real(0, 0)] ../../source3/passdb/lookup_sid.c:114(lookup_name) lookup_name: flags = 0x00 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* torture/rpc/lsa: allow testing different lookup levelsAlexander Bokovoy2019-08-142-53/+67
| | | | | | | | | Convert torture/rpc/lsa LookupNames/LookupSids code to allow testing different LSA_LOOKUP_NAMES_* levels. Keep existing level 1 (LSA_LOOKUP_NAMES_ALL) for the current set of tests. Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* smbd: Fix CID 1452293 Incorrect expression (NO_EFFECT)Volker Lendecke2019-08-141-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Aug 14 11:48:42 UTC 2019 on sn-devel-184
* ctdb-daemon: Avoid signed/unsigned comparison by castingMartin Schwenke2019-08-141-1/+1
| | | | | | | | | | | | | | | | | Compiling with -Wsign-compare complains: 1047 | && (call->call_id == CTDB_FETCH_WITH_HEADER_FUNC)) { | ^~ struct ctdb_call is a protocol element, so we can't simply change it. Found by csbuild. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Wed Aug 14 10:29:59 UTC 2019 on sn-devel-184
* ctdb-daemon: Avoid signed/unsigned comparison by declaring as unsignedMartin Schwenke2019-08-141-2/+2
| | | | | | | | | | | | | | | | | | | Compiling with -Wsign-compare complains: ctdb/server/ctdb_call.c:831:12: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] 831 | if (count <= ctdb_db->statistics.hot_keys[0].count) { | ^~ and ctdb/server/ctdb_call.c:844:13: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] 844 | if (count <= ctdb_db->statistics.hot_keys[i].count) { | ^~ Found by cs-build. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-common: Return value of ctdb_queue_length() should be unsignedMartin Schwenke2019-08-142-2/+2
| | | | | | | | | | | | | | | | Compiling with -Wsign-compare complains: ctdb/server/ctdb_daemon.c: scope_hint: In function ‘daemon_queue_send’ ctdb/server/ctdb_daemon.c:259:40: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] ... The struct ctdb_queue member out_queue_length is actually uint32_t, so just return that type. Found by csbuild. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Use select_test_node() in ctdb setdebug simple testMartin Schwenke2019-08-141-1/+1
| | | | | | | There is no requirement for IP addresses here. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add function select_test_node()Martin Schwenke2019-08-141-0/+8
| | | | | | | Should be used when public IP addresses are not assigned. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Fix usage for "ctdb cattdb"Martin Schwenke2019-08-141-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Don't print summary on failure if -e option is specifiedMartin Schwenke2019-08-141-4/+6
| | | | | | | | If there is a failure it will always be the last test run. Don't obscure this by following it with a summary. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Drop mention of non-existent -s optionMartin Schwenke2019-08-141-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add -I <count> option for iterating testsMartin Schwenke2019-08-141-3/+24
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Factor out main test loop into run_tests()Martin Schwenke2019-08-141-24/+33
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add shellcheck test for some test scripts and includesMartin Schwenke2019-08-141-0/+24
| | | | | | | These files now pass, so we might as well keep them in good shape. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: New variable CTDB_SCRIPTS_TESTS_BIN_DIRMartin Schwenke2019-08-141-1/+4
| | | | | | | This can be used to find ctdb_run_tests and ctdb_local_daemons. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Rename CTDB_SCRIPTS_TESTS_BINDIR to CTDB_SCRIPTS_TESTS_LIBEXEC_DIRMartin Schwenke2019-08-142-5/+5
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Simplify test_wrap scriptMartin Schwenke2019-08-142-22/+8
| | | | | | | Given other improvements, this is now needlessly complex. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Avoid shellcheck warning SC2045Martin Schwenke2019-08-141-1/+5
| | | | | | | SC2045 Iterating over ls output is fragile. Use globs. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Avoid shellcheck warning SC2034Martin Schwenke2019-08-142-1/+1
| | | | | | | SC2034 summary appears unused. Verify use (or export if used externally) Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Avoid shellcheck warning SC2230Martin Schwenke2019-08-141-1/+1
| | | | | | | SC2230 which is non-standard... Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Avoid shellcheck warning SC2188Martin Schwenke2019-08-141-1/+1
| | | | | | | SC2188 This redirection doesn't have a command... Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Avoid shellcheck warning SC2155Martin Schwenke2019-08-143-6/+8
| | | | | | | | | | | | SC2155 Declare and assign separately to avoid masking return values The wscript changes require an identical change in local_daemons.sh. While touching the lines in wscript, escape the backslashes to make them literal backslashes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Avoid shellcheck warning SC2004Martin Schwenke2019-08-141-4/+4
| | | | | | | SC2004 $/${} is unnecessary on arithmetic variables Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Avoid shellcheck warning SC2164Martin Schwenke2019-08-141-1/+4
| | | | | | | SC2164 Use 'cd ... || exit' or 'cd ... || return' in case cd fails Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Avoid shellcheck warning SC2086Martin Schwenke2019-08-141-6/+7
| | | | | | | SC2086 Double quote to prevent globbing and word splitting Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Drop 'o' option from getopts commandMartin Schwenke2019-08-141-1/+1
| | | | | | | | | | | | Commit 90de5e0594b9180226b9a13293afe31f18576b3d remove the processing for this option but forgot to remove it from the getopts command. Versions of ShellCheck >= 0.4.7 warn on this, so it is worth fixing. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14086 RN: Fix onnode test failure with ShellCheck >= 0.4.7 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* torture: Fix CID 1452288 Null pointer dereferences (NULL_RETURNS)Volker Lendecke2019-08-141-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Aug 14 08:59:23 UTC 2019 on sn-devel-184
* lib: CID 1452289: API usage errors (USE_AFTER_FREE)Volker Lendecke2019-08-141-1/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbd: Fix CID 1452290 Null pointer dereferences (REVERSE_INULL)Volker Lendecke2019-08-141-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>