Hi again,

Eric Biggers wrote:
> Hi,
>
> I also noticed that libntfs-3g does not permit certain operations on a reparse
> point file that is not a symlink or junction:
>
>       - delete the file
>       - create a hard link to the file
>       - set the short (DOS) name of the file
>
> Is there any particular reason for these restrictions?  Granted, libntfs-3g 
> does
> not know how to interpret the reparse point so it cannot be "dereferenced", 
> but
> it seems it should still be valid to operate on the reparse point file itself.

This is simply because it is felt dangerous to
meddle with objets whose purpose and structure
are not known.

Actually I have had reports about problems with
new compressed files. Better prevent users making
bad decisions about them. Currently, if such a
file is deleted, there is no way to recreate it.

>
> wimlib happens to run into this problem in an obscure case (I've been doing 
> some
> randomized tests which have been digging up all sorts of strange cases...).  
> The
> workaround is to wait to set the reparse point attribute until the file has
> already been assigned all its names.  However, I believe that the following
> checks may be candidates for removal in a future version of libntfs-3g:

The usage of reparse points for compressed files was
not anticipated, and adjustments have to be made.
I have already pointed out these files can have both
EA and REPARSE_DATA, which Microsoft still advertise
as forbidden.

I have also discovered that the presence of reparse
tag in the name attribute is only done by windows
for names created after the reparse tag is set
(currently ntfs-3g never inserts the reparse tag
in the name attribute). So you should not delay
inserting the reparse point after all the names
(again : no effect by ntfs-3g currently).

I agree that these files can have hard link and
DOS names. I feel deleting the last name as unsafe.

I am putting this on hold until you have a more clear
view on your use case, and how to fix it.

Also I am wondering whether some generic feature
could be added to ntfs-3g to delegate the processing
of reparse points to an external library.

Regards

Jean-Pierre

>
> diff --git a/libntfs-3g/dir.c b/libntfs-3g/dir.c
> index 8633c7d..e95eff5 100644
> --- a/libntfs-3g/dir.c
> +++ b/libntfs-3g/dir.c
> @@ -2157,11 +2157,6 @@ static int ntfs_link_i(ntfs_inode *ni, ntfs_inode 
> *dir_ni, const ntfschar *name,
>               goto err_out;
>       }
>       
> -     if ((ni->flags & FILE_ATTR_REPARSE_POINT)
> -        && !ntfs_possible_symlink(ni)) {
> -             err = EOPNOTSUPP;
> -             goto err_out;
> -     }
>       if (NVolHideDotFiles(dir_ni->vol)) {
>               /* Set hidden flag according to the latest name */
>               if ((name_len > 1)
> diff --git a/libntfs-3g/index.c b/libntfs-3g/index.c
> index d498dde..af5d912 100644
> --- a/libntfs-3g/index.c
> +++ b/libntfs-3g/index.c
> @@ -1857,13 +1857,6 @@ int ntfs_index_remove(ntfs_inode *dir_ni, ntfs_inode 
> *ni,
>               if (ntfs_index_lookup(key, keylen, icx))
>                       goto err_out;
>
> -             if ((((FILE_NAME_ATTR *)icx->data)->file_attributes &
> -                             FILE_ATTR_REPARSE_POINT)
> -                && !ntfs_possible_symlink(ni)) {
> -                     errno = EOPNOTSUPP;
> -                     goto err_out;
> -             }
> -
>               ret = ntfs_index_rm(icx);
>               if (ret == STATUS_ERROR)
>                       goto err_out;
>
> ------------------------------------------------------------------------------
> _______________________________________________
> ntfs-3g-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel
>


------------------------------------------------------------------------------
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to