From b51bd2f9d1753bd6079eec4127c4300175dae36e Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 23 Sep 2010 12:17:04 -0400 Subject: [PATCH] symlink: set reparse tag for symlinks getattr upcall for FileAttributeTagInformation sets ReparseTag=IO_REPARSE_TAG_SYMLINK readdir upcall sets EaSize=IO_REPARSE_TAG_SYMLINK; this makes the 'dir' command show files as , and causes a FSCTL_GET_REPARSE_POINT to query the symlink target Signed-off-by: Casey Bodley --- daemon/getattr.c | 3 ++- daemon/readdir.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/daemon/getattr.c b/daemon/getattr.c index f6e8ffb..b528ec4 100644 --- a/daemon/getattr.c +++ b/daemon/getattr.c @@ -102,7 +102,8 @@ int handle_getattr(nfs41_upcall *upcall) break; case FileAttributeTagInformation: args->tag_info.FileAttributes = nfs_file_info_to_attributes(&info); - args->tag_info.ReparseTag = 0; + args->tag_info.ReparseTag = info.type == NF4LNK ? + IO_REPARSE_TAG_SYMLINK : 0; break; default: eprintf("unhandled file query class %d\n", args->query_class); diff --git a/daemon/readdir.c b/daemon/readdir.c index f968c75..3987537 100644 --- a/daemon/readdir.c +++ b/daemon/readdir.c @@ -190,7 +190,8 @@ static void readdir_copy_full_dir_info( IN PFILE_DIR_INFO_UNION info) { readdir_copy_dir_info(entry, info); - info->fifdi.EaSize = 0; + info->fifdi.EaSize = entry->attr_info.type == NF4LNK ? + IO_REPARSE_TAG_SYMLINK : 0; } static void readdir_copy_both_dir_info(