"sudo -i" does not read .profile when root uses bash

Bug #1612028 reported by Karl-Philipp Richter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sudo (Ubuntu)
New
Undecided
Unassigned

Bug Description

According to `man sudo` `sudo -i` is supposed to read `.profile`, but apparently it doesn't since adding `alias ll='ls -la'` to the end of `/root/.profile` causes `ll` to fail with `ll: command not found`, but the alias should be available if `.profile` was read. `root` uses `/bin/bash` according to `/etc/passwd`.

Now, I got it. /root/.profile is only sourced at the first sudo -i after reboot (or maybe display manager (re-)login), not at every following sudo -i - at least in gnome-terminal. If sudo -i is run once when /root/.bash_profile is present it is sourced (and /root/.profile skipped as expected) and if it /root/.bash_profile is removed every following invokation of sudo -i causes /root/.profile to be sourced. That not right, right?

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: sudo 1.8.16-0ubuntu1.1
ProcVersionSignature: Ubuntu 4.4.0-34.53-generic 4.4.15
Uname: Linux 4.4.0-34-generic x86_64
NonfreeKernelModules: openafs
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Aug 11 04:35:28 2016
InstallationDate: Installed on 2015-12-12 (242 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
SourcePackage: sudo
UpgradeStatus: Upgraded to xenial on 2016-03-14 (149 days ago)
VisudoCheck:
 /etc/sudoers: Analyse OK
 /etc/sudoers.d/README: Analyse OK
modified.conffile..etc.sudoers: [inaccessible: [Errno 13] Keine Berechtigung: '/etc/sudoers']
modified.conffile..etc.sudoers.d.README: [inaccessible: [Errno 13] Keine Berechtigung: '/etc/sudoers.d/README']

Revision history for this message
Karl-Philipp Richter (krichter722) wrote :
description: updated
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.