pulseaudio suspend/resume script fails for accounts with >8 char username

Bug #374694 reported by Stephane Miller
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Fix Released
Undecided
Luke Yelavich

Bug Description

Binary package hint: pulseaudio

The suspend/resume script for this package (located at /usr/lib/pm-utils/sleep.d/01PulseAudio) will fail if a user has a username longer than eight characters. This is because it relies on the output of 'ps aux', which will display usernames longer than eight characters as their numeric uids. The resulting sudo command generated by the script will then fail, because if sudoing to a uid, the sudo command would need to be specified as "sudo -u #1000" rather than "sudo -u 1000".

I observed this issue on 9.04 (Jaunty). The pulseaudio package version is 0.9.14-0ubuntu20. I expected suspend to work (as it did in Intrepid). It didn't. I had a look at /var/log/pm-suspend.log, and now here we are. :)

The attached diff represents one way of fixing this issue.

Revision history for this message
Stephane Miller (stephaneeee) wrote :
Revision history for this message
Luke Yelavich (themuso) wrote : Re: [Bug 374694] [NEW] pulseaudio suspend/resume script fails for accounts with >8 char username

Thanks for your bug report.
I think using the UID instead of the user name is actually a much better idea. Each user's UID is unique, and there is no chance of the script choaking on the many different characters that are possible in usernames.

I'll work on a patch to use the UID instead, thanks again.

 affects ubuntu/pulseaudio
 status confirmed
 assignee themuso

Changed in pulseaudio (Ubuntu):
assignee: nobody → Luke Yelavich (themuso)
status: New → Confirmed
Revision history for this message
Luke Yelavich (themuso) wrote : Re: [Bug 374694] Re: pulseaudio suspend/resume script fails for accounts with >8 char username

Due to the way that updates are made available for stable Ubuntu releases, this will not be fixed in Jaunty right away, since there is already an update to pulseaudio pending. However, it will be fixed in karmic, which is the next development release, and once the pulseaudio update is made available for jaunty, will be addressed there.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:0.9.15-2ubuntu1

---------------
pulseaudio (1:0.9.15-2ubuntu1) karmic; urgency=low

  * Merge from Debian unstable, remaining changes:
    - epoch (my stupid fault :S)
    - Don't build against, and create jack package. Jack is not in main
    - use linear resampler to work better with lack of PREEMPT in jaunty's
      -generic kernel config, also change buffer size
    - Add alsa configuration files to route alsa applications via pulseaudio
    - Move libasound2-plugins from Recommends to Depends
    - Add pm-utils sleep hook to suspend (and resume) users' pulseaudio
      daemons
    - patch to fix source/sink and suspend-on-idle race
    - Make initscript more informative in the default case of per-user
      sessions
    - create /var/run/pulse, and make restart more robust
    - add status check for system wide pulseaudio instance
    - LSB {Required-*,Should-*} should specify hal instead of dbus,
      since hal is required (and already requires dbus)
    - indicate that the system pulseaudio instance is being started from the init
      script
    - Install more upstream man pages
    - Link to pacat for parec man page
    - check whether pulseaudio is running before preloading the padsp library
    - Add DEB_OPT_FLAG = -O3 as per recommendation from
      pulseaudio-discuss/2007-December/001017.html
    - cache /usr/share/sounds/ubuntu/stereo/ wav files on pulseaudio load
    - disable glitch free (use tsched=0)
    - Generate a PO template on build
    - add special case to disable pulseaudio loading if accessibility/speech
      is being used
    - the sd wrapper script should not load pulseaudio if pulseaudio is being
      used as a system service
    - add a pulseaudio apport hook
    - fix some typos in README.Debian
    - demote paprefs to suggests
    - drop padevchooser(Recommends) and pavucontrol (Suggests)
    - drop libasyncns-dev build dependency, its in universe
    - add libudev-dev as a build-dependency
    - Retain libbluetooth-dev build dependency
  * debian/01Pulseaudio: Harvist users by UID, and not username, to ensure
    that the script doesn't choak on characters not already considered as
    used in a username (LP: #374694)

 -- Luke Yelavich <email address hidden> Tue, 26 May 2009 23:33:42 +0200

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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