From 145cb4ded2834a4c36a4ce077611e73a394fc3d2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 5 Feb 2016 18:31:25 +0100 Subject: [PATCH] gluon-luci-admin: ensure that the authorized_keys file always ends with a newline Fixes #558 --- .../files/usr/lib/lua/luci/model/cbi/admin/remote.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-luci-admin/files/usr/lib/lua/luci/model/cbi/admin/remote.lua b/package/gluon-luci-admin/files/usr/lib/lua/luci/model/cbi/admin/remote.lua index 13840542..c79c0195 100644 --- a/package/gluon-luci-admin/files/usr/lib/lua/luci/model/cbi/admin/remote.lua +++ b/package/gluon-luci-admin/files/usr/lib/lua/luci/model/cbi/admin/remote.lua @@ -44,7 +44,7 @@ if fs.access("/etc/config/dropbear") then function keys.write(self, section, value) if value then - fs.writefile("/etc/dropbear/authorized_keys", value:gsub("\r\n", "\n")) + fs.writefile("/etc/dropbear/authorized_keys", value:gsub("\r\n", "\n"):trim() .. "\n") end end