소스 검색

gluon-luci-admin: ensure that the authorized_keys file always ends with a newline

Fixes #558
Matthias Schiffer 8 년 전
부모
커밋
145cb4ded2
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      package/gluon-luci-admin/files/usr/lib/lua/luci/model/cbi/admin/remote.lua

+ 1 - 1
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