samba.git
2 years agolibcli/smb: remove unused PROTOCOL_SMB3_10 definition
Stefan Metzmacher [Fri, 9 Jul 2021 10:04:30 +0000 (12:04 +0200)]
libcli/smb: remove unused PROTOCOL_SMB3_10 definition

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agodocs-xml: remove support for "SMB3_10"
Stefan Metzmacher [Fri, 9 Jul 2021 10:03:06 +0000 (12:03 +0200)]
docs-xml: remove support for "SMB3_10"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibcli/smb: replace PROTOCOL_SMB3_10 with PROTOCOL_SMB3_11
Stefan Metzmacher [Wed, 11 Nov 2020 14:14:12 +0000 (15:14 +0100)]
libcli/smb: replace PROTOCOL_SMB3_10 with PROTOCOL_SMB3_11

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:smbd: replace PROTOCOL_SMB3_10 with PROTOCOL_SMB3_11
Stefan Metzmacher [Wed, 11 Nov 2020 14:14:12 +0000 (15:14 +0100)]
s3:smbd: replace PROTOCOL_SMB3_10 with PROTOCOL_SMB3_11

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibcli/smb: remove unused PROTOCOL_SMB2_24 definition
Stefan Metzmacher [Fri, 9 Jul 2021 10:04:30 +0000 (12:04 +0200)]
libcli/smb: remove unused PROTOCOL_SMB2_24 definition

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agodocs-xml: remove support for "SMB2_24"
Stefan Metzmacher [Fri, 9 Jul 2021 10:03:06 +0000 (12:03 +0200)]
docs-xml: remove support for "SMB2_24"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibcli/smb: replace PROTOCOL_SMB2_24 with PROTOCOL_SMB3_00
Stefan Metzmacher [Wed, 11 Nov 2020 14:14:12 +0000 (15:14 +0100)]
libcli/smb: replace PROTOCOL_SMB2_24 with PROTOCOL_SMB3_00

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:smbd: replace PROTOCOL_SMB2_24 with PROTOCOL_SMB3_00
Stefan Metzmacher [Wed, 11 Nov 2020 14:14:12 +0000 (15:14 +0100)]
s3:smbd: replace PROTOCOL_SMB2_24 with PROTOCOL_SMB3_00

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibcli/smb: remove unused PROTOCOL_SMB2_22 definition
Stefan Metzmacher [Fri, 9 Jul 2021 10:04:30 +0000 (12:04 +0200)]
libcli/smb: remove unused PROTOCOL_SMB2_22 definition

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agodocs-xml: remove support for "SMB2_22"
Stefan Metzmacher [Fri, 9 Jul 2021 10:03:06 +0000 (12:03 +0200)]
docs-xml: remove support for "SMB2_22"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibcli/smb: replace PROTOCOL_SMB2_22 with PROTOCOL_SMB3_00
Stefan Metzmacher [Wed, 11 Nov 2020 14:14:12 +0000 (15:14 +0100)]
libcli/smb: replace PROTOCOL_SMB2_22 with PROTOCOL_SMB3_00

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:smbd: replace PROTOCOL_SMB2_22 with PROTOCOL_SMB3_00
Stefan Metzmacher [Wed, 11 Nov 2020 14:14:12 +0000 (15:14 +0100)]
s3:smbd: replace PROTOCOL_SMB2_22 with PROTOCOL_SMB3_00

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:torture: replace PROTOCOL_SMB2_22 with PROTOCOL_SMB3_00
Stefan Metzmacher [Fri, 9 Jul 2021 09:57:17 +0000 (11:57 +0200)]
s3:torture: replace PROTOCOL_SMB2_22 with PROTOCOL_SMB3_00

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmb2_negprot: no longer use experimental dialects 2.2.2, 2.2.4, 3.1.0 on the wire
Stefan Metzmacher [Wed, 11 Nov 2020 14:14:12 +0000 (15:14 +0100)]
smb2_negprot: no longer use experimental dialects 2.2.2, 2.2.4, 3.1.0 on the wire

These were only used in Windows development versions but not in
production.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibcli/smb: no longer use experimental dialects 2.2.2, 2.2.4, 3.1.0 on the wire
Stefan Metzmacher [Wed, 11 Nov 2020 14:14:12 +0000 (15:14 +0100)]
libcli/smb: no longer use experimental dialects 2.2.2, 2.2.4, 3.1.0 on the wire

These were only used in Windows development versions but not in
production.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos4:torture:libsmbclient: make use of PROTOCOL_* enum values instead of of hardcoded...
Stefan Metzmacher [Fri, 9 Jul 2021 12:58:24 +0000 (14:58 +0200)]
s4:torture:libsmbclient: make use of PROTOCOL_* enum values instead of of hardcoded int values

We should also test protocol versions which are not our default.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoselftest: use SAMBA_DEPRECATED_SUPPRESS=1 for all tests
Stefan Metzmacher [Fri, 9 Jul 2021 12:12:39 +0000 (14:12 +0200)]
selftest: use SAMBA_DEPRECATED_SUPPRESS=1 for all tests

The deprecation warnings are filling the logs and make it hard to
find/see real problems.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jul 14 21:57:11 UTC 2021 on sn-devel-184

2 years agos3:tests: use SAMBA_DEPRECATED_SUPPRESS=1 for backbox tests
Stefan Metzmacher [Wed, 14 Jul 2021 04:30:03 +0000 (06:30 +0200)]
s3:tests: use SAMBA_DEPRECATED_SUPPRESS=1 for backbox tests

These tests should not depend on the number of deprecation warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2 years agoldb: version 2.4 will be used for Samba 4.15 ldb-2.4.0
Stefan Metzmacher [Wed, 14 Jul 2021 20:50:19 +0000 (22:50 +0200)]
ldb: version 2.4 will be used for Samba 4.15

- Improve calculate_popt_array_length()
- Use C99 initializers for builtin_popt_options[]
- pyldb: Fix Message.items() for a message containing elements
- pyldb: Add test for Message.items()
- tests: Use ldbsearch '--scope instead of '-s'
- pyldb: fix a typo
- Change page size of guidindexpackv1.ldb
- Use a 1MiB lmdb so the test also passes on aarch64 CentOS stream
- attrib_handler casefold: simplify space dropping
- fix ldb_comparison_fold off-by-one overrun
- CVE-2020-27840: pytests: move Dn.validate test to ldb
- CVE-2020-27840 ldb_dn: avoid head corruption in ldb_dn_explode
- CVE-2021-20277 ldb/attrib_handlers casefold: stay in bounds
- CVE-2021-20277 ldb tests: ldb_match tests with extra spaces
- improve comments for ldb_module_connect_backend()
- test/ldb_tdb: correct introductory comments
- ldb.h: remove undefined async_ctx function signatures
- correct comments in attrib_handers val_to_int64
- dn tests use cmocka print functions
- ldb_match: remove redundant check
- add tests for ldb_wildcard_compare
- ldb_match: trailing chunk must match end of string
- pyldb: catch potential overflow error in py_timestring
- ldb: remove some 'if PY3's in tests
- Add missing break in switch statement

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2 years agotdb: version 1.4.4 tdb-1.4.4
Stefan Metzmacher [Wed, 14 Jul 2021 20:30:19 +0000 (22:30 +0200)]
tdb: version 1.4.4

- Fix a memory leak on error
- python: remove all 'from __future__ import print_function'
- Fix CID 1471761 String not null terminated
- Use hex_byte() in parse_hex()
- Use hex_byte() in read_data()
- fix studio compiler build
- Fix some signed/unsigned comparisons
- also use __has_attribute macro to check for attribute support
- Fix clang 9 missing-field-initializer warnings
- pytdb tests: add test for storev()
- pytdb: add python binding for storev()
- tdbtorture: Use ARRAY_DEL_ELEMENT()
- py3: Remove #define PyInt_FromLong PyLong_FromLong
- py3: Remove #define PyInt_AsLong PyLong_AsLong
- py3: Remove #define PyInt_Check PyLong_Check
- tdb: Align integer types

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2 years agotalloc: version 2.3.3 talloc-2.3.3
Stefan Metzmacher [Wed, 14 Jul 2021 20:28:19 +0000 (22:28 +0200)]
talloc: version 2.3.3

- python: Ensure reference counts are properly incremented
- Bug 9931: change pytalloc source to LGPL

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2 years agos3:winbind: Get rid of the winbind dc-connect child
Isaac Boukris [Thu, 17 Sep 2020 09:12:53 +0000 (11:12 +0200)]
s3:winbind: Get rid of the winbind dc-connect child

The new code uses PING_DC to tell the child to try to go online.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Isaac Boukris <iboukris@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2 years agos3:winbind: Remove trailing whitespaces in winbindd_dual.c
Andreas Schneider [Tue, 13 Jul 2021 12:39:38 +0000 (14:39 +0200)]
s3:winbind: Remove trailing whitespaces in winbindd_dual.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agos3:winbind: Remove trailing whitespaces in winbindd_cm.c
Andreas Schneider [Tue, 13 Jul 2021 12:37:17 +0000 (14:37 +0200)]
s3:winbind: Remove trailing whitespaces in winbindd_cm.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agos3:winbind: Remove trailing whitespaces in winbindd.c
Andreas Schneider [Tue, 13 Jul 2021 12:38:56 +0000 (14:38 +0200)]
s3:winbind: Remove trailing whitespaces in winbindd.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agos4-selftest: add net offlinejoin tests
Günther Deschner [Fri, 4 Jun 2021 22:32:17 +0000 (00:32 +0200)]
s4-selftest: add net offlinejoin tests

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Jul 14 17:38:21 UTC 2021 on sn-devel-184

2 years agodocs: document "net offlinejoin" set of commands
Günther Deschner [Tue, 13 Apr 2021 16:45:56 +0000 (18:45 +0200)]
docs: document "net offlinejoin" set of commands

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-net: add "net offlinejoin" command
Günther Deschner [Tue, 9 Mar 2021 12:52:51 +0000 (13:52 +0100)]
s3-net: add "net offlinejoin" command

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add djoin tool
Günther Deschner [Tue, 9 Feb 2021 16:16:04 +0000 (17:16 +0100)]
s3-libnetapi: add djoin tool

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: implement NetRequestOfflineDomainJoin_l
Günther Deschner [Tue, 9 Feb 2021 16:15:20 +0000 (17:15 +0100)]
s3-libnetapi: implement NetRequestOfflineDomainJoin_l

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add NetRequestOfflineDomainJoin example code
Günther Deschner [Mon, 8 Feb 2021 14:35:31 +0000 (15:35 +0100)]
s3-libnetapi: add NetRequestOfflineDomainJoin example code

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add NetRequestOfflineDomainJoin to api
Günther Deschner [Mon, 8 Feb 2021 14:50:21 +0000 (15:50 +0100)]
s3-libnetapi: add NetRequestOfflineDomainJoin to api

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add NetRequestOfflineDomainJoin() boilerplate.
Günther Deschner [Mon, 8 Feb 2021 12:59:40 +0000 (13:59 +0100)]
s3-libnetapi: add NetRequestOfflineDomainJoin() boilerplate.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add NetRequestOfflineDomainJoin to IDL
Günther Deschner [Mon, 8 Feb 2021 12:44:54 +0000 (13:44 +0100)]
s3-libnetapi: add NetRequestOfflineDomainJoin to IDL

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: implement NetProvisionComputerAccount_l
Günther Deschner [Fri, 5 Feb 2021 12:05:45 +0000 (13:05 +0100)]
s3-libnetapi: implement NetProvisionComputerAccount_l

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add NetProvisionComputerAccount example code
Günther Deschner [Thu, 4 Feb 2021 21:03:54 +0000 (22:03 +0100)]
s3-libnetapi: add NetProvisionComputerAccount example code

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add NetProvisionComputerAccount to api.
Günther Deschner [Thu, 4 Feb 2021 21:02:54 +0000 (22:02 +0100)]
s3-libnetapi: add NetProvisionComputerAccount to api.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add NetProvisionComputerAccount() boilerplate
Günther Deschner [Thu, 4 Feb 2021 20:41:27 +0000 (21:41 +0100)]
s3-libnetapi: add NetProvisionComputerAccount() boilerplate

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add NetProvisionComputerAccount() to IDL
Günther Deschner [Wed, 3 Feb 2021 14:28:13 +0000 (15:28 +0100)]
s3-libnetapi: add NetProvisionComputerAccount() to IDL

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add netapi_save_file_ucs2() to example code
Günther Deschner [Thu, 18 Feb 2021 15:10:01 +0000 (16:10 +0100)]
s3-libnetapi: add netapi_save_file_ucs2() to example code

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add netapi_read_file helper
Günther Deschner [Wed, 10 Feb 2021 11:21:31 +0000 (12:21 +0100)]
s3-libnetapi: add netapi_read_file helper

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add offline domain join related error codes (not WERRORs)
Günther Deschner [Mon, 8 Feb 2021 13:01:42 +0000 (14:01 +0100)]
s3-libnetapi: add offline domain join related error codes (not WERRORs)

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add missing NetJoinFlags for netapi
Günther Deschner [Wed, 3 Feb 2021 14:08:03 +0000 (15:08 +0100)]
s3-libnetapi: add missing NetJoinFlags for netapi

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add libnetapi_set_logfile()
Günther Deschner [Mon, 15 Feb 2021 16:33:46 +0000 (17:33 +0100)]
s3-libnetapi: add libnetapi_set_logfile()

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnetapi: add libnetapi_get_use_kerberos()
Günther Deschner [Thu, 8 Apr 2021 20:14:41 +0000 (22:14 +0200)]
s3-libnetapi: add libnetapi_get_use_kerberos()

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agore-run make libnetapi ....
Günther Deschner [Mon, 8 Feb 2021 14:59:32 +0000 (15:59 +0100)]
re-run make libnetapi ....

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: always check config correctness while joining offline
Günther Deschner [Fri, 19 Feb 2021 14:00:24 +0000 (15:00 +0100)]
s3-libnet_join: always check config correctness while joining offline

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: check for netbios name correctness as well
Günther Deschner [Fri, 19 Feb 2021 13:49:50 +0000 (14:49 +0100)]
s3-libnet_join: check for netbios name correctness as well

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: set netbios name as well when modification is requested
Günther Deschner [Thu, 18 Feb 2021 15:58:42 +0000 (16:58 +0100)]
s3-libnet_join: set netbios name as well when modification is requested

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: use dsgetonedcname to validate given DC
Günther Deschner [Tue, 16 Feb 2021 15:13:37 +0000 (16:13 +0100)]
s3-libnet_join: use dsgetonedcname to validate given DC

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-dsgetdcname: add dsgetonedcname()
Günther Deschner [Tue, 16 Feb 2021 15:11:14 +0000 (16:11 +0100)]
s3-dsgetdcname: add dsgetonedcname()

The idea is to run the same DC validation steps as for dsgetdcname()
just omit the query list of DCs via DNS/netbios step but instead
validate a given DC right away.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: use joinprov3 struct in libnet_DomainOfflineJoin()
Günther Deschner [Tue, 11 May 2021 13:22:55 +0000 (15:22 +0200)]
s3-libnet_join: use joinprov3 struct in libnet_DomainOfflineJoin()

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: add support for libnet_DomainOfflineJoin
Günther Deschner [Mon, 15 Feb 2021 19:57:56 +0000 (20:57 +0100)]
s3-libnet_join: add support for libnet_DomainOfflineJoin

libnet_DomainOfflineJoin will consume the provided offline domain join
blob and lay out libnet_Join information to properly store join metadata
in the local database.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-dsgetdcname: return dcinfo also when delivering from the cache.
Günther Deschner [Sat, 13 Feb 2021 21:11:52 +0000 (22:11 +0100)]
s3-dsgetdcname: return dcinfo also when delivering from the cache.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-dsgetdcname: the returned dcinfo unc should always be prefixed
Günther Deschner [Sat, 13 Feb 2021 21:03:06 +0000 (22:03 +0100)]
s3-dsgetdcname: the returned dcinfo unc should always be prefixed

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: add request_offline_join flag
Günther Deschner [Mon, 15 Feb 2021 19:43:37 +0000 (20:43 +0100)]
s3-libnet_join: add request_offline_join flag

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: fully implement libnet_odj_compose_OP_JOINPROV3_PART
Günther Deschner [Sat, 13 Feb 2021 17:21:23 +0000 (18:21 +0100)]
s3-libnet_join: fully implement libnet_odj_compose_OP_JOINPROV3_PART

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-librpc: add ODJ_PROVISION_DATA pointer to libnet_JoinCtx
Günther Deschner [Mon, 15 Feb 2021 16:34:55 +0000 (17:34 +0100)]
s3-librpc: add ODJ_PROVISION_DATA pointer to libnet_JoinCtx

It will be used later to pass in offline domain join structs to serve
request offline domain join requests.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: return account rid in libnet_JoinCtx
Günther Deschner [Sat, 13 Feb 2021 17:20:53 +0000 (18:20 +0100)]
s3-libnet_join: return account rid in libnet_JoinCtx

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: add libnet_odj_find_joinprov3()
Günther Deschner [Tue, 11 May 2021 13:22:12 +0000 (15:22 +0200)]
s3-libnet_join: add libnet_odj_find_joinprov3()

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: add libnet_odj_find_win7blob to libnet_offline_join
Günther Deschner [Mon, 15 Feb 2021 19:57:04 +0000 (20:57 +0100)]
s3-libnet_join: add libnet_odj_find_win7blob to libnet_offline_join

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: add some libnet_JoinCtx-to-ODJ helpers
Günther Deschner [Wed, 10 Feb 2021 14:56:43 +0000 (15:56 +0100)]
s3-libnet_join: add some libnet_JoinCtx-to-ODJ helpers

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: return the allocated netr_DsRGetDCNameInfo struct
Günther Deschner [Tue, 2 Mar 2021 16:45:46 +0000 (17:45 +0100)]
s3-libnet_join: return the allocated netr_DsRGetDCNameInfo struct

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-rpc_client: add copy_netr_DsRGetDCNameInfo() helper
Günther Deschner [Fri, 12 Feb 2021 22:56:10 +0000 (23:56 +0100)]
s3-rpc_client: add copy_netr_DsRGetDCNameInfo() helper

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: let libnetjoin return a netr_DsRGetDCNameInfo
Günther Deschner [Sat, 13 Feb 2021 01:27:03 +0000 (02:27 +0100)]
s3-libnet_join: let libnetjoin return a netr_DsRGetDCNameInfo

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3-libnet_join: add new provision_computer_account_only flag
Günther Deschner [Fri, 5 Feb 2021 12:23:50 +0000 (13:23 +0100)]
s3-libnet_join: add new provision_computer_account_only flag

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos4-torture: add odj ndr testsuite
Günther Deschner [Mon, 8 Feb 2021 15:08:10 +0000 (16:08 +0100)]
s4-torture: add odj ndr testsuite

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agolibrpc: make sure the 4 byte _pad in ODJ_WIN7BLOB is never 0
Günther Deschner [Thu, 25 Feb 2021 22:19:25 +0000 (23:19 +0100)]
librpc: make sure the 4 byte _pad in ODJ_WIN7BLOB is never 0

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agolibrpc: more work on ODJ IDL
Günther Deschner [Mon, 8 Feb 2021 15:08:43 +0000 (16:08 +0100)]
librpc: more work on ODJ IDL

A lot of nested use of serialization stream pointers
([MS-RPCE] 2.2.6 Type Serialization Version 1).

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agolibrpc: add custom odj_switch_level_from_guid()
Günther Deschner [Mon, 8 Feb 2021 22:45:42 +0000 (23:45 +0100)]
librpc: add custom odj_switch_level_from_guid()

This function maintains an arbitrary mapping of GUID strings to
integers. This is required as only integers can be used as
discriminators for autogenerated ODJ unions.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agolibrpc: compile ODJ idl
Günther Deschner [Fri, 5 Feb 2021 18:19:36 +0000 (19:19 +0100)]
librpc: compile ODJ idl

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agolibrpc: add "Offline Domain Join" (ODJ) IDL
Günther Deschner [Fri, 5 Feb 2021 18:19:11 +0000 (19:19 +0100)]
librpc: add "Offline Domain Join" (ODJ) IDL

This IDL is based on

https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/NetMgmt/odj-idl.md

and has been licensed by Microsoft under the terms of the MIT License.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agolibrpc/ndr: do not print strings when NDR_SECRET is used
Günther Deschner [Wed, 10 Feb 2021 10:23:13 +0000 (11:23 +0100)]
librpc/ndr: do not print strings when NDR_SECRET is used

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2 years agos3: VFS: Update status of SMB_VFS_READ_DFS_PATHAT.
Jeremy Allison [Tue, 13 Jul 2021 00:58:29 +0000 (17:58 -0700)]
s3: VFS: Update status of SMB_VFS_READ_DFS_PATHAT.

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): Wed Jul 14 08:58:30 UTC 2021 on sn-devel-184

2 years agos3: smbd: In dfs_path_lookup(), use relative dirfsp, atname lookups in SMB_VFS_READ_D...
Jeremy Allison [Tue, 13 Jul 2021 00:56:13 +0000 (17:56 -0700)]
s3: smbd: In dfs_path_lookup(), use relative dirfsp, atname lookups in SMB_VFS_READ_DFS_PATHAT() for the pathname walk fallback.

Note that parent_pathref() must succeed before we call SMB_VFS_READ_DFS_PATHAT().
If parent_pathref() fails, just step back a component without calling
SMB_VFS_READ_DFS_PATHAT().

There are no longer any non-relative uses of SMB_VFS_READ_DFS_PATHAT().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: In dfs_path_lookup(), use relative dirfsp, atname lookups in SMB_VFS_READ_D...
Jeremy Allison [Tue, 13 Jul 2021 00:53:19 +0000 (17:53 -0700)]
s3: smbd: In dfs_path_lookup(), use relative dirfsp, atname lookups in SMB_VFS_READ_DFS_PATHAT() for the whole path optimization.

Note parent_pathref() must succeed before we can call SMB_VFS_READ_DFS_PATHAT().
Otherwise, just skip the whole path optimization and go onto the path walk code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: In is_msdfs_link(), change to dirfsp, atname parameters.
Jeremy Allison [Tue, 13 Jul 2021 00:44:10 +0000 (17:44 -0700)]
s3: smbd: In is_msdfs_link(), change to dirfsp, atname parameters.

Remember to update the smb_fname->st struct inside check_msdfs_link(),
as we now pass the atname to is_msdfs_link(), not the smb_fname.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Add dirfsp, atname parameters to check_msdfs_link().
Jeremy Allison [Tue, 13 Jul 2021 00:35:26 +0000 (17:35 -0700)]
s3: smbd: Add dirfsp, atname parameters to check_msdfs_link().

Replace the old connection_struct *conn parameter.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: Pass dirfsp, atname down to mode_fn() passed to smbd_dirptr_get_entry().
Jeremy Allison [Mon, 12 Jul 2021 23:40:08 +0000 (16:40 -0700)]
s3: smbd: Pass dirfsp, atname down to mode_fn() passed to smbd_dirptr_get_entry().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: smbd: In smbd_dirptr_get_entry(), postpone TALLOC_FREE(atname) as we're going...
Jeremy Allison [Mon, 12 Jul 2021 23:32:23 +0000 (16:32 -0700)]
s3: smbd: In smbd_dirptr_get_entry(), postpone TALLOC_FREE(atname) as we're going to pass this to mode_fn().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: time_audit. In smb_time_audit_read_dfs_pathat(), cope with relative pathnames.
Jeremy Allison [Tue, 13 Jul 2021 00:16:08 +0000 (17:16 -0700)]
s3: VFS: time_audit. In smb_time_audit_read_dfs_pathat(), cope with relative pathnames.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: shadow_copy2. In shadow_copy2_read_dfs_pathat(), cope with relative pathnames.
Jeremy Allison [Tue, 13 Jul 2021 00:09:51 +0000 (17:09 -0700)]
s3: VFS: shadow_copy2. In shadow_copy2_read_dfs_pathat(), cope with relative pathnames.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: glusterfs. In vfs_gluster_read_dfs_pathat(), cope with relative pathnames.
Jeremy Allison [Tue, 13 Jul 2021 00:04:59 +0000 (17:04 -0700)]
s3: VFS: glusterfs. In vfs_gluster_read_dfs_pathat(), cope with relative pathnames.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: full_audit. In smb_full_audit_read_dfs_pathat(), cope with relative pathnames.
Jeremy Allison [Tue, 13 Jul 2021 00:01:34 +0000 (17:01 -0700)]
s3: VFS: full_audit. In smb_full_audit_read_dfs_pathat(), cope with relative pathnames.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: ceph: In cephwrap_read_dfs_pathat(), cope with relative pathnames.
Jeremy Allison [Mon, 12 Jul 2021 23:58:05 +0000 (16:58 -0700)]
s3: VFS: ceph: In cephwrap_read_dfs_pathat(), cope with relative pathnames.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: cap: Fix cap_read_dfs_pathat() to cope with relative paths.
Jeremy Allison [Mon, 12 Jul 2021 23:45:13 +0000 (16:45 -0700)]
s3: VFS: cap: Fix cap_read_dfs_pathat() to cope with relative paths.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: default. In vfswrap_read_dfs_pathat(), cope with relative pathnames.
Jeremy Allison [Tue, 13 Jul 2021 00:21:03 +0000 (17:21 -0700)]
s3: VFS: default. In vfswrap_read_dfs_pathat(), cope with relative pathnames.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: default. In vfswrap_read_dfs_pathat() use sys_fstatat().
Jeremy Allison [Tue, 13 Jul 2021 16:15:18 +0000 (09:15 -0700)]
s3: VFS: default. In vfswrap_read_dfs_pathat() use sys_fstatat().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos2: VFS: default. Fix vfswrap_read_dfs_pathat() to use fsp_get_pathref_fd() not fsp_g...
Jeremy Allison [Mon, 12 Jul 2021 22:24:30 +0000 (15:24 -0700)]
s2: VFS: default. Fix vfswrap_read_dfs_pathat() to use fsp_get_pathref_fd() not fsp_get_io_fd().

We don't need an io fd here, and we only get away
with it as we have the assert above:

SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);

This will be removed next.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: VFS: default. Fix vfswrap_readdir() to use sys_fstatat().
Jeremy Allison [Tue, 13 Jul 2021 16:10:50 +0000 (09:10 -0700)]
s3: VFS: default. Fix vfswrap_readdir() to use sys_fstatat().

Change struct stat st -> SMB_STRUCT_STAT st
and just copy the struct on success, as sys_fstatat()
already does the init_stat_ex_from_stat() for us.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: lib: Add sys_fstatat() wrapper.
Jeremy Allison [Mon, 12 Jul 2021 22:37:20 +0000 (15:37 -0700)]
s3: lib: Add sys_fstatat() wrapper.

Does the usual things we need with fake_dir_create_times.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3: expect fstatat() and dirfd()
Ralph Boehme [Tue, 13 Jul 2021 16:03:31 +0000 (09:03 -0700)]
s3: expect fstatat() and dirfd()

FreeBSD, AIX and Solaris all have this.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_shadow_copy2: ensure we call convert_sbuf() in shadow_copy2_*stat() on already...
Ralph Boehme [Sat, 3 Jul 2021 13:46:11 +0000 (15:46 +0200)]
vfs_shadow_copy2: ensure we call convert_sbuf() in shadow_copy2_*stat() on already converted paths with absolute path

shadow_copy2_strip_snapshot() will happily return without modifying the passed
timestamp=0 if the path is already converted and refers to an object in a
snapshot, eg (first debug line from extra debugging patch [1]):

[10 2021/07/02 08:19:28.811424 pid=738290 ../../source3/modules/vfs_shadow_copy2.c:1303 shadow_copy2_fstat]
  shadow_copy2_fstat: fsp [test.txt {@GMT-2000.01.02-03.04.05}]
[10 2021/07/02 08:19:28.811449 pid=738290 ../../source3/modules/vfs_shadow_copy2.c:607 _shadow_copy2_strip_snapshot_internal]
  _shadow_copy2_strip_snapshot_internal: [from shadow_copy2_fstat()] Path 'test.txt {@GMT-2000.01.02-03.04.05}'
[10 2021/07/02 08:19:28.811474 pid=738290 ../../source3/modules/vfs_shadow_copy2.c:619 _shadow_copy2_strip_snapshot_internal]
  _shadow_copy2_strip_snapshot_internal: abs path '/gpfs0/smb_snapshots2/filesetone/.snapshots/@GMT-2000.01.02-03.04.05/test.txt'
[10 2021/07/02 08:19:28.811496 pid=738290 ../../source3/modules/vfs_shadow_copy2.c:1924 shadow_copy2_snapshot_to_gmt]
  shadow_copy2_snapshot_to_gmt: match @GMT-%Y.%m.%d-%H.%M.%S: @GMT-2000.01.02-03.04.05
[10 2021/07/02 08:19:28.811536 pid=738290 ../../source3/modules/vfs_shadow_copy2.c:566 check_for_converted_path]
  check_for_converted_path: path |/gpfs0/smb_snapshots2/filesetone/.snapshots/@GMT-2000.01.02-03.04.05/test.txt| is already converted. connect path = |/gpfs0/smb_snapshots2/filesetone/.snapshots/@GMT-2000.01.02-03.04.05|

As check_for_converted_path() detects an "already converted path",
_shadow_copy2_strip_snapshot_internal() just returns without modifying the value
of the timestamp.

By using shadow_copy2_strip_snapshot_converted() instead of
shadow_copy2_strip_snapshot() we can check if the path is in fact referring to a
VSS object by checking the "converted" bool.

An alternative way would have been directly checking fsp->fsp_name->twrp != 0,
but that would be a new semantic in the module, I'll leave this excersize for
the future when we clean up the usage of shadow_copy2_strip_snapshot() in the
whole module.

This change also switches to using the absolute paths in both place where
convert_sbuf() is called.

[1]
@@ -1309,8 +1348,16 @@ static int shadow_copy2_fstat(vfs_handle_struct *handle, files_struct *fsp,
                saved_errno = errno;
        }

+       DBG_DEBUG("fsp [%s]\n", fsp_str_dbg(fsp));

RN: vfs_shadow_copy2 fixinodes not correctly updating inode numbers
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14756

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoselftest: add a test for shadow:fixinodes
Ralph Boehme [Tue, 6 Jul 2021 05:24:00 +0000 (07:24 +0200)]
selftest: add a test for shadow:fixinodes

This will fail with

  Failed to open file \@GMT-2015.10.31-19.40.30\subdir\hardlink. NT_STATUS_ACCESS_DENIED

The open is failing in openat_pathref_fsp():

  [2021/07/06 04:58:17.677104, 10, pid=95070, effective(1000, 1000), real(1000, 0)] ../../source3/smbd/files.c:541(openat_pathref_fsp)
    openat_pathref_fsp: file [subdir/hardlink {@GMT-2015.10.31-19.40.30}] - dev/ino mismatch. Old (dev=64770, ino=3826943444). New (dev=64770, ino=1746568660).
  [2021/07/06 04:58:17.677114, 10, pid=95070, effective(1000, 1000), real(1000, 0)] ../../source3/smbd/files.c:568(openat_pathref_fsp)
    openat_pathref_fsp: Opening pathref for [subdir/hardlink {@GMT-2015.10.31-19.40.30}] failed: NT_STATUS_ACCESS_DENIED

The reason is subtle:

shadow_copy2 calculates inode numbers of snapshot files based on the path of the
file. The result of that when doing a path based stat() from filename_convert()
was

  [2021/07/06 04:58:17.676159, 10, pid=95070, effective(1000, 1000), real(1000, 0)] ../../source3/smbd/filename.c:1945(filename_convert_internal)
    filename_convert_internal: XXX smb_fname [subdir/hardlink {@GMT-2015.10.31-19.40.30}] (dev=64770, ino=3826943444).

which is the "Old" inode shown above.

Later in the open code called from openat_pathref_fsp() -> fd_openat() ->
non_widelink_open() since 4.14 we call SMB_VFS_FSTAT() where fsp->fsp_name will
be set to the new relative *basename* of the file:

  [2021/07/06 04:58:17.676917, 10, pid=95070, effective(1000, 1000), real(1000, 0), class=vfs] ../../source3/modules/vfs_default.c:1302(vfswrap_fstat)
    vfswrap_fstat: XXX fsp [hardlink {@GMT-2015.10.31-19.40.30}] (dev=64770, ino=3826943444)

So for stat() the hash function in called with the full path relative to the share
root:

  subdir/hardlink

while for fstat() the hash function will used

  hardlink

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoselftest: simplify snapshot directory creation in test_shadow_copy_torture.sh
Ralph Boehme [Tue, 6 Jul 2021 05:22:40 +0000 (07:22 +0200)]
selftest: simplify snapshot directory creation in test_shadow_copy_torture.sh

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoselftest: enable "shadow:fixinodes" in "shadow_write" share
Ralph Boehme [Tue, 6 Jul 2021 05:20:15 +0000 (07:20 +0200)]
selftest: enable "shadow:fixinodes" in "shadow_write" share

The existing tests don't care and this will be used in a subsequent commit to
demonstrate that this option is currently broken.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoselftest: pass smbclient arg to samba3.blackbox.shadow_copy_torture test
Ralph Boehme [Tue, 6 Jul 2021 05:19:36 +0000 (07:19 +0200)]
selftest: pass smbclient arg to samba3.blackbox.shadow_copy_torture test

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: update smb_fname statinfo from fsp
Ralph Boehme [Wed, 7 Jul 2021 10:40:05 +0000 (12:40 +0200)]
smbd: update smb_fname statinfo from fsp

fd_openat() has done an FSTAT on the handle so update the smb_fname stat info
with "truth".  from the handle.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: put back dev/ino stat/fstat check in openat_pathref_fsp()
Ralph Boehme [Wed, 7 Jul 2021 09:48:34 +0000 (11:48 +0200)]
smbd: put back dev/ino stat/fstat check in openat_pathref_fsp()

This reverts commit a6df051dd5e8c63f2fdfdb20ee01169d2bdb97dd:

  "s3: smbd: In openat_pathref_fsp(), just check we're opening the same file type, not dev and inode."

The prior changes mean we can go back to checking dev/ino
matches.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: canonicalize SMB_VFS_FSTAT() stat buffer
Ralph Boehme [Tue, 6 Jul 2021 07:04:26 +0000 (09:04 +0200)]
smbd: canonicalize SMB_VFS_FSTAT() stat buffer

This helps code inside any module implementing fstat() looking at
fsp->fsp_name->st instead of the passed in stat buf.

I only ran afoul of this in a DEBUG message I added while debugging some inode
related problem.

No change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>