From b3a86d0256a3a421e2baa1021d370be8c1a1fa4d Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Tue, 24 Apr 2012 11:41:40 -0400 Subject: [PATCH] simply logic for unsetting readonly attribute --- daemon/setattr.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/daemon/setattr.c b/daemon/setattr.c index 1d46983..8e2768b 100644 --- a/daemon/setattr.c +++ b/daemon/setattr.c @@ -83,6 +83,13 @@ static int handle_nfs41_setattr(setattr_upcall_args *args) info.attrmask.count = 2; } + if (old_info.mode == 0444 && + ((basic_info->FileAttributes & FILE_ATTRIBUTE_READONLY) == 0)) { + info.mode = 0644; + info.attrmask.arr[1] |= FATTR4_WORD1_MODE; + info.attrmask.count = 2; + } + if (superblock->cansettime) { /* set the time_delta so xdr_settime4() can decide * whether or not to use SET_TO_SERVER_TIME4 */