diff options
author | Roland McGrath <roland@gnu.org> | 2001-07-03 01:10:37 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2001-07-03 01:10:37 +0000 |
commit | 49a2c9d930156814d5bcf34fd8e2126780ab6ef9 (patch) | |
tree | 8c5998098036bb8321f5c0fe76e3ae903d09cb04 /libnetfs/file-getcontrol.c | |
parent | abd1e84b6b14f34beae53005fcead93b1d755ff5 (diff) |
2001-06-21 Neal H Walfield <neal@cs.uml.edu>
* 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.
Diffstat (limited to 'libnetfs/file-getcontrol.c')
-rw-r--r-- | libnetfs/file-getcontrol.c | 10 |
1 files changed, 6 insertions, 4 deletions
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 <hurd/fshelp.h> 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) |