Using sudo with virtualenvwrapper causes $HOME/.virtualenvs/hook.log to have have wrong acces rights
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
virtualenvwrapper (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When virutalenvwrapper is installed and you open a new a sudo shell the file hook.log is owned by root but located in the user's home.
ls -la .virtualenvs/
insgesamt 72
drwxr-xr-x 2 stephan stephan 4096 2011-10-06 23:56 .
drwxr-xr-x 121 stephan stephan 12288 2011-10-07 17:55 ..
-rwxrwxr-x 1 stephan stephan 106 2011-08-25 02:01 get_env_details
-rw-r--r-- 1 root root 1160 2011-10-07 15:10 hook.log
-rw-r--r-- 1 stephan stephan 10208 2011-10-06 23:56 hook.log.1
-rwxrwxr-x 1 stephan stephan 92 2011-08-25 02:01 initialize
-rwxrwxr-x 1 stephan stephan 69 2011-08-25 02:01 postactivate
-rwxrwxr-x 1 stephan stephan 71 2011-08-25 02:01 postdeactivate
-rwxrwxr-x 1 stephan stephan 69 2011-08-25 02:01 postmkvirtualenv
-rwxrwxr-x 1 stephan stephan 63 2011-08-25 02:01 postrmvirtualenv
-rwxrwxr-x 1 stephan stephan 70 2011-08-25 02:01 preactivate
-rwxrwxr-x 1 stephan stephan 72 2011-08-25 02:01 predeactivate
-rwxrwxr-x 1 stephan stephan 94 2011-08-25 02:01 premkvirtualenv
-rwxrwxr-x 1 stephan stephan 64 2011-08-25 02:01 prermvirtualenv
This causes an error message like this
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/
backupCount=1,
File "/usr/lib/
BaseRotatin
File "/usr/lib/
logging.
File "/usr/lib/
StreamHandl
File "/usr/lib/
stream = open(self.
IOError: [Errno 13] Permission denied: '/home/
virtualenvwrapp
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/
backupCount=1,
File "/usr/lib/
BaseRotatin
File "/usr/lib/
logging.
File "/usr/lib/
StreamHandl
File "/usr/lib/
stream = open(self.
IOError: [Errno 13] Permission denied: '/home/
virtualenvwrapp
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: virtualenvwrapper 2.7.1-1
ProcVersionSign
Uname: Linux 3.0.0-12-generic x86_64
NonfreeKernelMo
ApportVersion: 1.23-0ubuntu2
Architecture: amd64
Date: Fri Oct 7 17:56:48 2011
InstallationMedia: Kubuntu 11.04 "Natty Narwhal" - Beta 1 amd64 (20110329.1)
PackageArchitec
ProcEnviron:
LANGUAGE=de_DE
LANG=de_DE.UTF-8
LC_MESSAGES=
SHELL=/bin/bash
SourcePackage: virtualenvwrapper
UpgradeStatus: Upgraded to oneiric on 2011-06-23 (106 days ago)
this is how sudo works on ubunt, you run as root but retain the users HOME variable. This can configured in sudo with env_reset, see the manpage.
I don't think there is anything virtualenvwrapper can do about that.