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.

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:

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

Reply via email to