[PATCH] smbd: Fix snapshot query on shares with DFS enabled

Uri Simchoni uri at samba.org
Fri Aug 19 08:22:54 UTC 2016


On 08/19/2016 12:51 AM, Jeremy Allison wrote:
> On Thu, Aug 18, 2016 at 11:32:35AM -0700, Jeremy Allison wrote:
>>
>> We still have the problem that when we create the paths previous
>> versions path to query the SMB1 server returns NT_STATUS_OBJECT_PATH_NOT_FOUND,
>> due to the fact we're not setting the flags2 FLAGS2_REPARSE_PATH
>> bit in the request when we're doing the path query. We don't
>> currently have capabilities to do that, so I'm going to create
>> another bug and add create fixes for all these things.
> 
> OK, here is a patchset that fixes enumerating and accessing
> shadow copy paths from smbclient and libsmbclient.
> 
> It looks a bigger patchset than it is :-).
> 
> Overview:
> 
> 01	- Add missing FLAGS2_REPARSE_PATH flag definitions.
> 02 - 04 - Add additional_flags2 arg to internal cli_XXX() functions
> 	  that need to pass paths that might contain @GMT- tokens.
> 05	- Add clistr_is_previous_version_path() function that checks
> 	  for a valid @GMT- path.
> 06 - 21 - For all cli_XX() functions that take a pathname, call
> 	  clistr_is_previous_version_path() and add in the
> 	  FLAGS2_REPARSE_PATH to the additional_flags2 parameter
> 	  if it maches.
> 
> 	  Only function not fixed is cli_set_ea_path(), which
> 	  uses the sync versions of cli_trans() which I didn't
> 	  change to add additional_flags2 arg. As this is a 'set'
> 	  function I don't think this works with a @GMT- path.
> 	  Patch 20 is a reminder to change cli_set_ea_path()
> 	  to use the async cli_trans_send()/cli_trans_recv()
> 	  if we ever need to fix this.
> 
> 22	- Fix wrong size in cli_shadow_copy_data_send() params.
> 23	- Harden cli_shadow_copy_data_recv() parsing in case
> 	  of bad server. Only crash bug here, nothing worse.
> 24	- Fix smbclient to use cli_shadow_copy_data() correctly
> 	  over SMB1.
> 
> Using this I can do an 'allinfo' against a Windows server
> with shadow copies, and see them available to smbclient.
> 
> Please review and push if happy ! Passes local samba3.blackbox.shadow_copy2
> tests.
> 
> Once this is in I'll do the same fix for accessing shadow
> copies over SMB2.
> 
> Cheers,
> 
> 	Jeremy.
> 

Pushed with a small space-before-tab correction in "libsmb: Add uint16_t
addtional_flags2 to cli_trans_send()"

Thanks,
Uri.




More information about the samba-technical mailing list