public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] COMMIT_MSG
@ 2020-07-10 23:04 Brian Inglis
  2020-07-10 23:04 ` [PATCH] pkg_upload.cygpart __pkg_announce SMTP HELO fails without smtp server FQDN Brian Inglis
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Brian Inglis @ 2020-07-10 23:04 UTC (permalink / raw)
  To: cygwin-patches

---
 lib/src_postinst.cygpart | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart
index 68381a0..091994a 100644
--- a/lib/src_postinst.cygpart
+++ b/lib/src_postinst.cygpart
@@ -1293,8 +1293,10 @@ __prep_libtool_modules() {
 					mv ${ltlibdir}/${dlname} ${D}/usr/${CTARGET}/sys-root/$(__target_prefix)/bin/
 				else
 					origdlname=${dlname}
+					# do full symlink resolution on both paths compared to avoid issues
+					local dest_prefix=$(readlink -f ${D}$(__host_prefix))
 
-					while [ $(readlink -f ${ltlibdir}/${dlname%/bin/*}) != ${D}$(__host_prefix) ]
+					while [ $(readlink -f ${ltlibdir}/${dlname%/bin/*}) != $dest_prefix ]
 					do
 						dlname=../${dlname}
 					done
-- 
2.27.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] pkg_upload.cygpart __pkg_announce SMTP HELO fails without smtp server FQDN
  2020-07-10 23:04 [PATCH] COMMIT_MSG Brian Inglis
@ 2020-07-10 23:04 ` Brian Inglis
  2020-07-10 23:04 ` [PATCH] src_postinstall _prep_libtool_modules infinite loop when symlink in path Brian Inglis
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Brian Inglis @ 2020-07-10 23:04 UTC (permalink / raw)
  To: cygwin-patches

added git send-email perl code for FQDN with hooks in perl script
---
 lib/pkg_upload.cygpart | 51 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 50 insertions(+), 1 deletion(-)

diff --git a/lib/pkg_upload.cygpart b/lib/pkg_upload.cygpart
index f88525d..06024b4 100644
--- a/lib/pkg_upload.cygpart
+++ b/lib/pkg_upload.cygpart
@@ -168,6 +168,7 @@ EOF
 	echo "Upload complete."
 }
 
+
 __pkg_announce() {
 	local msg=$(mktemp -t cygwin-announce-${PF}.XXXXXX)
 	local msgat=$(date +@%s)
@@ -198,7 +199,52 @@ _EOF
 
 	${EDITOR:-vi} $msg || error "Editor exited abormally, aborting annoucement"
 
+# FQDN from git send-email
+# Returns the local Fully Qualified Domain Name (FQDN) if available.
+#
+# Tightly configured MTAa require that a caller sends a real DNS
+# domain name that corresponds the IP address in the HELO/EHLO
+# handshake. This is used to verify the connection and prevent
+# spammers from trying to hide their identity. If the DNS and IP don't
+# match, the receiving MTA may deny the connection.
+#
+# Here is a deny example of Net::SMTP with the default "localhost.localdomain"
+#
+# Net::SMTP=GLOB(0x267ec28)>>> EHLO localhost.localdomain
+# Net::SMTP=GLOB(0x267ec28)<<< 550 EHLO argument does not match calling host
+#
+# This maildomain*() code is based on ideas in Perl library Test::Reporter
+# /usr/share/perl5/Test/Reporter/Mail/Util.pm ==> sub _maildomain ()
+
 	perl <(cat <<EOF
+sub valid_fqdn {
+	my \$domain = shift;
+	return defined \$domain && !(\$^O eq 'darwin' && \$domain =~ /\.local\$/) && \$domain =~ /\./;
+}
+sub maildomain_net {
+    use Net::Domain ();
+	my \$maildomain;
+	my \$domain = Net::Domain::domainname();
+	\$maildomain = \$domain if valid_fqdn(\$domain);
+	return \$maildomain;
+}
+sub maildomain_mta {
+	my \$maildomain;
+	for my \$host (qw(mailhost localhost)) {
+		my \$smtp = Net::SMTP->new(\$host);
+		if (defined \$smtp) {
+			my \$domain = \$smtp->domain;
+			\$smtp->quit;
+			\$maildomain = \$domain if valid_fqdn(\$domain);
+			last if \$maildomain;
+		}
+	}
+	return \$maildomain;
+}
+sub maildomain {
+	return maildomain_net() || maildomain_mta() || 'localhost.localdomain';
+}
+
 use strict;
 use MIME::Parser;
 use Net::SMTP;
@@ -214,7 +260,9 @@ my \$entity = \$parser->parse_open("$msg");
 
 print "Sending announcement of ${NAME}-${PVR} via \$smtp_server\n";
 
+my \$smtp_domain ||= maildomain();  # get FQDN and add Hello below
 my \$smtp = new Net::SMTP(\$smtp_server,
+			  Hello => \$smtp_domain,
 			  ${SMTP_SERVER_PORT+Port => ${SMTP_SERVER_PORT},}
 			  SSL => \$smtp_encryption eq 'ssl')
 	 or die "No mailserver at ".\$smtp_server;
@@ -224,7 +272,8 @@ if (\$smtp_encryption eq 'tls') {
 	\$smtp->response();
 	\$smtp->code == 220 or die "$server does not support STARTTLS";
 	\$smtp = Net::SMTP::SSL->start_SSL(\$smtp) or die "STARTTLS failed";
-	\$smtp->hello(\$smtp_server);
+	# Send EHLO again to receive fresh supported commands
+	\$smtp->hello(\$smtp_domain);
 }
 if (defined \$smtp_user) {
 	use Authen::SASL qw(Perl);
-- 
2.27.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] src_postinstall _prep_libtool_modules infinite loop when symlink in path
  2020-07-10 23:04 [PATCH] COMMIT_MSG Brian Inglis
  2020-07-10 23:04 ` [PATCH] pkg_upload.cygpart __pkg_announce SMTP HELO fails without smtp server FQDN Brian Inglis
@ 2020-07-10 23:04 ` Brian Inglis
  2020-07-10 23:30 ` [PATCH] COMMIT_MSG - cygport patches Brian Inglis
  2020-07-13  7:14 ` [PATCH] COMMIT_MSG Corinna Vinschen
  3 siblings, 0 replies; 5+ messages in thread
From: Brian Inglis @ 2020-07-10 23:04 UTC (permalink / raw)
  To: cygwin-patches

---
 lib/src_postinst.cygpart | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart
index 68381a0..091994a 100644
--- a/lib/src_postinst.cygpart
+++ b/lib/src_postinst.cygpart
@@ -1293,8 +1293,10 @@ __prep_libtool_modules() {
 					mv ${ltlibdir}/${dlname} ${D}/usr/${CTARGET}/sys-root/$(__target_prefix)/bin/
 				else
 					origdlname=${dlname}
+					# do full symlink resolution on both paths compared to avoid issues
+					local dest_prefix=$(readlink -f ${D}$(__host_prefix))
 
-					while [ $(readlink -f ${ltlibdir}/${dlname%/bin/*}) != ${D}$(__host_prefix) ]
+					while [ $(readlink -f ${ltlibdir}/${dlname%/bin/*}) != $dest_prefix ]
 					do
 						dlname=../${dlname}
 					done
-- 
2.27.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] COMMIT_MSG - cygport patches
  2020-07-10 23:04 [PATCH] COMMIT_MSG Brian Inglis
  2020-07-10 23:04 ` [PATCH] pkg_upload.cygpart __pkg_announce SMTP HELO fails without smtp server FQDN Brian Inglis
  2020-07-10 23:04 ` [PATCH] src_postinstall _prep_libtool_modules infinite loop when symlink in path Brian Inglis
@ 2020-07-10 23:30 ` Brian Inglis
  2020-07-13  7:14 ` [PATCH] COMMIT_MSG Corinna Vinschen
  3 siblings, 0 replies; 5+ messages in thread
From: Brian Inglis @ 2020-07-10 23:30 UTC (permalink / raw)
  To: Cygwin Patches

Sorry,
These cygport patches were expected to allow edits as usual but just went!
Minor "unrelated" ~/.gitconfig changes seem to have removed confirmation.

This should have been an -F COMMIT_MSG but I typed -m COMMIT_MSG.

The next fixes a cygport announce SMTP server issue using code from git send-email.

The last fixes a cygport install infinite loop when there is a symlink along the
path to DEST host prefix.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] COMMIT_MSG
  2020-07-10 23:04 [PATCH] COMMIT_MSG Brian Inglis
                   ` (2 preceding siblings ...)
  2020-07-10 23:30 ` [PATCH] COMMIT_MSG - cygport patches Brian Inglis
@ 2020-07-13  7:14 ` Corinna Vinschen
  3 siblings, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2020-07-13  7:14 UTC (permalink / raw)
  To: cygwin-patches

Hi Brian,

On Jul 10 17:04, Brian Inglis wrote:
> ---
>  lib/src_postinst.cygpart | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

cygwin-patches is not for cygport patches(*).  Please use cygwin-apps.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-13  7:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10 23:04 [PATCH] COMMIT_MSG Brian Inglis
2020-07-10 23:04 ` [PATCH] pkg_upload.cygpart __pkg_announce SMTP HELO fails without smtp server FQDN Brian Inglis
2020-07-10 23:04 ` [PATCH] src_postinstall _prep_libtool_modules infinite loop when symlink in path Brian Inglis
2020-07-10 23:30 ` [PATCH] COMMIT_MSG - cygport patches Brian Inglis
2020-07-13  7:14 ` [PATCH] COMMIT_MSG Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).