[exim] behaviour of ${readsocket{ changed after upgrading to…

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Victor Ustugov
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: [exim] behaviour of ${readsocket{ changed after upgrading to exim 4.94/4.94.2
Hello

I discovered issue with ${readsocket{ after upgrading to 4.94.

First of all some manual examples.


Example 1:

# telnet whois.radb.net 43
Trying 198.108.0.18...
Connected to whois.radb.net.
Escape character is '^]'.
131.111.8.88                           <- THIS IS INPUT FROM KEYBOARD
route:          131.111.0.0/16
descr:          University of Cambridge
descr:          Computer Laboratory
descr:          New Museums Site
descr:          Pembroke Street
descr:          Cambridge
descr:          CB2 3QH
descr:          UNITED KINGDOM
origin:         AS786
...
Connection closed by foreign host.



Example 2:

# telnet whois.ripe.net 43
Trying 193.0.6.135...
Connected to whois.ripe.net.
Escape character is '^]'.
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf

131.111.8.88                           <- THIS IS INPUT FROM KEYBOARD
% Note: this output has been filtered.
%       To receive output for a database update, use the "-B" flag.


% Information related to '131.111.0.0 - 131.111.255.255'

% Abuse contact for '131.111.0.0 - 131.111.255.255' is 'abuse@???'

inetnum:        131.111.0.0 - 131.111.255.255
netname:        CAM-AC-UK
descr:          University of Cambridge
country:        GB
status:         LEGACY
admin-c:        UCSD1-RIPE
tech-c:         UCSN1-RIPE
mnt-by:         CAM-AC-UK-MNT
org:            ORG-UCAM1-RIPE
created:        1970-01-01T00:00:00Z
last-modified:  2019-12-04T13:01:56Z
source:         RIPE
...
Connection closed by foreign host.



Example 3:

# telnet whois.com.ua 43
Trying 217.12.194.25...
Connected to whois.ua.
Escape character is '^]'.
% Request from 185.187.83.14
% This is the Ukrainian Whois query server #F.
% The Whois is subject to Terms of use
% See https://hostmaster.ua/services/
%
% IN THE PROCESS OF DELEGATION OF A DOMAIN NAME,
% THE REGISTRANT IS AN ENTITY WHO USES AND MANAGES A CERTAIN DOMAIN NAME,
% AND THE REGISTRAR IS A BUSINESS ENTITY THAT PROVIDES THE REGISTRANT
% WITH THE SERVICES NECESSARY FOR THE TECHNICAL MAINTENANCE OF THE
REGISTRATION AND OPERATION OF THE DOMAIN NAME.
% FOR INFORMATION ABOUT THE REGISTRANT OF THE DOMAIN NAME, YOU SHOULD
CONTACT THE REGISTRAR.

s56.org.ua                           <- THIS IS INPUT FROM KEYBOARD
domain:           s56.org.ua
dom-public:       NO
mnt-by:           ua.bestname
nserver:          ns1.s56.org.ua
nserver:          ns2.s56.org.ua
status:           ok
created:          2012-04-07 21:35:04+03
modified:         2021-04-02 08:27:03+03
expires:          2022-04-07 21:35:04+03
source:           UAEPP
...
Connection closed by foreign host.



I tried to get the same results with exim 4.93.0.4 and ${readsocket{.


Example 1, exim 4.93.0.4, shutdown=yes:

# exim -be
'${readsocket{inet:whois.radb.net:43}{131.111.8.88\n}{20s:shutdown=yes}{\n}{socket
failure}}'
route:          131.111.0.0/16
descr:          University of Cambridge
descr:          Computer Laboratory
descr:          New Museums Site
descr:          Pembroke Street
descr:          Cambridge
descr:          CB2 3QH
descr:          UNITED KINGDOM
origin:         AS786
mnt-by:         JIPS-NOSC
created:        1970-01-01T00:00:00Z
last-modified:  2004-12-02T16:49:50Z
source:         RIPE
remarks:        ****************************
remarks:        * THIS OBJECT IS MODIFIED
remarks:        * Please note that all data that is generally regarded
as personal
remarks:        * data has been removed from this object.
remarks:        * To view the original object, please query the RIPE
Database at:
remarks:        * http://www.ripe.net/whois
remarks:        ****************************


It is ok.


Example 2, exim 4.93.0.4, shutdown=yes:

# exim -be
'${readsocket{inet:whois.ripe.net:43}{131.111.8.88\n}{20s:shutdown=yes}{\n}{socket
failure}}'
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf

I got only part of output, it is not ok.


Example 3, exim 4.93.0.4, shutdown=yes:

# exim -be
'${readsocket{inet:whois.com.ua:43}{s56.org.ua\n}{20s:shutdown=yes}{\n}{socket
failure}}'

I got empty output, it is not ok.


Change shutdown to "no".


Example 1, exim 4.93.0.4, shutdown=no:

# exim -be
'${readsocket{inet:whois.radb.net:43}{131.111.8.88\n}{20s:shutdown=no}{\n}{socket
failure}}'
route:          131.111.0.0/16
descr:          University of Cambridge
descr:          Computer Laboratory
descr:          New Museums Site
descr:          Pembroke Street
descr:          Cambridge
descr:          CB2 3QH
descr:          UNITED KINGDOM
origin:         AS786
...


It is ok.


Example 2, exim 4.93.0.4, shutdown=no:

# exim -be
'${readsocket{inet:whois.ripe.net:43}{131.111.8.88\n}{20s:shutdown=no}{\n}{socket
failure}}'
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf

% Note: this output has been filtered.
%       To receive output for a database update, use the "-B" flag.


% Information related to '131.111.0.0 - 131.111.255.255'

% Abuse contact for '131.111.0.0 - 131.111.255.255' is 'abuse@???'

inetnum:        131.111.0.0 - 131.111.255.255
netname:        CAM-AC-UK
descr:          University of Cambridge
country:        GB
status:         LEGACY
admin-c:        UCSD1-RIPE
tech-c:         UCSN1-RIPE
mnt-by:         CAM-AC-UK-MNT
org:            ORG-UCAM1-RIPE
created:        1970-01-01T00:00:00Z
last-modified:  2019-12-04T13:01:56Z
source:         RIPE
...
% This query was served by the RIPE Database Query Service version 1.100
(HEREFORD)


It is ok.


Example 3, exim 4.93.0.4, shutdown=no:

# exim -be
'${readsocket{inet:whois.com.ua:43}{s56.org.ua\n}{20s:shutdown=no}{\n}{socket
failure}}'
% Request from 83.142.233.82
% This is the Ukrainian Whois query server #B.
% The Whois is subject to Terms of use
% See https://hostmaster.ua/services/
%
% IN THE PROCESS OF DELEGATION OF A DOMAIN NAME,
% THE REGISTRANT IS AN ENTITY WHO USES AND MANAGES A CERTAIN DOMAIN NAME,
% AND THE REGISTRAR IS A BUSINESS ENTITY THAT PROVIDES THE REGISTRANT
% WITH THE SERVICES NECESSARY FOR THE TECHNICAL MAINTENANCE OF THE
REGISTRATION AND OPERATION OF THE DOMAIN NAME.
% FOR INFORMATION ABOUT THE REGISTRANT OF THE DOMAIN NAME, YOU SHOULD
CONTACT THE REGISTRAR.

domain:           s56.org.ua
dom-public:       NO
mnt-by:           ua.bestname
nserver:          ns1.s56.org.ua
nserver:          ns2.s56.org.ua
status:           ok
created:          2012-04-07 21:35:04+03
modified:         2021-04-02 08:27:03+03
expires:          2022-04-07 21:35:04+03
source:           UAEPP
...
% Query time:     101 msec


It is ok.


So I was quite happy with exim 4.93.0.4 and ${readsocket{ with shutdown=no.

But "something went wrong" after upgrading to exim 4.94.2 (test results
of exim 4.94 are the same).


Example 1, exim 4.94.2, shutdown=no:

# exim -be
'${readsocket{inet:whois.radb.net:43}{131.111.8.88\n}{20s:shutdown=no}{\n}{socket
failure}}'

I got empty output, it is not ok.


example 2, exim 4.94.2, shutdown=no:

# exim -be
'${readsocket{inet:whois.ripe.net:43}{131.111.8.88\n}{20s:shutdown=no}{\n}{socket
failure}}'

I got empty output, it is not ok.


example 3, exim 4.94.2, shutdown=no:

# exim -be
'${readsocket{inet:whois.com.ua:43}{s56.org.ua\n}{20s:shutdown=no}{\n}{socket
failure}}'

I got empty output, it is not ok.


Change shutdown to "yes".


Example 1, exim 4.94.2, shutdown=yes:

# exim -be
'${readsocket{inet:whois.radb.net:43}{131.111.8.88\n}{20s:shutdown=yes}{\n}{socket
failure}}'
route:          131.111.0.0/16
descr:          University of Cambridge
descr:          Computer Laboratory
descr:          New Museums Site
descr:          Pembroke Street
descr:          Cambridge
descr:          CB2 3QH
descr:          UNITED KINGDOM
origin:         AS786
mnt-by:         JIPS-NOSC
created:        1970-01-01T00:00:00Z
last-modified:  2004-12-02T16:49:50Z
source:         RIPE
remarks:        ****************************
remarks:        * THIS OBJECT IS MODIFIED
remarks:        * Please note that all data that is generally regarded
as personal
remarks:        * data has been removed from this object.
remarks:        * To view the original object, please query the RIPE
Database at:
remarks:        * http://www.ripe.net/whois
remarks:        ****************************


It is ok.



Example 2, exim 4.94.2, shutdown=yes

# exim -be
'${readsocket{inet:whois.ripe.net:43}{131.111.8.88\n}{20s:shutdown=yes}{\n}{socket
failure}}'
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf

I got only part of output, it is not ok.


exim 4.94.2, shutdown=yes

# exim -be
'${readsocket{inet:whois.com.ua:43}{s56.org.ua\n}{20s:shutdown=yes}{\n}{socket
failure}}'

I got empty output, it is not ok.


As far as I can see, there was a huge refactoring of src/expand.c. And
it is quite difficult for me to compare the sources of exim 4.93.0.4 and
exim 4.94.2 (or exim 4.94) and understand the reason for the change in
behavior ${readsocket{.

Is this a bug or maybe something has changed in how ${readsocket{ should
be used?

All of above examples are easy to reproduce.

Thanks in advance.


-- 
Best wishes
Victor Ustugov        mailto:victor@corvax.kiev.ua
Skype ID: corvax_nb   JID: victor@???
public GnuPG/PGP key: https://victor.corvax.kiev.ua/corvax.asc