From 487bba2f0cd506b4a79e1d92184a5f80d827954f Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 16 Jun 2001 20:23:09 +0000 Subject: 2001-04-01 Neal H Walfield * dir-lookup.c (diskfs_S_dir_lookup): Use iohelp_create_empty_iouser. * fsys-getfile.c (diskfs_S_fsys_getfile): Use iohelp_create_complex_iouser. * io-reauthenticate.c (diskfs_S_io_reauthenticate): Use new iohelp_reauth semantics. * io-restrict-auth.c (diskfs_S_io_restrict_auth): Use new iohelp_create_iouser semantics. * protid-make.c (diskfs_finish_protid): Use iohelp_create_simple_iouser and new iohelp_dup_iouse semantics. * trans-callback.c (_diskfs_translator_callback2_fn): Use iohelp_create_simple_iouser. --- libdiskfs/protid-make.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'libdiskfs/protid-make.c') diff --git a/libdiskfs/protid-make.c b/libdiskfs/protid-make.c index 8f45cfd5..9b78a37f 100644 --- a/libdiskfs/protid-make.c +++ b/libdiskfs/protid-make.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994, 1995, 1996 Free Software Foundation + Copyright (C) 1994,95,96,2001 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 @@ -17,6 +17,7 @@ #include "priv.h" #include +#include /* Build and return in CRED a protid which has no user identification, for peropen PO. The node PO->np must be locked. */ @@ -41,20 +42,17 @@ diskfs_start_protid (struct peropen *po, struct protid **cred) void diskfs_finish_protid (struct protid *cred, struct iouser *user) { + error_t err; + if (!user) - { - uid_t zero = 0; - /* Create one for root */ - user = iohelp_create_iouser (make_idvec (), make_idvec ()); - idvec_set_ids (user->uids, &zero, 1); - idvec_set_ids (user->gids, &zero, 1); - cred->user = user; - } + err = iohelp_create_simple_iouser (&cred->user, 0, 0); else - cred->user = iohelp_dup_iouser (user); + err = iohelp_dup_iouser (&cred->user, user); + assert_perror (err); - mach_port_move_member (mach_task_self (), cred->pi.port_right, - diskfs_port_bucket->portset); + err = mach_port_move_member (mach_task_self (), cred->pi.port_right, + diskfs_port_bucket->portset); + assert_perror (err); } /* Create and return a protid for an existing peropen PO in CRED for USER. -- cgit v1.2.3