diff options
author | Thomas Bushnell <thomas@gnu.org> | 1999-02-16 11:15:52 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1999-02-16 11:15:52 +0000 |
commit | 54ed05f99084f567e787bc0be44b8ec2c57d1f8d (patch) | |
tree | 86830a78d957b5d5f9d913be371836127bc3e2d6 /term | |
parent | fe25b1e7fcbcc6a33aa95557e2799790bbd4e5e9 (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')
-rw-r--r-- | term/ChangeLog | 4 | ||||
-rw-r--r-- | term/users.c | 44 |
2 files changed, 48 insertions, 0 deletions
diff --git a/term/ChangeLog b/term/ChangeLog index feb965e2..b1ea689e 100644 --- a/term/ChangeLog +++ b/term/ChangeLog @@ -1,3 +1,7 @@ +Tue Feb 16 06:10:08 1999 Thomas Bushnell, BSG <tb@mit.edu> + + * users.c (trivfs_S_io_revoke): New function. + 1999-02-05 Mark Kettenis <kettenis@gnu.org> * users.c (trivfs_S_file_chmod): Clear S_ISVTX bit instead of 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, |