samba.git
4 years agos3: VFS: Complete the removal of SMB_VFS_CHOWN()
Jeremy Allison [Thu, 10 Oct 2019 21:35:37 +0000 (14:35 -0700)]
s3: VFS: Complete the removal of SMB_VFS_CHOWN()

No longer used anywhere.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 15 20:07:51 UTC 2019 on sn-devel-184

4 years agos3: VFS: vfs_full_audit: Remove chown_fn(). No longer used.
Jeremy Allison [Thu, 10 Oct 2019 21:30:42 +0000 (14:30 -0700)]
s3: VFS: vfs_full_audit: Remove chown_fn(). No longer used.

NB, this will now fail smb_vfs_assert_all_fns()
until we remove the chown_fn() from the VFS definitions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_time_audit: Remove chown_fn(). No longer used.
Jeremy Allison [Thu, 10 Oct 2019 21:29:30 +0000 (14:29 -0700)]
s3: VFS: vfs_time_audit: Remove chown_fn(). No longer used.

NB, this will now fail smb_vfs_assert_all_fns()
until we remove the chown_fn() from the VFS definitions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_cap: Remove chown_fn().
Jeremy Allison [Thu, 10 Oct 2019 21:28:38 +0000 (14:28 -0700)]
s3: VFS: vfs_cap: Remove chown_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_snapper: Remove chown_fn().
Jeremy Allison [Thu, 10 Oct 2019 21:27:36 +0000 (14:27 -0700)]
s3: VFS: vfs_snapper: Remove chown_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_shadow_copy2: Remove chown_fn().
Jeremy Allison [Thu, 10 Oct 2019 21:26:59 +0000 (14:26 -0700)]
s3: VFS: vfs_shadow_copy2: Remove chown_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_media_harmony: Remove chown_fn().
Jeremy Allison [Thu, 10 Oct 2019 21:26:12 +0000 (14:26 -0700)]
s3: VFS: vfs_media_harmony: Remove chown_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_glusterfs: Remove chown_fn().
Jeremy Allison [Thu, 10 Oct 2019 21:25:31 +0000 (14:25 -0700)]
s3: VFS: vfs_glusterfs: Remove chown_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_fruit: Remove chown_fn().
Jeremy Allison [Thu, 10 Oct 2019 21:24:46 +0000 (14:24 -0700)]
s3: VFS: vfs_fruit: Remove chown_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_fake_acls: Remove chown_fn().
Jeremy Allison [Thu, 10 Oct 2019 21:24:00 +0000 (14:24 -0700)]
s3: VFS: vfs_fake_acls: Remove chown_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_ceph_snapshots: Remove chown_fn().
Jeremy Allison [Thu, 10 Oct 2019 21:23:15 +0000 (14:23 -0700)]
s3: VFS: vfs_ceph_snapshots: Remove chown_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_ceph: Remove chown_fn().
Jeremy Allison [Thu, 10 Oct 2019 21:22:35 +0000 (14:22 -0700)]
s3: VFS: vfs_ceph: Remove chown_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_catia: Remove chown_fn().
Jeremy Allison [Thu, 10 Oct 2019 21:21:51 +0000 (14:21 -0700)]
s3: VFS: vfs_catia: Remove chown_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_cap: Remove chown_fn().
Jeremy Allison [Thu, 10 Oct 2019 21:20:02 +0000 (14:20 -0700)]
s3: VFS: vfs_cap: Remove chown_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: torture: Remove cmd_chown() - can be replicated by cmd_open()->cmd_fchown().
Jeremy Allison [Thu, 10 Oct 2019 21:18:32 +0000 (14:18 -0700)]
s3: torture: Remove cmd_chown() - can be replicated by cmd_open()->cmd_fchown().

Last user of SMB_VFS_CHOWN() in the codebase.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: pysmbd: Change py_smbd_chown() to use SMB_VFS_FCHOWN() internally.
Jeremy Allison [Thu, 10 Oct 2019 21:14:13 +0000 (14:14 -0700)]
s3: pysmbd: Change py_smbd_chown() to use SMB_VFS_FCHOWN() internally.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: smbd: Remove vfs_chown_fsp().
Jeremy Allison [Tue, 8 Oct 2019 20:46:02 +0000 (13:46 -0700)]
s3: smbd: Remove vfs_chown_fsp().

No longer used. This gets rid of another case
where we were playing directory changing games
that are eliminated by just using a file handle.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: smbd: set_nt_acl(). Now we know we always have a valid file handle, always use...
Jeremy Allison [Tue, 8 Oct 2019 20:45:45 +0000 (13:45 -0700)]
s3: smbd: set_nt_acl(). Now we know we always have a valid file handle, always use VFS_FCHOWN.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agoaudit_logging: Don't spam the logs if dsdb_event is not found
Andreas Schneider [Fri, 11 Oct 2019 06:28:30 +0000 (08:28 +0200)]
audit_logging: Don't spam the logs if dsdb_event is not found

This gets only registered by our tests.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct 14 07:41:52 UTC 2019 on sn-devel-184

4 years agos3:libads: Do not turn on canonicalization flag for MIT Kerberos
Andreas Schneider [Wed, 9 Oct 2019 14:32:47 +0000 (16:32 +0200)]
s3:libads: Do not turn on canonicalization flag for MIT Kerberos

This partially reverts 303b7e59a286896888ee2473995fc50bb2b5ce5e.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14155

Pair-Programmed-With: Isaac Boukris <iboukris@redhat.com>

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Sat Oct 12 17:39:13 UTC 2019 on sn-devel-184

4 years agotestprogs: Add test for kinit with canonicalization
Andreas Schneider [Wed, 9 Oct 2019 14:59:59 +0000 (16:59 +0200)]
testprogs: Add test for kinit with canonicalization

Pair-Programmed-With: Isaac Boukris <iboukris@redhat.com>

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos4:selftest: Do not print the target env twice
Andreas Schneider [Wed, 9 Oct 2019 14:57:11 +0000 (16:57 +0200)]
s4:selftest: Do not print the target env twice

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agogitlab-ci: Run several AD tests with MIT KDC
Andreas Schneider [Wed, 9 Oct 2019 13:55:50 +0000 (15:55 +0200)]
gitlab-ci: Run several AD tests with MIT KDC

This will avoid introducing regressions in either client or server code.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos4:selftest: Do not print the target env twice
Andreas Schneider [Thu, 10 Oct 2019 07:14:24 +0000 (09:14 +0200)]
s4:selftest: Do not print the target env twice

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agolib:krb5_wrap: Do not create a temporary file for MEMORY keytabs
Andreas Schneider [Wed, 9 Oct 2019 18:11:03 +0000 (20:11 +0200)]
lib:krb5_wrap: Do not create a temporary file for MEMORY keytabs

The autobuild cleanup script fails with:

The tree has 3 new uncommitted files!!!
git clean -n
Would remove MEMORY:tmp_smb_creds_SK98Lv
Would remove MEMORY:tmp_smb_creds_kornU6
Would remove MEMORY:tmp_smb_creds_ljR828

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agospnego: fix server handling of no optimistic exchange
Isaac Boukris [Wed, 4 Sep 2019 14:04:12 +0000 (17:04 +0300)]
spnego: fix server handling of no optimistic exchange

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14106

Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Sat Oct 12 15:51:42 UTC 2019 on sn-devel-184

4 years agopython/tests/gensec: add spnego downgrade python tests
Isaac Boukris [Thu, 10 Oct 2019 21:20:16 +0000 (00:20 +0300)]
python/tests/gensec: add spnego downgrade python tests

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14106

Pair-Programmed-With: Andreas Schneider <asn@samba.org>

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agopython/tests/gensec: make it possible to add knownfail tests for gensec.update()
Stefan Metzmacher [Fri, 11 Oct 2019 11:23:17 +0000 (13:23 +0200)]
python/tests/gensec: make it possible to add knownfail tests for gensec.update()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14106

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoselftest: add tests for no optimistic spnego exchange
Isaac Boukris [Wed, 4 Sep 2019 13:39:43 +0000 (16:39 +0300)]
selftest: add tests for no optimistic spnego exchange

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14106

Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agospnego: add client option to omit sending an optimistic token
Isaac Boukris [Wed, 4 Sep 2019 13:31:21 +0000 (16:31 +0300)]
spnego: add client option to omit sending an optimistic token

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14106

Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agoselftest: s3: add a test for spnego downgrade from krb5 to ntlm
Isaac Boukris [Mon, 7 Oct 2019 20:51:19 +0000 (23:51 +0300)]
selftest: s3: add a test for spnego downgrade from krb5 to ntlm

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14106

Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:libsmb: Do not check the SPNEGO neg token for KRB5
Andreas Schneider [Thu, 10 Oct 2019 14:18:21 +0000 (16:18 +0200)]
s3:libsmb: Do not check the SPNEGO neg token for KRB5

The list is not protected and this could be a downgrade attack.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14106

Pair-Programmed-With: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agospnego: ignore server mech_types list
Isaac Boukris [Thu, 3 Oct 2019 10:09:29 +0000 (13:09 +0300)]
spnego: ignore server mech_types list

We should not use the mech list sent by the server in the last
'negotiate' packet in CIFS protocol, as it is not protected and
may be subject to downgrade attacks.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14106

Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agowscript: split function check to one per line and sort alphabetically
Ralph Boehme [Mon, 30 Sep 2019 09:52:06 +0000 (11:52 +0200)]
wscript: split function check to one per line and sort alphabetically

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Oct 10 20:13:25 UTC 2019 on sn-devel-184

4 years agowscript: remove all checks for _FUNC and __FUNC
Ralph Boehme [Mon, 30 Sep 2019 09:49:28 +0000 (11:49 +0200)]
wscript: remove all checks for _FUNC and __FUNC

Those where historic artifacts not needed anymore.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoWHATSNEW: Mention performance improvements for SMB3 encryption
Andreas Schneider [Tue, 1 Oct 2019 15:38:57 +0000 (17:38 +0200)]
WHATSNEW: Mention performance improvements for SMB3 encryption

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Oct 10 09:41:26 UTC 2019 on sn-devel-184

4 years agolibrpc: Remove server build of oxidresolver.idl
Andrew Bartlett [Mon, 23 Sep 2019 05:08:56 +0000 (17:08 +1200)]
librpc: Remove server build of oxidresolver.idl

We do not have a server for this DCOM component so do not generate
the code for it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolibrpc: Remove client and server build of w32time.idl
Andrew Bartlett [Mon, 23 Sep 2019 04:58:35 +0000 (16:58 +1200)]
librpc: Remove client and server build of w32time.idl

We do not have a server for the Win32 Time Server so do not generate
the code for it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolibrpc: Remove client and server build of rot.idl
Andrew Bartlett [Mon, 23 Sep 2019 04:57:48 +0000 (16:57 +1200)]
librpc: Remove client and server build of rot.idl

We do not have a client or server for this DCOM component so do not generate
the code for it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolibrpc: Remove s4 server build of dfs
Andrew Bartlett [Mon, 23 Sep 2019 04:47:48 +0000 (16:47 +1200)]
librpc: Remove s4 server build of dfs

We do not have a source4 varient of the dfs server, so do not generate
the code for it.

DFS is very closely tied to SMB so we use the DFS server in
smbd.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolibrpc: Remove s3 server build of unixinfo
Andrew Bartlett [Mon, 23 Sep 2019 04:40:47 +0000 (16:40 +1200)]
librpc: Remove s3 server build of unixinfo

We do not have a source3 varient of the unixinfo server, so do not generate
the code for it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolibrpc: Add commnets on the split out of IDL files
Andrew Bartlett [Mon, 23 Sep 2019 04:39:11 +0000 (16:39 +1200)]
librpc: Add commnets on the split out of IDL files

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolibrpc: Remove server build of remact.idl
Andrew Bartlett [Mon, 23 Sep 2019 04:37:31 +0000 (16:37 +1200)]
librpc: Remove server build of remact.idl

We do not have a server for the DCOM Remote activation service, so do not generate
the code for it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolibrpc: Remove s4 server build of ntsvcs
Andrew Bartlett [Mon, 23 Sep 2019 04:34:19 +0000 (16:34 +1200)]
librpc: Remove s4 server build of ntsvcs

We do not have a source4 varient of the ntsvcs server, so do not generate
the code for it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolibrpc: Remove s4 server build of initshutdown
Andrew Bartlett [Mon, 23 Sep 2019 04:32:38 +0000 (16:32 +1200)]
librpc: Remove s4 server build of initshutdown

We do not have a source4 varient of the initshutdown server, so do not generate
the code for it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolibrpc: Remove unused build of atsvc server
Andrew Bartlett [Mon, 23 Sep 2019 04:31:07 +0000 (16:31 +1200)]
librpc: Remove unused build of atsvc server

This avoids building server-side code we do not use and so makes the build
smaller and code auditing easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: Complete the removal of SMB_VFS_RMDIR()
Jeremy Allison [Fri, 4 Oct 2019 22:41:21 +0000 (15:41 -0700)]
s3: VFS: Complete the removal of SMB_VFS_RMDIR()

All users now use SMB_VFS_UNLINKAT(..., AT_REMOVEDIR).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Oct 10 07:26:43 UTC 2019 on sn-devel-184

4 years agos3: VFS: vfs_time_audit: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 22:23:44 +0000 (15:23 -0700)]
s3: VFS: vfs_time_audit: Remove rmdir_fn(). No longer used.

NB, this will now fail smb_vfs_assert_all_fns()
until we remove the rmdir_fn() from the VFS definitions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_time_audit: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 22:22:19 +0000 (15:22 -0700)]
s3: VFS: vfs_time_audit: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_syncops: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 22:21:21 +0000 (15:21 -0700)]
s3: VFS: vfs_syncops: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_streams_depot: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 22:17:32 +0000 (15:17 -0700)]
s3: VFS: vfs_streams_depot: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_snapper: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 22:10:58 +0000 (15:10 -0700)]
s3: VFS: vfs_snapper: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_shadow_copy2: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 22:10:07 +0000 (15:10 -0700)]
s3: VFS: vfs_shadow_copy2: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_posix_eadb: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 22:09:00 +0000 (15:09 -0700)]
s3: VFS: vfs_posix_eadb: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_media_harmony: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 21:52:18 +0000 (14:52 -0700)]
s3: VFS: vfs_media_harmony: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_glusterfs: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 21:51:15 +0000 (14:51 -0700)]
s3: VFS: vfs_glusterfs: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_extd_audit: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 21:49:54 +0000 (14:49 -0700)]
s3: VFS: vfs_extd_audit: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_ceph_snapshots: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 21:44:48 +0000 (14:44 -0700)]
s3: VFS: vfs_ceph_snapshots: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_ceph: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 21:44:08 +0000 (14:44 -0700)]
s3: VFS: vfs_ceph: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_catia: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 21:43:11 +0000 (14:43 -0700)]
s3: VFS: vfs_catia: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_cap: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 21:42:26 +0000 (14:42 -0700)]
s3: VFS: vfs_cap: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_audit: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 21:41:26 +0000 (14:41 -0700)]
s3: VFS: vfs_audit: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_acl_xattr: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 21:40:26 +0000 (14:40 -0700)]
s3: VFS: vfs_acl_xattr: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_acl_tdb: Remove rmdir_fn(). No longer used.
Jeremy Allison [Fri, 4 Oct 2019 21:39:30 +0000 (14:39 -0700)]
s3: VFS: vfs_acl_tdb: Remove rmdir_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_fruit: Remove rmdir_fn. No longer used.
Jeremy Allison [Fri, 4 Oct 2019 21:14:17 +0000 (14:14 -0700)]
s3: VFS: vfs_fruit: Remove rmdir_fn. No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_unityed_media: Remove rmdir_fn. No longer used.
Jeremy Allison [Fri, 4 Oct 2019 21:01:55 +0000 (14:01 -0700)]
s3: VFS: vfs_unityed_media: Remove rmdir_fn. No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_xattr_tdb: Remove rmdir_fn. No longer used.
Jeremy Allison [Fri, 4 Oct 2019 20:53:13 +0000 (13:53 -0700)]
s3: VFS: vfs_xattr_tdb: Remove rmdir_fn. No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Change rmdir_internals() to call SMB_VFS_UNLINKAT() in rmdir cases.
Jeremy Allison [Fri, 4 Oct 2019 20:51:09 +0000 (13:51 -0700)]
s3: smbd: Change rmdir_internals() to call SMB_VFS_UNLINKAT() in rmdir cases.

Use conn->cwd_fsp as current fsp.

No logic change for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Change recursive_rmdir() to call SMB_VFS_UNLINKAT() in rmdir case.
Jeremy Allison [Fri, 4 Oct 2019 19:54:05 +0000 (12:54 -0700)]
s3: smbd: Change recursive_rmdir() to call SMB_VFS_UNLINKAT() in rmdir case.

Use conn->cwd_fsp as current fsp.

No logic change for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: cmd_vfs: Change cmd_pathfunc() to call SMB_VFS_UNLINKAT() in rmdir case.
Jeremy Allison [Fri, 4 Oct 2019 19:51:06 +0000 (12:51 -0700)]
s3: cmd_vfs: Change cmd_pathfunc() to call SMB_VFS_UNLINKAT() in rmdir case.

Use conn->cwd_fsp as current fsp.

No logic change for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_fruit: Change fruit_rmdir_internal() to call UNLINKAT instead of RMDIR.
Jeremy Allison [Fri, 4 Oct 2019 21:03:39 +0000 (14:03 -0700)]
s3: VFS: vfs_fruit: Change fruit_rmdir_internal() to call UNLINKAT instead of RMDIR.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_streams_depot: Change RMDIR -> UNLINKAT inside streams_depot_unlink_inte...
Jeremy Allison [Fri, 4 Oct 2019 22:40:34 +0000 (15:40 -0700)]
s3: VFS: vfs_streams_depot: Change RMDIR -> UNLINKAT inside streams_depot_unlink_internal().

No logic change.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_streams_depot: Change RMDIR -> UNLINKAT inside stream_dir().
Jeremy Allison [Fri, 4 Oct 2019 22:38:45 +0000 (15:38 -0700)]
s3: VFS: vfs_streams_depot: Change RMDIR -> UNLINKAT inside stream_dir().

No logic change.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_streams_depot: Add a dirfsp parameter to streams_depot_rmdir_internal().
Jeremy Allison [Fri, 4 Oct 2019 22:14:21 +0000 (15:14 -0700)]
s3: VFS: vfs_streams_depot: Add a dirfsp parameter to streams_depot_rmdir_internal().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_streams_depot: Rename streams_depot_rmdir() to streams_depot_rmdir_inter...
Jeremy Allison [Fri, 4 Oct 2019 22:12:30 +0000 (15:12 -0700)]
s3: VFS: vfs_streams_depot: Rename streams_depot_rmdir() to streams_depot_rmdir_internal().

Make rmdir_fn() a wrapper function. This will
allow us to add the dirfsp parameter.

Fix DEBUG statement so it doesn't print the wrong function name.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_posix_eadb: Convert streams_depot_rmdir_internal() to call UNLINKAT...
Jeremy Allison [Fri, 4 Oct 2019 22:16:06 +0000 (15:16 -0700)]
s3: VFS: vfs_posix_eadb: Convert streams_depot_rmdir_internal() to call UNLINKAT() instead of RMDIR().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_posix_eadb: Convert posix_eadb_rmdir_internal() to call UNLINKAT() inste...
Jeremy Allison [Fri, 4 Oct 2019 22:07:46 +0000 (15:07 -0700)]
s3: VFS: vfs_posix_eadb: Convert posix_eadb_rmdir_internal() to call UNLINKAT() instead of RMDIR().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_posix_eadb: Add a dirfsp parameter to posix_eadb_rmdir_internal().
Jeremy Allison [Fri, 4 Oct 2019 22:06:23 +0000 (15:06 -0700)]
s3: VFS: vfs_posix_eadb: Add a dirfsp parameter to posix_eadb_rmdir_internal().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_posix_eadb: Rename posix_eadb_rmdir() to posix_eadb_rmdir_internal().
Jeremy Allison [Fri, 4 Oct 2019 22:04:02 +0000 (15:04 -0700)]
s3: VFS: vfs_posix_eadb: Rename posix_eadb_rmdir() to posix_eadb_rmdir_internal().

Make rmdir_fn() a wrapper function. This will
allow us to add the dirfsp parameter.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_acl_common: Convert rmdir_acl_common() to use UNLINKAT instead of RMDIR.
Jeremy Allison [Fri, 4 Oct 2019 21:37:01 +0000 (14:37 -0700)]
s3: VFS: vfs_acl_common: Convert rmdir_acl_common() to use UNLINKAT instead of RMDIR.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: Change rmdir_acl_common() to take a files_struct *dirfsp pointer.
Jeremy Allison [Fri, 4 Oct 2019 21:34:41 +0000 (14:34 -0700)]
s3: VFS: Change rmdir_acl_common() to take a files_struct *dirfsp pointer.

Pass in the passed dirfsp if available, else handle->conn->cwd_fsp.

No logic changes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_acl_common: Change acl_common_remove_object() to use UNLINKAT instead...
Jeremy Allison [Fri, 4 Oct 2019 21:25:00 +0000 (14:25 -0700)]
s3: VFS: vfs_acl_common: Change acl_common_remove_object() to use UNLINKAT instead of RMDIR.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_acl_xattr. Wrap rmdir_acl_common() by acl_xattr_rmdir() so we don't...
Jeremy Allison [Fri, 4 Oct 2019 21:31:59 +0000 (14:31 -0700)]
s3: VFS: vfs_acl_xattr. Wrap rmdir_acl_common() by acl_xattr_rmdir() so we don't call it directly.

This will allow adding the extra dirfsp parameter to
rmdir_acl_common().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosmbd: Fix an uninitalized variable
Volker Lendecke [Tue, 8 Oct 2019 15:37:56 +0000 (17:37 +0200)]
smbd: Fix an uninitalized variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct 10 01:04:33 UTC 2019 on sn-devel-184

4 years agomdssvc.idl: pass policy_handle as pointer
Ralph Boehme [Fri, 23 Aug 2019 16:43:02 +0000 (18:43 +0200)]
mdssvc.idl: pass policy_handle as pointer

No change in behaviour, this just changes all functions to take the
policy_handle argument as pointer instead of passing it by value.
This is how all other IDLs pass it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Oct  9 15:52:55 UTC 2019 on sn-devel-184

4 years agos3:mdssvc: fix service startup in deamon mode
Ralph Boehme [Tue, 20 Aug 2019 15:00:49 +0000 (17:00 +0200)]
s3:mdssvc: fix service startup in deamon mode

Changes:

* Don't initialize the RPC service by calling setup_rpc_module() in the parent
  mdssd. This is not needed in the parent, only in the worker childs.

* In the worker childs call setup_rpc_module() instead of init_rpc_module()
  which ensures rpc_mdssvc_init() is called with the mdssvc callback which is
  needed to initialize mdssvc via mdssvc_init_cb() -> init_service_mdssvc()

* Finally rpc_setup_mdssvc() is adjusted to be a noop if mdssvc is configured to
  as external and when called by the main parent smbd via dcesrv_ep_setup() ->
  setup_rpc_modules()

I've manually tested all 4 combinations of external=yes|no X module=yes|no with
the new mdfind command.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agos3:mdssvc: use a helper variable for the service type
Ralph Boehme [Tue, 20 Aug 2019 14:50:52 +0000 (16:50 +0200)]
s3:mdssvc: use a helper variable for the service type

No change in behaviour. Simplifies a subsequent logical change.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agomdssd: fix a debug message
Ralph Boehme [Tue, 20 Aug 2019 15:00:12 +0000 (17:00 +0200)]
mdssd: fix a debug message

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agos3: rpc_server: enable mdssvc by default
Ralph Boehme [Mon, 19 Aug 2019 13:50:36 +0000 (15:50 +0200)]
s3: rpc_server: enable mdssvc by default

Now that mdssvc is built by default and also tested in CI, enable it by default,
running as embedded service.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agoselftest: add mdfind blackbox test
Ralph Boehme [Sat, 17 Aug 2019 09:36:55 +0000 (11:36 +0200)]
selftest: add mdfind blackbox test

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agos3:utils: add mdfind
Ralph Boehme [Thu, 2 May 2019 19:33:46 +0000 (21:33 +0200)]
s3:utils: add mdfind

A small command line tool to run macOS Spotlight searches against an SMB server
that runs the Spotlight mdssvc RPC service, including macOS and Samba.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agoselftest: add end-to-end tests for mdssvc with a fake HTTP server
Ralph Boehme [Sun, 28 Jul 2019 13:25:54 +0000 (15:25 +0200)]
selftest: add end-to-end tests for mdssvc with a fake HTTP server

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agoselftest: split fileserver testenv into simpleserver and fileserver
Ralph Boehme [Tue, 30 Jul 2019 10:00:18 +0000 (12:00 +0200)]
selftest: split fileserver testenv into simpleserver and fileserver

The simpleserver testenv continues to be built with minimal
dependencies. fileserver otoh will be built with bells and whistles including
JSON which I need for using the env as target for Spotlight tests.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agos3:mdssvc: add unit tests for the Spotlight to Elasticsearch parser
Ralph Boehme [Tue, 30 Jul 2019 10:47:03 +0000 (12:47 +0200)]
s3:mdssvc: add unit tests for the Spotlight to Elasticsearch parser

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agos3:mdssvc: add Elasticsearch backend
Ralph Boehme [Mon, 5 Aug 2019 14:25:01 +0000 (16:25 +0200)]
s3:mdssvc: add Elasticsearch backend

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agos3:mdssvc: add missing mds_ctx deallocation
Ralph Boehme [Tue, 13 Aug 2019 12:16:07 +0000 (14:16 +0200)]
s3:mdssvc: add missing mds_ctx deallocation

The mds_ctx object was created in _mdssvc_open() as a talloc child of the pipe
which means as long as the pipe is connected it's not freed.

To ensure we do proper rundown of all resources including backend connections
and pending queries, we must free the mds_ctx object.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agos3:mdssvc: fix a long line
Ralph Boehme [Tue, 13 Aug 2019 12:13:20 +0000 (14:13 +0200)]
s3:mdssvc: fix a long line

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agos3:mdssvc: modernize a few DEBUG macros
Ralph Boehme [Tue, 13 Aug 2019 12:11:23 +0000 (14:11 +0200)]
s3:mdssvc: modernize a few DEBUG macros

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agos3:mdssvc: remove unused snum from struct sl_query
Ralph Boehme [Tue, 13 Aug 2019 10:55:33 +0000 (12:55 +0200)]
s3:mdssvc: remove unused snum from struct sl_query

Looks like this was never used, it's also available via mds_ctx->snum.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agobuild: add SAMBA_DATADIR as "samba" subdirectory of DATADIR
Ralph Boehme [Fri, 10 May 2019 16:49:20 +0000 (18:49 +0200)]
build: add SAMBA_DATADIR as "samba" subdirectory of DATADIR

DATADIR should have been set to this path from the beginning, too late to change
that now as ut's used as parent for two other directory varialbles: SETUPDIR and
CODEPAGEDIR.

From <https://www.gnu.org/prep/standards/html_node/Directory-Variables.html>:

  datadir

    The directory for installing idiosyncratic read-only
    architecture-independent data files for this program. This is usually the
    same place as ‘datarootdir’, but we use the two separate variables so that
    you can move these program-specific files without altering the location for
    Info files, man pages, etc.

    This should normally be /usr/local/share, but write it as
    $(datarootdir). (If you are using Autoconf, write it as ‘@datadir@’.)

    The definition of ‘datadir’ is the same for all packages, so you should
    install your data in a subdirectory thereof. Most packages install their
    data under $(datadir)/package-name/.

Currently Samba doesn't install any application specific data files, but I'm
going to do just that in a subsequent commit.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>