Browse Source

Allow SSH keys for only "/"

Miraty 1 year ago
parent
commit
808de3fdbf
1 changed files with 1 additions and 1 deletions
  1. 1 1
      pg-act/ht/keys.php

+ 1 - 1
pg-act/ht/keys.php

@@ -9,7 +9,7 @@ foreach ($_POST['keys'] as $i => $key) {
 		unset($_POST['keys'][$i]);
 		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.'));
 	if (preg_match('#' . ED25519_PUBKEY_REGEX . '#D', $key['public-key']) !== 1)
 		output(403, _('Ed25519 public key seems wrongly formatted.'));