diff options
author | Daniel Pinto <danielpinto52@gmail.com> | 2022-10-10 14:14:31 +0300 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2022-11-12 20:59:42 +0300 |
commit | 1d07a9dfa19914ad27bdb9ec9ac0baa2329b2ae3 (patch) | |
tree | 5b658d1e9a95f5a8da7b79bc895415de1f43fb4c /fs/ntfs3/inode.c | |
parent | 75b5e47201329537c8b88531a59aab2cbcec8d61 (diff) | |
download | linux-1d07a9dfa19914ad27bdb9ec9ac0baa2329b2ae3.tar.xz |
fs/ntfs3: Add windows_names mount option
When enabled, the windows_names mount option prevents the creation
of files or directories with names not allowed by Windows. Use
the same option name as NTFS-3G for compatibility.
Signed-off-by: Daniel Pinto <danielpinto52@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/inode.c')
-rw-r--r-- | fs/ntfs3/inode.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 9c244029be75..a2522fc41240 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -1368,6 +1368,13 @@ struct inode *ntfs_create_inode(struct user_namespace *mnt_userns, mi_get_ref(&ni->mi, &new_de->ref); fname = (struct ATTR_FILE_NAME *)(new_de + 1); + + if (sbi->options->windows_names && + !valid_windows_name(sbi, (struct le_str *)&fname->name_len)) { + err = -EINVAL; + goto out4; + } + mi_get_ref(&dir_ni->mi, &fname->home); fname->dup.cr_time = fname->dup.m_time = fname->dup.c_time = fname->dup.a_time = std5->cr_time; |