summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdiskfs/file-set-trans.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libdiskfs/file-set-trans.c b/libdiskfs/file-set-trans.c
index 0972bd40..c2edec87 100644
--- a/libdiskfs/file-set-trans.c
+++ b/libdiskfs/file-set-trans.c
@@ -186,10 +186,15 @@ diskfs_S_file_set_translator (struct protid *cred,
return error;
}
}
- np->dn_stat.st_mode = (np->dn_stat.st_mode & ~S_IFMT) | newmode;
- diskfs_node_update (np, 1);
+ newmode = (np->dn_stat.st_mode & ~S_IFMT) | newmode;
+ error = validate_mode_change (np, newmode);
+ if (!error)
+ {
+ np->dn_stat.st_mode = newmode;
+ diskfs_node_update (np, 1);
+ }
mutex_unlock (&np->lock);
- return 0;
+ return error;
}
}
error = diskfs_set_translator (np, passive, passivelen, cred);