sudo resets HOME envar

Bug #221395 reported by Tushar T
6
Affects Status Importance Assigned to Milestone
sudo (Ubuntu)
Fix Released
Undecided
Martin Pitt
Hardy
Fix Released
Undecided
Martin Pitt

Bug Description

Binary package hint: sudo

See the upstream bug that I had reported and was fixed:
   http://www.gratisoft.us/bugzilla/show_bug.cgi?id=282

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.

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

Revision history for this message
Martin Pitt (pitti) wrote :
Changed in sudo:
assignee: nobody → pitti
status: New → In Progress
Revision history for this message
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
Revision history for this message
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
     specific)
   - 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 http://www.gratisoft.us/bugzilla/show_bug.cgi?id=285
    (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)
description: updated
Revision history for this message
Martin Pitt (pitti) wrote :

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

Revision history for this message
Martin Pitt (pitti) wrote :

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

Revision history for this message
Steve Langasek (vorlon) wrote :

Accepted into -proposed, please test and give feedback here

Changed in sudo:
status: In Progress → Fix Committed
Revision history for this message
Tushar T (sukucorp) wrote :

Verified. HOME envar is not reset anymore.

Revision history for this message
Martin Pitt (pitti) wrote :

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

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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