Cygwin: path_conv: rename is_rep_symlink to is_known_reparse_point

...in preparation of reusing this flag for other types of
reparse points, not only symlinks.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2018-03-01 16:41:45 +01:00
parent a27a7752ec
commit 7ae89fe708
5 changed files with 14 additions and 13 deletions

View File

@ -594,9 +594,9 @@ fhandler_base::open (int flags, mode_t mode)
if (get_device () == FH_FS)
{
/* Add the reparse point flag to native symlinks, otherwise we open the
target, not the symlink. This would break lstat. */
if (pc.is_rep_symlink ())
/* Add the reparse point flag to known repares points, otherwise we
open the target, not the reparse point. This would break lstat. */
if (pc.is_known_reparse_point ())
options |= FILE_OPEN_REPARSE_POINT;
/* O_TMPFILE files are created with delete-on-close semantics, as well

View File

@ -1977,7 +1977,7 @@ readdir_get_ino (const char *path, bool dot_dot)
pc.get_object_attr (attr, sec_none_nih),
&io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT
| (pc.is_rep_symlink ()
| (pc.is_known_reparse_point ()
? FILE_OPEN_REPARSE_POINT : 0)))
)
{

View File

@ -1013,7 +1013,7 @@ path_conv::check (const char *src, unsigned opt,
saw_symlinks = 1;
if (component == 0 && !need_directory
&& (!(opt & PC_SYM_FOLLOW)
|| (is_rep_symlink ()
|| (is_known_reparse_point ()
&& (opt & PC_SYM_NOFOLLOW_REP))))
{
/* last component of path is a symlink. */

View File

@ -183,7 +183,7 @@ class path_conv
}
int issymlink () const {return path_flags & PATH_SYMLINK;}
int is_lnk_symlink () const {return path_flags & PATH_LNK;}
int is_rep_symlink () const {return path_flags & PATH_REP;}
int is_known_reparse_point () const {return path_flags & PATH_REP;}
int isdevice () const {return dev.not_device (FH_FS) && dev.not_device (FH_FIFO);}
int isfifo () const {return dev.is_device (FH_FIFO);}
int isspecial () const {return dev.not_device (FH_FS);}

View File

@ -705,9 +705,9 @@ unlink_nt (path_conv &pc)
pc.get_nt_native_path (), pc.isdir ());
ACCESS_MASK access = DELETE;
ULONG flags = FILE_OPEN_FOR_BACKUP_INTENT;
/* Add the reparse point flag to native symlinks, otherwise we remove the
target, not the symlink. */
if (pc.is_rep_symlink ())
/* Add the reparse point flag to known reparse points, otherwise we remove
the target, not the reparse point. */
if (pc.is_known_reparse_point ())
flags |= FILE_OPEN_REPARSE_POINT;
pc.get_object_attr (attr, sec_none_nih);
@ -2477,7 +2477,8 @@ rename2 (const char *oldpath, const char *newpath, unsigned int flags)
ULONG sharing = FILE_SHARE_READ | FILE_SHARE_WRITE
| (oldpc.fs_is_samba () ? 0 : FILE_SHARE_DELETE);
ULONG flags = FILE_OPEN_FOR_BACKUP_INTENT
| (oldpc.is_rep_symlink () ? FILE_OPEN_REPARSE_POINT : 0);
| (oldpc.is_known_reparse_point ()
? FILE_OPEN_REPARSE_POINT : 0);
status = NtOpenFile (&fh, access,
oldpc.get_object_attr (attr, sec_none_nih),
&io, sharing, flags);
@ -2541,7 +2542,7 @@ rename2 (const char *oldpath, const char *newpath, unsigned int flags)
dstpc->get_object_attr (attr, sec_none_nih),
&io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT
| (dstpc->is_rep_symlink ()
| (dstpc->is_known_reparse_point ()
? FILE_OPEN_REPARSE_POINT : 0));
if (!NT_SUCCESS (status))
{
@ -2575,7 +2576,7 @@ rename2 (const char *oldpath, const char *newpath, unsigned int flags)
(removepc ?: dstpc)->get_object_attr (attr, sec_none_nih),
&io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT
| ((removepc ?: dstpc)->is_rep_symlink ()
| ((removepc ?: dstpc)->is_known_reparse_point ()
? FILE_OPEN_REPARSE_POINT : 0))))
{
FILE_INTERNAL_INFORMATION ofii, nfii;
@ -2651,7 +2652,7 @@ rename2 (const char *oldpath, const char *newpath, unsigned int flags)
oldpc.get_object_attr (attr, sec_none_nih),
&io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT
| (oldpc.is_rep_symlink ()
| (oldpc.is_known_reparse_point ()
? FILE_OPEN_REPARSE_POINT : 0));
if (NT_SUCCESS (status))
{