Compare commits

..

No commits in common. '0aac610b4903317737cf1fc99891c26ed6fa7436' and '644506e891b2255ef598cffef5939f62af827497' have entirely different histories.

4
.gitignore vendored

@ -1,6 +1,2 @@
tmp
debian/*.log
debian/.debhelper
debian/duma-ssh-central-auth.substvars
debian/duma-ssh-central-auth
debian/files

7
debian/changelog vendored

@ -1,10 +1,3 @@
duma-ssh-central-auth (0.2-1) unstable; urgency=medium
* Add forgotten reading of ACL for all servers
* Follow symlinks to fix working with aliases inside users/
-- Mikhail Novosyolov <mikhailnov@dumalogiya.ru> Tue, 09 Feb 2021 17:06:00 +0300
duma-ssh-central-auth (0.1-2) unstable; urgency=medium
* Initial build

@ -16,7 +16,6 @@ _main(){
echo_err "No user defined!"
return 1
fi
ALLOWED=0
user="$1"
# not --fqdn, it may give strange results,
# e.g. webinar.dumalogiya.ru -> webinar
@ -44,18 +43,12 @@ _main(){
ACL="${DIR}/servers/${hostname}"
if [ ! -f "$ACL" ] || [ ! -r "$ACL" ]; then
echo_err "ACL for this server does not exist or cannot be read!"
return 2
fi
if grep -q "^${user}$" "$ACL"; then
ALLOWED=1
else
if grep -q "^${user}$" "${DIR}/servers/all"; then
ALLOWED=1
fi
fi
if [ "$ALLOWED" = 1 ]; then
# Выводим все публичные ключи пользователя на stdout
# Если файлы не будут найдены, xargs сделает ненулевой код возврата
find -L "${DIR}/users/${user}" -name "*.key" -type f | xargs cat
find "${DIR}/users/${user}" -name "*.key" -type f | xargs cat
else
echo_err "User ${user} does not have access to ${hostname}!"
return 2

Loading…
Cancel
Save