ssh-import-lp-id expects HOME to be set

Bug #528029 reported by Scott Moser
6
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}

Scott Moser (smoser)
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
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in cloud-utils (Ubuntu Lucid):
status: In Progress → Fix Released
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.