summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2001-03-28 18:06:38 +0000
committerMarcus Brinkmann <marcus@gnu.org>2001-03-28 18:06:38 +0000
commit50d29b8c6df6ab62be6a029175b6fa0f251ed305 (patch)
tree150c10f4160f89a2168af62b8cd7a12270f00a75 /libdiskfs
parent5b8d267faf5a8291c6e239d2d18749d4426cb685 (diff)
2001-03-28 Marcus Brinkmann <marcus@gnu.org>
* dir-lookup.c (diskfs_S_dir_lookup): New variable USER. Store new iouser in that variable and free it after creating the protid for DIRPORT. * trans-callback.c (_diskfs_translator_callback2_fn): Likewise. * io-restrict-auth.c (diskfs_S_io_restrict_auth): Likewise. * io-reauthenticate.c (diskfs_S_io_reauthenticate): Likewise.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/ChangeLog9
-rw-r--r--libdiskfs/dir-lookup.c8
-rw-r--r--libdiskfs/io-reauthenticate.c7
-rw-r--r--libdiskfs/io-restrict-auth.c6
-rw-r--r--libdiskfs/trans-callback.c6
5 files changed, 28 insertions, 8 deletions
diff --git a/libdiskfs/ChangeLog b/libdiskfs/ChangeLog
index 262de9e3..5febd0d5 100644
--- a/libdiskfs/ChangeLog
+++ b/libdiskfs/ChangeLog
@@ -1,3 +1,12 @@
+2001-03-28 Marcus Brinkmann <marcus@gnu.org>
+
+ * dir-lookup.c (diskfs_S_dir_lookup): New variable USER. Store new
+ iouser in that variable and free it after creating the protid for
+ DIRPORT.
+ * trans-callback.c (_diskfs_translator_callback2_fn): Likewise.
+ * io-restrict-auth.c (diskfs_S_io_restrict_auth): Likewise.
+ * io-reauthenticate.c (diskfs_S_io_reauthenticate): Likewise.
+
2001-02-25 Roland McGrath <roland@frob.com>
* readonly-changed.c: New file.
diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c
index 489b4dd8..2cecc91d 100644
--- a/libdiskfs/dir-lookup.c
+++ b/libdiskfs/dir-lookup.c
@@ -209,6 +209,7 @@ diskfs_S_dir_lookup (struct protid *dircred,
|| fshelp_translated (&np->transbox)))
{
mach_port_t dirport;
+ struct iouser *user;
/* A callback function for short-circuited translators.
Symlink & ifsock are handled elsewhere. */
@@ -247,11 +248,12 @@ diskfs_S_dir_lookup (struct protid *dircred,
/* Create an unauthenticated port for DNP, and then
unlock it. */
+ user = iohelp_create_iouser (make_idvec (), make_idvec ());
error =
diskfs_create_protid (diskfs_make_peropen (dnp, 0, dircred->po),
- iohelp_create_iouser (make_idvec (),
- make_idvec ()),
- &newpi);
+ user, &newpi);
+ iohelp_free_iouser (user);
+
if (error)
goto out;
diff --git a/libdiskfs/io-reauthenticate.c b/libdiskfs/io-reauthenticate.c
index e2c0e68b..eb564a26 100644
--- a/libdiskfs/io-reauthenticate.c
+++ b/libdiskfs/io-reauthenticate.c
@@ -26,6 +26,7 @@ diskfs_S_io_reauthenticate (struct protid *cred,
struct protid *newcred;
error_t err;
mach_port_t newright;
+ struct iouser *user;
if (cred == 0)
return EOPNOTSUPP;
@@ -46,8 +47,10 @@ diskfs_S_io_reauthenticate (struct protid *cred,
newright = ports_get_send_right (newcred);
assert (newright != MACH_PORT_NULL);
- diskfs_finish_protid (newcred, iohelp_reauth (diskfs_auth_server_port,
- rend_port, newright, 1));
+ user = iohelp_reauth (diskfs_auth_server_port, rend_port, newright, 1);
+ diskfs_finish_protid (newcred, user);
+
+ iohelp_free_iouser (user);
mach_port_deallocate (mach_task_self (), rend_port);
mach_port_deallocate (mach_task_self (), newright);
diff --git a/libdiskfs/io-restrict-auth.c b/libdiskfs/io-restrict-auth.c
index 0a3a5021..691a59ed 100644
--- a/libdiskfs/io-restrict-auth.c
+++ b/libdiskfs/io-restrict-auth.c
@@ -41,6 +41,7 @@ diskfs_S_io_restrict_auth (struct protid *cred,
{
error_t err;
struct idvec *uvec, *gvec;
+ struct iouser *user;
struct protid *newpi;
int i;
@@ -66,10 +67,10 @@ diskfs_S_io_restrict_auth (struct protid *cred,
if (listmember (gids, cred->user->gids->ids[i], ngids))
idvec_add (gvec, cred->user->gids->ids[i]);
}
+ user = iohelp_create_iouser (uvec, gvec);
mutex_lock (&cred->po->np->lock);
- err = diskfs_create_protid (cred->po, iohelp_create_iouser (uvec, gvec),
- &newpi);
+ err = diskfs_create_protid (cred->po, user, &newpi);
if (! err)
{
*newport = ports_get_right (newpi);
@@ -78,5 +79,6 @@ diskfs_S_io_restrict_auth (struct protid *cred,
}
mutex_unlock (&cred->po->np->lock);
+ iohelp_free_iouser (user);
return err;
}
diff --git a/libdiskfs/trans-callback.c b/libdiskfs/trans-callback.c
index 43492d6e..5923d265 100644
--- a/libdiskfs/trans-callback.c
+++ b/libdiskfs/trans-callback.c
@@ -56,15 +56,19 @@ _diskfs_translator_callback2_fn (void *cookie1, void *cookie2,
struct protid *cred;
error_t err;
struct idvec *uids, *gids;
+ struct iouser *user;
uids = make_idvec ();
gids = make_idvec ();
idvec_set_ids (uids, &np->dn_stat.st_uid, 1);
idvec_set_ids (gids, &np->dn_stat.st_gid, 1);
+ user = iohelp_create_iouser (uids, gids);
err =
diskfs_create_protid (diskfs_make_peropen (np, flags, cookie2),
- iohelp_create_iouser (uids, gids), &cred);
+ user, &cred);
+
+ iohelp_free_iouser (user);
if (! err)
{
*underlying = ports_get_right (cred);