From 5d7ee86cd8a8b409fece1c36c2038f5e30e8df24 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 24 Jun 1996 19:17:51 +0000 Subject: (diskfs_S_file_chflags): Validate flags change before making it. --- libdiskfs/file-chflags.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libdiskfs/file-chflags.c') 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; })); } -- cgit v1.2.3