Assumes that it runs under sudo and breaks if it doesn't.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openstack-installer |
Triaged
|
High
|
Mike McCracken |
Bug Description
Hi,
I made it use utils.install_
I don't know if i should revert back to:
if not user_name:
return
instead.
Author: Ian Kumlien <email address hidden>
Date: Wed Jan 21 15:19:33 2015 +0100
drop_
If the user didn't use sudo or f.ex. used sudo su
to avoid rootsquash problems on homedirectories then
SUDO_USER is not set and we'll basically break.
diff --git a/cloudinstall/
index 2daf49c..ec90cfa 100644
--- a/cloudinstall/
+++ b/cloudinstall/
@@ -181,7 +181,8 @@ class MultiInstall(
if os.geteuid() != 0:
return
- user_name = os.getenv(
+ user_name = utils.install_
+
pwnam = pwd.getpwnam(
Changed in cloud-installer: | |
assignee: | nobody → Mike McCracken (mikemc) |
importance: | Undecided → High |
status: | New → Triaged |
Ian, thanks for looking into this. Can you explain a little further about what problems this fixes?
I'm afraid I'm not familiar with reasons to use 'sudo su' (I assume, followed by running the installer as root) instead of just 'sudo openstack-install'.
In any case, if you do use sudo su, does it make sense to drop privileges? Probably not, so I think your initial comment about just returning if SUDO_USER is not set is probably better.
However, since we've assumed that the only way this should be run is using 'sudo openstack-install', you may experience other issues, probably related to permissions problems with files created by other places that use utils.install_user and expect that to not return root.