summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-10-11 08:38:02 +0000
committerRoland McGrath <roland@gnu.org>1999-10-11 08:38:02 +0000
commita967e32672cc433772cea16034eb0a7e156c14f1 (patch)
treeba3a043163d7c57c19af9ed8423a2f9635167f99
parentd19f04c4df837375c2f13f781c8c00cab5051e8b (diff)
1999-10-11 Roland McGrath <roland@baalperazim.frob.com>
* 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.
-rw-r--r--libtrivfs/dir-lookup.c14
1 files changed, 11 insertions, 3 deletions
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;