Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 630896 - mail-filter/amavisd-new: init script for amavisd-snmp has bashisms
Summary: mail-filter/amavisd-new: init script for amavisd-snmp has bashisms
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-13 14:27 UTC by Michael Orlitzky
Modified: 2018-11-26 00:24 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
amavisd-snmp.initd.patch (amavisd-snmp.initd.patch,709 bytes, text/x-diff)
2018-03-10 23:11 UTC, Scall
Details
amavisd-snmp.initd.patch (amavisd-snmp.initd.patch,713 bytes, patch)
2018-03-10 23:41 UTC, Scall
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Orlitzky gentoo-dev 2017-09-13 14:27:17 UTC
The amavisd-snmp init script uses double-bracket "[[ ... ]]" tests, which crash OpenRC when /bin/sh is not bash:

  $ sudo /etc/init.d/amavisd-snmp start
   * Caching service dependencies ...
  /lib64/rc/sh/gendepends.sh: 12: /lib64/rc/sh/gendepends.sh: [[: not found
  /lib64/rc/sh/gendepends.sh: 14: /lib64/rc/sh/gendepends.sh: [[: not found
  /lib64/rc/sh/gendepends.sh: 23: /lib64/rc/sh/gendepends.sh: [[: not found
Comment 1 Scall 2018-03-10 23:11:58 UTC
Created attachment 523382 [details]
amavisd-snmp.initd.patch

Fixed. Please apply this patch.
Comment 2 Scall 2018-03-10 23:41:33 UTC
Created attachment 523384 [details, diff]
amavisd-snmp.initd.patch
Comment 3 Larry the Git Cow gentoo-dev 2018-11-26 00:24:33 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8635dce998732f7f82cc6c51bd0a7014c5e6ae6a

commit 8635dce998732f7f82cc6c51bd0a7014c5e6ae6a
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2018-11-22 03:10:18 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2018-11-26 00:17:56 +0000

    mail-filter/amavisd-new: new revision to clean up auxiliary init scripts.
    
      * Two new service scripts for amavisd-snmp-agent{,-zmq}. Prior, both
        of these programs were installed, but had only a single service
        script which tried to figure out what to do at runtime. The new
        way is cleaner, doesn't rely on bashisms (bug 630896), and fixes
        a security issue (bug 630898).
    
      * A new OpenRC service script for amavis-mc. This fixes an
        unreported (to Gentoo, anyway) security issue. This program can
        create its PID file only after dropping privileges, which makes it
        unsafe for OpenRC to later "kill" it. The new script runs the
        program in the foreground and lets OpenRC (safely) handle the
        bookkeeping.
    
    Closes: https://bugs.gentoo.org/630896
    Bug: https://bugs.gentoo.org/630898
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
    Package-Manager: Portage-2.3.51, Repoman-2.3.11

 .../amavisd-new/amavisd-new-2.11.1-r2.ebuild       | 198 +++++++++++++++++++++
 mail-filter/amavisd-new/files/amavis-mc.initd-r1   |  18 ++
 .../files/amavisd-snmp-subagent-zmq.initd          |  26 +++
 .../amavisd-new/files/amavisd-snmp-subagent.initd  |  25 +++
 4 files changed, 267 insertions(+)