summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-06-24 19:08:04 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-06-24 19:08:04 +0000
commit06ca25eac7fe461edac4deeb66f891301eae84d4 (patch)
tree202632d101bcaaa55226eabf6418f0d2ce6cec49 /libdiskfs
parent52bf1f14d0f2ddecf8acd5f52e440fb791ac3d0f (diff)
(diskfs_S_file_chmod): Validate mode change before making it.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/file-chmod.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libdiskfs/file-chmod.c b/libdiskfs/file-chmod.c
index c5228d13..545b810f 100644
--- a/libdiskfs/file-chmod.c
+++ b/libdiskfs/file-chmod.c
@@ -1,5 +1,5 @@
/* libdiskfs implementation of fs.defs: file_chmod
- 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
@@ -39,8 +39,12 @@ diskfs_S_file_chmod (struct protid *cred,
mode &= ~S_ISUID;
}
mode |= (np->dn_stat.st_mode & (S_IFMT | S_ISPARE));
- np->dn_stat.st_mode = mode;
- np->dn_set_ctime = 1;
+ err = diskfs_validate_mode_change (np, mode);
+ if (!err)
+ {
+ np->dn_stat.st_mode = mode;
+ np->dn_set_ctime = 1;
+ }
}
}));
}