spamassassin postinst uses a login shell

Bug #1310307 reported by Nick Moffitt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
spamassassin (Ubuntu)
New
High
Unassigned

Bug Description

When upgrading my precise mail server to trusty, spamassasin errored out the upgrade by running a login shell somewhere. I could tell it happened because it ran /usr/games/fortune and tried to use some bash login files sourced from the official ones:

Setting up spamassassin (3.4.0-1ubuntu1) ...
I note with interest that my beloved is now partway lodged
in a hedgerow. Just makin' all my dreams come true.

                -- Ryan, SGR 2009-06-18
-su: 1: /etc/local.login: whoson: not found
Current users:
        (0 people logged in)
-su: 28: /etc/bash_completion: [[: not found
-su: 34: /etc/bash_completion: [[: not found
-su: 51: /etc/bash_completion: Bad substitution
dpkg: error processing spamassassin (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 spamassassin

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: spamassassin 3.4.0-1ubuntu1
Uname: Linux 3.14.0-031400rc6-generic x86_64
ApportVersion: 2.14.1-0ubuntu3
Architecture: amd64
CurrentDesktop: Unity
Date: Sun Apr 20 17:07:57 2014
EcryptfsInUse: Yes
PackageArchitecture: all
SourcePackage: spamassassin
UpgradeStatus: Upgraded to trusty on 2014-02-25 (53 days ago)

Revision history for this message
Nick Moffitt (nick-moffitt) wrote :
Revision history for this message
Nick Moffitt (nick-moffitt) wrote :

It would appear most likely that this is caused by the line that runs:

    su - $OWNER -c "sa-update --gpghomedir /var/lib/spamassassin/sa-update-keys --import /usr/share/spamassassin/GPG.KEY"

Revision history for this message
Nick Moffitt (nick-moffitt) wrote :

Getting rid of the '-' in the above 'su -' fixes this neatly for me. It was caused partly by the /etc/login containing some bashisms, because I never expected dash to be used as an interactive shell on that system

Robie Basak (racb)
Changed in spamassassin (Ubuntu):
importance: Undecided → High
Revision history for this message
Stefan Tauner (stefanct) wrote :

In my case the culprit is/was '/etc/profile.d/mate-qt.sh' from package 'ubuntu-mate-default-settings'.

Revision history for this message
Stefan Tauner (stefanct) wrote :

And I just noticed that this bug is about 5 years old... this is with Ubuntu 18.04 and ubuntu-mate-default-settings version 18.04.17. The actual output is:

    Installing new version of config file /etc/init.d/spamassassin ...
    -su: 2: [: x: unexpected operator
    -su: 2: [: x: unexpected operator

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.