You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it is not enough for Caller to get the file's attributes. For example, a directory's link file is SMB2_TYPE_LINK, and an normal file's link file is also SMB2_TYPE_LINK too! It is hard for Caller to distinguish them. The code now is:
if (fs->basic.file_attributes&SMB2_FILE_ATTRIBUTE_REPARSE_POINT) {
st->smb2_type=SMB2_TYPE_LINK;
}
From code showed, smb2_type is getted from file_attributes, and file_attributes already saved all attributes. For example, it's value is (SMB2_FILE_ATTRIBUTE_REPARSE_POINT|SMB2_FILE_ATTRIBUTE_DIRECTORY)0x410 for a directory's link.
Let 'file_attributes' equal 'smb2_type', can help the Caller to get full information about the file in smb.
The text was updated successfully, but these errors were encountered:
hengwu0
changed the title
Let 'file_attributes' equal 'smb2_type'
Can't distinguish between directory's link and single file's link on smb2
Jun 19, 2021
It is not that easy since windows will often not add the SMB2_FILE_ATTRIBUTE_DIRECTORY flag in the attributes for reparse points that point to a directory.
For example reparse points created with mklink on windows 2016 will not.
So the only reliable way to do this would be to stat() all links and see if they are a directory or not while reading the directory.
The
smb2_type
only have 3 values:it is not enough for Caller to get the file's attributes. For example, a directory's link file is
SMB2_TYPE_LINK
, and an normal file's link file is alsoSMB2_TYPE_LINK
too! It is hard for Caller to distinguish them. The code now is:From code showed,
smb2_type
is getted fromfile_attributes
, andfile_attributes
already saved all attributes. For example, it's value is (SMB2_FILE_ATTRIBUTE_REPARSE_POINT|SMB2_FILE_ATTRIBUTE_DIRECTORY)0x410 for a directory's link.Let 'file_attributes' equal 'smb2_type', can help the Caller to get full information about the file in smb.
The text was updated successfully, but these errors were encountered: