sudoedit triggers pam_mount to enquire the password of the encrypted partition, trying to mount it and later to umount it.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
user-mounts |
New
|
Undecided
|
Unassigned | ||
sudo (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I have sudo 1.8.3p1-1ubuntu3.1 from precise-proposed and I use pam_mount for mounting encrypted partitions at login. (LVM partitions, if that matters.)
'sudoedit' command triggers pam_mount to enquire the password of the encrypted partition, trying to mount it and later to umount it. Mounting and umounting fails, because the encrypted partition is already mounted, unlocked and busy. The edited file is not changed rendering sudoedit useless.
$ sudoedit test
reenter password for pam_mount:
pam_mount(
pam_mount(
pam_mount(
pam_mount(
pam_mount(
pam_mount(
pam_mount(
pam_mount(
pam_mount(
pam_mount(
pam_mount(
pam_mount(
pam_mount(
If I edit the file "test", the tmp file "/var/tmp/
sudo (version 1.8.3p1-1ubuntu3.1) does not trigger this behavior, just sudoedit. If I clear the sudo timestamp:
$ sudo -k
$ sudoedit test
[sudo] password for myusername:
pam_mount(
[...the same errors...]
If I donwgrade to version sudo=1.
shell:~$ sudoedit test
reenter password for pam_mount:
pam_mount(
pam_mount(
pam_mount(
sudoedit: pam_mount.c:417: modify_pm_count: Assertion `user != ((void *)0)' failed.
Aborted
shell:~$ ls test
ls: cannot access test: No such file or directory
So sudoedit was unusable also with the old version.
The workaround is to edit files using "sudo vim (file)"
$ lsb_release -rd
Description: Ubuntu 12.04 LTS
Release: 12.04
sudo:
Installed: 1.8.3p1-1ubuntu3.1
/$ cat /etc/pam.d/sudo
#%PAM-1.0
@include common-auth
@include common-account
@include common-
$ grep pam_mount /etc/pam.d/common-*
/etc/pam.
/etc/pam.
/etc/pam.
Hence, pam_mount.so is in both common-auth and common-
File /etc/security/
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.
<pam_mount>
<debug enable="0" />
<mntoptions allow="
<mntoptions require=
<logout wait="0" hup="0" term="0" kill="0" />
<mkmountpoint enable="1" remove="true" />
<volume user="myusername" fstype="crypt" path="/
</pam_mount>
Changed in sudo (Ubuntu): | |
assignee: | nobody → TJ (intuitivenipple) |
status: | New → In Progress |
As reported by Stewart Prescott [1], this error is triggered when the system invokes pam-mount twice, which means that pam-mount tries to mount the volume twice as a result and the second time fails because the mount point is not empty.
Currently, this seems to be a bug of the default packaging rather than an user misconfiguration since even by resetting to default values via command
pam-auth-update
do not fix the situation. In Ubuntu 12.04 pam-mount is referenced in 3 files:
common-auth session- noninteractive
common-session
common-
and given that /etc/pam.d/sudo calls session- noninteractive
#%PAM-1.0
@include common-auth
@include common-account
@include common-
therefore pam-mount is called twice (common-auth and common- noninteractive)
By removing (commenting out) the reference to pam-mount in "common- session- noninteractive" this error does not appear any more, without compromising any feature on non-server machines.
By the way, in my case the exact same error referenced in this bug does not appear only with sudoedit, but also with sudo itself updated to the latest version 1.8.3p1-1ubuntu3.1
[1] http:// nanonanonano. net/linux/ debian/ enchome