r920 - in /zope-common/trunk: debian/changelog dzhandle

bzed-guest at users.alioth.debian.org bzed-guest at users.alioth.debian.org
Tue Jul 3 20:32:09 UTC 2007


Author: bzed-guest
Date: Tue Jul  3 20:32:09 2007
New Revision: 920

URL: http://svn.debian.org/wsvn/pkg-zope/?sc=1&rev=920
Log:
  * dzhandle:
    - take care of the user an instance is running as while
      adding new products/extensions instead of chowning
      them to the default zope:zope user (Closes: #431484)


Modified:
    zope-common/trunk/debian/changelog
    zope-common/trunk/dzhandle

Modified: zope-common/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-zope/zope-common/trunk/debian/changelog?rev=920&op=diff
==============================================================================
--- zope-common/trunk/debian/changelog (original)
+++ zope-common/trunk/debian/changelog Tue Jul  3 20:32:09 2007
@@ -2,8 +2,12 @@
 
   * Updating the German debconf template translation, thanks to
     Erik Schanze <eriks at debian.org> (Closes: #431343)
-
- -- Bernd Zeimetz <bernd at bzed.de>  Mon, 02 Jul 2007 01:07:11 +0200
+  * dzhandle:
+    - take care of the user an instance is running as while
+      adding new products/extensions instead of chowning
+      them to the default zope:zope user (Closes: #431484)
+
+ -- Bernd Zeimetz <bernd at bzed.de>  Tue, 03 Jul 2007 22:31:09 +0200
 
 zope-common (0.5.36) unstable; urgency=low
 

Modified: zope-common/trunk/dzhandle
URL: http://svn.debian.org/wsvn/pkg-zope/zope-common/trunk/dzhandle?rev=920&op=diff
==============================================================================
--- zope-common/trunk/dzhandle (original)
+++ zope-common/trunk/dzhandle Tue Jul  3 20:32:09 2007
@@ -1543,6 +1543,7 @@
         instance.set_addon_mode(self.options.amode)
         instance.set_addon_technique(self.options.atechnique)
         instance.set_restart_policy(self.options.restart)
+        instance.set_zope_user(self.options.srvuser.split(":"))
         instance.write_dzfile(uid=self.uid, gid=self.gid)
         if not instance.addon_installation_required():
             return
@@ -1833,6 +1834,7 @@
         self.restart_policy = None
         self.addon_mode = None
         self.excluded_addons = []
+        self.zope_user = None
         self.new_layout = os.path.exists(os.path.join(home, 'bin', 'runzope'))
         self.is_purged = False
         self.zeo = False
@@ -1937,7 +1939,7 @@
         try:
             self.set_zope_user(attrs['Zope-User'].split(':'))
         except KeyError:
-            self.zope_user = None
+            pass
         except ValueError, msg:
             raise DZError, "%s in `%s'" % (msg, fn)
 
@@ -1970,8 +1972,12 @@
 
     def add_addon(self, addon, global_options, addon_technique=None):
         if self.zope_user:
-            uid = self.zope_user[0]
-            gid = self.zope_user[1]
+            try:
+                uid, gid = self.zope_user
+                uid = pwd.getpwnam(uid)[2]
+                gid = grp.getgrnam(gid)[2]
+            except KeyError, msg:
+                self.error(msg)
         else:
             uid = uid=global_options.uid
             gid = global_options.gid




More information about the pkg-zope-commits mailing list