The Tahoe-LAFS decentralized secure filesystem.
Go to file
Brian Warner d27a57cb49 Avoid Popen() of executables that don't exist
The stdlib 'subprocess' module in python-2.7.4 through 2.7.7 suffers
from http://bugs.python.org/issue18851 which causes unrelated file
descriptors to be closed when `subprocess.call()` fails the `exec()`,
such as when the executable being invoked does not actually exist. There
appears to be some randomness involved. This was fixed in python-2.7.8.

Tahoe's iputil.py uses subprocess.call on many different "ifconfig"-type
executables, most of which don't exist on any given platform (added in
git commit 8e31d66cd0). This results in a lot of file-descriptor
closing, which (at least during unit tests) tends to clobber important
things like Tub TCP sockets. This seems to be the root cause behind
ticket:2121, in which normal code tries to close already-closed sockets,
crashing the unit tests. Since different platforms have different
ifconfigs, some platforms will experience more failed execs than others,
so this bug could easily behave differently on linux vs freebsd, as well
as working normally on python-2.7.8 or 2.7.4.

This patch inserts a guard to make sure that os.path.isfile() is true
before allowing Popen.call() to try executing the target. This ought to
be enough to avoid the bug. It changes both iputil.py and
allmydata.__init__ (which uses Popen for calling "lsb_release"), which
are all the places where 'subprocess' is used outside of unit tests.

Other potential fixes: use the 'subprocess32' module from PyPI (which is
a bug-free backport of the Python3 stdlib subprocess module, but would
introduce a new dependency), or require python >= 2.7.8 (but this would
rule out development/deployment on the current OS-X 10.9 release, which
ships with 2.7.5, as well as other distributions like Ubuntu 14.04 LTS).

I believe this closes ticket:2121, and given the apparent relationship
between 2121 and 2023, I think it also closes ticket:2023 (although
since 2023 doesn't have copies of the failing log files, it's hard to
tell). I'm hoping that this will tide us over until 1.11 is released, at
which point we can execute on the plan to remove iputil.py entirely by
changing the way that nodes learn their externally-facing IP address.
2014-09-12 13:01:56 -07:00
bin Require at least Python 2.6. fixes #1658 2013-03-15 05:13:30 +00:00
docs Rename README.txt to README.rst, and add Travis-CI and Coveralls badges to it. 2014-09-09 18:51:44 +01:00
misc coverage2el.py: update to current coverage-3.7.1 API 2014-09-09 09:47:13 -07:00
setuptools-0.6c16dev4.egg Move embedded setuptools egg to reflect new version (0.6c16dev4). 2013-03-17 16:53:32 +00:00
src Avoid Popen() of executables that don't exist 2014-09-12 13:01:56 -07:00
static Make bb-freeze (and probably other static packaging tools) work. This updates various places where we assumed that the tahoe process was executed via the Python interpreter. It also allows tests to recursively invoke the same tahoe.exe, rather than bin/tahoe. refs #585 2011-01-21 00:04:29 -08:00
.gitignore Ignore .*.kate-swp and /*.patch files. 2013-07-16 16:14:42 +01:00
.travis.yml travis: show os.statvfs before build, to investigate #2290 2014-09-12 12:14:29 -07:00
COPYING.GPL Fix repeated 'the' in license text. 2011-08-19 13:48:36 -07:00
COPYING.TGPPL.rst magic first line tells emacs to use utf8+bom 2013-11-08 21:08:05 +00:00
CREDITS Update my CREDITS entry. 2014-03-15 22:17:03 +00:00
Makefile Makefile: remove 'twisted' from SOURCES 2014-09-09 10:31:05 -07:00
MANIFEST.in Remove darcs from setup.py, remove darcsver egg. Closes #1908. 2013-03-19 16:07:22 -07:00
NEWS.rst magic first line tells emacs to use utf8+bom 2013-11-08 21:08:05 +00:00
README.rst Rename README.txt to README.rst, and add Travis-CI and Coveralls badges to it. 2014-09-09 18:51:44 +01:00
relnotes.txt update docs for 1.10 release 2013-05-01 10:25:40 -07:00
setup.cfg remove obsolete debian-package building tools 2014-09-04 22:05:08 -07:00
setup.py Rename README.txt to README.rst, and add Travis-CI and Coveralls badges to it. 2014-09-09 18:51:44 +01:00
Tahoe.home rename bin/allmydata-tahoe to bin/tahoe. Closes #155. 2007-10-11 03:38:24 -07:00

Tahoe-LAFS

Tahoe-LAFS is a Free Software/Open Source decentralized data store. It distributes your filesystem across multiple servers, and even if some of the servers fail or are taken over by an attacker, the entire filesystem continues to work correctly and to preserve your privacy and security.

To get started please see quickstart.rst in the docs directory.

LICENCE

Copyright 2006-2014 The Tahoe-LAFS Software Foundation

You may use this package under the GNU General Public License, version 2 or, at your option, any later version. You may use this package under the Transitive Grace Period Public Licence, version 1.0, or at your option, any later version. (You may choose to use this package under the terms of either licence, at your option.) See the file COPYING.GPL for the terms of the GNU General Public License, version 2. See the file COPYING.TGPPL.rst for the terms of the Transitive Grace Period Public Licence, version 1.0.

See TGPPL.PDF for why the TGPPL exists, graphically illustrated on three slides.


image

image