From 06fa6934cb39694bc7db84216925db93fe05f28f Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 12 Oct 2010 09:53:20 -0400 Subject: [PATCH] readdir: view broken referrals as directories if readdir fails to look up a referred entry, set its type to NF4DIR so windows explorer shows it as a directory. when you double-click on the directory, it gives a message saying that it "refers to a location that is unavailable" Signed-off-by: Casey Bodley --- daemon/readdir.c | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/readdir.c b/daemon/readdir.c index 4e50d15..fac88ad 100644 --- a/daemon/readdir.c +++ b/daemon/readdir.c @@ -277,6 +277,7 @@ static int readdir_copy_entry( *dst_len -= info->NextEntryOffset; if (entry->attr_info.rdattr_error == NFS4ERR_MOVED) { + entry->attr_info.type = NF4DIR; /* default to dir */ /* look up attributes for referral entries, but ignore return value; * it's okay if lookup fails, we'll just write garbage attributes */ lookup_entry(args->root, args->state->session,