ssh-import-lp-id expects HOME to be set
Bug #528029 reported by
Scott Moser
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-utils (Ubuntu) |
Fix Released
|
Medium
|
Dustin Kirkland | ||
Lucid |
Fix Released
|
Medium
|
Dustin Kirkland |
Bug Description
Binary package hint: cloud-init
if HOME is not available in the environment, then ssh-import-lp-id will write (or attempt to write) to /.ssh .
2 paths:
1. fail, say "HOME must be set", exit 1
2. try harder to get home, if you can't then fail
Here is how to try harder:
gethome() {
local id=$1 pwline="" home=""
{ [ -n "$id" ] || id=$(id -u) ; } || return 1
pwline=$(getent passwd "${id}") || return 1
home=$(echo "${pwline}" | awk -F: '{print $6}') || return 1
[ -n "${home}" ] && echo "${home}"
}
{ [ -n "$HOME" ] || HOME=$(gethome); } || fail "failed to get HOME"
echo HOME=${HOME}
Changed in cloud-init (Ubuntu): | |
assignee: | nobody → Dustin Kirkland (kirkland) |
description: | updated |
affects: | cloud-init (Ubuntu) → cloud-utils (Ubuntu) |
Changed in cloud-utils (Ubuntu): | |
status: | New → In Progress |
importance: | Undecided → Medium |
milestone: | none → ubuntu-10.04-beta-1 |
To post a comment you must log in.
This bug was fixed in the package cloud-utils - 0.7-0ubuntu1
---------------
cloud-utils (0.7-0ubuntu1) lucid; urgency=low
* ssh-import-lp-id: ensure that $HOME is set properly, LP: #528029;
add a usage statement
-- Dustin Kirkland <email address hidden> Thu, 25 Feb 2010 16:19:35 -0600