Bug 1478651 - For sudo --login [command], .bash_profile is not read by shell
For sudo --login [command], .bash_profile is not read by shell
Status: NEW
Product: Fedora
Classification: Fedora
Component: sudo (Show other bugs)
25
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Daniel Kopeček
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-05 12:18 EDT by Don Swaner
Modified: 2017-08-05 12:18 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Don Swaner 2017-08-05 12:18:23 EDT
Description of problem:
When "sudo --login" (without a command specified) is run, .bash_profile	is read by the shell, in agreement with what the sudo man page states.  However, when "sudo --login [command]" (with a command specified) is run, .bash_profile is not read by the shell, contrary to what the sudo man page states.

Version-Release number of selected component (if applicable):
sudo-1.8.20p2-1.fc25.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Run "sudo --login".  A root login shell with '#' prompt is presented. Enter an alias for a command, such as "ll", and the command output is displayed. Exit the root shell.
2. Run "sudo --login ll", and a	error message is displayed: "bash: ll: command not found" - the same error displayed when "sudo ll" is run.

Actual results:
When running "sudo --login ll", an error message results.

Expected results:
When running "sudo -i ll", the .bash_profile is read by the shell, and the command alias properly executes.


Additional info:
If this sudo behavior is considered to be correct, then the sudo man page needs to be clarified.

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