summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libtrivfs/ChangeLog26
-rw-r--r--libtrivfs/Makefile2
-rw-r--r--libtrivfs/io-reauthenticate.c5
-rw-r--r--libtrivfs/io-restrict-auth.c8
-rw-r--r--libtrivfs/io-stat.c3
-rw-r--r--libtrivfs/open.c6
-rw-r--r--libtrivfs/protid-clean.c5
-rw-r--r--libtrivfs/protid-dup.c10
-rw-r--r--libtrivfs/trivfs.h1
9 files changed, 44 insertions, 22 deletions
diff --git a/libtrivfs/ChangeLog b/libtrivfs/ChangeLog
index cd26fc31..6cba0e88 100644
--- a/libtrivfs/ChangeLog
+++ b/libtrivfs/ChangeLog
@@ -1,3 +1,29 @@
+Mon Nov 18 18:13:42 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
+
+ * io-stat.c (trivfs_S_io_stat): Make the mode specify IFCHR by
+ default.
+
+Sat Nov 16 17:20:15 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
+
+ * Makefile (HURDLIBS): Add `iohelp'.
+
+Thu Nov 14 13:13:10 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
+
+ * io-restrict-auth.c (trivfs_S_io_restrict_auth): idvec_set ->
+ idvec_set_ids. Fix unrelated typos.
+
+ * protid-dup.c (trivfs_protid_dup): Use iouser_dup_iouser instead
+ of copying old arrays by hand.
+ * protid-clean.c (trivfs_clean_protid): Free CRED->user instead of
+ CRED->uids and CRED->gids.
+ * io-reauthenticate.c (trivfs_S_io_reauthenticate): Args for
+ io_restrict_auth now come from the new structure definitions.
+ * open.c (trivfs_open): Pass correct first arg to idvec_contains.
+
+ * open.c (trivfs_open): Delete variable I.
+
+ * trivfs.h: Include <hurd/iohelp.h>
+
Thu Nov 7 17:05:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* io-restrict-auth.c (trivfs_S_io_restrict_auth): If CRED has
diff --git a/libtrivfs/Makefile b/libtrivfs/Makefile
index 74fb8cec..8fc8594a 100644
--- a/libtrivfs/Makefile
+++ b/libtrivfs/Makefile
@@ -45,7 +45,7 @@ SRCS=$(FSSRCS) $(IOSRCS) $(FSYSSRCS) $(OTHERSRCS)
MIGSTUBS=fsServer.o ioServer.o fsysServer.o fsys_replyUser.o
libname = libtrivfs
-HURDLIBS = ports shouldbeinlibc
+HURDLIBS = iohelp ports shouldbeinlibc
OBJS= $(sort $(subst .c,.o,$(SRCS)) $(MIGSTUBS))
LCLHDRS = trivfs.h fsmutations.h priv.h
MIGSFLAGS=-imacros $(srcdir)/fsmutations.h
diff --git a/libtrivfs/io-reauthenticate.c b/libtrivfs/io-reauthenticate.c
index 31a7c99b..3754ff72 100644
--- a/libtrivfs/io-reauthenticate.c
+++ b/libtrivfs/io-reauthenticate.c
@@ -70,7 +70,10 @@ trivfs_S_io_reauthenticate (struct trivfs_protid *cred,
do
err = io_restrict_auth (newcred->po->cntl->underlying, &newcred->realnode,
- gen_uids, genuidlen, gen_gids, gengidlen);
+ newcred->user->uids->ids,
+ newcred->user->uids->num,
+ newcred->user->gids->ids,
+ newcred->user->gids->num);
while (err == EINTR);
if (!err && trivfs_protid_create_hook)
{
diff --git a/libtrivfs/io-restrict-auth.c b/libtrivfs/io-restrict-auth.c
index 947f6953..a1324410 100644
--- a/libtrivfs/io-restrict-auth.c
+++ b/libtrivfs/io-restrict-auth.c
@@ -60,14 +60,14 @@ trivfs_S_io_restrict_auth (struct trivfs_protid *cred,
if (cred->isroot)
{
/* CRED has root access, and so may use any ids. */
- idvec_set (uvec, uids, nuids);
- idvec_set (gvec, gids, ngids);
+ idvec_set_ids (uvec, uids, nuids);
+ idvec_set_ids (gvec, gids, ngids);
}
else
{
/* Otherwise, use any of the requested ids that CRED already has. */
for (i = 0; i < cred->user->uids->num; i++)
- if (listmember (uids, cred->user->uids->id[i], nuids))
+ if (listmember (uids, cred->user->uids->ids[i], nuids))
idvec_add (uvec, cred->user->uids->ids[i]);
for (i = 0; i < cred->user->gids->num; i++)
if (listmember (gids, cred->user->gids->ids[i], ngids))
@@ -80,7 +80,7 @@ trivfs_S_io_restrict_auth (struct trivfs_protid *cred,
&newcred);
if (err)
{
- iouser_free_iouser (user);
+ iohelp_free_iouser (user);
return err;
}
diff --git a/libtrivfs/io-stat.c b/libtrivfs/io-stat.c
index aba8540a..6466e453 100644
--- a/libtrivfs/io-stat.c
+++ b/libtrivfs/io-stat.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1993, 1994 Free Software Foundation
+ Copyright (C) 1993, 1994, 1996 Free Software Foundation
This file is part of the GNU Hurd.
@@ -42,6 +42,7 @@ trivfs_S_io_stat (struct trivfs_protid *cred,
st->st_fstype = trivfs_fstype;
st->st_fsid = trivfs_fsid;
+ st->st_mode = (st->st_mode & ~S_IFMT) | S_IFCHR;
trivfs_modify_stat (cred, st);
}
diff --git a/libtrivfs/open.c b/libtrivfs/open.c
index 40665407..d28af8cf 100644
--- a/libtrivfs/open.c
+++ b/libtrivfs/open.c
@@ -1,6 +1,6 @@
/* Make a new trivfs peropen/protid
- Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -55,10 +55,8 @@ trivfs_open (struct trivfs_control *cntl,
sizeof (struct trivfs_protid), &new);
if (! err)
{
- int i;
-
new->user = user;
- if (idvec_contains (user, 0))
+ if (idvec_contains (user->uids, 0))
new->isroot = 1;
new->po = po;
diff --git a/libtrivfs/protid-clean.c b/libtrivfs/protid-clean.c
index b986fca0..b76b202e 100644
--- a/libtrivfs/protid-clean.c
+++ b/libtrivfs/protid-clean.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1994, 1995 Free Software Foundation
+ Copyright (C) 1994, 1995, 1996 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
@@ -44,8 +44,7 @@ trivfs_clean_protid (void *arg)
}
mutex_unlock (&cred->po->cntl->lock);
- free (cred->uids);
- free (cred->gids);
+ iohelp_free_iouser (cred->user);
if (cred->realnode != MACH_PORT_NULL)
mach_port_deallocate (mach_task_self (), cred->realnode);
diff --git a/libtrivfs/protid-dup.c b/libtrivfs/protid-dup.c
index 0aa62dbf..097ab55b 100644
--- a/libtrivfs/protid-dup.c
+++ b/libtrivfs/protid-dup.c
@@ -1,6 +1,6 @@
/* Duplicate a protid
- Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -42,13 +42,7 @@ trivfs_protid_dup (struct trivfs_protid *cred, struct trivfs_protid **dup)
new->isroot = cred->isroot;
- new->uids = malloc (cred->nuids * sizeof (uid_t));
- bcopy (cred->uids, new->uids, cred->nuids * sizeof (uid_t));
- new->nuids = cred->nuids;
-
- new->gids = malloc (cred->ngids * sizeof (gid_t));
- bcopy (cred->gids, new->gids, cred->ngids * sizeof (uid_t));
- new->ngids = cred->ngids;
+ new->user = iohelp_dup_iouser (cred->user);
new->realnode = cred->realnode;
mach_port_mod_refs (mach_task_self (), new->realnode,
diff --git a/libtrivfs/trivfs.h b/libtrivfs/trivfs.h
index 64a3c1f9..04e73e4a 100644
--- a/libtrivfs/trivfs.h
+++ b/libtrivfs/trivfs.h
@@ -23,6 +23,7 @@
#include <sys/types.h> /* for uid_t &c */
#include <mach/mach.h>
#include <hurd/ports.h>
+#include <hurd/iohelp.h>
struct trivfs_protid
{