Windows sends GetInfo SMB2_FS_INFO_05 (AKA GET FS INFO) with open files and expects to get ROFS for previous versions

Richard Sharpe realrichardsharpe at gmail.com
Sat Nov 9 12:47:06 MST 2013


Hi folks,

Attached is a small segment of a capture showing that Windows sends
GETINFO GET FS INFO requests for open files and returns ROFS for an
open file that is a previous version.

We simply do not handle that because we return the attributes returned
at connect time.

While we do pass down the file name, this is not much use. This is
what we currently do in master:

                case SMB_FS_ATTRIBUTE_INFORMATION:

                        additional_flags = 0;
#if defined(HAVE_SYS_QUOTAS)
                        additional_flags |= FILE_VOLUME_QUOTAS;
#endif

                        if(lp_nt_acl_support(SNUM(conn))) {
                                additional_flags |= FILE_PERSISTENT_ACLS;
                        }

                        /* Capabilities are filled in at connection
time through STATVFS call */
                        additional_flags |= conn->fs_capabilities;
                        additional_flags |= lp_parm_int(conn->params->service,
                                                        "share", "fake_fscaps",
                                                        0);


SIVAL(pdata,0,FILE_CASE_PRESERVED_NAMES|FILE_CASE_SENSITIVE_SEARCH|
                                FILE_SUPPORTS_OBJECT_IDS|FILE_UNICODE_ON_DISK|
                                additional_flags); /* FS ATTRIBUTES */

                        SIVAL(pdata,4,255); /* Max filename component length */
                        /* NOTE! the fstype must *not* be null
terminated or win98 won't recognise it
                                and will think we can't do long filenames */
                        len = srvstr_push(pdata, flags2, pdata+12, fstype,
                                          PTR_DIFF(end_data, pdata+12),
                                          STR_UNICODE);
                        SIVAL(pdata,8,len);
                        data_len = 12 + len;
                        if (max_data_bytes >= 16 && data_len > max_data_bytes) {
                                /* the client only requested a portion of the
                                   file system name */
                                data_len = max_data_bytes;
                                status = STATUS_BUFFER_OVERFLOW;
                        }
                        *fixed_portion = 16;
                        break;

We would have to either:

1. call SMB_VFS_FS_CAPABILITIES and pass the file name (or the FSP), or

2. Some other function that can indicate that the file is a previous
version and if so, OR in the ROFS bit.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: windows-prev-versions-get-fs-info.pcapng
Type: application/octet-stream
Size: 1936 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131109/cb87c867/attachment.obj>


More information about the samba-technical mailing list