commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 02/04: eth-multiplexer: Remove invalid permission check.


From: Samuel Thibault
Subject: [hurd] 02/04: eth-multiplexer: Remove invalid permission check.
Date: Mon, 24 Oct 2016 00:16:41 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch dde
in repository hurd.

commit b5654e5387b52f2beb58e621ee4d2bd8a61684da
Author: Justus Winter <address@hidden>
Date:   Sat Oct 15 18:09:19 2016 +0200

    eth-multiplexer: Remove invalid permission check.
    
    * eth-multiplexer/device_impl.c (ds_device_open): Do not check for the
    mode that was used to open the node.  We use the VFS as a namespace to
    look up servers.  The device protocol is independent from the file
    protocol.  Furthermore, EBADF is not a proper error for this protocol.
    
    Fixes handing multiplexed ethernet devices to Subhurds.
---
 eth-multiplexer/device_impl.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/eth-multiplexer/device_impl.c b/eth-multiplexer/device_impl.c
index 7d82b8d..b15a009 100644
--- a/eth-multiplexer/device_impl.c
+++ b/eth-multiplexer/device_impl.c
@@ -51,8 +51,6 @@ ds_device_open (mach_port_t master_port, mach_port_t 
reply_port,
                mach_msg_type_name_t *devicetype)
 {
   struct vether_device *dev;
-  int openstat; 
-  int right_mode = 1;
   struct protid *pi = ports_lookup_port (netfs_port_bucket, master_port, 0);
   if (pi == NULL)
     return D_NO_SUCH_DEVICE;
@@ -85,18 +83,8 @@ ds_device_open (mach_port_t master_port, mach_port_t 
reply_port,
     }
 
   dev = (struct vether_device *) pi->po->np->nn->ln;
-  /* check the mode */
-  openstat = pi->po->openstat;
-  if (mode & D_READ && !(openstat & O_READ))
-    right_mode = 0;
-  if (mode & D_WRITE && !(openstat & O_WRITE))
-    right_mode = 0;
-  ports_port_deref (pi);
-
   if (dev)
     {
-      if (!right_mode)
-       return EBADF;
       *device = dev->dev_port;
       *devicetype = MACH_MSG_TYPE_MAKE_SEND;
       return 0;

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]