summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-06-24 19:09:39 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-06-24 19:09:39 +0000
commit478e107390f25a180a26ee3174a848c9dcc51c34 (patch)
tree186b319d68826799e21d5a4208f5d75c72b8a2bf
parent06ca25eac7fe461edac4deeb66f891301eae84d4 (diff)
(diskfs_S_file_set_translator): Validate mode change before making it.
-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);