summaryrefslogtreecommitdiff
path: root/term/users.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-02-16 11:15:52 +0000
committerThomas Bushnell <thomas@gnu.org>1999-02-16 11:15:52 +0000
commit54ed05f99084f567e787bc0be44b8ec2c57d1f8d (patch)
tree86830a78d957b5d5f9d913be371836127bc3e2d6 /term/users.c
parentfe25b1e7fcbcc6a33aa95557e2799790bbd4e5e9 (diff)
Tue Feb 16 06:10:08 1999 Thomas Bushnell, BSG <tb@mit.edu>
* users.c (trivfs_S_io_revoke): New function.
Diffstat (limited to 'term/users.c')
-rw-r--r--term/users.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/term/users.c b/term/users.c
index 9cd71c51..7bbe709c 100644
--- a/term/users.c
+++ b/term/users.c
@@ -801,6 +801,50 @@ trivfs_S_io_readable (struct trivfs_protid *cred,
return 0;
}
+error_t
+trivfs_S_io_revoke (struct trivfs_protid *cred)
+{
+ struct stat st;
+
+ error_t
+ iterator_function (void *port)
+ {
+ struct trivfs_proted *user = port;
+
+ if ((user.class == cred.class) && (user != cred))
+ ports_destroy_right (user);
+ return 0;
+ }
+
+ if (!cred)
+ return EOPNOTSUPP;
+
+ mutex_lock (&global_lock);
+
+ if (!cred->isroot)
+ {
+ /* XXX */
+ st.st_uid = term_owner;
+ st.st_gid = term_group;
+
+ err = fshelp_isowner (&st, cred->user);
+ if (err)
+ {
+ mutex_unlock (&global_lock);
+ return err;
+ }
+ }
+
+ ports_bucket_iterate (term_bucket, iterator_function);
+
+ mutex_unlock (&global_lock);
+ return 0;
+}
+
+
+
+
+
/* TIOCMODG ioctl -- Get modem state */
kern_return_t
S_tioctl_tiocmodg (io_t port,