Commit 76915efb authored by Antoine Millet's avatar Antoine Millet
Browse files

Added right checking for rshell* and forward functions

parent 6f939397
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -674,6 +674,7 @@ class CliHandler(RegisteredCCHandler):
        :param tql: tql matching only one object on which start the rshell
        :return: the label of the created tunnel
        """
        self.check('rshell', tql)
        objects = self.server.list(tql, show=('r', 'p'))
        if len(objects) != 1:
            raise NotImplementedError('Rshell only support one tunnel at time for now')
@@ -700,6 +701,7 @@ class CliHandler(RegisteredCCHandler):
        :param xpixel: unused
        :param ypixel: unused
        """
        self.check('rshell')
        ttype, client, ctun, stun = self.client.get_tunnel(label)
        if ttype != 'rshell':
            raise ValueError('Label does not refers on a rshell')
@@ -709,6 +711,7 @@ class CliHandler(RegisteredCCHandler):
    def rshell_wait(self, label):
        """ Wait for a remote shell termination.
        """
        self.check('rshell')
        ttype, client, ctun, stun = self.client.get_tunnel(label)
        if ttype != 'rshell':
            raise ValueError('Label does not refers on a rshell')
@@ -731,6 +734,7 @@ class CliHandler(RegisteredCCHandler):
        :param port: port on which establish the tunnel on destination
        :param destination: tunnel destination (from the remote client side)
        """
        self.check('forward', 'id=%s' % login)
        # Create the tunnel to the node:
        try:
            host_client = self.server.get_client(login)