Fix patch for SRV record resolution feature
Related: rhbz#1787010
This commit is contained in:
		
							parent
							
								
									4e749ca039
								
							
						
					
					
						commit
						905901669f
					
				| @ -1,6 +1,6 @@ | ||||
| commit 8c6d20a8232030dae413c2562741b445fc54ebfd | ||||
| commit 4b486868473462f9b65cc3ad44c48c2e68ee45ee | ||||
| Author: Tomas Korbar <tkorbar@redhat.com> | ||||
| Date:   Thu May 4 14:24:07 2023 +0200 | ||||
| Date:   Wed May 17 13:17:30 2023 +0200 | ||||
| 
 | ||||
|     Backport SRV record resolution feature | ||||
| 
 | ||||
| @ -659,7 +659,7 @@ index 74459d9..f8bb550 100644 | ||||
|  /* .ad | ||||
|  /* .fi | ||||
| diff --git a/src/posttls-finger/posttls-finger.c b/src/posttls-finger/posttls-finger.c
 | ||||
| index a3a9946..a56bad1 100644
 | ||||
| index a3a9946..b428cb3 100644
 | ||||
| --- a/src/posttls-finger/posttls-finger.c
 | ||||
| +++ b/src/posttls-finger/posttls-finger.c
 | ||||
| @@ -236,6 +236,8 @@
 | ||||
| @ -838,17 +838,22 @@ index a3a9946..a56bad1 100644 | ||||
|      if (alldig(service)) { | ||||
|  	if ((port = atoi(service)) >= 65536 || port == 0) | ||||
|  	    msg_fatal("bad network port in destination: %s", destination); | ||||
| @@ -1509,15 +1587,18 @@ static void connect_remote(STATE *state, char *dest)
 | ||||
| @@ -1507,17 +1585,21 @@ static char *parse_destination(char *destination, char *def_service,
 | ||||
|  static void connect_remote(STATE *state, char *dest) | ||||
|  { | ||||
|      DNS_RR *addr; | ||||
|      char   *buf; | ||||
|      char   *domain; | ||||
| +    char   *service;
 | ||||
| -    char   *buf;
 | ||||
| -    char   *domain;
 | ||||
|   | ||||
|      /* When reconnecting use IP address of previous session */ | ||||
|      if (state->addr == 0) { | ||||
| +	char   *buf;
 | ||||
| +	char   *domain;
 | ||||
| +	char   *service;
 | ||||
| +
 | ||||
|  	buf = parse_destination(dest, state->smtp ? "smtp" : "24", | ||||
| -				&domain, &state->port);
 | ||||
| +				&domain, service, &state->port);
 | ||||
| +				&domain, &service, &state->port);
 | ||||
|  	if (!state->nexthop) | ||||
|  	    state->nexthop = mystrdup(domain); | ||||
|  	if (state->smtp == 0 || *dest == '[') | ||||
| @ -858,7 +863,7 @@ index a3a9946..a56bad1 100644 | ||||
|  	else | ||||
|  	    state->addr = domain_addr(state, domain); | ||||
|  	myfree(buf); | ||||
| @@ -1531,10 +1612,14 @@ static void connect_remote(STATE *state, char *dest)
 | ||||
| @@ -1531,10 +1613,14 @@ static void connect_remote(STATE *state, char *dest)
 | ||||
|      for (addr = state->addr; addr; addr = addr->next) { | ||||
|  	int     level = dane_host_level(state, addr); | ||||
|   | ||||
| @ -869,13 +874,13 @@ index a3a9946..a56bad1 100644 | ||||
|  	    || (state->stream = connect_addr(state, addr)) == 0) { | ||||
| -	    msg_info("Failed to establish session to %s via %s: %s",
 | ||||
| -		     dest, HNAME(addr), vstring_str(state->why->reason));
 | ||||
| +	    msg_info("Failed to establish session to %s:%s via %s:%u: %s",
 | ||||
| +		     dest, service, HNAME(addr), addr->port,
 | ||||
| +            msg_info("Failed to establish session to %s via %s:%u: %s",
 | ||||
| +                     dest, HNAME(addr), addr->port,
 | ||||
| +		     vstring_str(state->why->reason));
 | ||||
|  	    continue; | ||||
|  	} | ||||
|  	/* We have a connection */ | ||||
| @@ -1819,6 +1904,7 @@ static void parse_options(STATE *state, int argc, char *argv[])
 | ||||
| @@ -1819,6 +1905,7 @@ static void parse_options(STATE *state, int argc, char *argv[])
 | ||||
|   | ||||
|      state->smtp = 1; | ||||
|      state->pass = 1; | ||||
| @ -883,7 +888,7 @@ index a3a9946..a56bad1 100644 | ||||
|      state->reconnect = -1; | ||||
|      state->max_reconnect = 5; | ||||
|      state->wrapper_mode = 0; | ||||
| @@ -1829,7 +1915,7 @@ static void parse_options(STATE *state, int argc, char *argv[])
 | ||||
| @@ -1829,7 +1916,7 @@ static void parse_options(STATE *state, int argc, char *argv[])
 | ||||
|      memset((void *) &state->options, 0, sizeof(state->options)); | ||||
|      state->options.host_lookup = mystrdup("dns"); | ||||
|   | ||||
| @ -892,7 +897,7 @@ index a3a9946..a56bad1 100644 | ||||
|  #ifdef USE_TLS | ||||
|  #define TLSOPTS "A:Cd:fF:g:H:k:K:l:L:m:M:p:P:r:s:wX" | ||||
|   | ||||
| @@ -1868,6 +1954,9 @@ static void parse_options(STATE *state, int argc, char *argv[])
 | ||||
| @@ -1868,6 +1955,9 @@ static void parse_options(STATE *state, int argc, char *argv[])
 | ||||
|  	case 'o': | ||||
|  	    override(optarg); | ||||
|  	    break; | ||||
|  | ||||
| @ -49,7 +49,7 @@ | ||||
| Name: postfix | ||||
| Summary: Postfix Mail Transport Agent | ||||
| Version: 3.5.8 | ||||
| Release: 5%{?dist} | ||||
| Release: 6%{?dist} | ||||
| Epoch: 2 | ||||
| Group: System Environment/Daemons | ||||
| URL: http://www.postfix.org | ||||
| @ -763,6 +763,10 @@ exit 0 | ||||
| %endif | ||||
| 
 | ||||
| %changelog | ||||
| * Wed May 17 2023 Tomas Korbar <tkorbar@redhat.com> - 2:3.5.8-6 | ||||
| - Fix patch for SRV record resolution feature | ||||
|   Related: rhbz#1787010 | ||||
| 
 | ||||
| * Thu May 04 2023 Tomas Korbar <tkorbar@redhat.com> - 2:3.5.8-5 | ||||
| - Backport dns SRV record resolution feature (RFC6186) | ||||
|   Resolves: rhbz#1787010 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user