mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 10:04:00 +08:00
Supported reparse tags for OneDrive cloud storage
Newer versions of Windows 10 use several reparse tags for files which are synchronized to OneDrive cloud storage (0x9000301a, 0x9000601a, 0x9000701a, ...). identify them as IO_REPARSE_TAG_CLOUD and use a single plugin to process them.
This commit is contained in:
parent
5239986093
commit
3243e62396
@ -2412,8 +2412,13 @@ typedef struct {
|
||||
* be slow. (E.g. the data is stored on a tape drive.)
|
||||
* bit 31: Microsoft bit. If set, the tag is owned by Microsoft. User
|
||||
* defined tags have to use zero here.
|
||||
* 4. However, on Windows 10 :
|
||||
* Some flags may be used in bits 12 to 15 to further describe the
|
||||
* reparse point, and bit 28 may be set, probably to signal the
|
||||
* presence of these flags.
|
||||
*/
|
||||
typedef enum {
|
||||
IO_REPARSE_TAG_WITH_FLAGS = const_cpu_to_le32(0x10000000),
|
||||
IO_REPARSE_TAG_IS_ALIAS = const_cpu_to_le32(0x20000000),
|
||||
IO_REPARSE_TAG_IS_HIGH_LATENCY = const_cpu_to_le32(0x40000000),
|
||||
IO_REPARSE_TAG_IS_MICROSOFT = const_cpu_to_le32(0x80000000),
|
||||
@ -2436,10 +2441,12 @@ typedef enum {
|
||||
IO_REPARSE_TAG_DFM = const_cpu_to_le32(0x80000016),
|
||||
IO_REPARSE_TAG_WOF = const_cpu_to_le32(0x80000017),
|
||||
IO_REPARSE_TAG_WCI = const_cpu_to_le32(0x80000018),
|
||||
IO_REPARSE_TAG_CLOUD = const_cpu_to_le32(0x9000001A),
|
||||
IO_REPARSE_TAG_GVFS = const_cpu_to_le32(0x9000001C),
|
||||
IO_REPARSE_TAG_LX_SYMLINK = const_cpu_to_le32(0xA000001D),
|
||||
|
||||
IO_REPARSE_TAG_VALID_VALUES = const_cpu_to_le32(0xf000ffff),
|
||||
IO_REPARSE_PLUGIN_SELECT = const_cpu_to_le32(0xffff0fff),
|
||||
} PREDEFINED_REPARSE_TAGS;
|
||||
|
||||
/**
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Copyright (c) 2004-2005 Yuval Fledel
|
||||
* Copyright (c) 2004-2007 Yura Pakhuchiy
|
||||
* Copyright (c) 2005 Cristian Klein
|
||||
* Copyright (c) 2011-2017 Jean-Pierre Andre
|
||||
* Copyright (c) 2011-2018 Jean-Pierre Andre
|
||||
*
|
||||
* This utility will dump a file's attributes.
|
||||
*
|
||||
@ -119,7 +119,7 @@ static void version(void)
|
||||
printf(" 2003 Leonard Norrgård\n");
|
||||
printf(" 2004-2005 Yuval Fledel\n");
|
||||
printf(" 2004-2007 Yura Pakhuchiy\n");
|
||||
printf(" 2011-2017 Jean-Pierre Andre\n");
|
||||
printf(" 2011-2018 Jean-Pierre Andre\n");
|
||||
printf("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home);
|
||||
}
|
||||
|
||||
@ -411,8 +411,12 @@ static char *ntfs_attr_get_name_mbs(ATTR_RECORD *attr)
|
||||
static const char *reparse_type_name(le32 tag)
|
||||
{
|
||||
const char *name;
|
||||
le32 seltag;
|
||||
|
||||
switch (tag) {
|
||||
seltag = tag;
|
||||
if (tag & IO_REPARSE_TAG_WITH_FLAGS)
|
||||
seltag &= IO_REPARSE_PLUGIN_SELECT;
|
||||
switch (seltag) {
|
||||
case IO_REPARSE_TAG_MOUNT_POINT :
|
||||
name = " (mount point)";
|
||||
break;
|
||||
@ -428,6 +432,9 @@ static const char *reparse_type_name(le32 tag)
|
||||
case IO_REPARSE_TAG_WCI :
|
||||
name = " (Windows container)";
|
||||
break;
|
||||
case IO_REPARSE_TAG_CLOUD :
|
||||
name = " (Cloud)";
|
||||
break;
|
||||
case IO_REPARSE_TAG_NFS :
|
||||
name = " (NFS symlink)";
|
||||
break;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* ntfs-3g_common.c - Common definitions for ntfs-3g and lowntfs-3g.
|
||||
*
|
||||
* Copyright (c) 2010-2016 Jean-Pierre Andre
|
||||
* Copyright (c) 2010-2018 Jean-Pierre Andre
|
||||
* Copyright (c) 2010 Erik Larsson
|
||||
*
|
||||
* This program/include file is free software; you can redistribute it and/or
|
||||
@ -801,7 +801,7 @@ const struct plugin_operations *select_reparse_plugin(ntfs_fuse_context_t *ctx,
|
||||
const struct plugin_operations *ops;
|
||||
void *handle;
|
||||
REPARSE_POINT *reparse;
|
||||
le32 tag;
|
||||
le32 tag, seltag;
|
||||
plugin_list_t *plugin;
|
||||
plugin_init_t pinit;
|
||||
|
||||
@ -809,7 +809,10 @@ const struct plugin_operations *select_reparse_plugin(ntfs_fuse_context_t *ctx,
|
||||
reparse = ntfs_get_reparse_point(ni);
|
||||
if (reparse) {
|
||||
tag = reparse->reparse_tag;
|
||||
for (plugin=ctx->plugins; plugin && (plugin->tag != tag);
|
||||
seltag = tag;
|
||||
if (tag & IO_REPARSE_TAG_WITH_FLAGS)
|
||||
seltag &= IO_REPARSE_PLUGIN_SELECT;
|
||||
for (plugin=ctx->plugins; plugin && (plugin->tag != seltag);
|
||||
plugin = plugin->next) { }
|
||||
if (plugin) {
|
||||
ops = plugin->ops;
|
||||
@ -819,12 +822,12 @@ const struct plugin_operations *select_reparse_plugin(ntfs_fuse_context_t *ctx,
|
||||
|
||||
snprintf(name,sizeof(name), PLUGIN_DIR
|
||||
"/ntfs-plugin-%08lx.so",
|
||||
(long)le32_to_cpu(tag));
|
||||
(long)le32_to_cpu(seltag));
|
||||
#else
|
||||
char name[64];
|
||||
|
||||
snprintf(name,sizeof(name), "ntfs-plugin-%08lx.so",
|
||||
(long)le32_to_cpu(tag));
|
||||
(long)le32_to_cpu(seltag));
|
||||
#endif
|
||||
handle = dlopen(name, RTLD_LAZY);
|
||||
if (handle) {
|
||||
@ -833,7 +836,7 @@ const struct plugin_operations *select_reparse_plugin(ntfs_fuse_context_t *ctx,
|
||||
/* pinit() should set errno if it fails */
|
||||
ops = (*pinit)(tag);
|
||||
if (ops && register_reparse_plugin(ctx,
|
||||
tag, ops, handle))
|
||||
seltag, ops, handle))
|
||||
ops = (struct plugin_operations*)NULL;
|
||||
} else
|
||||
errno = ELIBBAD;
|
||||
|
Loading…
Reference in New Issue
Block a user