diff options
author | zeripath <art27@cantab.net> | 2019-01-24 14:12:17 +0000 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-01-24 16:12:17 +0200 |
commit | 44371b96f56d408ed9af487d482ea021bfabeafa (patch) | |
tree | ef1255b481b05eba285f1267920097d194ca8cc9 /integrations/user_test.go | |
parent | cd83c2ca051f9d6a3f7b2842e19aaa2c069cf769 (diff) | |
download | gitea-44371b96f56d408ed9af487d482ea021bfabeafa.tar.gz gitea-44371b96f56d408ed9af487d482ea021bfabeafa.zip |
Ensure valid git author names passed in signatures (#5774)
* Ensure valid git author names passed in signatures
Fix #5772 - Git author names are not allowed to include `\n` `<` or `>` and
must not be empty. Ensure that the name passed in a signature is valid.
* Account for pathologically named external users
LDAP and the like usernames are not checked in the same way that users who signup are.
Therefore just ensure that user names are also git safe and if totally pathological -
Set them to "user-$UID"
* Add Tests and adjust test users
Make our testcases a little more pathological so that we be sure that integration
tests have a chance to spot these cases.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'integrations/user_test.go')
-rw-r--r-- | integrations/user_test.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/integrations/user_test.go b/integrations/user_test.go index 7ff986d546..a6ad164d61 100644 --- a/integrations/user_test.go +++ b/integrations/user_test.go @@ -47,6 +47,7 @@ func TestRenameInvalidUsername(t *testing.T) { "%2f..", "%00", "thisHas ASpace", + "p<A>tho>lo<gical", } session := loginUser(t, "user2") |