summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-06-24 19:17:51 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-06-24 19:17:51 +0000
commit5d7ee86cd8a8b409fece1c36c2038f5e30e8df24 (patch)
tree30464bb19774c55f7adbf0dfdbc1c996ba969ed8
parent43707f198a822999a078e57806d45921a1a3d9d6 (diff)
(diskfs_S_file_chflags): Validate flags change before making it.
-rw-r--r--libdiskfs/file-chflags.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libdiskfs/file-chflags.c b/libdiskfs/file-chflags.c
index 8dee0a8b..e1403f25 100644
--- a/libdiskfs/file-chflags.c
+++ b/libdiskfs/file-chflags.c
@@ -1,5 +1,5 @@
/* libdiskfs implementation of fs.defs:file_chflags
- Copyright (C) 1992, 1993, 1994 Free Software Foundation
+ Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -25,7 +25,10 @@ diskfs_S_file_chflags (struct protid *cred,
{
CHANGE_NODE_FIELD (cred,
({
- if (!(err = diskfs_isowner (np, cred)))
- np->dn_stat.st_flags = flags;
+ err = diskfs_isowner (np, cred);
+ if (!err)
+ err = diskfs_validate_flags_change (np, flags);
+ if (!err)
+ np->dn_stat.st_flags = flags;
}));
}