troycurtisjr in subversion

Add CVE-2018-11803 notices to the website.

* index.html, news.html

- Add security announcement.

- Include CVE link in 1.11.1 and 1.10.4 release announcements.

- Ensure anchor ids are unique.

* security/CVE-2018-11803-advisory.txt New file.

* security/CVE-2018-11803-advisory.txt.asc New file.

* security/index.html

Add links to CVE-2018-11803 advisory and signature.

    • ?
    • ?
* COMMITTERS: Move myself to the full committer section.

* staging/docs/community-guide/releasing.part.html

(tarball-signing): Fix public key list url.

On branch swig-py3: Update BRANCH-README.


Remove resolved TODO items for better swig build error messages and returning

bytes versus str.

On branch swig-py3: Improve error messages for swig language builds.



* build/ac-macros/swig.m4


message if the language binding is not configured for any reason, and clear

the error message if the configuration is successful.

* build/generator/

(Generator.write): Add 'name' and 'short_upper' to the ezt template data for

each swig language option.

* build/generator/templates/

(.swig_py_checked, .swig_pl_checked, .swig_rb_checked): New make targets.

(autogen-swig-py, autogen-swig-pl, autogen-swig-rb, swig-py, swig-pl, swig-rb):

Add corresponding swig_<lang>_checked dependency to top-level swig building


On branch swig-py3: Fix macro usage to distinguish py2 and py3 context.

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c

Include "swigutil_py3c.h" file before define SVN_SWIG_BYTES_FMT to use

IS_PY3 macro to switch py2 and py3 context.

(add_directory, add_file, apply_textdelta, change_file_prop,

close_file, parse_fn3_set_revision_property,

parse_fn3_set_node_property, svn_swig_py_notify_func,

svn_swig_py_notify_func, svn_swig_py_delta_path_driver_cb_func,

svn_swig_py_repos_authz_func, svn_swig_py_log_receiver,





ra_callbacks_get_wc_prop, ra_callbacks_push_or_set_wc_prop,

ra_callbacks_invalidate_wc_props, svn_swig_py_commit_callback,

reporter_set_path, reporter_link_path,


wc_diff_callbacks2_file_deleted, wc_diff_callbacks2_dir_added,



Use IS_PY3 macro instead of comparison of PY_VERSION_HEX.

(add_directory, add_file, apply_textdelta, change_file_prop,

close_file, parse_fn3_set_revision_property,

parse_fn3_set_node_property, ra_callbacks_get_wc_prop,

ra_callbacks_push_or_set_wc_prop, ra_callbacks_invalidate_wc_props):

Enclose only format argument of Py_CallFunction or Py_CallMethod

with #if IS_PY3 #else #endif block.

Patch By: Yasuhito Futatsuki <>

On branch swig-py3: Revise encode/decode usage in swig-py unit test.

[in subversion/bindings/swig/python/tests]

* (SubversionClientTestCase.test_update4): Don't encode os.path.sep

if it is already a bytes object.

* (SubversionCoreTestCase.test_stream_write): Don't encode fname

if it is already a bytes object.

* (DeltaTestCase.testTxWindowHandler_stream_IF,

DeltaTestCase.testTxWindowHandler_Stream_IF): Don't encode fname if it

is already a bytes object.

* (SubversionFSTestCase.setUp): Don't encode self.tmpfile if it is

already a bytes object.

* trac/versioncontrol/

Remove unnecessary variable IS_PY3 and therefore unnecessary import of

sys module.

(SubversionNode.__init__): Don't use IS_PY3 condition, just store a unicode

string in the exception object.

* (Temper.alloc_empty_dir, Temper.alloc_empty_repo): Ensure suffix

arg for tempfile.mkdtemp() is unicode (for py3 < 3.5).

Patch By: Yasuhito Futatsuki <>

On branch swig-py3: Fix tests after str to bytes API conversion.

* subversion/bindings/swig/python/tests/


SubversionClientTestCase.test_shelf)): Construct paths as bytes instead of


* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c

(svn_swig_py_client_status_func): The path given to the callback should be

bytes instead of str for consistency with the rest of the API.

On branch swig-py3: Use bytes for all API string parameters.

Since many string like arguments in the API can contain arbitrary bytes, use the

Python Bytes interface in Python 3, while still using Str in Python 2, to ensure

full compatibility with all possible input data.

Build system change:

* build/ac-macros/swig.m4:

Add "-DPY3" option to SWIG_PY_OPTS for py3 build to define symbol to switch

typemap between py2 and py3.

Typemap changes:

* subversion/bindings/swig/core.i

(%typemap(argout) (char *buffer, apr_size_t *len):

Map buffer arg to Bytes insted of Str.

(%typemap(in) (const char *data, apr_size_t *len) ($*2_type temp):

Map data arg to Bytes instead of Str and pass Py_ssize_t variable as length

argment of PyBytes_AsStringAndSize for for explicit type conversion.

(%typemap(in) const void *value):

Map value arg to Bytes instead of Str for svn_auth_set_parameter().

* subversion/bindings/swig/include/svn_global.swg:

- Define SWIG_PYTHON_STRICT_BYTE_CHAR symbol for swig context for


- Switch "in" type typemap for char *, char const *, char * const,

and char const * const "", to use parse parameter "y" for py3 and

"s" for py2.

* subversion/bindings/swig/include/svn_string.swg

(%typemap(argout) RET_STRING, %typemap(in) svn_stringbuf_t *,

%typemap(out) svn_stringbuf_t *, %typemap(in) const svn_string_t *,

%typemap(out) svn_string_t *, %typemap(argout) const char **OUTPUT):

Map args to Bytes instead of Str.

* subversion/bindings/swig/include/svn_swigcompat.swg

(%set_constant(name, value): Use PyDict_SetItem and PyBytes_FromString

instead of PyDict_SetItemString, for SWIG <= 1.3.27 (not tested).

* subversion/bindings/swig/include/svn_types.swg

(%typemap(in) const char *MAY_BE_NULL): Don't use "z" conversion

format and convert to Bytes if it is not NULL.

(%typemap(in) (const char *PTR, apr_size_t LEN): Use PyBytes_Check and

PyBytes_AsStringAndSize instead of PyStr_Check and PyStr_AsUTF8AndSize.

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c

(make_string_from_ob(), make_svn_string_from_ob(),

svn_swig_py_make_file(), svn_swig_py_get_commit_log_func()):

Use PyBytes_Check and PyBytes_AsString instead of PyStr_Check and


(convert_hash()): Use Dict_SetItem and PyBytes_FromString instead of


(convert_svn_string_t(), svn_swig_py_proparray_to_dict(),


Use PyBytes_AsStringAndSize instead of PyStr_AsUTF8AndSize.

(cstring_to_pystring(), convert_string(),








svn_swig_py_array_to_list()): Use PyBytes_FromString instead of


(delete_entry(), add_directory(), open_directory(), change_dir_prop(),

add_file(), open_file(), apply_textdelta(), change_file_prop(),

close_file(), parse_fn3_uuid_record(), parse_fn3_set_revision_property(),

parse_fn3_set_node_property(), parse_fn3_delete_node_property(),

svn_swig_py_notify_func(), svn_swig_py_status_func(),

svn_swig_py_delta_path_driver_cb_func(), svn_swig_py_status_func2(),

svn_swig_py_fs_lock_callback(), svn_swig_py_repos_authz_func(),

svn_swig_py_repos_history_func(), svn_swig_py_proplist_receiver2(),

svn_swig_py_log_receiver(), svn_swig_py_info_receiver_func(),









svn_swig_py_config_auth_walk_func(), ra_callbacks_get_wc_prop(),

ra_callbacks_push_or_set_wc_prop(), ra_callbacks_invalidate_wc_props(),

svn_swig_py_commit_callback(), svn_swig_py_ra_file_rev_handler_func(),

svn_swig_py_ra_lock_callback(), reporter_set_path(),

reporter_delete_path(), reporter_link_path(),


wc_diff_callbacks2_file_deleted(), wc_diff_callbacks2_dir_added(),




svn_swig_py_config_section_enumerator2()): Use 's' for py2 and use 'y'

for py3 in argment format string.

(ra_callbacks_push_or_set_wc_prop()): Use PyBytes_FromStringAndSize

instead of PyStr_FromStringAndSize.

(ra_callbacks_get_client_string()): Use PyBytes_FromString instaed of


* subversion/bindings/swig/svn_client.i

(%typemap(argout) apr_array_header_t **props):

Use PyBytes_FromStringAndSize() instead of PyStr_FromStringAndSize.

Helper python code changes:

* subversion/bindings/swig/python/svn/

(svn_path_compare_paths): Do not use cmp, for py3 compatibility.

( Chunks is now list of bytes, not list of str.

* subversion/bindings/swig/python/svn/


- Make sure self.tempfile1 and self.self.tempfile2 are bytes.

- Pass bytes to header_encoding arg in _svndiff.file_output_unified4().

* subversion/bindings/swig/python/svn/


Treat path as bytes in sample code.

* subversion/bindings/swig/python/svn/

(ChangeCollector._make_base_path()): Treat path as bytes.

(ChangeCollector.open_root(): Path and basepath should be bytes in


(RevisionChangeCollector._make_base_path()): Treat path as bytes.

Unit test changes:

* subversion/bindings/swig/python/tests/

Replace all str literals with bytes literals except docstring and module name.

* subversion/bindings/swig/python/tests/

(ChecksumTestCases.test_checksum()): Check if type of check_val is

bytes instead of str.

* subversion/bindings/swig/python/tests/

Replace all str literals with bytes literals except for the mode arg of open(),

arguments to utils.Temper methods, docstrings, and module names.

(SubversionClientTestCase.test_uuid_from_url): Check if return value

type client.uuid_from_url() is bytes instead of str.

(SubversionClientTestCase.test_uuid_from_path): Check if return value

type client.uuid_from_path() is bytes instead of str.

(SubversionClientTestCase.test_merge_peg3()): Open the result file in

raw mode.

(SubversionClientTestCase.test_update4()): Convert os.path.sep into

bytes if it is str in py3.

* subversion/bindings/swig/python/tests/

Replace all str literals with bytes literals except for exception messages,

arguments to utils.Temper methods, docstrigs, and module names.

Add new tests for svn_stream_*()

(SubversionCoreTestCase.test_stream_from_stringbuf()): New test method.

(SubversionCoreTestCase.test_stream_read_full()): New test method.

(SubversionCoreTestCase.test_stream_read2()): New test method.

(SubversionCoreTestCase.test_stream_write_exception()): New test method.

(SubversionCoreTestCase.test_stream_write()): New test method.

(SubversionCoreTestCase.test_stream_readline()): New test method.

* subversion/bindings/swig/python/tests/



Use bytes literals to make stream when using


Use bytes file name to make stream when using


* subversion/bindings/swig/python/tests/

(SubversionFSTestCase.log_message_func(): log_msg_func3 callback now

expects bytes to return.

(SubversionFSTestCase.setUp()): Pass bytes path and url to client.import2().


SubversionFSTestCase.test_diff_repos_paths_external()): Use bytes for

path1 argument to fs.FileDiff.__init__().

* subversion/bindings/swig/python/tests/



SubversionMergeinfoTestCase.MERGEINFO_SRC): Use bytes instead of str.


- Pass list of bytes for paths arg to repos.fs_get_mergeinfo().

- Replace str in expected_mergeinfo with bytes.

* subversion/bindings/swig/python/tests/

Replace all str literals with bytes literals except assertion message,

arguments to utils.Temper methods, docstrings, and module names.

(SubversionRepositoryAccessTestCase.test_get_file): Compare file

content as bytes.

* subversion/bindings/swig/python/tests/

Replace all str literals with bytes literals when passed into or returned from

the Subversion API, except exception messages.

(SubversionRepositoryTestCase.test_dump_fs2()): Treat dump and

feedback as bytes and compose expected_feedback as bytes.

* subversion/bindings/swig/python/tests/


Temper.alloc_empty_repo): Convert return value of tempfile.mkdtemp() into


(Temper.file_uri_for_path()): Return URI as bytes.

* subversion/bindings/swig/python/tests/

Replace all str literals with bytes literals when passed into or returned from

the Subversion API, except exception messages.

(SubversionWorkingCopyTestCase.test_get_adm_dir()): Check type as



SubversionWorkingCopyTestCase.test_diff_editor4()): Open file in raw mode.

(SubversionWorkingCopyTestCase.test_commit()): Use bytes literals

instead of str.

* subversion/bindings/swig/python/tests/trac/versioncontrol/

(Node.DIRECTORY, Node.FILE): Replace str with bytes.

(Node.__init__): Do not convert path to str.

(Node.get_name): Treat self.path as bytes.

(Changeset.ADD, Changeset.COPY, Changeset.DELETE, Changeset.EDIT,

Changeset.MOVE): Replace str with bytes.

* subversion/bindings/swig/python/tests/trac/versioncontrol/




SubversionRepository.next_rev()): Treat self.path and self.scope as bytes.


SubversionRepository.get_node()): Treat path as bytes.

(SubversionRepository.get_path_history()): Replace 'unknown' Changeset value

with bytes.

(SubversionRepository.get_deltas()): Replace str 'entry' arg to

repos.svn_repos_dir_delta() with bytes.


- Treat self.path and self.scope as bytes.

- Decode path into str for exception message on py3.

(SubversionNode.get_entries()): Treat self.path as bytes.

(SubversionNode.get_properties()): Property values are bytes, not str.

(DiffChangeEditor.open_root()): Return bytes value.

* subversion/bindings/swig/python/tests/trac/versioncontrol/tests/

Replace all str literals with bytes literals when passed into or returned from

the Subversion API, except exception messages.

(REPOS_URL) Build REPOS_URL as bytes.

Patch By: Yasuhito FUTATSUKI <>

  1. … 11 more files in changeset.
On branch swig-py3: Complete Python SWIG bindings for svn_client.h.

* subversion/bindings/swig/include/svn_containers.swg

(apr_array_header_t **OUTPUT_OF_CONST_CHAR_P): Add additional "char *" array


(%typemap(argout) apr_array_header_t **options): New output mapping for array

of svn_client_conflict_option_t objects.

(%typemap(argout) apr_array_header_t **versions_p): New output mapping for

array of svn_client__shelf_version_t objects.

* subversion/bindings/swig/include/svn_string.swg

(const char **OUTPUT): Add additional char * output parameter for log_message.

* subversion/bindings/swig/include/svn_types.swg

(SWIGTYPE **OUTPARAM): Add several missing output parameter swig types.

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c,


Add make_ob_* swig constructor for svn_client_status_dup.

(svn_swig_py_client_status_func): New Function.

* subversion/bindings/swig/svn_client.i

Add callback typemaps for usages of svn_client_status_func_t.

* subversion/bindings/swig/python/tests/

(SubversionClientTestCase.assert_all_instances_of): New helper method.

(SubversionClientTestCase.test_platform_providers): Add usage of

assert_all_instances_of() helper method.

(SubversionClientTestCase.test_conflict): New test method.

(SubversionClientTestCase.test_shelf): New test method.

On branch swig-py3: Address compiler warnings under Python 3.

Resolved compiler warnings relating to handling of const values when the SWIG

bindings are built under Python 3.

* subversion/bindings/swig/core.i

(const char *data, apr_size_t *len): Explicitly cast away const and document

the rationale.

(const void *value): Fix variable initialization from PyStr_AsString to be


* subversion/bindings/swig/include/svn_types.swg

(const char *PTR, apr_size_t LEN): Explicitly cast away const and document the


* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c

(svn_swig_py_make_file): Fix variable initialization from PyStr_AsString to be


On branch swig-py3: Catchup to trunk @r1849002.

  1. /branches/swig-py3/tools/client-side/svnconflict
  2. … 17 more files in changeset.
Update external 'diff' command test for svn.fs.FileDiff() to depend on presence

of the command instead of testing for 'win32' platform.

* subversion/bindings/swig/python/tests/

(SubversionFSTestCase.test_diff_repos_paths): Split function into internal

and external variants.

(SubversionFSTestCase.test_diff_repos_paths_external): New test method.

(SubversionFSTestCase.test_diff_repos_paths_internal): New test method.

(SubversionFSTestCase.setUp): Added unicode test commit from original

test_diff_repos_paths() so all test methods have a common repository setup.

Found by: stsp

Fix Python unit test, fs.SubversionFSTestCase, on Windows.

* subversion/bindings/swig/python/tests/


Update default test case to invoke internal diff implementation and add

a case for testing calls to the 'diff' executable on non-Windows platforms.

* subversion/bindings/swig/python/svn/

(FileDiff.__init__): Add difftemp to track temporary file for cleanup.

(FileDiff.__del__): Ensure difftemp is cleaned up.

(File.get_pipe): Add a condition to use the internal diff implementation when

the diffoptions value is given as None.

Ensure Python bindings for fs.FileDiff behaves correctly when the python-future

package is installed.

* subversion/bindings/swig/python/svn/

Try the Python 2 '__builtin__' import before the Python 3 'builtins'.

(FileDiff._dump_contents): Open temporary file in binary mode.

* subversion/bindings/swig/python/tests/

Add test for fs.FileDiff.

* subversion/bindings/swig/python/tests/

(suite): Add fs test suite.

Found By: Kenneth Porter <>

    • ?
On branch swig-py3: Ensure swig check_output() is decoded as utf8.

To support Python 2 and 3, explicitly decode check_output() return as utf8.

* build/generator/swig/

(Generator.__init__, Generator.version): Explicitly decode check_output() as


On branch swig-py3: Catchup to trunk @r1822734.

    • ?
    • ?
    • ?
    • ?
  1. … 58 more files in changeset.
On branch swig-py3: Update status now the Visual Studio <= 2008 works.

* BRANCH-README: Remove note about only Visual Studio > 2008 being supported.

On branch swig-py3: Fix python swig compile for Visual Studio <= 2008.

Add the proper UserMacros definitions to pull in the necessary SWIG arguments

for python generation.

* build/generator/templates/vcnet_vsprops.ezt

New file defining UserMacros.

* build/generator/templates/vcnet_vcproj.ezt

Inherit the new property sheet containing UserMacros.

* build/generator/

(Generator.write_project): Write out the property sheet for Visual Studio

2008 and earlier.

On branch swig-py3: Update BRANCH-README with Windows status.


- Update with current Windows build status.

On branch swig-py3: Revert a Python 3 only usage.

* build/generator/


Drop the Python 3 only "errors" argument to fileinput.hook_encoded().

On branch swig-py3: Add py3c library support to the Windows build.

* build/generator/templates/vcnet_vcxproj.ezt

(UserMacros): Add template options to define UserMacros.

* build/generator/

(Generator.write_project): Include new user macro values in

data passed to the ezt template function.

* build/generator/

(UserMacro): Define a new type to use with user macro templates.

(GenDependenciesBase._optional_libraries): Include py3c library.

(GenDependenciesBase.parse_options): Include the py3c library path


(GenDependenciesBase.find_libraries): Add a call to _find_py3c().

(GenDependenciesBase._find_python): Define SWIG_PY_OPTS user macro

based on detected Python version.

(GenDependenciesBase._find_py3c): New method.


GenDependenciesBase._find_jdk): Ensure output from subprocess is

properly decoded.


(_usage_exit): Add --with-py3c usage.

(my_getopt): Add with-py3c option.

* subversion/bindings/swig/INSTALL

Include py3c in Windows SWIG building instructions.

* build/generator/

(IncludeDependencyInfo._scan_for_includes): Ensure file data is

properly encoded as UTF8.

* build/generator/

(WinGeneratorBase.makeguid): Ensure data input to hashlib is binary

and not Unicode.

(WinGeneratorBase.get_win_includes): Include py3c include directory

in swig compile definition.

    • ?
    • ?
On branch swig-py3: Go back to using classic classes for Python 2 swig bindings.

Add some additional clarifying comments for the reasons behind overriding

__getattr__ and __getattribute__.

* build/ac-macros/swig.m4

(SVN_FIND_SWIG): Add the '-classic' flag to swig when python 2 is detected.

* subversion/bindings/swig/include/

(_retrieve_swig_value): Factor out metadata retrieval from __getattribute__ to a new function.

(__getattribute__): Only define __getattribute__ for new style classes.

(__getattr__): Add back implementation for classic classes.

Suggested By: brane

On branch swig-py3: Create and use a wrapper function to efficiently retrieve

lists from dict object on Python 2 and 3.

Wrapping dict methods such as keys() and values() in list() works to create a

independent list, but on Python 2 two distinct lists are created which is


* subversion/bindings/swig/python/svn/

Create a new utility function, _as_list(), and remove now unnecessary

_bi_list alias.

(svn.core._unprefix_names, svn.core.__all__): Use new _as_list() function in

place of list() on dict output.

* subversion/bindings/swig/python/svn/,



























Use new _as_list() function in place of list() on dict output.

Found By: danielsh, brane

On branch swig-py3: Properly handle NULL values from the Python C API.

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c

(svn_swig_py_as_file): Ensure each return from the Python C API is not NULL

before passing to the next API function.

Found By: danielsh

On branch swig-py3: Clarify move detection logic in swig trac tests.

* subversion/bindings/swig/python/tests/trac/versioncontrol/

(get_changes): Clarify the move detection logic by adding a few comments and

replacing the odd index/offset based loop with one based on enumerate.

Suggested By: danielsh

On branch swig-py3: Fix swig tests which relied on consistent dict key ordering.

* subversion/bindings/swig/python/tests/trac/versioncontrol/

(test_changeset_file_edit, test_changeset_file_copy): Ensure consistent dict

key sequence ordering by using sorted().

* subversion/bindings/swig/python/tests/trac/versioncontrol/tests/

(get_changes): Ensure moves indexes are sorted so that deletions work correctly.

Found By: danielsh

On branch swig-py3: Add missing undef to the py3c/swig compatibility header.

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py3c.h

Add PyInt_FromSize_t to the list of undefs to prevent conflicts between py3c

and swig.

On branch swig-py3: Do not include internal header as a system header.

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c

Change include of swigutil_py3c.h from <> to "" as it is an internal header.

Found By: danielsh

On branch swig-py3: Move py3c compat fixes to all swig modules.

Resolves compile warnings in Python 3 build for all modules, not just those in


* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py3c.h:

New file containing the py3c compat undef fixes previously in swigutil_py.c.

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c:

Moved py3c compat undef fixes to swigutil_py3c.h and include the header.

* subversion/bindings/swig/include/svn_global.swg:

Add swigutil_py3c.h include to ensure all swig modules get the compat fixes.

* subversion/bindings/swig/core.i,










Remove redundant py3c.h inclusion, now that svn_global.swg includes


Found By: danielsh