openssh: keep same permission for /etc/ssh
authorHuangbin Zhan <zhanhb88@gmail.com>
Tue, 2 Nov 2021 12:56:29 +0000 (20:56 +0800)
committerRosen Penev <rosenp@gmail.com>
Fri, 12 Nov 2021 19:04:02 +0000 (11:04 -0800)
Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
net/openssh/Makefile

index 93e32d180ff78afecc2a33c2d67d9b7d46ac728c..ec7fbb00e429d7a3756b2bbcc5c3b55ee78374a8 100644 (file)
@@ -197,13 +197,12 @@ define Build/Compile
 endef
 
 define Package/openssh-moduli/install
-       $(INSTALL_DIR) $(1)/etc/ssh
+       install -d -m0700 $(1)/etc/ssh
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ssh/moduli $(1)/etc/ssh/
 endef
 
 define Package/openssh-client/install
-       $(INSTALL_DIR) $(1)/etc/ssh
-       chmod 0700 $(1)/etc/ssh
+       install -d -m0700 $(1)/etc/ssh
        $(CP) $(PKG_INSTALL_DIR)/etc/ssh/ssh_config $(1)/etc/ssh/
        $(INSTALL_DIR) $(1)/usr/libexec
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh $(1)/usr/libexec/ssh-openssh
@@ -221,8 +220,7 @@ define Package/openssh-keygen/install
 endef
 
 define Package/openssh-server/install
-       $(INSTALL_DIR) $(1)/etc/ssh
-       chmod 0700 $(1)/etc/ssh
+       install -d -m0700 $(1)/etc/ssh
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
        sed -r -i 's,^#(HostKey /etc/ssh/ssh_host_(rsa|ed25519)_key)$$$$,\1,' $(1)/etc/ssh/sshd_config
        $(INSTALL_DIR) $(1)/etc/init.d