summaryrefslogtreecommitdiff
path: root/pfinet
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-07-19 03:42:43 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-07-19 03:42:43 +0000
commit8ad48f6ce444648397d82b107cd196c24599d7cb (patch)
tree1dbc9e6c691521e74a48a9df2b7944366a4c0922 /pfinet
parentf030ef4e9d02fc0c88113a569773e49d629e9aa2 (diff)
*** empty log message ***
Diffstat (limited to 'pfinet')
-rw-r--r--pfinet/ChangeLog8
-rw-r--r--pfinet/io-ops.c10
-rw-r--r--pfinet/misc.c13
-rw-r--r--pfinet/socket-ops.c4
4 files changed, 26 insertions, 9 deletions
diff --git a/pfinet/ChangeLog b/pfinet/ChangeLog
index b2484ffb..c84fe38d 100644
--- a/pfinet/ChangeLog
+++ b/pfinet/ChangeLog
@@ -1,3 +1,11 @@
+Thu Jul 18 23:19:07 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu>
+
+ * misc.c (make_sock_user): New parm `noinstall'; if it's set use
+ non-installing version of ports_create_port. All callers
+ changed.
+ * io-ops.c (S_io_reauthenticate): Install NEWUSER port right into
+ portset after it's fully initialized.
+
Sat Jul 13 20:18:18 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu>
* io-ops.c (S_io_reauthenticate): Repeat auth_server_authenticate
diff --git a/pfinet/io-ops.c b/pfinet/io-ops.c
index 1ca158bb..72895065 100644
--- a/pfinet/io-ops.c
+++ b/pfinet/io-ops.c
@@ -373,7 +373,7 @@ S_io_reauthenticate (struct sock_user *user,
aux_gids = agbuf;
mutex_lock (&global_lock);
- newuser = make_sock_user (user->sock, 0);
+ newuser = make_sock_user (user->sock, 0, 1);
auth = getauth ();
newright = ports_get_right (newuser);
@@ -401,6 +401,10 @@ S_io_reauthenticate (struct sock_user *user,
for (i = 0; i < genuidlen; i++)
if (gen_uids[i] == 0)
newuser->isroot = 1;
+
+ mach_port_move_member (mach_task_self (), newuser->pi.port_right,
+ pfinet_bucket->portset);
+
mutex_unlock (&global_lock);
ports_port_deref (newuser);
@@ -445,7 +449,7 @@ S_io_restrict_auth (struct sock_user *user,
if (uids[i] == 0)
isroot = 1;
- newuser = make_sock_user (user->sock, isroot);
+ newuser = make_sock_user (user->sock, isroot, 0);
*newobject = ports_get_right (newuser);
*newobject_type = MACH_MSG_TYPE_MAKE_SEND;
ports_port_deref (newuser);
@@ -463,7 +467,7 @@ S_io_duplicate (struct sock_user *user,
return EOPNOTSUPP;
mutex_lock (&global_lock);
- newuser = make_sock_user (user->sock, user->isroot);
+ newuser = make_sock_user (user->sock, user->isroot, 0);
*newobject = ports_get_right (newuser);
*newobject_type = MACH_MSG_TYPE_MAKE_SEND;
ports_port_deref (newuser);
diff --git a/pfinet/misc.c b/pfinet/misc.c
index b1cf519b..6eb96b89 100644
--- a/pfinet/misc.c
+++ b/pfinet/misc.c
@@ -21,14 +21,19 @@
#include "pfinet.h"
#include <string.h>
-/* Create a sock_user structure, initialized from SOCK and ISROOT. */
+/* Create a sock_user structure, initialized from SOCK and ISROOT.
+ If NOINSTALL is set, don't put it in the portset. */
struct sock_user *
-make_sock_user (struct socket *sock, int isroot)
+make_sock_user (struct socket *sock, int isroot, int noinstall)
{
struct sock_user *user;
- errno = ports_create_port (socketport_class, pfinet_bucket,
- sizeof (struct sock_user), &user);
+ if (noinstall)
+ errno = ports_create_port_noinstall (socketport_class, pfinet_bucket,
+ sizeof (struct sock_user), &user);
+ else
+ errno = ports_create_port (socketport_class, pfinet_bucket,
+ sizeof (struct sock_user), &user);
if (errno)
return 0;
diff --git a/pfinet/socket-ops.c b/pfinet/socket-ops.c
index 968f927a..691dccfc 100644
--- a/pfinet/socket-ops.c
+++ b/pfinet/socket-ops.c
@@ -62,7 +62,7 @@ S_socket_create (struct trivfs_protid *master,
sock_release (sock);
else
{
- user = make_sock_user (sock, master->isroot);
+ user = make_sock_user (sock, master->isroot, 0);
*port = ports_get_right (user);
*porttype = MACH_MSG_TYPE_MAKE_SEND;
ports_port_deref (user);
@@ -146,7 +146,7 @@ S_socket_accept (struct sock_user *user,
if (err)
goto out;
- newuser = make_sock_user (newsock, user->isroot);
+ newuser = make_sock_user (newsock, user->isroot, 0);
*new_port = ports_get_right (newuser);
*new_port_type = MACH_MSG_TYPE_MAKE_SEND;
ports_port_deref (newuser);