summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2016-01-05 15:08:09 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2016-01-05 23:37:28 -0800
commit4aac468dd735c08eb7441e1129c180381a2c7689 (patch)
tree3141fad19cd5758e90ff51bea23b0cf5f129d7fd /net-nds/nsscache
parentdev-ruby/text: add 1.3.1 (diff)
downloadgentoo-4aac468dd735c08eb7441e1129c180381a2c7689.tar.gz
gentoo-4aac468dd735c08eb7441e1129c180381a2c7689.tar.bz2
gentoo-4aac468dd735c08eb7441e1129c180381a2c7689.zip
net-nds/nsscache: much better authorized_keys command, in use in infra soon.
Package-Manager: portage-2.2.24
Diffstat (limited to 'net-nds/nsscache')
-rw-r--r--net-nds/nsscache/Manifest1
-rw-r--r--net-nds/nsscache/files/authorized-keys-command.py52
-rw-r--r--net-nds/nsscache/nsscache-0.30-r2.ebuild (renamed from net-nds/nsscache/nsscache-0.30-r1.ebuild)6
3 files changed, 5 insertions, 54 deletions
diff --git a/net-nds/nsscache/Manifest b/net-nds/nsscache/Manifest
index 2380aec1616c..7facc4c536cd 100644
--- a/net-nds/nsscache/Manifest
+++ b/net-nds/nsscache/Manifest
@@ -1,2 +1,3 @@
DIST nsscache-0.23.tar.gz 92603 SHA256 b33ea574cd6e9c4f5ce57b8fae9dd64a710ec89d3f382c879f0af8c6215d0d9e SHA512 2bce655f6e8b64eb258779f80620d4514729d221ce9ed9ca7f675c22faeca400478827f27befa9cdac5e95f33934609d84d520af71f756721e22aa0c7cef82d6 WHIRLPOOL 78d6e8abdc4d66df667d2c9e3ab4c6e1c065a224283c94ab44bd51209db373d896b7221923d1948e7cdc36dcfc752d9f98162c3ece95955578b9b7c0c5b28dd8
+DIST nsscache-0.30-gentoo-authorized-keys-command.py 8004 SHA256 956323bc311381da23c788e143706e732eef86ad37cf570209b28206ecea6a1f SHA512 58d3053aa140cbec214033ea3c524e7e7b670aa94a6ff306b9d816ffd4c23b8c781b1178ef7ce14009f8b45afaf05f75e9248e8c1eebef790b838baef5f50c26 WHIRLPOOL 5612cce26ab4172fcf019de702b5d26d830850cff3002dd23a2061b25ebb98d4c4a5436c17a6bcacc952ecdeb2027b677893552fce0520089a0d1f793cac7b75
DIST nsscache-0.30.tar.gz 109615 SHA256 9cbae8768b6671ec7d8a94d76c62be69cd4c704ea792b50b6dbfa2786cfe19e4 SHA512 22c58904eadd2e69405c42263c1c85c7b612151466386870fbea7685ab32835250a84f1acd83fca6f3289582c74df5371cbfb4f354679a302f240fd0ff334712 WHIRLPOOL b9b9384f8c238a49f44ab9037d598f7a4795a52ae6e62de352127a7a53546bb84861b943282c58680fb2c088a5b9a1a4a0c3bb921eecec2e26a2f92b83137718
diff --git a/net-nds/nsscache/files/authorized-keys-command.py b/net-nds/nsscache/files/authorized-keys-command.py
deleted file mode 100644
index 085be71d67c1..000000000000
--- a/net-nds/nsscache/files/authorized-keys-command.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/python
-# vim: ts=4 sts=4 et:
-# pylint: disable=invalid-name
-"""
-OpenSSH AuthorizedKeysCommand: NSSCache input
-Copyright 2016 Gentoo Foundation
-Distributed is distributed under the BSD license.
-
-This script returns one or more authorized keys for use by SSH, by extracting
-them from a local cache file /etc/sshkey.cache.
-
-Two variants are supported, based on the existing nsscache code:
-Format 1:
- username:key1
- username:key2
-Format 2:
- username:['key1', 'key2']
-
-Ensure this script is mentioned in the sshd_config like so:
-AuthorizedKeysCommand /path/to/nsscache/authorized-keys-command.py
-"""
-from __future__ import print_function
-from ast import literal_eval
-from os.path import basename
-import sys
-import errno
-
-SSHKEY_CACHE = '/etc/sshkey.cache'
-
-if __name__ == "__main__":
- if len(sys.argv) != 2:
- sys.exit("Usage: %s %s" % (basename(sys.argv[0]), 'USERNAME'))
-
- try:
- with open(SSHKEY_CACHE, 'r') as f:
- for line in f:
- (username, key) = line.split(':', 1)
- if username != sys.argv[1]:
- continue
- key = key.strip()
- if key.startswith("[") and key.endswith("]"):
- # Python array
- for i in literal_eval(key):
- print(i.strip())
- else:
- # Raw key
- print(key)
- except IOError as err:
- if err.errno in [errno.EPERM, errno.ENOENT]:
- pass
- else:
- raise err
diff --git a/net-nds/nsscache/nsscache-0.30-r1.ebuild b/net-nds/nsscache/nsscache-0.30-r2.ebuild
index 5be043c32bae..b6456123856b 100644
--- a/net-nds/nsscache/nsscache-0.30-r1.ebuild
+++ b/net-nds/nsscache/nsscache-0.30-r2.ebuild
@@ -9,7 +9,9 @@ inherit eutils distutils-r1
DESCRIPTION="commandline tool to sync directory services to local cache"
HOMEPAGE="https://github.com/google/nsscache"
-SRC_URI="https://github.com/google/nsscache/archive/version/${PV}.tar.gz -> ${P}.tar.gz"
+SRC_URI="
+ https://github.com/google/nsscache/archive/version/${PV}.tar.gz -> ${P}.tar.gz
+ https://dev.gentoo.org/~robbat2/nsscache-0.30-gentoo-authorized-keys-command.py"
LICENSE="GPL-2"
SLOT="0"
@@ -40,7 +42,7 @@ src_install() {
doman nsscache.1 nsscache.conf.5
dodoc THANKS nsscache.cron CONTRIBUTING.md README.md
exeinto /usr/libexec/nsscache
- doexe "${FILESDIR}"/authorized-keys-command.py
+ newexe "${DISTDIR}"/nsscache-0.30-gentoo-authorized-keys-command.py authorized-keys-command.py
keepdir /var/lib/nsscache
}