aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-04-23 14:26:05 +0200
committerGravatar Christian Hesse <mail@eworm.de>2024-04-23 14:26:05 +0200
commitf11da7dd07f5cf668ef8980a5e34e7fd3ee5a19a (patch)
tree4cc835907ca179884d16324cda44ef56dbfcafc5
parent00ca37c068518b6c0252e1a09d365d5ea49d8d3b (diff)
mod/ssh-keys-import: create directory later
-rw-r--r--mod/ssh-keys-import.rsc10
1 files changed, 5 insertions, 5 deletions
diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc
index f37c28b..e920762 100644
--- a/mod/ssh-keys-import.rsc
+++ b/mod/ssh-keys-import.rsc
@@ -38,11 +38,6 @@
:return false;
}
- :if ([ $MkDir "tmpfs/ssh-keys-import" ] = false) do={
- $LogPrint warning $0 ("Creating directory 'tmpfs/ssh-keys-import' failed!");
- :return false;
- }
-
:local FingerPrintMD5 [ :convert from=base64 transform=md5 to=hex ($KeyVal->1) ];
:if ([ :len [ /user/ssh-keys/find where user=$User key-owner~("\\bmd5=" . $FingerPrintMD5 . "\\b") ] ] > 0) do={
@@ -51,6 +46,11 @@
:return false;
}
+ :if ([ $MkDir "tmpfs/ssh-keys-import" ] = false) do={
+ $LogPrint warning $0 ("Creating directory 'tmpfs/ssh-keys-import' failed!");
+ :return false;
+ }
+
:local FileName ("tmpfs/ssh-keys-import/key-" . [ $GetRandom20CharAlNum 6 ] . ".pub");
/file/add name=$FileName contents=($Key . ", md5=" . $FingerPrintMD5);
$WaitForFile $FileName;