sudo -u needs escaped hash when /usr/lib/pm-utils/sleep.d/01PulseAudio uses bash

Bug #414385 reported by Christoph Kurrat on 2009-08-16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Daniel T Chen

Bug Description

Description: Ubuntu 9.04
Release: 9.04

  Version table:
 *** 0
        500 jaunty/main Packages
        100 /var/lib/dpkg/status

  Installed: 1:0.9.14-0ubuntu20.2
  Candidate: 1:0.9.14-0ubuntu20.2
  Version table:
 *** 1:0.9.14-0ubuntu20.2 0
        500 jaunty-updates/main Packages
        500 jaunty-security/main Packages
        100 /var/lib/dpkg/status
     1:0.9.14-0ubuntu20 0
        500 jaunty/main Packages

I am using /bin/bash instead of /bin/dash as /bin/sh


Using the command "sudo pm-suspend", only the screen is locked.

This seems to be caused by /usr/lib/pm-utils/sleep.d/01PulseAudio

From the /var/log/pm-suspend.log:
+ suspend_pulse
++ get_pulse_users
+++ ps aux
+++ awk '/\/usr\/bin\/pulseaudio --start/ {print $1}'
++ echo 1000
+ for i in '$(get_pulse_users)'
+ sudo -H -u 1000 pactl suspend-sink 1
+ sudo -H -u 1000 pactl suspend-source 1
+ hook_exit_status 1

executing sudo -H -u 1000 pactl suspend-sink 1 from a root-console resulted in:

sudo: no passwd entry for 1000!

man sudo told me, that the -u flag has to be used with the username or the uid preceded by an escaped hash symbol (\#)

This does not seem to be the case using dash.

Changing the four occurrences of the sudo -u call in 01PulseAudio solved the problem. This fix does work with dash, too.

Christoph Kurrat (c.kurrat) wrote :
Christoph Kurrat (c.kurrat) wrote :
Daniel T Chen (crimsun) wrote :

Great catch, thanks!

Changed in pulseaudio (Ubuntu):
assignee: nobody → Daniel T Chen (crimsun)
status: New → Fix Committed
summary: - pm-suspend does not work, caused by /usr/lib/pm-
- utils/sleep.d/01PulseAudio
+ sudo -u needs escaped hash when /usr/lib/pm-utils/sleep.d/01PulseAudio
+ uses bash
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:0.9.16~test5-0ubuntu1

pulseaudio (1:0.9.16~test5-0ubuntu1) karmic; urgency=low

  * New upstream release
  * debian/patches/0050-backport-git-post-test4.patch: drop
  * debian/patches/0050-revert-pacmd-poll-argv.patch: revert pacmd
    changesets due to excessive cpu usage (poll()) with resume:
    - aae7054b1c442e62cc1154d15a4b7a569d60d8f4
    - 5fcb8a3c0838a4ecdb00a0af09b6e1a358b114d0
  * debian/01PulseAudio: Escape hash when passed to sudo -u
    (LP: #414385). Thanks, Christoph Kurrat and Dana Goyette!
  * debian/pulseaudio.init: Add NetworkManager to
    Should-St{art,op} to fix sink/source publishing with Avahi
    (LP: #413443). Thanks, Martin-Éric Racine!

 -- Daniel T Chen <email address hidden> Wed, 19 Aug 2009 17:43:48 -0400

Changed in pulseaudio (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers