From ed22a9fde99d5c37358fc449a3a1c58efa9907f8 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 7 Mar 1995 23:00:39 +0000 Subject: (diskfs_S_file_getcontrol): Perform the permission check for each id in the chain. --- libdiskfs/file-getcontrol.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libdiskfs/file-getcontrol.c') diff --git a/libdiskfs/file-getcontrol.c b/libdiskfs/file-getcontrol.c index 4ea2ae8e..1d7dfa9b 100644 --- a/libdiskfs/file-getcontrol.c +++ b/libdiskfs/file-getcontrol.c @@ -1,5 +1,5 @@ /* libdiskfs implementation of fs.defs:file_getcontrol.c - Copyright (C) 1992, 1993, 1994 Free Software Foundation + Copyright (C) 1992, 1993, 1994, 1995 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 @@ -24,14 +24,17 @@ diskfs_S_file_getcontrol (struct protid *cred, mach_port_t *control, mach_msg_type_name_t *controltype) { - int error = 0;; + int error = 0; + struct userid *id; if (!cred) return EOPNOTSUPP; - if (!diskfs_isuid (0, cred)) - error = EPERM; - else + assert (cred->id); + for (id = cred->id; id && !error; id = id->next) + if (!diskfs_idhasuid (0, id)) + error = EPERM; + if (!error) { spin_lock (&_diskfs_control_lock); _diskfs_ncontrol_ports++; -- cgit v1.2.3