Jeremy Allison [Fri, 9 Aug 2019 23:06:11 +0000 (16:06 -0700)]
s3: VFS: vfs_glusterfs. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:03:11 +0000 (16:03 -0700)]
s3: VFS: vfs_fruit. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:01:57 +0000 (16:01 -0700)]
s3: VFS: vfs_extd_audit. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:59:54 +0000 (15:59 -0700)]
s3: VFS: vfs_crossrename. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:59:05 +0000 (15:59 -0700)]
s3: VFS: vfs_ceph_snapshots. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:58:11 +0000 (15:58 -0700)]
s3: VFS: vfs_ceph. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:56:59 +0000 (15:56 -0700)]
s3: VFS: vfs_catia. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:55:48 +0000 (15:55 -0700)]
s3: VFS: vfs_cap. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:41:59 +0000 (15:41 -0700)]
s3: VFS: vfs_audit. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:27:49 +0000 (16:27 -0700)]
s3: VFS: vfs_recycle. Use SMB_VFS_RENAMEAT() instead of SMB_VFS_RENAME().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:26:10 +0000 (16:26 -0700)]
s3: smbd: vfs_virusfilter: Use SMB_VFS_RENAMEAT() instead of SMB_VFS_RENAME.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:40:47 +0000 (15:40 -0700)]
s3: torture: Change cmd_vfs to call SMB_VFS_RENAMEAT().
Use conn->cwd_fsp as current src and dst fsp's.
No logic change for now.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:38:32 +0000 (15:38 -0700)]
s3: smbd: Change rename_internals_fsp() to call SMB_VFS_RENAMEAT().
Use conn->cwd_fsp as current src and dst fsp's.
No logic change for now.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:36:32 +0000 (16:36 -0700)]
s3: VFS: vfs_virusfilter. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:36:52 +0000 (15:36 -0700)]
s3: VFS: vfs_unityed_media. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:34:52 +0000 (15:34 -0700)]
s3: VFS: vfs_time_audit. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:33:08 +0000 (15:33 -0700)]
s3: VFS: vfs_syncops. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:31:03 +0000 (15:31 -0700)]
s3: VFS: vfs_streams_xattr. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:28:56 +0000 (15:28 -0700)]
s3: VFS: vfs_streams_depot. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:28:34 +0000 (15:28 -0700)]
s3: VFS: vfs_snapper. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:13:24 +0000 (15:13 -0700)]
s3: VFS: vfs_shadow_copy2. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:03:44 +0000 (15:03 -0700)]
s3: VFS: vfs_netatalk. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:03:06 +0000 (15:03 -0700)]
s3: VFS: vfs_media_harmony. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:02:35 +0000 (15:02 -0700)]
s3: VFS: vfs_glusterfs. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 21:25:21 +0000 (14:25 -0700)]
s3: VFS: vfs_full_audit. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 21:22:03 +0000 (14:22 -0700)]
s3: VFS: vfs_fruit. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 21:19:09 +0000 (14:19 -0700)]
s3: VFS: vfs_extd_audit. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 21:16:12 +0000 (14:16 -0700)]
s3: VFS: vfs_crossrename. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 20:49:46 +0000 (13:49 -0700)]
s3: VFS: vfs_ceph_snapshots. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 20:45:32 +0000 (13:45 -0700)]
s3: VFS: vfs_ceph. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 8 Aug 2019 23:35:54 +0000 (16:35 -0700)]
s3: VFS: vfs_catia. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 8 Aug 2019 23:13:20 +0000 (16:13 -0700)]
s3: VFS: vfs_cap. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 8 Aug 2019 22:30:54 +0000 (15:30 -0700)]
s3: VFS: vfs_audit. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 8 Aug 2019 22:22:31 +0000 (15:22 -0700)]
s3: VFS: Add SMB_VFS_RENAMEAT().
Currently identical to SMB_VFS_RENAME() - uses
AT_FDCWD for both src and dst directories.
Next, move add to all VFS modules that implement
rename and eventually remove rename.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Ralph Boehme [Thu, 15 Aug 2019 13:53:32 +0000 (15:53 +0200)]
s3: VFS: change connection_struct cwd_fname to cwd_fsp
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Thu, 15 Aug 2019 12:43:07 +0000 (14:43 +0200)]
vfs_full_audit: pass conn to smb_fname_str_do_log()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Thu, 15 Aug 2019 13:15:30 +0000 (15:15 +0200)]
s3:smbd: modernize conn_new()
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>
Jeremy Allison [Thu, 8 Aug 2019 21:38:24 +0000 (14:38 -0700)]
s3: smbd: Reformatting. Use helper variable for SMB_VFS_RENAME call.
Will make replacement with renameat() clearer later.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Ralph Boehme [Wed, 14 Aug 2019 08:11:15 +0000 (10:11 +0200)]
vfs_glusterfs: initialize st_ex_file_id, st_ex_itime and st_ex_iflags
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
Ralph Boehme [Wed, 14 Aug 2019 08:06:00 +0000 (10:06 +0200)]
vfs_default: use correct flag in vfswrap_fs_file_id
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>
Christof Schmitt [Tue, 13 Aug 2019 20:45:48 +0000 (13:45 -0700)]
smbd: Make sys_disk_free static
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
Christof Schmitt [Tue, 13 Aug 2019 20:44:52 +0000 (13:44 -0700)]
selftest: Add test for quota query on directory with SGID
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Christof Schmitt [Tue, 13 Aug 2019 20:37:22 +0000 (13:37 -0700)]
vfs_fake_dfq: Add option to fake stat information
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>
Christof Schmitt [Wed, 7 Aug 2019 17:42:26 +0000 (10:42 -0700)]
vfs_gpfs: Check group quota for directory when SGID is set
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>
Christof Schmitt [Tue, 13 Aug 2019 20:40:48 +0000 (13:40 -0700)]
quotas: Check group quota for directory when SGID is set
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>
Andreas Schneider [Mon, 12 Aug 2019 17:07:15 +0000 (19:07 +0200)]
auth:ntlmssp: Use generate_random_buffer() for session keys
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
Andreas Schneider [Mon, 12 Aug 2019 16:57:06 +0000 (18:57 +0200)]
s3:passdb: Use generate_secret_buffer() for generating passwords
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Andreas Schneider [Mon, 12 Aug 2019 16:56:35 +0000 (18:56 +0200)]
s4:samdb: Use generate_nonce_buffer() for AEC GCM nonce
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Andreas Schneider [Mon, 12 Aug 2019 16:55:56 +0000 (18:55 +0200)]
lib:util: Use generate_secret_buffer() for long term passwords
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Andreas Schneider [Mon, 12 Aug 2019 16:50:02 +0000 (18:50 +0200)]
Revert "s4:rpc_server: Use generate_secret_buffer() to create a session key"
This reverts commit
4b2480518bd3887be3a6cfb713523ac084e09fd5.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Andreas Schneider [Mon, 12 Aug 2019 16:49:52 +0000 (18:49 +0200)]
Revert "s4:rpc_server: Use generate_secret_buffer() for backupkey wap_key"
This reverts commit
5a62056b4530e4c509444be9164a1fca1dce193f.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Andreas Schneider [Mon, 12 Aug 2019 16:49:37 +0000 (18:49 +0200)]
Revert "s4:rpc_server: Use generate_secret_buffer() for netlogon challange"
This reverts commit
a21770cfdffd2a21045a1bc87e489af0f4c6f130.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Andreas Schneider [Mon, 12 Aug 2019 16:49:31 +0000 (18:49 +0200)]
Revert "libcli:auth: Use generate_secret_buffer() for netlogon challenge"
This reverts commit
c3ba556f52b15dd80efc26e4fb8f43ce2ee3a7f0.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Andreas Schneider [Mon, 12 Aug 2019 14:10:20 +0000 (16:10 +0200)]
lib:util: Fix documentation for random number functions
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Alexander Bokovoy [Sat, 10 Aug 2019 08:53:12 +0000 (11:53 +0300)]
smbtorture: extend rpc.lsa to lookup machine over forest-wide LookupNames
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
Alexander Bokovoy [Thu, 1 Aug 2019 12:48:58 +0000 (15:48 +0300)]
lookup_name: allow own domain lookup when flags == 0
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>
Alexander Bokovoy [Thu, 1 Aug 2019 18:08:52 +0000 (21:08 +0300)]
torture/rpc/lsa: allow testing different lookup levels
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>
Volker Lendecke [Wed, 14 Aug 2019 08:26:59 +0000 (10:26 +0200)]
smbd: Fix CID
1452293 Incorrect expression (NO_EFFECT)
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
Martin Schwenke [Thu, 1 Aug 2019 00:58:42 +0000 (10:58 +1000)]
ctdb-daemon: Avoid signed/unsigned comparison by casting
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
Martin Schwenke [Thu, 1 Aug 2019 00:55:39 +0000 (10:55 +1000)]
ctdb-daemon: Avoid signed/unsigned comparison by declaring as unsigned
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>
Martin Schwenke [Thu, 1 Aug 2019 00:46:36 +0000 (10:46 +1000)]
ctdb-common: Return value of ctdb_queue_length() should be unsigned
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>
Martin Schwenke [Fri, 26 Jul 2019 01:15:50 +0000 (11:15 +1000)]
ctdb-tests: Use select_test_node() in ctdb setdebug simple test
There is no requirement for IP addresses here.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Fri, 26 Jul 2019 01:15:05 +0000 (11:15 +1000)]
ctdb-tests: Add function select_test_node()
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>
Martin Schwenke [Thu, 1 Aug 2019 06:16:31 +0000 (16:16 +1000)]
ctdb-tools: Fix usage for "ctdb cattdb"
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 5 Aug 2019 01:52:16 +0000 (11:52 +1000)]
ctdb-tests: Don't print summary on failure if -e option is specified
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>
Martin Schwenke [Mon, 5 Aug 2019 01:50:21 +0000 (11:50 +1000)]
ctdb-tests: Drop mention of non-existent -s option
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 5 Aug 2019 01:48:13 +0000 (11:48 +1000)]
ctdb-tests: Add -I <count> option for iterating tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 5 Aug 2019 01:19:30 +0000 (11:19 +1000)]
ctdb-tests: Factor out main test loop into run_tests()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 12 Aug 2019 05:13:47 +0000 (15:13 +1000)]
ctdb-tests: Add shellcheck test for some test scripts and includes
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>
Martin Schwenke [Tue, 13 Aug 2019 00:57:47 +0000 (10:57 +1000)]
ctdb-tests: New variable CTDB_SCRIPTS_TESTS_BIN_DIR
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>
Martin Schwenke [Tue, 13 Aug 2019 00:53:48 +0000 (10:53 +1000)]
ctdb-tests: Rename CTDB_SCRIPTS_TESTS_BINDIR to CTDB_SCRIPTS_TESTS_LIBEXEC_DIR
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 12 Aug 2019 12:10:41 +0000 (22:10 +1000)]
ctdb-tests: Simplify test_wrap script
Given other improvements, this is now needlessly complex.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 5 Aug 2019 00:28:52 +0000 (10:28 +1000)]
ctdb-tests: Avoid shellcheck warning SC2045
SC2045 Iterating over ls output is fragile. Use globs.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 5 Aug 2019 00:22:36 +0000 (10:22 +1000)]
ctdb-tests: Avoid shellcheck warning SC2034
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>
Martin Schwenke [Mon, 5 Aug 2019 00:21:16 +0000 (10:21 +1000)]
ctdb-tests: Avoid shellcheck warning SC2230
SC2230 which is non-standard...
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 5 Aug 2019 00:19:13 +0000 (10:19 +1000)]
ctdb-tests: Avoid shellcheck warning SC2188
SC2188 This redirection doesn't have a command...
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 5 Aug 2019 00:18:08 +0000 (10:18 +1000)]
ctdb-tests: Avoid shellcheck warning SC2155
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>
Martin Schwenke [Mon, 5 Aug 2019 00:14:22 +0000 (10:14 +1000)]
ctdb-tests: Avoid shellcheck warning SC2004
SC2004 $/${} is unnecessary on arithmetic variables
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 5 Aug 2019 00:12:23 +0000 (10:12 +1000)]
ctdb-tests: Avoid shellcheck warning SC2164
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>
Martin Schwenke [Mon, 5 Aug 2019 00:09:34 +0000 (10:09 +1000)]
ctdb-tests: Avoid shellcheck warning SC2086
SC2086 Double quote to prevent globbing and word splitting
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 12 Aug 2019 06:11:13 +0000 (16:11 +1000)]
ctdb-tools: Drop 'o' option from getopts command
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>
Volker Lendecke [Wed, 14 Aug 2019 06:41:03 +0000 (08:41 +0200)]
torture: Fix CID
1452288 Null pointer dereferences (NULL_RETURNS)
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
Volker Lendecke [Wed, 14 Aug 2019 06:39:10 +0000 (08:39 +0200)]
lib: CID
1452289: API usage errors (USE_AFTER_FREE)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Wed, 14 Aug 2019 06:37:00 +0000 (08:37 +0200)]
smbd: Fix CID
1452290 Null pointer dereferences (REVERSE_INULL)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Wed, 14 Aug 2019 06:36:00 +0000 (08:36 +0200)]
smbd: Fix CID
1452291 Null pointer dereferences (NULL_RETURNS)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Wed, 14 Aug 2019 06:34:18 +0000 (08:34 +0200)]
librpc: Fix CID
1452292 Null pointer dereferences (REVERSE_INULL)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
David Disseldorp [Mon, 12 Aug 2019 12:35:37 +0000 (14:35 +0200)]
s3/pdb: fix debug message typos
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 13 00:42:09 UTC 2019 on sn-devel-184
David Disseldorp [Mon, 12 Aug 2019 12:32:47 +0000 (14:32 +0200)]
ctdb/doc: fix some double-word typos
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Andreas Schneider [Wed, 31 Jul 2019 13:44:24 +0000 (15:44 +0200)]
libcli:auth: Use generate_secret_buffer() for netlogon challenge
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Aug 12 10:42:35 UTC 2019 on sn-devel-184
Andreas Schneider [Wed, 31 Jul 2019 13:42:26 +0000 (15:42 +0200)]
s4:rpc_server: Use generate_secret_buffer() for netlogon challange
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Andreas Schneider [Wed, 31 Jul 2019 13:41:29 +0000 (15:41 +0200)]
s4:rpc_server: Use generate_secret_buffer() for backupkey wap_key
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Andreas Schneider [Wed, 31 Jul 2019 13:40:12 +0000 (15:40 +0200)]
s4:rpc_server: Use generate_secret_buffer() to create a session key
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Andreas Schneider [Wed, 31 Jul 2019 13:38:50 +0000 (15:38 +0200)]
lib:util: Add better documentation for generate_secret_buffer()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Andreas Schneider [Wed, 31 Jul 2019 13:28:34 +0000 (15:28 +0200)]
s3:smbd: Use generate_nonce_buffer() for AES-CCM and AES-GCM nonce
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Andreas Schneider [Wed, 31 Jul 2019 13:25:35 +0000 (15:25 +0200)]
libcli:smb: Use generate_nonce_buffer() for AES-CCM and AES-GCM nonce
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Andreas Schneider [Wed, 31 Jul 2019 13:16:37 +0000 (15:16 +0200)]
lib:util: Add generate_nonce_buffer()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 17:32:41 +0000 (10:32 -0700)]
s3: VFS: vfs_snapper: Make setxattr return errno = EROFS on a shadow copy path.
smbd has no business modifying a shadow copy filesystem, it should be read-only.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Mon Aug 12 01:18:45 UTC 2019 on sn-devel-184
Jeremy Allison [Fri, 9 Aug 2019 17:31:38 +0000 (10:31 -0700)]
s3: VFS: vfs_snapper: Make removexattr return errno = EROFS on a shadow copy path.
smbd has no business modifying a shadow copy filesystem, it should be read-only.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 17:30:19 +0000 (10:30 -0700)]
s3: VFS: vfs_snapper: Make chflags return errno = EROFS on a shadow copy path.
smbd has no business modifying a shadow copy filesystem, it should be read-only.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 17:29:23 +0000 (10:29 -0700)]
s3: VFS: vfs_snapper: Make rmdir return errno = EROFS on a shadow copy path.
smbd has no business modifying a shadow copy filesystem, it should be read-only.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>