Re: [PATCH v2 2/3] git-send-email: die on invalid smtp_encryption
- From
Drew DeVault <sir@cmpwn.com>
- Date
- Apr 11, 2021, 14:21 UTC
- Message-ID
- <CAKYMAEJQOA3.25YK6UYSYFHXQ@taiga>
- In-Reply-To
- <87blakgaxr.fsf@evledraar.gmail.com>
On Sun Apr 11, 2021 at 10:20 AM EDT, Ævar Arnfjörð Bjarmason wrote:
Show 9 quoted lines
> > # 'default' encryption is none -- this only prevents a warning
> > $smtp_encryption = '' unless (defined $smtp_encryption);
> > +if ($smtp_encryption ne "" && $smtp_encryption ne "ssl" && $smtp_encryption ne "tls") {
> > + die __("Invalid smtp_encryption configuration: expected 'ssl', 'tls', or nothing.\n");
> > +}
>
> Having not tested this but just eyeballed the code, I'm fairly sure
> you're adding a logic error here, or is $smtp_encryption guaranteed to
> be defined at this point?I will admit to being ignorant of much of Perl's semantics, but I had assumed that the line prior to my additions addresses this:
$smtp_encryption = '' unless (defined $smtp_encryption);
> $smtp_encryption !~ /^(?:|ssl|tls)$/s
Yeah, that would probably be better.