sudo -p '' displays a password prompt which it shouldn't

Bug #1799857 reported by David Partridge
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
sudo (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

I have small script that invokes another shell script as root thus:

#!/bin/bash
echo "mypass" | sudo -p '' -S /usr/StorMan/StorMan.sh

when running in 16.04 LTS this didn't display a password prompt which I understand to be correct behaviour. Since upgrading to 18.04.1 LTS the output looks like:

amonra@Charon:~$ ./storman
[sudo] password for amonra:

which as far as I can determine is not correct.

Thanks
Dave

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: sudo 1.8.21p2-3ubuntu1
ProcVersionSignature: Ubuntu 4.15.0-38.41-generic 4.15.18
Uname: Linux 4.15.0-38-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.4
Architecture: amd64
CurrentDesktop: LXDE
Date: Thu Oct 25 03:07:27 2018
InstallationDate: Installed on 2016-03-28 (940 days ago)
InstallationMedia: Ubuntu-Server 14.04.4 LTS "Trusty Tahr" - Release amd64 (20160217.1)
SourcePackage: sudo
UpgradeStatus: Upgraded to bionic on 2018-10-22 (2 days ago)
VisudoCheck:
 /etc/sudoers: parsed OK
 /etc/sudoers.d/README: parsed OK
modified.conffile..etc.sudoers: [inaccessible: [Errno 13] Permission denied: '/etc/sudoers']
modified.conffile..etc.sudoers.d.README: [inaccessible: [Errno 13] Permission denied: '/etc/sudoers.d/README']

Revision history for this message
David Partridge (perdrix) wrote :
Revision history for this message
Karl Stenerud (kstenerud) wrote :

Confirmed incorrect behavior in bionic. xenial and cosmic behave correctly.

Changed in sudo (Ubuntu):
status: New → Confirmed
Revision history for this message
Karl Stenerud (kstenerud) wrote :

I've unfortunately hit a wall investigating this :(

sudo should only override the prompt if passprompt_override is set in sudoers, or the env variable SUDO_PROMPT is set, and neither is set in bionic. Furthermore, it's not an issue with the binary, as I've tried taking the bionic sudo and putting it in a cosmic machine, and it works perfectly, honoring -p '' like the cosmic version does. That leaves the environment somehow, but I've run out of leads.

It does work properly in xenial and in cosmic, and the prompt seems to just be cosmetic anyway, so I'm marking this wontfix.

Changed in sudo (Ubuntu):
status: Confirmed → Won't Fix
Revision history for this message
David Partridge (perdrix) wrote :

There must be something in the code that is causing this. I confirm that neither the EV SUDO_PROMPT, nor passprompt_override in /etc/sudoers are set.

While I agree that it's purely cosmetic, it would be nice to have it fixed (pretty please).

Cheers
Dave

Revision history for this message
David Partridge (perdrix) wrote :

This was fixed in sudo 1.8.22 by the following commit:
https://www.sudo.ws/repos/sudo/rev/93cc4f4761f3

Revision history for this message
David Partridge (perdrix) wrote :

I installed sudo 1.8.23-2 from the cosmic repository and can confirm that if fixes the problem

Dave

Revision history for this message
Robie Basak (racb) wrote :

Let's leave this open since the bug appears valid and somebody else might be able to volunteer the fix.

Changed in sudo (Ubuntu):
status: Won't Fix → Triaged
Revision history for this message
David Partridge (perdrix) wrote :

Robie, it's already fixed see my earlier posts to this thread.

Dave

Revision history for this message
Robie Basak (racb) wrote :

Yes, but the fix will need to be backported and tested in Bionic separately, if you want Bionic fixed. The final backported patch needs to be a "debdiff" or contain the equivalent information, including the changelog entry, etc. See https://wiki.ubuntu.com/StableReleaseUpdates#Procedure for details.

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.