From 49a2c9d930156814d5bcf34fd8e2126780ab6ef9 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 3 Jul 2001 01:10:37 +0000 Subject: 2001-06-21 Neal H Walfield * file-getcontrol.c (netfs_S_file_getcontrol): When checking if we can give the control port out, use fshelp_iscontroller rather than doing the check by hand. --- libnetfs/file-getcontrol.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libnetfs') diff --git a/libnetfs/file-getcontrol.c b/libnetfs/file-getcontrol.c index c33d524f..50401f86 100644 --- a/libnetfs/file-getcontrol.c +++ b/libnetfs/file-getcontrol.c @@ -1,6 +1,6 @@ /* Return the filesystem corresponding to a file - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc. Written by Michael I. Bushnell, p/BSG. This file is part of the GNU Hurd. @@ -21,6 +21,7 @@ #include "netfs.h" #include "fsys_S.h" +#include error_t netfs_S_file_getcontrol (struct protid *user, @@ -33,10 +34,11 @@ netfs_S_file_getcontrol (struct protid *user, if (!user) return EOPNOTSUPP; - if (!idvec_contains (user->user->uids, 0)) - return EPERM; + err = fshelp_iscontroller (&netfs_root_node->nn_stat, user->user); + if (err) + return err; - /* They've got root; give it to them. */ + /* They've have the appropriate credentials; give it to them. */ err = ports_create_port (netfs_control_class, netfs_port_bucket, sizeof (struct port_info), &pi); if (err) -- cgit v1.2.3