Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-47909] @daniel-beck asks about usernames containing valid $ …
…escapes. Behavior is partly broken.
  • Loading branch information
jglick committed Nov 9, 2017
1 parent 5d2b824 commit 48fcab9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/src/test/java/hudson/model/UserTest.java
Expand Up @@ -823,6 +823,13 @@ public void shellyUsernameMigrated() {
assertFalse(new File(rootDir, "bla$phem.us").exists());
assertTrue(user.getConfigFile().getFile().exists());
assertThat(user.getFullName(), equalTo("Weird Username"));
user = User.getById("make\u1000000", false);
assertNotNull("we do not prevent accesses to the phony name, alas", user);
user = User.getById("make$1000000", false);
assertCorrectConfig(user, "users/make$00241000000/config.xml");
assertFalse(new File(rootDir, "make$1000000").exists());
assertTrue("but asking for the real name triggers migration", user.getConfigFile().getFile().exists());
assertThat(user.getFullName(), equalTo("Greedy Fella"));
}

private static void assertCorrectConfig(User user, String unixPath) {
Expand Down
Binary file not shown.

0 comments on commit 48fcab9

Please sign in to comment.