From 06ca25eac7fe461edac4deeb66f891301eae84d4 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 24 Jun 1996 19:08:04 +0000 Subject: (diskfs_S_file_chmod): Validate mode change before making it. --- libdiskfs/file-chmod.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libdiskfs') 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; + } } })); } -- cgit v1.2.3