Wed Oct 8 19:13:41 2008 UTC ()
Apply changeset 18434 from upstream xen-3.3-testing tree.
This fixes security issue http://secunia.com/advisories/32064/


(cegger)
diff -r1.9 -r1.10 pkgsrc/sysutils/xentools33/Makefile
diff -r1.12 -r1.13 pkgsrc/sysutils/xentools33/distinfo
diff -r0 -r1.1 pkgsrc/sysutils/xentools33/patches/patch-ga
diff -r0 -r1.1 pkgsrc/sysutils/xentools33/patches/patch-gb
diff -r0 -r1.1 pkgsrc/sysutils/xentools33/patches/patch-gc
diff -r0 -r1.1 pkgsrc/sysutils/xentools33/patches/patch-gd

cvs diff -r1.9 -r1.10 pkgsrc/sysutils/xentools33/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/sysutils/xentools33/Attic/Makefile 2008/09/30 15:08:34 1.9
+++ pkgsrc/sysutils/xentools33/Attic/Makefile 2008/10/08 19:13:41 1.10
@@ -1,20 +1,20 @@ @@ -1,20 +1,20 @@
1# $NetBSD: Makefile,v 1.9 2008/09/30 15:08:34 joerg Exp $ 1# $NetBSD: Makefile,v 1.10 2008/10/08 19:13:41 cegger Exp $
2# 2#
3 3
4VERSION= 3.3.0 4VERSION= 3.3.0
5DISTNAME= xen-${VERSION} 5DISTNAME= xen-${VERSION}
6PKGNAME= xentools33-${VERSION} 6PKGNAME= xentools33-${VERSION}
7PKGREVISION= 1 7PKGREVISION= 2
8CATEGORIES= sysutils 8CATEGORIES= sysutils
9MASTER_SITES= http://bits.xensource.com/oss-xen/release/${VERSION}/ 9MASTER_SITES= http://bits.xensource.com/oss-xen/release/${VERSION}/
10EXTRACT_SUFX= .tar.gz 10EXTRACT_SUFX= .tar.gz
11 11
12MAINTAINER= cegger@NetBSD.org 12MAINTAINER= cegger@NetBSD.org
13HOMEPAGE= http://xen.org/ 13HOMEPAGE= http://xen.org/
14COMMENT= Userland Tools for Xen 3.3.x 14COMMENT= Userland Tools for Xen 3.3.x
15 15
16PKG_DESTDIR_SUPPORT= user-destdir 16PKG_DESTDIR_SUPPORT= user-destdir
17 17
18#DEPENDS+= ${PYPKGPREFIX}-twisted-[0-9]*:../../net/py-twisted 18#DEPENDS+= ${PYPKGPREFIX}-twisted-[0-9]*:../../net/py-twisted
19DEPENDS+= ${PYPKGPREFIX}-readline-[0-9]*:../../devel/py-readline 19DEPENDS+= ${PYPKGPREFIX}-readline-[0-9]*:../../devel/py-readline
20 20

cvs diff -r1.12 -r1.13 pkgsrc/sysutils/xentools33/Attic/distinfo (expand / switch to unified diff)

--- pkgsrc/sysutils/xentools33/Attic/distinfo 2008/09/30 15:08:34 1.12
+++ pkgsrc/sysutils/xentools33/Attic/distinfo 2008/10/08 19:13:41 1.13
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: distinfo,v 1.12 2008/09/30 15:08:34 joerg Exp $ 1$NetBSD: distinfo,v 1.13 2008/10/08 19:13:41 cegger Exp $
2 2
3SHA1 (xen-3.3.0.tar.gz) = b6365864eeb5125e0f66a056c4c72816e1789358 3SHA1 (xen-3.3.0.tar.gz) = b6365864eeb5125e0f66a056c4c72816e1789358
4RMD160 (xen-3.3.0.tar.gz) = c98c08617e302ef4004d17cb0ba161d0ed7af59c 4RMD160 (xen-3.3.0.tar.gz) = c98c08617e302ef4004d17cb0ba161d0ed7af59c
5Size (xen-3.3.0.tar.gz) = 11338614 bytes 5Size (xen-3.3.0.tar.gz) = 11338614 bytes
6SHA1 (patch-aa) = 74c3023e39baf488f8bae060e93f6175b32df61a 6SHA1 (patch-aa) = 74c3023e39baf488f8bae060e93f6175b32df61a
7SHA1 (patch-ab) = a6244d421dc995c9bcbc9959de422972f9d46b6d 7SHA1 (patch-ab) = a6244d421dc995c9bcbc9959de422972f9d46b6d
8SHA1 (patch-ac) = 70af1b1a787b9dad9e41a2ffe14d595c6797b4d7 8SHA1 (patch-ac) = 70af1b1a787b9dad9e41a2ffe14d595c6797b4d7
9SHA1 (patch-ad) = 323e854e5872e770580068fa93a74bd0b1531025 9SHA1 (patch-ad) = 323e854e5872e770580068fa93a74bd0b1531025
10SHA1 (patch-ae) = bb7116a71bf6637591b639511f055836a13d9887 10SHA1 (patch-ae) = bb7116a71bf6637591b639511f055836a13d9887
11SHA1 (patch-af) = 5995f0f8ee9cf40c8ac43d02568d942430993b3e 11SHA1 (patch-af) = 5995f0f8ee9cf40c8ac43d02568d942430993b3e
12SHA1 (patch-ag) = 6b6c26c5fbb28b9cc37e76b250cc90fed111e78a 12SHA1 (patch-ag) = 6b6c26c5fbb28b9cc37e76b250cc90fed111e78a
13SHA1 (patch-ah) = cc8d95c73d7f4a08f311e8417d26f53ffd010549 13SHA1 (patch-ah) = cc8d95c73d7f4a08f311e8417d26f53ffd010549
14SHA1 (patch-ai) = 0906a5ec3a7450fc987b01289e2560e60966d00d 14SHA1 (patch-ai) = 0906a5ec3a7450fc987b01289e2560e60966d00d
@@ -39,13 +39,17 @@ SHA1 (patch-de) = 0f2b717b2ae14ce128c361 @@ -39,13 +39,17 @@ SHA1 (patch-de) = 0f2b717b2ae14ce128c361
39SHA1 (patch-df) = 46b99d00c6562c41e5fd96df8dbcb0653c1baa46 39SHA1 (patch-df) = 46b99d00c6562c41e5fd96df8dbcb0653c1baa46
40SHA1 (patch-ea) = 4c5cd6bd798488c13a264b567a67aa7cb5f8a2e4 40SHA1 (patch-ea) = 4c5cd6bd798488c13a264b567a67aa7cb5f8a2e4
41SHA1 (patch-eb) = cf63c43ccbc6b7b435be871e392f9729bd392ab4 41SHA1 (patch-eb) = cf63c43ccbc6b7b435be871e392f9729bd392ab4
42SHA1 (patch-ec) = ec7745d92a74a7101391e07508a4ede9a72fd1d1 42SHA1 (patch-ec) = ec7745d92a74a7101391e07508a4ede9a72fd1d1
43SHA1 (patch-ed) = 613f4c4605af860e5f88b68c49a0e7870ba6ecde 43SHA1 (patch-ed) = 613f4c4605af860e5f88b68c49a0e7870ba6ecde
44SHA1 (patch-ee) = 119029fda1d4ecee90d0a108151596cb3ef0ec74 44SHA1 (patch-ee) = 119029fda1d4ecee90d0a108151596cb3ef0ec74
45SHA1 (patch-ef) = c8740b1c9cfac686f2e4e32c7613b5f02206459d 45SHA1 (patch-ef) = c8740b1c9cfac686f2e4e32c7613b5f02206459d
46SHA1 (patch-eg) = 84e816c95167828314ef901e324772249a407c41 46SHA1 (patch-eg) = 84e816c95167828314ef901e324772249a407c41
47SHA1 (patch-fa) = b4a4b7334357ebcd1646886c18c9772e8b9ae765 47SHA1 (patch-fa) = b4a4b7334357ebcd1646886c18c9772e8b9ae765
48SHA1 (patch-fb) = 22a07628566b43aa786c410927d29a283e8cf141 48SHA1 (patch-fb) = 22a07628566b43aa786c410927d29a283e8cf141
49SHA1 (patch-fc) = 37c9b0897182de93a01f9620ef6346ef68157770 49SHA1 (patch-fc) = 37c9b0897182de93a01f9620ef6346ef68157770
50SHA1 (patch-fd) = cb4741bf33050d72cfbcd2eff4a8632d976de643 50SHA1 (patch-fd) = cb4741bf33050d72cfbcd2eff4a8632d976de643
51SHA1 (patch-fe) = 85d42672766fe8ce2dc7f745938722710c6ee5a3 51SHA1 (patch-fe) = 85d42672766fe8ce2dc7f745938722710c6ee5a3
 52SHA1 (patch-ga) = c7a32f0feefd9b00993e64e406ad2914e6737fb6
 53SHA1 (patch-gb) = 3018ec50cdfcc73effbd53b19387bbed9ce46f9c
 54SHA1 (patch-gc) = 26a750ca14bcaa33b3f63c16104d2acfae764c96
 55SHA1 (patch-gd) = 78e9bcba7dbd2dbd520c015947240b7e514abf8c

File Added: pkgsrc/sysutils/xentools33/patches/Attic/patch-ga
$NetBSD: patch-ga,v 1.1 2008/10/08 19:13:41 cegger Exp $

--- python/xen/xend/XendDomainInfo.py.orig	2008-08-22 09:49:08.000000000 +0000
+++ python/xen/xend/XendDomainInfo.py
@@ -455,8 +455,8 @@ class XendDomainInfo:
             try:
                 self._constructDomain()
                 self._storeVmDetails()
-                self._createDevices()
                 self._createChannels()
+                self._createDevices()
                 self._storeDomDetails()
                 self._endRestore()
             except:
@@ -1232,31 +1232,6 @@ class XendDomainInfo:
     def permissionsVm(self, *args):
         return xstransact.SetPermissions(self.vmpath, *args)
 
-
-    def _readVmTxn(self, transaction,  *args):
-        paths = map(lambda x: self.vmpath + "/" + x, args)
-        return transaction.read(*paths)
-
-    def _writeVmTxn(self, transaction,  *args):
-        paths = map(lambda x: self.vmpath + "/" + x, args)
-        return transaction.write(*paths)
-
-    def _removeVmTxn(self, transaction,  *args):
-        paths = map(lambda x: self.vmpath + "/" + x, args)
-        return transaction.remove(*paths)
-
-    def _gatherVmTxn(self, transaction,  *args):
-        paths = map(lambda x: self.vmpath + "/" + x, args)
-        return transaction.gather(paths)
-
-    def storeVmTxn(self, transaction,  *args):
-        paths = map(lambda x: self.vmpath + "/" + x, args)
-        return transaction.store(*paths)
-
-    def permissionsVmTxn(self, transaction,  *args):
-        paths = map(lambda x: self.vmpath + "/" + x, args)
-        return transaction.set_permissions(*paths)
-
     #
     # Function to update xenstore /dom/*
     #
@@ -1304,8 +1279,11 @@ class XendDomainInfo:
     def _recreateDomFunc(self, t):
         t.remove()
         t.mkdir()
-        t.set_permissions({'dom' : self.domid})
+        t.set_permissions({'dom' : self.domid, 'read' : True})
         t.write('vm', self.vmpath)
+        for i in [ 'device', 'control', 'error' ]:
+            t.mkdir(i)
+            t.set_permissions(i, {'dom' : self.domid})
 
     def _storeDomDetails(self):
         to_store = {
@@ -2390,11 +2368,11 @@ class XendDomainInfo:
 
         paths = self._prepare_phantom_paths()
 
-        self._cleanupVm()
         if self.dompath is not None:
             self.destroyDomain()
 
         self._cleanup_phantom_devs(paths)
+        self._cleanupVm()
 
         if "transient" in self.info["other_config"] \
            and bool(self.info["other_config"]["transient"]):
@@ -2731,7 +2709,6 @@ class XendDomainInfo:
         self._writeVm(to_store)
         self._setVmPermissions()
 
-
     def _setVmPermissions(self):
         """Allow the guest domain to read its UUID.  We don't allow it to
         access any other entry, for security."""
@@ -2750,7 +2727,7 @@ class XendDomainInfo:
              log.warn("".join(traceback.format_stack()))
              return self._stateGet()
          else:
-             raise AttributeError()
+             raise AttributeError(name)
 
     def __setattr__(self, name, value):
         if name == "state":
@@ -2864,12 +2841,6 @@ class XendDomainInfo:
                                   ignore_devices = ignore_store,
                                   legacy_only = legacy_only)
 
-        #if not ignore_store and self.dompath:
-        #    vnc_port = self.readDom('console/vnc-port')
-        #    if vnc_port is not None:
-        #        result.append(['device',
-        #                       ['console', ['vnc-port', str(vnc_port)]]])
-
         return result
 
     # Xen API
@@ -3135,7 +3106,7 @@ class XendDomainInfo:
             if not config.has_key('device'):
                 devid = config.get('id')
                 if devid != None:
-                    config['device'] = 'eth%d' % devid
+                    config['device'] = 'eth%s' % devid
                 else:
                     config['device'] = ''
 

File Added: pkgsrc/sysutils/xentools33/patches/Attic/patch-gb
$NetBSD: patch-gb,v 1.1 2008/10/08 19:13:41 cegger Exp $

--- python/xen/xend/image.py.orig	2008-08-22 09:49:08.000000000 +0000
+++ python/xen/xend/image.py
@@ -502,7 +502,7 @@ class ImageHandler:
         if fifo_fd >= 0:
             self._openSentinel(sentinel_path_fifo)
             os.close(fifo_fd)
-            self.pid = self.vm.gatherDom(('image/device-model-pid', int))
+            self.pid = self.vm._gatherDom(('image/device-model-pid', int))
             log.debug("%s device model rediscovered, pid %s sentinel fifo %s",
                     name, self.pid, sentinel_path_fifo)
             self.sentinel_thread = thread.start_new_thread(self._sentinel_watch,())

File Added: pkgsrc/sysutils/xentools33/patches/Attic/patch-gc
$NetBSD: patch-gc,v 1.1 2008/10/08 19:13:41 cegger Exp $

--- python/xen/xend/server/DevController.py.orig	2008-08-22 09:49:08.000000000 +0000
+++ python/xen/xend/server/DevController.py
@@ -126,8 +126,11 @@ class DevController:
                     log.debug(
                       'DevController: still waiting to write device entries.')
 
+                devpath = self.devicePath(devid)
+
                 t.remove(frontpath)
                 t.remove(backpath)
+                t.remove(devpath)
 
                 t.mkdir(backpath)
                 t.set_permissions(backpath,
@@ -142,6 +145,14 @@ class DevController:
                 t.write2(frontpath, front)
                 t.write2(backpath,  back)
 
+                t.mkdir(devpath)
+                t.write2(devpath, {
+                    'backend' : backpath,
+                    'backend-id' : "%i" % backdom,
+                    'frontend' : frontpath,
+                    'frontend-id' : "%i" % self.vm.getDomid()
+                })
+
                 if t.commit():
                     return devid
 
@@ -254,11 +265,12 @@ class DevController:
 
         if force:
             frontpath = self.frontendPath(dev)
-            backpath = xstransact.Read(frontpath, "backend")
+            backpath = self.readVm(devid, "backend")
             if backpath:
                 xstransact.Remove(backpath)
             xstransact.Remove(frontpath)
 
+        # xstransact.Remove(self.devicePath()) ?? Below is the same ?
         self.vm._removeVm("device/%s/%d" % (self.deviceClass, dev))
 
     def configurations(self, transaction = None):
@@ -302,9 +314,10 @@ class DevController:
         @return: dict
         """
         if transaction is None:
-            backdomid = xstransact.Read(self.frontendPath(devid), "backend-id")
+            backdomid = xstransact.Read(self.devicePath(devid), "backend-id")
         else:
-            backdomid = transaction.read(self.frontendPath(devid) + "/backend-id")
+            backdomid = transaction.read(self.devicePath(devid) + "/backend-id")
+
         if backdomid is None:
             raise VmError("Device %s not connected" % devid)
 
@@ -446,17 +459,22 @@ class DevController:
         else:
             raise VmError("Device %s not connected" % devid)
 
+    def readVm(self, devid, *args):
+        devpath = self.devicePath(devid)
+        if devpath:
+            return xstransact.Read(devpath, *args)
+        else:
+            raise VmError("Device config %s not found" % devid)
+
     def readBackend(self, devid, *args):
-        frontpath = self.frontendPath(devid)
-        backpath = xstransact.Read(frontpath, "backend")
+        backpath = self.readVm(devid, "backend")
         if backpath:
             return xstransact.Read(backpath, *args)
         else:
             raise VmError("Device %s not connected" % devid)
 
     def readBackendTxn(self, transaction, devid, *args):
-        frontpath = self.frontendPath(devid)
-        backpath = transaction.read(frontpath + "/backend")
+        backpath = self.readVm(devid, "backend")
         if backpath:
             paths = map(lambda x: backpath + "/" + x, args)
             return transaction.read(*paths)
@@ -474,7 +492,7 @@ class DevController:
         """@return The IDs of each of the devices currently configured for
         this instance's deviceClass.
         """
-        fe = self.backendRoot()
+        fe = self.deviceRoot()
 
         if transaction:
             return map(lambda x: int(x.split('/')[-1]), transaction.list(fe))
@@ -483,8 +501,7 @@ class DevController:
 
 
     def writeBackend(self, devid, *args):
-        frontpath = self.frontendPath(devid)
-        backpath = xstransact.Read(frontpath, "backend")
+        backpath = self.readVm(devid, "backend")
 
         if backpath:
             xstransact.Write(backpath, *args)
@@ -549,9 +566,8 @@ class DevController:
 
 
     def waitForBackend(self, devid):
-
         frontpath = self.frontendPath(devid)
-        # lookup a phantom 
+        # lookup a phantom
         phantomPath = xstransact.Read(frontpath, 'phantom_vbd')
         if phantomPath is not None:
             log.debug("Waiting for %s's phantom %s.", devid, phantomPath)
@@ -564,7 +580,7 @@ class DevController:
             if result['status'] != 'Connected':
                 return (result['status'], err)
             
-        backpath = xstransact.Read(frontpath, "backend")
+        backpath = self.readVm(devid, "backend")
 
 
         if backpath:
@@ -629,17 +645,20 @@ class DevController:
     def frontendRoot(self):
         return "%s/device/%s" % (self.vm.getDomainPath(), self.deviceClass)
 
-    def backendRoot(self):
-        """Construct backend root path assuming backend is domain 0."""
-        from xen.xend.XendDomain import DOM0_ID
-        from xen.xend.xenstore.xsutil import GetDomainPath
-        return "%s/backend/%s/%s" % (GetDomainPath(DOM0_ID),
-                                     self.deviceClass, self.vm.getDomid())
-
     def frontendMiscPath(self):
         return "%s/device-misc/%s" % (self.vm.getDomainPath(),
                                       self.deviceClass)
 
+    def deviceRoot(self):
+        """Return the /vm/device. Because backendRoot assumes the
+        backend domain is 0"""
+        return "%s/device/%s" % (self.vm.vmpath, self.deviceClass)
+
+    def devicePath(self, devid):
+        """Return the /device entry of the given VM. We use it to store
+        backend/frontend locations"""
+        return "%s/device/%s/%s" % (self.vm.vmpath,
+                                    self.deviceClass, devid)
 
 def hotplugStatusCallback(statusPath, ev, result):
     log.debug("hotplugStatusCallback %s.", statusPath)

File Added: pkgsrc/sysutils/xentools33/patches/Attic/patch-gd
$NetBSD: patch-gd,v 1.1 2008/10/08 19:13:41 cegger Exp $

--- python/xen/xend/server/netif.py.orig	2008-08-22 09:49:08.000000000 +0000
+++ python/xen/xend/server/netif.py
@@ -142,10 +142,6 @@ class NetifController(DevController):
         if sec_lab:
             back['security_label'] = sec_lab
 
-        config_path = "device/%s/%d/" % (self.deviceClass, devid)
-        for x in back:
-            self.vm._writeVm(config_path + x, back[x])
-
         back['handle'] = "%i" % devid
         back['script'] = os.path.join(xoptions.network_script_dir, script)
         if rate:
@@ -189,40 +185,14 @@ class NetifController(DevController):
 
         result = DevController.getDeviceConfiguration(self, devid, transaction)
 
-        config_path = "device/%s/%d/" % (self.deviceClass, devid)
-        devinfo = ()
         for x in ( 'script', 'ip', 'bridge', 'mac',
                    'type', 'vifname', 'rate', 'uuid', 'model', 'accel',
                    'security_label'):
             if transaction is None:
-                y = self.vm._readVm(config_path + x)
+                y = self.readBackend(devid, x)
             else:
-                y = self.vm._readVmTxn(transaction, config_path + x)
-            devinfo += (y,)
-        (script, ip, bridge, mac, typ, vifname, rate, uuid,
-         model, accel, security_label) = devinfo
-
-        if script:
-            result['script'] = script
-        if ip:
-            result['ip'] = ip
-        if bridge:
-            result['bridge'] = bridge
-        if mac:
-            result['mac'] = mac
-        if typ:
-            result['type'] = typ
-        if vifname:
-            result['vifname'] = vifname
-        if rate:
-            result['rate'] = rate
-        if uuid:
-            result['uuid'] = uuid
-        if model:
-            result['model'] = model
-        if accel:
-            result['accel'] = accel
-        if security_label:
-            result['security_label'] = security_label
+                y = self.readBackendTxn(transaction, devid, x)
+            if y:
+                result[x] = y
 
         return result