Bug 207117 - mail/ssmtp: Config file is parsed incorrectly if '#' character is part of an option value
Summary: mail/ssmtp: Config file is parsed incorrectly if '#' character is part of an ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Lars Engels
URL: https://bugs.debian.org/cgi-bin/bugre...
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-02-11 21:17 UTC by Sergey Manucharian
Modified: 2017-11-24 08:05 UTC (History)
4 users (show)

See Also:
linimon: maintainer-feedback? (aragon)


Attachments
a patch to the existing patch for ssmtp.c file (717 bytes, patch)
2016-02-11 21:17 UTC, Sergey Manucharian
no flags Details | Diff
a patch to the existing FreeBSD patch (5.49 KB, patch)
2016-10-02 04:51 UTC, Sergey Manucharian
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Manucharian 2016-02-11 21:17:03 UTC
Created attachment 166879 [details]
a patch to the existing patch for ssmtp.c file

The bug appears when a '#' is used in values of variables in the config file.
For example, using the following password:

AuthPass=my#password

will cause that everything beyond # to be ignored as a comment.

The patch attached adds a check for '=' character: if it appears before '#' do not ignore '#' and the followed characters.
Comment 1 VK 2016-09-25 21:52:36 UTC
First of all, this is maintainer timeout, so a committer please look at the issue.

The upstream is dead. This was reported many years ago with no resolution:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=544018

Gentoo has some fixes as well:

https://bugs.gentoo.org/show_bug.cgi?id=258018

I vote for this patch to be added to FreeBSD, regardless of upstream. However, there are reports about other chars being problematic in AuthPass as well:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=463196

Can this patch be reworked to include those too, while at it?
Comment 2 Sergey Manucharian 2016-09-26 19:09:56 UTC
Thanks, Vladimir! I'll rework my patch to include other problematic characters as well.
Comment 3 Sergey Manucharian 2016-10-02 04:51:06 UTC
Created attachment 175355 [details]
a patch to the existing FreeBSD patch

fixes parsing of ssmtp config file: characters "#' and "=" can be used in user passwords.
Comment 4 Sergey Manucharian 2016-10-02 04:58:23 UTC
The Debian bug mentioned above is related to ssmtp-2.61: characters "=" and ":" are not parsed correctly in "AuthPass" field.

FreeBSD has ssmtp-2.64 in ports. I checked it and found that there is no problem with ":", but confirm that "=" is not working in password. It is an obvious bug in the config file parser: it uses "=" among the "end of parameter" characters.

The patched attached fixes that.
Comment 5 Lars Engels freebsd_committer freebsd_triage 2017-11-23 21:33:08 UTC
Committed, thanks!

Sorry that it took so long!
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-11-23 21:33:40 UTC
A commit references this bug:

Author: lme
Date: Thu Nov 23 21:32:48 UTC 2017
New revision: 454801
URL: https://svnweb.freebsd.org/changeset/ports/454801

Log:
  mail/ssmtp:

  - Add a patch to allow passwords containing = and # characters
  - Bump PORTREVISION

  PR:		207117
  Submitted by:	Sergey Manucharian <sm@ara-ler.com>
  Approved by:	maintainer timeout (21 months)
  MFH:		2017Q4

Changes:
  head/mail/ssmtp/Makefile
  head/mail/ssmtp/files/patch-ssmtp.c
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-11-24 08:05:17 UTC
A commit references this bug:

Author: lme
Date: Fri Nov 24 08:04:35 UTC 2017
New revision: 454812
URL: https://svnweb.freebsd.org/changeset/ports/454812

Log:
  MFH: r454801

  mail/ssmtp:

  - Add a patch to allow passwords containing = and # characters
  - Bump PORTREVISION

  PR:		207117
  Submitted by:	Sergey Manucharian <sm@ara-ler.com>
  Approved by:	maintainer timeout (21 months)

  Approved by:	ports-secteam (junovich)

Changes:
_U  branches/2017Q4/
  branches/2017Q4/mail/ssmtp/Makefile
  branches/2017Q4/mail/ssmtp/files/patch-ssmtp.c