<para>0: use the older I/O processing mechanism.</para>
<para>1: use the new Direct I/O processing mechanism.</para>
</section>
+ <section>
+ <title id="Regkey_TransarcAFSDaemon_Parameters_VolumeInfoReadOnlyFlag">Value: VolumeInfoReadOnlyFlag</title>
+ <indexterm significance="normal">
+ <primary>VolumeInfoReadOnlyFlag</primary>
+ </indexterm>
+ <para>Regkey: [HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters]</para>
+ <para>Type: DWORD {0, 1}
+ </para>
+ <para>
+ Default: 1</para>
+ <para>The Win32 GetVolumeInformation and GetVolumeInformationByHandle APIs permit
+ applications to query volume attributes such as Case Preserving, Case Insensitive
+ lookups, support for hard links, support for reparse points, support for Unicode and
+ whether or not the volume is read only. The FILE_READ_ONLY_VOLUME flag when set permits
+ applications such as the Explorer Shell to disable the "Delete" and "Rename" options and
+ prevent copying files into the volume without issuing the request to the file system.
+ Unfortunately, the Windows 7 explorer shell has a bug when a drive letter is mapped to a
+ UNC path. If the mapped path refers to a read only volume, then all volumes accessible
+ via the drive letter are also treated as read only. This bug is fixed in Windows 8 and
+ Server 2012. To improve application compatibility the setting of the
+ FILE_READ_ONLY_VOLUME flag is disabled by default on Windows 7 and below and enabled on
+ Windows 8 and above.</para>
+ <para>0: prevent setting the FILE_READ_ONLY_VOLUME flag. (default on Win7 and below).</para>
+ <para>1: permit setting the FILE_READ_ONLY_VOLUME flag. (default on Win8 and above)</para>
+ </section>
</section>
<section>
<title id="Regkey_TransarcAFSDaemon_Parameters_GlobalAutoMapper">Regkey:
extern int cm_readonlyVolumeVersioning;
extern int cm_shortNames;
extern int cm_directIO;
+extern int cm_volumeInfoReadOnlyFlag;
extern long rx_mtu;
afs_int32 cm_verifyData = 0;
int cm_shortNames = 1;
int cm_directIO = 1;
+int cm_volumeInfoReadOnlyFlag = 0;
int smb_UseV3 = 1;
afs_uint32 smb_Enabled = 1;
afsi_log("CM ShortNames is %u", cm_shortNames);
dummyLen = sizeof(DWORD);
+ code = RegQueryValueEx(parmKey, "VolumeInfoReadOnlyFlag", NULL, NULL,
+ (BYTE *) &dwValue, &dummyLen);
+ if (code == ERROR_SUCCESS) {
+ cm_volumeInfoReadOnlyFlag = (unsigned short) dwValue;
+ } else {
+ /* enable by default on Win 8 and Server 2012 */
+ if (osVersion.dwMajorVersion > 6 ||
+ osVersion.dwMajorVersion == 6 &&
+ osVersion.dwMinorVersion >= 2)
+ cm_volumeInfoReadOnlyFlag = 1;
+ else
+ cm_volumeInfoReadOnlyFlag = 0;
+ }
+ afsi_log("CM VolumeInfoReadOnlyFlag is %u", cm_volumeInfoReadOnlyFlag);
+
+ dummyLen = sizeof(DWORD);
code = RegQueryValueEx(parmKey, "DirectIO", NULL, NULL,
(BYTE *) &dwValue, &dummyLen);
if (code == ERROR_SUCCESS) {
memcpy(&pResultCB->VolumeCreationTime, &ft, sizeof(ft));
pResultCB->AvailableAllocationUnits.QuadPart = 0;
- pResultCB->FileSystemAttributes |= FILE_READ_ONLY_VOLUME;
+ if (cm_volumeInfoReadOnlyFlag)
+ pResultCB->FileSystemAttributes |= FILE_READ_ONLY_VOLUME;
pResultCB->VolumeLabelLength = cm_Utf8ToUtf16( "Freelance.Local.Root", -1, pResultCB->VolumeLabel,
(sizeof(pResultCB->VolumeLabel) / sizeof(WCHAR)) + 1);
}
volType = cm_VolumeType(volp, scp->fid.volume);
- if (volType == ROVOL || volType == BACKVOL)
+ if (cm_volumeInfoReadOnlyFlag && (volType == ROVOL || volType == BACKVOL))
pResultCB->FileSystemAttributes |= FILE_READ_ONLY_VOLUME;
flags = CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS;