<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>59217</bug_id>
          
          <creation_ts>2004-08-02 19:23 0000</creation_ts>
          <short_desc>Zope 2.7.2 - Permissions on /usr/lib/zope-2.7.2 set incorrectly</short_desc>
          <delta_ts>2004-09-20 04:19:32 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>Sparc</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>jtb68@netprodigy.com</reporter>
          <assigned_to>net-zope@gentoo.org</assigned_to>
          <cc>jesse@boldandbusted.com</cc>
    
    <cc>jtk@yahoo.com</cc>

      

      
          <long_desc isprivate="0">
            <who>jtb68@netprodigy.com</who>
            <bug_when>2004-08-02 19:23:24 0000</bug_when>
            <thetext>I performed an
ACCEPT_KEYWORDS=~sparc emerge zope

For some reason, the group was set to &quot;root&quot; for the entire /usr/lib/zope-2.7.2 tree.

The system is completely up to date (I ran &apos;emerge world&apos; recently).

I also managed to reproduce this on a X86 machine, which is a little less up to date (GLSA&apos;s have been updated, but not much else in about two months).

Reproducible: Always
Steps to Reproduce:
I did have Zope previously installed on the machine, performed the following: 
1) &quot;emerge unmerge zope&quot;
2) rm -Rf /usr/lib/zope-2.7.2
3) rm -Rf /var/lib/zope
4) rm /etc/conf.d/zope-2.7.2
5) rm /etc/init.d/zope-2.7.2
6) userdel zope
7) groupdel zope
8) ACCEPT_KEYWORDS=~x86 emerge zope
9) ls -al /usr/lib/zope-2.7.2
Actual Results:  
odin / # ls -al /usr/lib/zope-2.7.2/
total 60
drwxr-x---   6 root root  4096 Aug  2 22:15 .
drwxr-xr-x  87 root root 40960 Aug  2 22:15 ..
drwxr-x---   2 root root  4096 Aug  2 22:15 bin
drwxr-x---   2 root root  4096 Aug  2 22:15 import
drwxr-x---   3 root root  4096 Aug  2 22:15 lib
drwxr-x---   9 root root  4096 Aug  2 22:15 skel

Once I created a Zope instance, Zope would fail to continue startup once it
dropped privs and switched to the &quot;zope&quot; user due to the inability to read
program files.  Specifically, it failed when it tried to import
/usr/lib/zope-2.7.2/lib/python/Zope/Startup/misc/lock_file.py (unable to
traverse past zope-2.7.2).

This wasn&apos;t obvious (no logging anywhere) until I started
/var/lib/zope/zope-2.7.2/bin/zopectl and issued &quot;foreground&quot;.

Expected Results:  
Group ownership on the /usr/lib/zope-2.7.2 tree should be set to &quot;zope&quot;

Interestingly enough, if I skip steps #6 and #7 and re-emerge, it appears to set
the group ownership correctly.  Maybe the user/group is getting created too late
in the process for it to happen the first time around?  However, it won&apos;t modify
the ownership on an existing directory tree, you must remove the
/usr/lib/zope-2.7.2 tree and leave the zope user+group in place.

After doing steps 1-5,8-9 or 2-5,8-9 in the &apos;Steps to reproduce&apos;:

odin / # ls -al /usr/lib/zope-2.7.2/
total 60
drwxr-x---   6 root zope  4096 Aug  2 22:20 .
drwxr-xr-x  87 root root 40960 Aug  2 22:20 ..
drwxr-x---   2 root zope  4096 Aug  2 22:20 bin
drwxr-x---   2 root zope  4096 Aug  2 22:20 import
drwxr-x---   3 root zope  4096 Aug  2 22:20 lib
drwxr-x---   9 root zope  4096 Aug  2 22:20 skel</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>stan@saticed.me.uk</who>
            <bug_when>2004-08-04 06:09:18 0000</bug_when>
            <thetext>The permissions are set in the setup_security called at the end of src_install.  The zope group isn&apos;t added until after this has run (in pkg_preinst) - moving the  setup_security call to pkg_postinst could sort it out</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fodder@mattturner.us</who>
            <bug_when>2004-08-08 16:57:42 0000</bug_when>
            <thetext>I can confirm having similar permissions-related startup issues with Zope 2.7.2 on x86. This problem may not be confined to Sparc alone. Only by running zopectl with the &quot;foreground&quot; command did I determine that Zope could not reach the Python packages that it needed. Altering group ownership to &quot;zope&quot; for the /usr/lib/zope-2.7.2 tree solved the problem.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>carter.smithhart@gmail.com</who>
            <bug_when>2004-08-10 22:00:36 0000</bug_when>
            <thetext>Created an attachment (id=37193)
Patch to fix bug 59217 and 58562

Changes include:
- ZS_DIR and ZI_DIR should no longer have double slashes at beginning (fixes
bug 58562)
- all dir variables now have END slashes. Fixed a few places where it was
inconsistant.
- moved setup_security call from src_install into pkg_preinst. If
setup_security waits until pkg_postinst, the files are already merged into the
system. (fixes bug #59217)


Suggested change:
- a better way (?) to correctly delete .default.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>carter.smithhart@gmail.com</who>
            <bug_when>2004-08-10 22:09:16 0000</bug_when>
            <thetext>Another thing...

After I made the necessary fixes to the ebuild, I tried doing an emerge zope (while zope-2.7.2 was still installed) and none of the permissions got fixed.... Why is that?

Shouldn&apos;t the permissions from an ebuild&apos;s image overwrite whatever is on the system? Is this a philosophical question that should be moved to the forum? Or is this an &quot;emerge&quot; tool bug?

So what I had to do is emerge -C zope-2.7.2, then emerge zope and the permissions were fixed.. Weird.. I challenge somebody else to try this and see if I&apos;m right.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kerframil@gmail.com</who>
            <bug_when>2004-08-17 09:22:43 0000</bug_when>
            <thetext>&gt; So what I had to do is emerge -C zope-2.7.2, then emerge zope and the permissions
&gt; were fixed.. Weird.. I challenge somebody else to try this and see if I&apos;m right.

I tried out the zope-2.7.2.ebuild, having applied your patch, and can confirm that this is indeed the case. I removed /usr/lib/zope-2.7.2 prior to re-emerging to rectify the problem.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kerframil@gmail.com</who>
            <bug_when>2004-08-17 09:49:00 0000</bug_when>
            <thetext>By the way, these are the components I am now using (in the net-zope category):

net-zope/epoz-0.8.2 *
net-zope/plonetranslations-0.1 *
net-zope/formulator-1.6.2 *
net-zope/cmfquickinstallertool-1.5.0 *
net-zope/ploneerrorreporting-0.11 *
net-zope/plone-2.0.4 *
net-zope/portaltransforms-1.0.4 *
net-zope/cmfactionicons-0.9 *
net-zope/cmf-1.4.7 *
net-zope/groupuserfolder-2.0.1 *
net-zope/placelesstranslationservice-1.0_rc8 *
net-zope/zope-2.7.2 *
net-zope/cmfformcontroller-1.0.3_beta *
net-zope/btreefolder2-1.0.1 *
net-zope/externaleditor-0.8 *
net-zope/archetypes-1.2.5_rc5 *
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kerframil@gmail.com</who>
            <bug_when>2004-08-17 09:50:02 0000</bug_when>
            <thetext>Oops, wrong bug - meant that comment for bug 51825 ... sorry.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jmjoseph@andrew.cmu.edu</who>
            <bug_when>2004-09-10 06:33:46 0000</bug_when>
            <thetext>This bug has been stagnant for nearly a month now.  As the current ebuild is unusable and this patch works, can we get this patch into portage sooner than later?  It&apos;s not as if it&apos;s doing anything crazy.  It&apos;s fine if it remains masked ~x86 while any other issues are sorted out.

Thanks. -Jacob</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>lanius@gentoo.org</who>
            <bug_when>2004-09-11 13:43:00 0000</bug_when>
            <thetext>*** Bug 58562 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>lanius@gentoo.org</who>
            <bug_when>2004-09-11 14:07:44 0000</bug_when>
            <thetext>finally applied in zope-2.7.2-r1</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jwashin@vt.edu</who>
            <bug_when>2004-09-19 05:05:06 0000</bug_when>
            <thetext>Apparently, one too many slashes were removed in the ebuild.  zope-2.7.2-r2 improperly installs itself into /usr/libzope-2.7.2 instead of usr/lib/zope-2.7.2

Easy to fix with mv.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jesse@boldandbusted.com</who>
            <bug_when>2004-09-19 16:11:29 0000</bug_when>
            <thetext>Wow, got bitten by the &quot;too many slashes&quot; myself. Too bad I zapped my entire zope installation in attempting to fix that before seeing this bug... :(</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>batlogg@gentoo.org</who>
            <bug_when>2004-09-20 04:19:32 0000</bug_when>
            <thetext>added the missing slash - sorry :)
NOTE: the ebuild doesn&apos;t require zope-config as dependency. you still can use it, but it&apos;s not default anymore. the permissions in the /usr/lib are more restrictive... we treat zope like a &quot;normal&quot; library.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>37193</attachid>
            <date>2004-08-10 22:00 0000</date>
            <desc>Patch to fix bug 59217 and 58562</desc>
            <filename>zope-2.7.2.ebuild.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIC91c3IvcG9ydGFnZS9uZXQtem9wZS96b3BlL3pvcGUtMi43LjIuZWJ1aWxkCTIwMDQtMDgt
MDEgMTU6MzU6NDkuMDAwMDAwMDAwIC0wNzAwCisrKyAvdXNyL2xvY2FsL3BvcnRhZ2UvbmV0LXpv
cGUvem9wZS96b3BlLTIuNy4yLmVidWlsZAkyMDA0LTA4LTEwIDIxOjU0OjMwLjEyOTE2NzExMiAt
MDcwMApAQCAtMTAsNyArMTAsNyBAQAogTElDRU5TRT0iWlBMIgogU0xPVD0iJHtQVn0iCiAKLUtF
WVdPUkRTPSJ+eDg2IH5zcGFyYyB+cHBjIH5hbHBoYSB+YW1kNjQiCitLRVlXT1JEUz0ieDg2IH5z
cGFyYyB+cHBjIH5hbHBoYSB+YW1kNjQiCiBJVVNFPSJ1bmljb2RlIgogCiBSREVQRU5EPSI9ZGV2
LWxhbmcv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