fix for current libsvn

This commit is contained in:
van Hauser 2016-11-04 17:53:07 +01:00
parent 5a1a66d2a3
commit 4ee7bc3c38
2 changed files with 11 additions and 4 deletions

View file

@ -10,6 +10,7 @@ Release 8.4-dev
* New command line options: * New command line options:
-y : disables -x 1aA interpretation, thanks to crondaemon for the patch -y : disables -x 1aA interpretation, thanks to crondaemon for the patch
-I : ignore an existing hydra.restore file (dont wait for 10 seconds) -I : ignore an existing hydra.restore file (dont wait for 10 seconds)
* Upgraded hydra-svn to work with the current libsvn version
* Fixed dpl4hydra to be able to update from the web again * Fixed dpl4hydra to be able to update from the web again
* Updated default password lists * Updated default password lists
* The protocols vnc, xmpp, telnet, imap, nntp and pcanywhere got accidentially long sleep commands due a patch in 8.2, fixed * The protocols vnc, xmpp, telnet, imap, nntp and pcanywhere got accidentially long sleep commands due a patch in 8.2, fixed

View file

@ -11,6 +11,8 @@
#include <svn_pools.h> #include <svn_pools.h>
#include <svn_config.h> #include <svn_config.h>
#include <svn_fs.h> #include <svn_fs.h>
#include <svn_path.h>
#endif #endif
#include "hydra-mod.h" #include "hydra-mod.h"
@ -52,6 +54,7 @@ int start_svn(int s, char *ip, int port, unsigned char options, char *miscptr, F
int ipv6 = 0; int ipv6 = 0;
char URL[1024]; char URL[1024];
char URLBRANCH[256]; char URLBRANCH[256];
const char *canonical;
apr_pool_t *pool; apr_pool_t *pool;
svn_error_t *err; svn_error_t *err;
svn_opt_revision_t revision; svn_opt_revision_t revision;
@ -79,7 +82,8 @@ int start_svn(int s, char *ip, int port, unsigned char options, char *miscptr, F
return 4; return 4;
} }
if ((err = svn_client_create_context(&ctx, pool))) { //if ((err = svn_client_create_context(&ctx, pool))) {
if ((err = svn_client_create_context2(&ctx, NULL, pool))) {
svn_handle_error2(err, stderr, FALSE, "hydra: "); svn_handle_error2(err, stderr, FALSE, "hydra: ");
return 4; return 4;
} }
@ -104,17 +108,19 @@ int start_svn(int s, char *ip, int port, unsigned char options, char *miscptr, F
else else
snprintf(URL, sizeof(URL), "svn://%s:%d/%s", hydra_address2string(ip), port, URLBRANCH); snprintf(URL, sizeof(URL), "svn://%s:%d/%s", hydra_address2string(ip), port, URLBRANCH);
dirents = SVN_DIRENT_KIND; dirents = SVN_DIRENT_KIND;
err = svn_client_list2(URL, &revision, &revision, svn_depth_unknown, dirents, FALSE, print_dirdummy, NULL, ctx, pool); canonical = svn_uri_canonicalize(URL, pool);
//err = svn_client_list2(canonical, &revision, &revision, svn_depth_unknown, dirents, FALSE, print_dirdummy, NULL, ctx, pool);
err = svn_client_list3(canonical, &revision, &revision, svn_depth_unknown, dirents, FALSE, FALSE, (svn_client_list_func2_t) print_dirdummy, NULL, ctx, pool);
svn_pool_clear(pool); svn_pool_clear(pool);
svn_pool_destroy(pool); svn_pool_destroy(pool);
if (err) { if (err) {
if (verbose) if (debug || (verbose && (err->apr_err != 170001 && err->apr_err != 170013)))
hydra_report(stderr, "[ERROR] Access refused (error code %d) , message: %s\n", err->apr_err, err->message); hydra_report(stderr, "[ERROR] Access refused (error code %d) , message: %s\n", err->apr_err, err->message);
//Username not found 170001 ": Username not found" //Username not found 170001 ": Username not found"
//Password incorrect 170001 ": Password incorrect" //Password incorrect 170001 ": Password incorrect"
if (err->apr_err != 170001) { if (err->apr_err != 170001 && err->apr_err != 170013) {
return 4; //error return 4; //error
} else { } else {
if (strstr(err->message, "Username not found")) { if (strstr(err->message, "Username not found")) {