Bug 667752 - sudo modifies HOME, breaks past behavior
Summary: sudo modifies HOME, breaks past behavior
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: sudo
Version: 14
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Kopeček
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-06 17:02 UTC by Daris A Nevil
Modified: 2012-08-16 18:01 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-16 18:01:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 471603 0 high CLOSED sudo: Hardcoded "secure-path" breaks functionality. 2021-02-22 00:41:40 UTC

Description Daris A Nevil 2011-01-06 17:02:32 UTC
Description of problem:

When I do 'sudo {cmd}', the HOME environment variable is set to the home directory of the target user.  Fedora 12 and earlier do not modify the HOME environment variable.

Version-Release number of selected component (if applicable):

sudo-1.7.4p4-4.fc14.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. Setup /etc/sudoers.d/xxx to allow you to sudo to root.
2. Do sudo sh
3. Do echo $HOME Or echo ~

Actual results:

Home of the root user (/root).

Expected results:

Home of the original user.

Additional info:

The problem is fixed by adding the line

  Defaults    env_keep += "HOME"

to the file /etc/sudoers.

See Also:

https://bugzilla.redhat.com/show_bug.cgi?id=635250
http://www.sudo.ws/pipermail/sudo-users/2010-September/004478.html

Comment 1 Daris A Nevil 2011-01-06 17:29:06 UTC
More info from a colleague.

It has to do with sudo being built with the –with-secure-path flag.  There have been outstanding bugs with other distributions for this issue for a while.  Interesting that Fedora adopted this default behavior as well.

https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/50797
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=85123

It even looks like Fedora tried this before in FC10, and it was fixed, so they’ve reintroduced the issue in FC14.

https://bugzilla.redhat.com/show_bug.cgi?id=471603

Comment 2 Fedora End Of Life 2012-08-16 18:01:39 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


Note You need to log in before you can comment on or make changes to this bug.