From a967e32672cc433772cea16034eb0a7e156c14f1 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 11 Oct 1999 08:38:02 +0000 Subject: 1999-10-11 Roland McGrath * dir-lookup.c (trivfs_S_dir_lookup): Duplicate CRED->user to pass it to trivfs_open. Add ref to CRED->realnode when used by trivfs_open. --- libtrivfs/dir-lookup.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'libtrivfs') diff --git a/libtrivfs/dir-lookup.c b/libtrivfs/dir-lookup.c index 5a10bf22..604df8cc 100644 --- a/libtrivfs/dir-lookup.c +++ b/libtrivfs/dir-lookup.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994, 1998 Free Software Foundation + Copyright (C) 1994, 1998, 1999 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 @@ -63,8 +63,16 @@ trivfs_S_dir_lookup (struct trivfs_protid *cred, if (trivfs_check_open_hook) err = (*trivfs_check_open_hook) (cred->po->cntl, cred->user, flags); if (!err) - err = trivfs_open (cred->po->cntl, cred->user, flags, - cred->realnode, &newcred); + { + struct iouser *user = iohelp_dup_iouser (cred->user); + err = trivfs_open (cred->po->cntl, user, flags, + cred->realnode, &newcred); + if (err) + iohelp_free_iouser (user); + else + mach_port_mod_refs (mach_task_self (), cred->realnode, + MACH_PORT_RIGHT_SEND, +1); + } if (err) return err; -- cgit v1.2.3