diff --git a/gns3server/modules/dynamips/__init__.py b/gns3server/modules/dynamips/__init__.py index 4fe702dd..af5d72f9 100644 --- a/gns3server/modules/dynamips/__init__.py +++ b/gns3server/modules/dynamips/__init__.py @@ -125,7 +125,7 @@ class Dynamips(IModule): def stop(self, signum=None): """ Properly stops the module. - + :param signum: signal number (if called by the signal handler) """ diff --git a/gns3server/modules/iou/__init__.py b/gns3server/modules/iou/__init__.py index bba1ee97..0a05d916 100644 --- a/gns3server/modules/iou/__init__.py +++ b/gns3server/modules/iou/__init__.py @@ -107,7 +107,7 @@ class IOU(IModule): def stop(self, signum=None): """ Properly stops the module. - + :param signum: signal number (if called by the signal handler) """ @@ -548,6 +548,30 @@ class IOU(IModule): response["port_id"] = request["port_id"] self.send_response(response) + def _check_for_privileged_access(self, device): + """ + Check if iouyap can access Ethernet and TAP devices. + + :param device: device name + """ + + # we are root, so iouyap should have privileged access too + if os.geteuid() == 0: + return + + # test if iouyap has the CAP_NET_RAW capability + if "security.capability" in os.listxattr(self._iouyap): + try: + caps = os.getxattr(self._iouyap, "security.capability") + # test the 2nd byte and check if the 13th bit (CAP_NET_RAW) is set + if struct.unpack("\s+not found")