From 61359542d74d26352f39e8432761a8a16ac577dc Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sat, 27 Jan 1996 16:34:35 +0000 Subject: (diskfs_S_io_restrict_auth): Use diskfs_create_protid instead of diskfs_make_protid, and deal with an error return. --- libdiskfs/io-restrict-auth.c | 18 ++++++++++++------ 1 file 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; } -- cgit v1.2.3