summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-03-07 23:00:39 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-03-07 23:00:39 +0000
commited22a9fde99d5c37358fc449a3a1c58efa9907f8 (patch)
tree7ae0eb900d0ee1a722625208fd064902bc247eca /libdiskfs
parentd84cd2a815d42475ec62dca2193dc7f4c4a448a3 (diff)
(diskfs_S_file_getcontrol): Perform the permission check for each id
in the chain.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/file-getcontrol.c13
1 files changed, 8 insertions, 5 deletions
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++;