summaryrefslogtreecommitdiff
path: root/libnetfs/dir-lookup.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-06-16 20:23:29 +0000
committerRoland McGrath <roland@gnu.org>2001-06-16 20:23:29 +0000
commit0a746fb19a663f41794f4c6ed6e63d4c5ce714b4 (patch)
tree8a32333adeedb387dabadce6165358563ec61e7d /libnetfs/dir-lookup.c
parent487bba2f0cd506b4a79e1d92184a5f80d827954f (diff)
2001-04-01 Neal H Walfield <neal@cs.uml.edu>
* dir-lookup.c (netfs_S_dir_lookup): Use iohelp_create_empty_iouser. Use iohelp_dup_iouser as per the new semantics. * dir-mkfile.c (netfs_S_dir_mkfile): Use iohelp_dup_iouser as per the new semantics. * file-exec.c (netfs_S_file_exec): Likewise. * file-reparent.c (netfs_S_file_reparent): Likewise. * fsys-getroot.c (netfs_S_fsys_getroot): Use iohelp_create_complex_iouser. * fsys-syncfs.c (netfs_S_fsys_syncfs): Use iohelp_create_simple_iouser. * io-duplicate.c (netfs_S_io_duplicate): Use iohelp_dup_iouser as per the new semantics. * io-reauthenticate.c (netfs_S_io_reauthenticate): Use iohelp_reauth as per the new semantics. * io-restric-auth.c (netfs_S_io_restric_auth): Use iohelp_create_complex_iouser. Check return values. * trans-callback.c (_netfs_transcallback2_fn): Use iohelp_create_simple_iouser.
Diffstat (limited to 'libnetfs/dir-lookup.c')
-rw-r--r--libnetfs/dir-lookup.c59
1 files changed, 38 insertions, 21 deletions
diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c
index ed7853ec..6911f5ae 100644
--- a/libnetfs/dir-lookup.c
+++ b/libnetfs/dir-lookup.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,98,99,2000,01 Free Software Foundation, Inc.
Written by Michael I. Bushnell, p/BSG.
This file is part of the GNU Hurd.
@@ -48,6 +48,7 @@ netfs_S_dir_lookup (struct protid *diruser,
char *nextname;
error_t error;
struct protid *newpi;
+ struct iouser *user;
if (!diruser)
return EOPNOTSUPP;
@@ -233,25 +234,37 @@ netfs_S_dir_lookup (struct protid *diruser,
/* Create an unauthenticated port for DNP, and then
unlock it. */
- newpi =
- netfs_make_protid (netfs_make_peropen (dnp, 0, diruser->po),
- iohelp_create_iouser (make_idvec (),
- make_idvec ()));
- dirport = ports_get_send_right (newpi);
- ports_port_deref (newpi);
-
- error = fshelp_fetch_root (&np->transbox, diruser->po,
- dirport,
- diruser->user,
- lastcomp ? flags : 0,
- ((np->nn_stat.st_mode & S_IPTRANS)
- ? _netfs_translator_callback1
- : short_circuited_callback1),
- _netfs_translator_callback2,
- do_retry, retry_name, retry_port);
- /* fetch_root copies DIRPORT for success, so we always should
- deallocate our send right. */
- mach_port_deallocate (mach_task_self (), dirport);
+ error = iohelp_create_empty_iouser (&user);
+ if (! error)
+ {
+ newpi = netfs_make_protid (netfs_make_peropen (dnp, 0,
+ diruser->po),
+ user);
+ if (! newpi)
+ {
+ iohelp_free_iouser (user);
+ error = ENOMEM;
+ }
+ }
+
+ if (! error)
+ {
+ dirport = ports_get_send_right (newpi);
+ ports_port_deref (newpi);
+
+ error = fshelp_fetch_root (&np->transbox, diruser->po,
+ dirport,
+ diruser->user,
+ lastcomp ? flags : 0,
+ ((np->nn_stat.st_mode & S_IPTRANS)
+ ? _netfs_translator_callback1
+ : short_circuited_callback1),
+ _netfs_translator_callback2,
+ do_retry, retry_name, retry_port);
+ /* fetch_root copies DIRPORT for success, so we always should
+ deallocate our send right. */
+ mach_port_deallocate (mach_task_self (), dirport);
+ }
if (error != ENOENT)
{
@@ -362,8 +375,12 @@ netfs_S_dir_lookup (struct protid *diruser,
flags &= ~OPENONLY_STATE_MODES;
+ error = iohelp_dup_iouser (&user, diruser->user);
+ if (error)
+ goto out;
+
newpi = netfs_make_protid (netfs_make_peropen (np, flags, diruser->po),
- iohelp_dup_iouser (diruser->user));
+ user);
*retry_port = ports_get_right (newpi);
ports_port_deref (newpi);