summaryrefslogtreecommitdiff
path: root/selftest
Commit message (Collapse)AuthorAgeFilesLines
* dns: prevent self-referencing CNAMEAaron Haslett2018-11-281-0/+1
| | | | | | | | | | | Stops the user from adding a self-referencing CNAME over RPC, which is an easy mistake to make with samba-tool. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13600 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* vfs_shadow_copy2: in fstat also convert fsp->fsp_name and ↵Ralph Boehme2018-11-271-1/+0
| | | | | | | | | | | | fsp->base_fsp->fsp_name Stacked VFS modules might use the file name, not the file handle. Looking at you, vfs_fruit... Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:selftest: add a VSS test reading a streamRalph Boehme2018-11-272-1/+2
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_shadow_copy2: nicely deal with attempts to open previous version for writingRalph Boehme2018-11-271-1/+0
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:script/tests: add a test for VSS write behaviourRalph Boehme2018-11-272-0/+10
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tests: Run backup tests against restoredc (SMBv1 disabled)Tim Beale2018-11-271-0/+12
| | | | | | | | | | | | | | | | | Running the backup tests against the restoredc highlights that the backup online/rename commands don't work if SMBv1 is disabled. Note that the offline commands still work because they don't rely on an SMB connection to the server. (Note that running the backup tests against the restoredc is probably a good idea anyway, to prove that there's no limit to the number of times you can restore a domain from backup, i.e. we support more than just a one-off restore). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Designate one testenv as having SMBv1 disabledTim Beale2018-11-272-6/+15
| | | | | | | | | | | | | | | | | | | We recommend users disable SMBv1 to avoid potential security holes. However, none of the AD DC testenvs have SMBv1 disabled. This patch disables SMBv1 on an arbitrarily-chosen testenv (restoredc). I chose restoredc as we'll want to run the backup tool tests against this target, and it might be useful to check we can backup a DC if it's already been restored once. Note that SMBv2 doesn't support POSIX extensions (only SMBv1 does), which is why we haven't just disabled SMBv1 on *all* testenvs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Make testenv NTVFS usage match --use-ntvfsTim Beale2018-11-271-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | Regardless of whether the testenv uses --use-ntvfs as part of its provision options, the s4 testenvs all default to using the NTVFS file server. It's not particularly obvious that this is happening. The new restore DCS (restoredc, renamedc, labdc) were all using NTVFS unintentionally. The problem is the s4 testenvs default to using services '-s3fs +smb". provision_ad_dc() explicitly overrides this to use s3fs again (technically it ends up with both in its smb.conf and just uses whatever comes last). This patch changes the testenv setup to check for the presence of the '--use-ntvfs' option and to set the 'server services' config option appropriately. This way, the provision command and the smb.conf options should always line up, with respect to NTVFS. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Make chgdcpass's NTVFS usage more obviousTim Beale2018-11-271-1/+1
| | | | | | | | | | | | | | | | | The chgdcpass testenv was not passing --use-ntvfs to the provision command, but it was still actually using NTVFS. The reason is the smb.conf generated by provision_raw_step1() would always try to use the s4/NTVFS file server. Because the smb.conf already existed, this trumped what was passed to the provision command. This patch doesn't change the chgdcpass file server. It just makes it more obvious that chgdcpass is using NTVFS. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Be explicit about which testenvs use ntvfsTim Beale2018-11-271-8/+13
| | | | | | | | | | | | | | | | If a testenv didn't specify any other provision arguments, then it defaulted to using the NTVFS file server. This patch makes it explicit, so we just pass through "--use-ntvfs" as extra provision args in the cases we want. (Whether all these testenvs really need to use NTVFS or not is another question, but at least now it's easy to see which testenvs use it). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* source4 smbd prefork: Cleanup messaging on restartGary Lockyer2018-11-231-8/+0
| | | | | | | Clean up names registered in messaging for a terminated process. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* source4 smbd test: prefork process restartGary Lockyer2018-11-234-0/+55
| | | | | | | | Add tests for the restarting of failed/terminated process, by the pre-fork process model. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* source4 samr: cache samr_EnumDomainUsers resultsGary Lockyer2018-11-201-2/+0
| | | | | | | | | | | Add a cache of GUID's that matched the last samr_EnunDomainUsers made on a domain handle. The cache is cleared if resume_handle is zero, and when the final results are returned to the caller. The existing code repeated the database query for each chunk requested. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests samr: Extra tests for samr_EnumDomainUserssGary Lockyer2018-11-201-0/+2
| | | | | | | | Add extra tests to test the content returned by samr_EnumDomainUsers, and tests for the result caching added in the following commit. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* source4 samr: cache samr_EnumDomainGroups resultsGary Lockyer2018-11-201-2/+0
| | | | | | | | | Add a cache of GUID's that matched the last samr_EnunDomainGroups made on a domain handle. The cache is cleared if resume_handle is zero, and when the final results are returned to the caller. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* test samr: Extra tests for samr_EnumDomainGroupsGary Lockyer2018-11-201-0/+2
| | | | | | | | Add extra tests to test the content returned by samr_EnumDomainGroups, and tests for the result caching added in the following commit. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* source4 samr: cache samr_QueryDisplayInfo resultsGary Lockyer2018-11-201-10/+0
| | | | | | | | | | | | | | Add a cache of GUID's that matched the last samr_QueryDisplayInfo made on a domain handle. The cache is cleared if the requested start index is zero, or if the level does not match that in the cache. The cache is maintained in the guid_caches array of the dcesrv_handle. Note: that currently this cache exists for the lifetime of the RPC handle. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests samr: Extra tests for samr_QueryDisplayInfoGary Lockyer2018-11-201-0/+10
| | | | | | | | | Add extra tests to test the content returned by samr_QueryDisplayInfo, which is not tested for the ADDC. Also adds tests for the result caching added in the following commit. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* netcmd: Flush replUpToDateVector when restoring offline backupTim Beale2018-11-201-3/+0
| | | | | | | | | | | | | | | | | | | | | The replUpToDateVector could be incorrect after an offline backup was restored. This means replication propagation dampening doesn't work properly. In the worst case, a singleton DC would have no replUpToDateVector at all, and so *all* objects created on that DC get replicated every time a new DRS connection is established between 2 DCs. This becomes a real problem if you used that singleton DC to create 100K objects... This patch flushes the replUpToDateVector when an offline backup gets restored. We need to do this before we add in the new DC and remove the old DCs. Note that this is only a problem for offline backups. The online/rename backups are received over DRS, and as part of the replication they receive the latest replUpToDateVector from the DC being backed up. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests: Add assertion that replUpToDateVector is present after backupTim Beale2018-11-201-0/+3
| | | | | | | | | We noticed that offline backups were missing a replUpToDateVector for the original DC, if the backup was taken on a singleton DC. This patch adds an assertion to the existing test-cases to highlight the problem. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/smb: don't overwrite status codeRalph Boehme2018-11-131-2/+0
| | | | | | | | | | | | | | The original commit c5cd22b5bbce724dcd68fe94320382b3f772cabf from bug 9175 never worked, as the preceeding signing check overwrote the status variable. Bug: https://bugzilla.samba.org/show_bug.cgi?id=9175 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Nov 13 17:28:45 CET 2018 on sn-devel-144
* s4:torture/smb2/session: test smbXcli_session_set_disconnect_expired() worksRalph Boehme2018-11-131-0/+2
| | | | | | | | | | | This adds a simple test that verifies that after having set smbXcli_session_set_disconnect_expired() a session gets disconnected when it expires. Bug: https://bugzilla.samba.org/show_bug.cgi?id=9175 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smb2_sesssetup: check session_info security level before it gets ↵Ralph Boehme2018-11-131-1/+0
| | | | | | | | | | | | | | | | | | | talloc_move'd We talloc_move() session_info to session->global->auth_session_info which sets session_info to NULL. This means security_session_user_level(NULL, NULL) will always return SECURITY_ANONYMOUS so we never sign the session setup response. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Nov 13 14:22:46 CET 2018 on sn-devel-144
* s4:torture/smb2/session: session reauth response must be signedRalph Boehme2018-11-131-0/+1
| | | | | | | | | | This test checks that a session setup reauth is signed even when neither client nor server require signing. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* vfs_fruit: validation of writes on AFP_AfpInfo streamRalph Boehme2018-11-091-3/+0
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13677 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture/vfs/fruit: torture writing AFP_AfpInfo streamRalph Boehme2018-11-091-0/+3
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13677 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: Fix backup testenv creation on certain host machinesTim Beale2018-11-091-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we created the backup-file for the restoredc/renamedc/labdc testenvs we weren't explicitly a --configfile on the samba-tool command. This meant the command tried to use the smb.conf form the default install location, i.e. /usr/local/samba/etc/smb.conf. On the gitlab CI runner, there's no samba installed, so it ends up using the default settings, which is fine. However, if the host machine had an invalid smb.conf installed there, creating the testenv would fail with an error like: ERROR(runtime): uncaught exception - Unable to load default file File "bin/python/samba/netcmd/__init__.py", line 184, in _run return self.run(*args, **kwargs) File "bin/python/samba/netcmd/domain_backup.py", line 222, in run lp = sambaopts.get_loadparm() File "bin/python/samba/getopt.py", line 94, in get_loadparm self._lp.load_default() We can avoid this by always explictly specifying the backupfromdc's smb.conf when creating the backup file. Likewise, labdc/customdc also need the config specified when the admin password is reset. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* selftest: Add README note: always use --configfile in testenv creationTim Beale2018-11-093-0/+16
| | | | | | | | | | We always need to specify "env->{CONFIGURATION}" when running a samba-tool command to setup a testenv. Add a note to the README as this wasn't at all clear. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* selftest: Test hide new files timeoutVolker Lendecke2018-11-091-0/+4
| | | | | | | | 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): Fri Nov 9 03:49:55 CET 2018 on sn-devel-144
* autobuild: make ad_dc use prefork process modelGary Lockyer2018-11-071-1/+1
| | | | | | | | Convert the ad_dc environment from single process model to the prefork process model. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Add some more testenv descriptionsTim Beale2018-11-071-0/+25
| | | | | | | | | | | This still doesn't cover all the testenvs comprehensively, but it pretty much exhausts my knowledge of what the various testenvs do. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Wed Nov 7 04:39:05 CET 2018 on sn-devel-144
* selftest: Add README documenting the customdc testenvTim Beale2018-11-071-0/+68
| | | | | | | Also documented the other backup/restore testenvs as well. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* selftest: Add share to test "delete readonly" optionChristof Schmitt2018-11-031-0/+4
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13673 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix DELETE_ON_CLOSE behaviour on files with READ_ONLY attributeChristof Schmitt2018-11-031-2/+0
| | | | | | | | | | | | | | MS-FSA states that a CREATE with FILE_DELETE_ON_CLOSE on an existing file with READ_ONLY attribute has to return STATUS_CANNOT_DELETE. This was missing in smbd as the check used the DOS attributes from the CREATE instead of the DOS attributes on the existing file. We need to handle the new file and existing file cases separately. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13673 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbtorture: Add test for DELETE_ON_CLOSE on files with READ_ONLY attributeChristof Schmitt2018-11-031-0/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13673 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: fix SMB2 aio cancellingRalph Boehme2018-11-021-1/+0
| | | | | | | | | | | | | | | | As we currently don't attempt to cancel the internal aio request, we must ignore the SMB2 cancel request and continue to process the SMB2 request, cf MS-SM2 3.3.5.16: If the target request is not successfully canceled, processing of the target request MUST continue and no response is sent to the cancel request. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13667 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture/smb2/read: add test for cancelling SMB aioRalph Boehme2018-11-022-0/+7
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13667 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftesthelpers: fix py3 tests with extra_pathDouglas Bagnall2018-11-021-6/+9
| | | | | | | | | If a test was supplied with extra_path, a PYTHONPATH= env variable was prepended to the args list, but the py3_compatible clause assumed the first args element was /usr/bin/python. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <noel.power@suse.com>
* selftest: Remove unnecessary code for backup testenvsTim Beale2018-11-011-10/+0
| | | | | | | | | | | | | | | setup_namespaces() already gets done for the backupfromdc's domain, so this step is unnecessary for the restoredc and offlinebackupdc testenvs (which are based off the backupfromdc's database). The setup_namespaces() step is still necessary for the renamedc/labdc, as these don't have the UPN/SPN suffixes for the new realm yet. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Nov 1 13:06:01 CET 2018 on sn-devel-144
* selftest: Add new customdc testenv that can load any backup-fileTim Beale2018-11-012-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | This adds a new testenv that can be used for sandpit/manual testing. This testenv can be based off any backup-file that you like. The main use case is large databases. Populating 1000s of users is time-consuming (it can take hours to create a really large DB). Instead of having to manually add users to the testenv every time you want to try something, this allows you to populate the users just once, take a backup/snapshot of the DB, and then spin up the backup multiple times. In theory this testenv could be useful for other situations too, e.g. dealing with a corrupted database, testing DB migration (e.g. 4.7 --> 4.8), or if (for some reason) you wanted to create a realistic lab-domain within a testenv. To run-up the testenv you need to specify a BACKUP_FILE environment variable (the same way we specify the SELFTEST_TESTENV), e.g. BACKUP_FILE=/files/backup-10k-ad_dc.tar.bz2 \ SELFTEST_TESTENV=customdc make testenv Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest/format_subunit_json: py3 print()Douglas Bagnall2018-11-011-4/+4
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <noel.power@suse.com>
* vfs_fruit: let fruit_open_meta() with O_CREAT return a fake-fdRalph Boehme2018-11-011-3/+0
| | | | | | | | | | | | | | | This is the final step in implementing the needed macOS semantics on the FinderInfo stream: as long as the client hasn't written a non-zero FinderInfo blob to the stream, there mustn't be a visible filesystem entry for other openers. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 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): Thu Nov 1 01:14:23 CET 2018 on sn-devel-144
* s4:torture/vfs/fruit: add test "empty_stream"Ralph Boehme2018-10-311-0/+3
| | | | | | | | | | | | One to rule them all: consistently test critical operations on all streams relevant to macOS clients: the FinderInfo stream, the Resource Fork stream and an arbitrary stream that macOS maps to xattrs when written to on a macOS SMB server. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_fruit: filter empty streamsRalph Boehme2018-10-311-3/+0
| | | | | | | | | | | | | | | | | | | | | | First step in achieving macOS compliant behaviour wrt to empty streams: - hide empty streams in streaminfo - prevent opens of empty streams This means that we may carry 0-byte sized streams in our streams backend, but this shouldn't really hurt. The previous attempt of deleting the streams when an SMB setinfo eof to 0 request came in, turned out be a road into desaster. We could set delete-on-close on the stream, but that means we'd have to check for it for every write on a stream and checking the delete-on-close bits requires fetching the locking.tdb record, so this is expensive and I'd like to avoid that overhead. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture/vfs/fruit: expand test "setinfo eof stream"Ralph Boehme2018-10-311-0/+3
| | | | | | | | | | | | | | o Adds checks verifying that after setting eof to 0 on a stream, a subsequent open gets ENOENT, before and after closing the handle that had been used to set eof to 0. o Verify that a write to a handle succeeds after that handle has been used to set eof to 0 on a stream. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_fruit: update handling of read-only creation of resource forkRalph Boehme2018-10-311-3/+0
| | | | | | | | | | macOS SMB server versions supports this since 10.12, so we adapt our behaviour. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture/vfs/fruit: update test "creating rsrc with read-only access" for ↵Ralph Boehme2018-10-311-0/+3
| | | | | | | | | | | | | newer macOS versions While this operation failed against older macOS versions, it passes against versions 10.12 and newer. Update the test accordingly, a subsequent commit will then update our implementation. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_fruit: optionally delete AppleDouble files without Resourcefork dataRalph Boehme2018-10-311-1/+0
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13642 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_fruit: detect empty resource forks in ad_convert()Ralph Boehme2018-10-311-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason the macOS client often writes AppleDouble files with a non-zero sized resource fork, but the resource fork data is just boilerplate data with the following string close to the start This resource fork intentionally left blank A dump with apple_dump looks like this: Entry ID : 00000002 : Resource Fork Offset : 00000052 : 82 Length : 0000011E : 286 -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) 00000000 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................ 00000010 : 54 68 69 73 20 72 65 73 6F 75 72 63 65 20 66 6F : This resource fo 00000020 : 72 6B 20 69 6E 74 65 6E 74 69 6F 6E 61 6C 6C 79 : rk intentionally 00000030 : 20 6C 65 66 74 20 62 6C 61 6E 6B 20 20 20 00 00 : left blank .. 00000040 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ 00000050 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ 00000060 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ 00000070 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ 00000080 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ 00000090 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ 000000A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ 000000B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ 000000C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ 000000D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ 000000E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ 000000F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ 00000100 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................ 00000110 : 00 00 00 00 00 00 00 00 00 1C 00 1E FF FF : .............. We can safely discard this Resource Fork data. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13642 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture: add test for AppleDouble ResourceFork conversionRalph Boehme2018-10-312-0/+20
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13642 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>