Fix shellcheck issue SC2174 master
authorMichael Prokop <mika@grml.org>
Thu, 3 Sep 2020 10:05:43 +0000 (12:05 +0200)
committerMichael Prokop <mika@grml.org>
Thu, 3 Sep 2020 10:05:43 +0000 (12:05 +0200)
Fixes:

|    mkdir -m 0700 -p "${AUTHORIZED_KEYS_TARGET}"
|          ^-- SC2174: When used with -p, -m only applies to the deepest directory.

Closes: #158

grml-debootstrap

index 823d876..52adf78 100755 (executable)
@@ -1851,7 +1851,8 @@ iface ${interface} inet dhcp
 
     AUTHORIZED_KEYS_TARGET="${MNTPOINT}/root/.ssh/"
     einfo "Copying '${AUTHORIZED_KEYS_SOURCE}' to '${AUTHORIZED_KEYS_TARGET}' as requested via --sshcopyauth option."
-    mkdir -m 0700 -p "${AUTHORIZED_KEYS_TARGET}"
+    mkdir -p "${AUTHORIZED_KEYS_TARGET}"
+    chmod 0700 "${AUTHORIZED_KEYS_TARGET}"
     if cp "${AUTHORIZED_KEYS_SOURCE}" "${AUTHORIZED_KEYS_TARGET}" ; then
       eend 0
     else