Merge lp:~kirkland/openssh/remove-ssh-import-id into lp:ubuntu/natty/openssh

Proposed by Dustin Kirkland  on 2011-01-04
Status: Merged
Merged at revision: 3224
Proposed branch: lp:~kirkland/openssh/remove-ssh-import-id
Merge into: lp:ubuntu/natty/openssh
Diff against target: 202 lines (+13/-142)
7 files modified
debian/changelog (+10/-0)
debian/control (+3/-3)
debian/openssh-server.install (+0/-1)
debian/openssh-server.links (+0/-2)
debian/openssh-server.manpages (+0/-1)
debian/ssh-import-id (+0/-118)
debian/ssh-import-id.1 (+0/-17)
To merge this branch: bzr merge lp:~kirkland/openssh/remove-ssh-import-id
Reviewer Review Type Date Requested Status
Colin Watson 2011-01-04 Approve on 2011-01-05
Review via email: mp+45185@code.launchpad.net

Description of the change

Remove all remnants of the ssh-import-id utility.

Note that this can be merged, but should not be uploaded to the Ubuntu Natty archive until the new source and binary packages for ssh-import-id are accepted into the Ubuntu Natty archive.

See:
 * https://launchpad.net/ubuntu/natty/+queue?queue_state=0&queue_text=ssh-import-id

To post a comment you must log in.
Colin Watson (cjwatson) wrote :

Thanks, looks fine!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-12-14 11:55:37 +0000
3+++ debian/changelog 2011-01-04 22:33:15 +0000
4@@ -1,3 +1,13 @@
5+openssh (1:5.6p1-2ubuntu4) UNRELEASED; urgency=low
6+
7+ * debian/control, debian/openssh-server.install, debian/openssh-
8+ server.links, debian/openssh-server.manpages, debian/ssh-import-id,
9+ debian/ssh-import-id.1: drop all remnants of the ssh-import-id
10+ utility which is now in its own source package; have openssh-server
11+ recommend that package
12+
13+ -- Dustin Kirkland <kirkland@ubuntu.com> Tue, 04 Jan 2011 16:23:03 -0600
14+
15 openssh (1:5.6p1-2ubuntu3) natty; urgency=low
16
17 [ Clint Byrum ]
18
19=== modified file 'debian/control'
20--- debian/control 2010-10-13 10:24:49 +0000
21+++ debian/control 2011-01-04 22:33:15 +0000
22@@ -45,9 +45,9 @@
23 Priority: optional
24 Architecture: any
25 Depends: ${shlibs:Depends}, ${misc:Depends}, debconf (>= 1.2.0) | debconf-2.0, libpam-runtime (>= 0.76-14), libpam-modules (>= 0.72-9), adduser (>= 3.9), dpkg (>= 1.9.0), openssh-client (= ${binary:Version}), lsb-base (>= 3.2-13), libssl0.9.8 (>= 0.9.8g-9), procps
26-Recommends: xauth
27-Conflicts: ssh (<< 1:3.8.1p1-9), ssh-nonfree (<<2), ssh-socks, ssh2, sftp, rsh-client (<<0.16.1-1), ssh-krb5 (<< 1:4.3p2-7), ssh-import
28-Replaces: ssh, openssh-client (<< 1:3.8.1p1-11), ssh-krb5, ssh-import
29+Recommends: xauth, ssh-import-id
30+Conflicts: ssh (<< 1:3.8.1p1-9), ssh-nonfree (<<2), ssh-socks, ssh2, sftp, rsh-client (<<0.16.1-1), ssh-krb5 (<< 1:4.3p2-7)
31+Replaces: ssh, openssh-client (<< 1:3.8.1p1-11), ssh-krb5
32 Suggests: ssh-askpass, rssh, molly-guard, openssh-blacklist, openssh-blacklist-extra, ufw
33 Provides: ssh-server
34 Description: secure shell (SSH) server, for secure access from remote machines
35
36=== modified file 'debian/openssh-server.install'
37--- debian/openssh-server.install 2010-07-22 12:45:31 +0000
38+++ debian/openssh-server.install 2011-01-04 22:33:15 +0000
39@@ -4,4 +4,3 @@
40 usr/share/man/man5/sshd_config.5
41 usr/share/man/man8/sftp-server.8
42 usr/share/man/man8/sshd.8
43-debian/ssh-import-id usr/bin/
44
45=== modified file 'debian/openssh-server.links'
46--- debian/openssh-server.links 2010-07-22 12:57:25 +0000
47+++ debian/openssh-server.links 2011-01-04 22:33:15 +0000
48@@ -1,3 +1,1 @@
49 usr/lib/openssh/sftp-server usr/lib/sftp-server
50-usr/bin/ssh-import-id usr/bin/ssh-import-lp-id
51-usr/share/man/man1/ssh-import-id.1.gz usr/share/man/man1/ssh-import-lp-id.1.gz
52
53=== removed file 'debian/openssh-server.manpages'
54--- debian/openssh-server.manpages 2010-07-22 12:45:31 +0000
55+++ debian/openssh-server.manpages 1970-01-01 00:00:00 +0000
56@@ -1,1 +0,0 @@
57-debian/ssh-import-id.1
58
59=== removed file 'debian/ssh-import-id'
60--- debian/ssh-import-id 2010-07-22 14:48:57 +0000
61+++ debian/ssh-import-id 1970-01-01 00:00:00 +0000
62@@ -1,118 +0,0 @@
63-#!/bin/sh
64-#
65-# ssh-import-id - authorize a user by fetching their key
66-# from a public SSH keyserver; Launchpad.net
67-# by default
68-#
69-# Copyright (C) 2010 Canonical Ltd.
70-#
71-# Authors: Dustin Kirkland <kirkland@canonical.com>
72-# Scott Moser <smoser@canonical.com>
73-#
74-# All rights reserved.
75-#
76-# Redistribution and use in source and binary forms, with or without
77-# modification, are permitted provided that the following conditions
78-# are met:
79-# 1. Redistributions of source code must retain the above copyright
80-# notice, this list of conditions and the following disclaimer.
81-# 2. Redistributions in binary form must reproduce the above copyright
82-# notice, this list of conditions and the following disclaimer in the
83-# documentation and/or other materials provided with the distribution.
84-#
85-# THIS SOFTWARE IS PROVIDED BY CANONICAL LTD. ``AS IS'' AND ANY EXPRESS OR
86-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
87-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
88-# IN NO EVENT SHALL CANONICAL LTD. BE LIABLE FOR ANY DIRECT, INDIRECT,
89-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
90-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
91-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
92-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
93-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
94-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
95-
96-# Abort on any unhandled error
97-set -e
98-
99-# The following URL *must* be an https address with a valid, signed certificate!!!
100-URL="https://launchpad.net/~%s/+sshkeys"
101-
102-usage() {
103- echo
104- echo "Usage:"
105- echo " $0 [USER_ID_1] [USER_ID_2] ... [USER_ID_n]"
106- echo
107- exit 1
108-}
109-
110-[ -n "$1" ] || usage
111-
112-error() {
113- printf "ERROR: %s\n" "$@" 1>&2
114- exit 1
115-}
116-
117-warn() {
118- printf "WARNING: %s\n" "$@" 1>&2
119-}
120-
121-info() {
122- printf "INFO: %s\n" "$@"
123-}
124-
125-url_encode() {
126- # from http://andy.wordpress.com/2008/09/17/urlencode-in-bash-with-perl/
127- printf "%s" "$1" | perl -pe's/([^-_.~A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg'
128-}
129-
130-validate_keys() {
131- # Prune blank lines, join lines that don't have a '= ',
132- # remove invalid characters
133- sed -i -e '/^$/d' \
134- -e ':join /=[ ]/!{ N; s/\n// ; b join }' \
135- -e 's/[^a-zA-Z0-9@: .\/=+-]//g' "$1"
136- # Count lines
137- lines=$(wc -l < "${1}")
138- # Count valid keys
139- keys=$(grep -c "^ssh-[dr]s[sa] [a-zA-Z0-9: .\/=+-]\+ " "$1")
140- # Validate counts match, and >0
141- [ $lines -gt 0 ] && [ $keys -eq $lines ]
142-}
143-
144-# Only support writing to this user's authorized_keys file
145-if [ -z "$HOME" ]; then
146- uid=$(id -u) || error "Cannot determine user id"
147- [ -n "$uid" ] || error "User id cannot be empty"
148- pwline=$(getent passwd "$uid") || error "Cannot get passwd entry"
149- HOME=$(echo "$pwline" | awk -F: '{print $6}') || error "Cannot determine home directory"
150- [ -n "$HOME" ] || error "Home directory cannot be empty"
151-fi
152-
153-DIR="$HOME/.ssh"
154-FILE="$DIR"/authorized_keys
155-
156-mkdir -m 0700 "$DIR" 2>/dev/null || true
157-[ -d "$DIR" ] || error "Cannot create directory [$DIR]"
158-[ -w "$DIR" ] || error "Cannot write to directory [$DIR]"
159-[ -e "$FILE" ] || (umask 0177 && touch "$FILE") || error "Cannot create [$FILE]"
160-
161-rc=0
162-tmp=$(mktemp)
163-trap "rm -f $tmp" EXIT HUP INT QUIT TERM
164-for i in "$@"; do
165- i=$(url_encode "$i") || error "Failed encoding [$i]"
166- url=$(printf "$URL" "$i")
167- if env -i wget --quiet -O- "$url" > "$tmp"; then
168- echo >> "$tmp" # needed for wc
169- if ! validate_keys "$tmp"; then
170- warn "Invalid keys at [$url]"
171- continue
172- fi
173- cat "$tmp" >> "$FILE" || error "Could not write to [$tmp]"
174- info "Successfully authorized [$i]"
175- else
176- rc=$?
177- warn "Failed to retrieve key for [$i] from [$url]"
178- fi
179-done
180-exit $rc
181
182=== removed file 'debian/ssh-import-id.1'
183--- debian/ssh-import-id.1 2010-08-02 14:56:36 +0000
184+++ debian/ssh-import-id.1 1970-01-01 00:00:00 +0000
185@@ -1,17 +0,0 @@
186-.TH ssh\-import\-id 1 "23 Feb 2010" ssh\-import "ssh\-import"
187-.SH NAME
188-ssh\-import\-id \- retrieve one or more public keys from a public keyserver (Launchpad.net by default) and append them to the current user's authorized_keys file
189-
190-.SH SYNOPSIS
191-.BI "ssh\-import\-id [launchpad_id_1] [launchpad_id_2] [launchpad_id_3] ...
192-
193-.SH DESCRIPTION
194-This utility will securely contact a public keyserver (Launchpad.net by default) and retrieve one or more user's public keys, and append these to the current user's \fI~/.ssh/authorized_keys\fP file.
195-
196-.SH SEE ALSO
197-\fIssh\fP(1)
198-
199-.SH AUTHOR
200-This manpage and the utility was written by Dustin Kirkland <kirkland@canonical.com> for Ubuntu systems (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the BSD License.
201-
202-On Debian systems, the complete text of the BSD License can be found in /usr/share/common-licenses/BSD.

Subscribers

People subscribed via source and target branches