summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdiskfs/io-restrict-auth.c18
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;
}