[MacPorts] #32312: subversion-python27bindings: initialization fails for user macports
#32312: subversion-python27bindings: initialization fails for user macports --------------------------------+------------------------------------------- Reporter: titus@… | Owner: blair@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: | Port: subversion-python27bindings --------------------------------+------------------------------------------- When this package is initialized it tries to open the file ~<sudoer>/.subversion/server. This fails if the user sudoed to is underprivileged for this directory, as e.g. on my machine the user macports. steps to reproduce: cd ~ chmod 700 .subversion curl -o hgsubversion-1.3.tar.gz http://pypi.python.org/packages/source/h/hgsubversion/hgsubversion-1.3.tar.g... tar xzf hgsubversion-1.3.tar.gz cd hgsubversion-1.3 sudo -u macports /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build -- Ticket URL: <https://trac.macports.org/ticket/32312> MacPorts <http://www.macports.org/> Ports system for Mac OS
#32312: subversion-python27bindings: initialization fails for user macports --------------------------------+------------------------------------------- Reporter: titus@… | Owner: blair@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: | Port: subversion-python27bindings --------------------------------+------------------------------------------- Comment(by dluke@…): Following your steps, I get: {{{ IOError: [Errno 13] Permission denied: '/Volumes/Extra/dluke/hgsubversion-1.3/hgsubversion.egg- info/top_level.txt' }}} If I chmod -R macports hgsubversion (after extracting), I get: {{{ % sudo -u macports /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build running build running build_py creating build creating build/lib creating build/lib/hgsubversion copying hgsubversion/__init__.py -> build/lib/hgsubversion copying hgsubversion/__version__.py -> build/lib/hgsubversion copying hgsubversion/editor.py -> build/lib/hgsubversion copying hgsubversion/maps.py -> build/lib/hgsubversion copying hgsubversion/pushmod.py -> build/lib/hgsubversion copying hgsubversion/replay.py -> build/lib/hgsubversion copying hgsubversion/stupid.py -> build/lib/hgsubversion copying hgsubversion/svncommands.py -> build/lib/hgsubversion copying hgsubversion/svnexternals.py -> build/lib/hgsubversion copying hgsubversion/svnmeta.py -> build/lib/hgsubversion copying hgsubversion/svnrepo.py -> build/lib/hgsubversion copying hgsubversion/util.py -> build/lib/hgsubversion copying hgsubversion/wrappers.py -> build/lib/hgsubversion creating build/lib/hgsubversion/svnwrap copying hgsubversion/svnwrap/__init__.py -> build/lib/hgsubversion/svnwrap copying hgsubversion/svnwrap/common.py -> build/lib/hgsubversion/svnwrap copying hgsubversion/svnwrap/subvertpy_wrapper.py -> build/lib/hgsubversion/svnwrap copying hgsubversion/svnwrap/svn_swig_wrapper.py -> build/lib/hgsubversion/svnwrap }}} Maybe including the actual error you get (and/or how you figured out that failing to access ~/.subversion/servers was the problem) would help? I imagine that access is actually coming from the subversion client (C) libraries, and should be able to handle the case where it can't access the file... Of course, the default permissions for ~/.subversion aren't 700 either (and ~/.subversion/servers is normally world-readable), so it's possible that you've discovered problem that upstream hasn't noticed yet. -- Ticket URL: <https://trac.macports.org/ticket/32312#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#32312: subversion-python27bindings: initialization fails for user macports --------------------------------+------------------------------------------- Reporter: titus@… | Owner: blair@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: | Port: subversion-python27bindings --------------------------------+------------------------------------------- Comment(by dluke@…): I also ran fs_usage against macports python2.7 while doing 'import svn' and it didn't attempt to read anything from ~/.subverison -- Ticket URL: <https://trac.macports.org/ticket/32312#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#32312: subversion-python27bindings: initialization fails for user macports --------------------------------+------------------------------------------- Reporter: titus@… | Owner: blair@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: | Port: subversion-python27bindings --------------------------------+------------------------------------------- Comment(by titus@…): Yes, I forgot to mention the chown -R macports hgsubversion-1.3 Did you install subversion-python27bindings? It has to be installed + activated. The problem is: {{{ Traceback (most recent call last): File "setup.py", line 105, in <module> from hgsubversion.svnwrap import svn_swig_wrapper File "/private/tmp/hgsubversion-1.3/hgsubversion/__init__.py", line 58, in <module> import svncommands File "/private/tmp/hgsubversion-1.3/hgsubversion/svncommands.py", line 14, in <module> import svnwrap File "/private/tmp/hgsubversion-1.3/hgsubversion/svnwrap/__init__.py", line 28, in <module> from svn_swig_wrapper import * File "/private/tmp/hgsubversion-1.3/hgsubversion/svnwrap/svn_swig_wrapper.py", line 60, in <module> svn_config = core.svn_config_get_config(None) File "/opt/local/lib/svn-python2.7/libsvn/core.py", line 3864, in svn_config_get_config return _core.svn_config_get_config(*args) svn.core.SubversionException: 13 - Kann Datei »/Users/titus/.subversion/servers« nicht öffnen: Permission denied }}} -- Ticket URL: <https://trac.macports.org/ticket/32312#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#32312: subversion-python27bindings: initialization fails for user macports --------------------------------+------------------------------------------- Reporter: titus@… | Owner: blair@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: | Port: subversion-python27bindings --------------------------------+------------------------------------------- Comment(by dluke@…): I do have it installed and activated. Your output doesn't give me anything to try to reproduce the issue (you don't include the command you're running, so I guess I can only assume it's the same as the one I ran). Your instructions don't reproduce the issue for me. Perhaps there is something different with your setup? Perhaps the permissions on ~/.subversion aren't the issue? This does look like the same issue as #30360. I think it's probably actually an issue with hgsubversion (possibly, you could argue that it's an upstream issue with the implementation of svn_config_get_config). -- Ticket URL: <https://trac.macports.org/ticket/32312#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#32312: subversion-python27bindings: initialization fails for user macports --------------------------------+------------------------------------------- Reporter: titus@… | Owner: blair@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: | Port: subversion-python27bindings --------------------------------+------------------------------------------- Comment(by dluke@…): Here is a simple reproduction of the issue you are seeing: {{{ % python2.7 Python 2.7.2 (default, Nov 22 2011, 09:49:02) [GCC 4.2.1 Compatible Apple Clang 3.0 (tags/Apple/clang-211.12)] on darwin Type "help", "copyright", "credits" or "license" for more information.
from svn import core core.svn_config_get_config(None) {'config': <libsvn.core.svn_config_t; proxy of <Swig Object of type 'svn_config_t *' at 0x10ecdded0> >, 'servers': <libsvn.core.svn_config_t; proxy of <Swig Object of type 'svn_config_t *' at 0x10ecddfc0> >} ^D [xeon:~] dluke% chmod 000 .subversion/ [xeon:~] dluke% python2.7 Python 2.7.2 (default, Nov 22 2011, 09:49:02) [GCC 4.2.1 Compatible Apple Clang 3.0 (tags/Apple/clang-211.12)] on darwin Type "help", "copyright", "credits" or "license" for more information. from svn import core core.svn_config_get_config(None) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/lib/svn-python2.7/libsvn/core.py", line 3864, in svn_config_get_config return _core.svn_config_get_config(*args) svn.core.SubversionException: 13 - Can't open file '/Volumes/Extra/dluke/.subversion/servers': Permission denied }}}
-- Ticket URL: <https://trac.macports.org/ticket/32312#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#32312: subversion-python27bindings: initialization fails for user macports --------------------------------+------------------------------------------- Reporter: titus@… | Owner: blair@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: | Port: subversion-python27bindings --------------------------------+------------------------------------------- Comment(by dluke@…): further: svn_config_get_config is called from hgsubversion/svnwrap/svn_swig_wrapper.py which doesn't appear to be run when you build hgsubversion. I tested again with ~/.subversion chmod'd to 000 and it built fine again for me. -- Ticket URL: <https://trac.macports.org/ticket/32312#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#32312: subversion-python27bindings: initialization fails for user macports --------------------------------+------------------------------------------- Reporter: titus@… | Owner: blair@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: | Port: subversion-python27bindings --------------------------------+------------------------------------------- Description changed by ryandesign@…: Old description:
When this package is initialized it tries to open the file ~<sudoer>/.subversion/server. This fails if the user sudoed to is underprivileged for this directory, as e.g. on my machine the user macports.
steps to reproduce:
cd ~
chmod 700 .subversion
curl -o hgsubversion-1.3.tar.gz http://pypi.python.org/packages/source/h/hgsubversion/hgsubversion-1.3.tar.g...
tar xzf hgsubversion-1.3.tar.gz
cd hgsubversion-1.3
sudo -u macports /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build
New description: When this package is initialized it tries to open the file ~<sudoer>/.subversion/server. This fails if the user sudoed to is underprivileged for this directory, as e.g. on my machine the user macports. steps to reproduce: {{{ cd ~ chmod 700 .subversion curl -o hgsubversion-1.3.tar.gz http://pypi.python.org/packages/source/h/hgsubversion/hgsubversion-1.3.tar.g... tar xzf hgsubversion-1.3.tar.gz cd hgsubversion-1.3 sudo -u macports /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build }}} -- -- Ticket URL: <https://trac.macports.org/ticket/32312#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#32312: subversion-python27bindings: initialization fails for user macports ------------------------------------------+--------------------------------- Reporter: titus@… | Owner: blair@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Resolution: invalid | Keywords: Port: subversion-python27bindings | ------------------------------------------+--------------------------------- Changes (by titus@…): * status: new => closed * resolution: => invalid Comment: Still, I don't understand why that doesn't happen with your installation. Anyway, I think that it's a combination of svn_swig_wrapper.py not catching an exception from svn_config_get_config and maybe - as you said - svn_config_get_config itself. Thanks for the testing! -- Ticket URL: <https://trac.macports.org/ticket/32312#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts