mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-12-04 15:34:28 +08:00
fix: catch and deny all junction/reparse point write operations
This commit is contained in:
parent
7c23599df4
commit
a69de4e713
@ -1045,6 +1045,12 @@ static ntfs_inode *__ntfs_create(ntfs_inode *dir_ni,
|
|||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dir_ni->flags & FILE_ATTR_REPARSE_POINT) {
|
||||||
|
errno = EOPNOTSUPP;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Allocate MFT record for new file. */
|
/* Allocate MFT record for new file. */
|
||||||
ni = ntfs_mft_record_alloc(dir_ni->vol, NULL);
|
ni = ntfs_mft_record_alloc(dir_ni->vol, NULL);
|
||||||
if (!ni) {
|
if (!ni) {
|
||||||
@ -1567,6 +1573,12 @@ int ntfs_link(ntfs_inode *ni, ntfs_inode *dir_ni, ntfschar *name, u8 name_len)
|
|||||||
ntfs_log_perror("ntfs_link wrong arguments");
|
ntfs_log_perror("ntfs_link wrong arguments");
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ni->flags & FILE_ATTR_REPARSE_POINT) {
|
||||||
|
err = EOPNOTSUPP;
|
||||||
|
goto err_out;
|
||||||
|
}
|
||||||
|
|
||||||
/* Create FILE_NAME attribute. */
|
/* Create FILE_NAME attribute. */
|
||||||
fn_len = sizeof(FILE_NAME_ATTR) + name_len * sizeof(ntfschar);
|
fn_len = sizeof(FILE_NAME_ATTR) + name_len * sizeof(ntfschar);
|
||||||
fn = ntfs_calloc(fn_len);
|
fn = ntfs_calloc(fn_len);
|
||||||
|
Loading…
Reference in New Issue
Block a user