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
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;

                        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",

                                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),
                        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;

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.

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: <>

More information about the samba-technical mailing list