diff options
author | Miles Bader <miles@gnu.org> | 1996-01-27 16:34:35 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-01-27 16:34:35 +0000 |
commit | 61359542d74d26352f39e8432761a8a16ac577dc (patch) | |
tree | 9c780042685d40d7b9386a1236471425d8a1d9d2 /libdiskfs | |
parent | dbfeb5554bddcea8677e11c110bf1f9598aa5052 (diff) |
(diskfs_S_io_restrict_auth): Use diskfs_create_protid instead of
diskfs_make_protid, and deal with an error return.
Diffstat (limited to 'libdiskfs')
-rw-r--r-- | libdiskfs/io-restrict-auth.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/libdiskfs/io-restrict-auth.c b/libdiskfs/io-restrict-auth.c index 3565e4e2..f2e00293 100644 --- a/libdiskfs/io-restrict-auth.c +++ b/libdiskfs/io-restrict-auth.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994, 1995 Free Software Foundation + Copyright (C) 1994, 1995, 1996 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 @@ -39,6 +39,7 @@ diskfs_S_io_restrict_auth (struct protid *cred, gid_t *gids, u_int ngids) { + error_t err; uid_t *newuids, *newgids; int i, newnuids, newngids; struct protid *newpi; @@ -57,10 +58,15 @@ diskfs_S_io_restrict_auth (struct protid *cred, newgids[newngids++] = cred->gids[i]; mutex_lock (&cred->po->np->lock); - newpi = diskfs_make_protid (cred->po, newuids, newnuids, newgids, newngids); - *newport = ports_get_right (newpi); + err = diskfs_create_protid (cred->po, newuids, newnuids, newgids, newngids, + &newpi); + if (! err) + { + *newport = ports_get_right (newpi); + *newportpoly = MACH_MSG_TYPE_MAKE_SEND; + ports_port_deref (newpi); + } mutex_unlock (&cred->po->np->lock); - *newportpoly = MACH_MSG_TYPE_MAKE_SEND; - ports_port_deref (newpi); - return 0; + + return err; } |