sudo resets HOME envar

Bug #221395 reported by Tushar T on 2008-04-24
Affects Status Importance Assigned to Milestone
sudo (Ubuntu)
Martin Pitt
Martin Pitt

Bug Description

Binary package hint: sudo

See the upstream bug that I had reported and was fixed:

As root, when I execute the command:
   HOME=<some_dir> sudo -u <some_user>
HOME is set to /root (root's home dir) not <some_dir>. As per the documentation, sudo should not mess with the HOME envar unless -H or -i is specified.

This is on hardy. It worked on gutsy.

broken Hardy final version:
   $ HOME=/tmp sudo -u nobody sh -c 'echo $HOME'
with hardy-proposed fixed version:
  $ HOME=/tmp sudo -u nobody sh -c 'echo $HOME'

Martin Pitt (pitti) wrote :
Changed in sudo:
assignee: nobody → pitti
status: New → In Progress
Martin Pitt (pitti) wrote :

Nominating for Hardy, since it is a regression from Gutsy.

Changed in sudo:
status: In Progress → Fix Committed
assignee: nobody → pitti
status: New → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sudo - 1.6.9p12-1ubuntu1

sudo (1.6.9p12-1ubuntu1) intrepid; urgency=low

  * Merge from debian unstable, remaining changes:
   - debian/rules: Disable lecture, enable tty_tickets by default. (Ubuntu
   - Add debian/sudo_root.8: Explanation of root handling through sudo.
     Install it in debian/rules. (Ubuntu specific)
   - sudo.c: If the user successfully authenticated and he is in the 'admin'
     group, then create a stamp ~/.sudo_as_admin_successful. Our default bash
     profile checks for this and displays a short intro about sudo if the
     flag is not present. (Ubuntu specific)
   - env.c: Add "http_proxy" to initial_keepenv_table, so that it is kept
     for "sudo apt-get ...". (Ubuntu specific EBW hack, should disappear at
     some point)
  * logging.c: Ignore SIGPIPE when creating an error email, so that non-fatal
    error messages (like "unable to resolve local host name") do not lead to
    being killed with SIGPIPE if /usr/bin/sendmail does not exist or crashes.
    Forwarded upstream to
    (LP: #32906)
  * env.c: Do not clobber $HOME when not specifying -H or -s. Patch taken from
    upstream CVS. (LP: #221395)
  * debian/postinst: put "NOPASSWD" example at the bottom, so that
    uncommenting it will actually work (later entries override former ones).
    (LP: #131399)

sudo (1.6.9p12-1) unstable; urgency=low

  * new upstream version, closes: #464890

sudo (1.6.9p11-3) unstable; urgency=low

  * patch for configure to fix FTBFS on GNU/kFreeBSD, closes: #465956

sudo (1.6.9p11-2) unstable; urgency=low

  * update version compared in preinst when removing obsolete init.d,
    closes: #459681
  * implement pam session config suggestions from Elizabeth Fong,
    closes: #452457, #402329

sudo (1.6.9p11-1) unstable; urgency=low

  * new upstream version

 -- Martin Pitt <email address hidden> Mon, 05 May 2008 20:31:58 +0200

Changed in sudo:
status: Fix Committed → Fix Released
Martin Pitt (pitti) on 2008-05-14
description: updated
Martin Pitt (pitti) wrote :

Attaching SRU debdiff for Hardy. I uploaded this, awaiting Steve's moderation from the queue.

Martin Pitt (pitti) wrote :

Steve, can you please process this? I don't want to ack my own upload. Thanks!

Steve Langasek (vorlon) wrote :

Accepted into -proposed, please test and give feedback here

Changed in sudo:
status: In Progress → Fix Committed
Tushar T (sukucorp) wrote :

Verified. HOME envar is not reset anymore.

Martin Pitt (pitti) wrote :

Works for me with the .debs from hardy-proposed, too.

Martin Pitt (pitti) wrote :

Copied to hardy-updates.

Changed in sudo:
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

Remote bug watches

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