Allow SSH keys for only "/"
This commit is contained in:
parent
18fa6d794a
commit
808de3fdbf
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ foreach ($_POST['keys'] as $i => $key) {
|
||||||
unset($_POST['keys'][$i]);
|
unset($_POST['keys'][$i]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (preg_match('#^/[/\p{L}\{M}\p{N}\p{P}\p{S}\p{Zs}]{1,254}$#Du', $key['dir'] ?? '') !== 1)
|
if (preg_match('#^/[/\p{L}\{M}\p{N}\p{P}\p{S}\p{Zs}]{0,254}$#Du', $key['dir'] ?? '') !== 1)
|
||||||
output(403, _('Path is not valid.'));
|
output(403, _('Path is not valid.'));
|
||||||
if (preg_match('#' . ED25519_PUBKEY_REGEX . '#D', $key['public-key']) !== 1)
|
if (preg_match('#' . ED25519_PUBKEY_REGEX . '#D', $key['public-key']) !== 1)
|
||||||
output(403, _('Ed25519 public key seems wrongly formatted.'));
|
output(403, _('Ed25519 public key seems wrongly formatted.'));
|
||||||
|
|
Loading…
Reference in a new issue