~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/bindings/swig/core.i

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
379
379
#ifdef SWIGPYTHON
380
380
%typemap(in) (char *buffer, apr_size_t *len) ($*2_type temp) {
381
381
    if (PyLong_Check($input)) {
382
 
        temp = PyLong_AsLong($input);
 
382
        temp = PyLong_AsUnsignedLong($input);
383
383
    }
384
384
    else if (PyInt_Check($input)) {
385
 
        temp = PyInt_AsLong($input);
 
385
        /* wish there was a PyInt_AsUnsignedLong but there isn't
 
386
           the mask version doesn't do bounds checking for us.
 
387
           I can't see a good way to do the bounds checking ourselves
 
388
           so just stick our head in the sand.  With Python3 this
 
389
           problem goes away because PyInt is gone anyway. */
 
390
        temp = PyInt_AsUnsignedLongMask($input);
386
391
    }
387
392
    else {
388
393
        PyErr_SetString(PyExc_TypeError,
389
394
                        "expecting an integer for the buffer size");
390
395
        SWIG_fail;
391
396
    }
392
 
    if (temp < 0) {
393
 
        PyErr_SetString(PyExc_ValueError,
394
 
                        "buffer size must be a positive integer");
395
 
        SWIG_fail;
396
 
    }
397
397
    $1 = malloc(temp);
398
398
    $2 = ($2_ltype)&temp;
399
399
}
514
514
    else if ($input == Py_None) {
515
515
        $1 = NULL;
516
516
    }
517
 
    else if (svn_swig_ConvertPtr($input, (void **)&$1, $descriptor(svn_auth_ssl_server_cert_info_t *)) == 0) {
 
517
    else if (svn_swig_py_convert_ptr($input, (void **)&$1,
 
518
                                     $descriptor(svn_auth_ssl_server_cert_info_t *)) == 0) {
518
519
    }
519
520
    else {
520
521
        PyErr_SetString(PyExc_TypeError, "not a known type");
523
524
}
524
525
#endif
525
526
 
 
527
#ifdef SWIGPERL
 
528
%typemap(in) const void *value 
 
529
  (apr_pool_t *_global_pool = NULL)
 
530
{
 
531
    if (!SvOK($input) || $input == &PL_sv_undef) {
 
532
        $1 = NULL;
 
533
    }
 
534
    else if (SvPOK($input)) {
 
535
        if (_global_pool == NULL)
 
536
            _global_pool = svn_swig_pl_make_pool((SV *)NULL);
 
537
        $1 = apr_pstrdup(_global_pool, SvPV_nolen($input));
 
538
    }
 
539
    else {
 
540
        croak("Value is not a string (or undef)");
 
541
    }
 
542
}
 
543
#endif
 
544
 
526
545
/*
527
546
  - all values are converted to char*
528
547
  - assume the first argument is Ruby object for svn_auth_baton_t*
644
663
#ifdef SWIGPERL
645
664
apr_pool_t *current_pool;
646
665
 
647
 
#if SWIG_VERSION <= 0x010324
648
 
%{
649
 
#define SVN_SWIGEXPORT(t) SWIGEXPORT(t)
650
 
%}
651
 
#else
652
 
%{
653
 
#define SVN_SWIGEXPORT(t) SWIGEXPORT t
654
 
%}
655
 
#endif
656
 
 
657
 
%{
658
 
 
 
666
%{
 
667
 
 
668
/* ### Eventually this should go away. This is not thread safe and a very
 
669
   ### good example on HOW NOT TO USE pools */
659
670
static apr_pool_t *current_pool = 0;
660
671
 
661
 
SVN_SWIGEXPORT(apr_pool_t *)
662
 
svn_swig_pl_get_current_pool (void)
 
672
static apr_pool_t *
 
673
core_get_current_pool (void)
663
674
{
664
675
  return current_pool;
665
676
}
666
677
 
667
 
SVN_SWIGEXPORT(void)
668
 
svn_swig_pl_set_current_pool (apr_pool_t *pool)
 
678
static void
 
679
core_set_current_pool (apr_pool_t *pool)
669
680
{
670
681
  current_pool = pool;
671
682
}
789
800
#endif
790
801
 
791
802
#ifdef SWIGPYTHON
792
 
# The auth baton depends on the providers, so we preserve a
793
 
# reference to them inside the wrapper. This way, if all external
794
 
# references to the providers are gone, they will still be alive,
795
 
# keeping the baton valid.
 
803
/* The auth baton depends on the providers, so we preserve a
 
804
   reference to them inside the wrapper. This way, if all external
 
805
   references to the providers are gone, they will still be alive,
 
806
   keeping the baton valid.
 
807
 */
796
808
%feature("pythonappend") svn_auth_open %{
797
809
  val.__dict__["_deps"] = list(args[0])
798
810
%}
867
879
#include "svn_private_config.h"
868
880
%}
869
881
%init %{
870
 
#if defined(SVN_AVOID_CIRCULAR_LINKAGE_AT_ALL_COSTS_HACK)
871
 
  svn_swig_pl_bind_current_pool_fns (&svn_swig_pl_get_current_pool,
872
 
                                     &svn_swig_pl_set_current_pool);
873
 
#endif
 
882
  svn_swig_pl__bind_current_pool_fns(&core_get_current_pool,
 
883
                                     &core_set_current_pool);
874
884
%}
875
885
#endif
876
886