Mercurial > hg > rlgallery-misc
annotate dgl/rlgwebd-compat.patch @ 60:876786c55450
Reduce the score graphs' column widths.
More and narrower categories bring out more detail.
| author | John "Elwin" Edwards |
|---|---|
| date | Wed, 21 Jan 2015 10:45:00 -0500 |
| parents | ce26225f7d9d |
| children | c2127bc98694 |
| rev | line source |
|---|---|
| 24 | 1 diff --git a/dgamelaunch.c b/dgamelaunch.c |
| 2 index fbf6ef5..b52b545 100644 | |
| 3 --- a/dgamelaunch.c | |
| 4 +++ b/dgamelaunch.c | |
| 5 @@ -1489,7 +1489,10 @@ int | |
| 6 changepw (int dowrite) | |
| 7 { | |
| 8 char buf[DGL_PASSWDLEN+1]; | |
| 9 + char salt[21]; | |
| 10 int error = 2; | |
| 11 + int i; | |
| 12 + FILE *urandom; | |
| 13 | |
| 14 /* A precondition is that struct `me' exists because we can be not-yet-logged-in. */ | |
| 15 if (!me) { | |
| 16 @@ -1553,8 +1556,28 @@ changepw (int dowrite) | |
| 17 error = 1; | |
| 18 } | |
| 19 | |
| 20 + salt[0] = salt[2] = salt[19] = '$'; | |
| 21 + salt[1] = '6'; | |
| 22 + salt[20] = '\0'; | |
| 23 + urandom = fopen("/dev/urandom", "r"); | |
| 24 + for (i = 3; i < 19; i++) { | |
| 25 + /* This does waste four random bytes. */ | |
| 26 + fread(salt + i, 1, 1, urandom); | |
| 27 + salt[i] &= 0x3f; | |
| 28 + if (salt[i] < 26) | |
| 29 + salt[i] += 'a'; | |
| 30 + else if (salt[i] < 52) | |
| 31 + salt[i] = 'A' + salt[i] - 26; | |
| 32 + else if (salt[i] < 62) | |
| 33 + salt[i] = '0' + salt[i] - 52; | |
| 34 + else if (salt[i] == 62) | |
| 35 + salt[i] = '.'; | |
| 36 + else | |
| 37 + salt[i] = '/'; | |
| 38 + } | |
| 39 + fclose(urandom); | |
| 40 free(me->password); | |
| 41 - me->password = strdup (crypt (buf, buf)); | |
| 42 + me->password = strdup (crypt (buf, salt)); | |
| 43 | |
|
ce26225f7d9d
Switch to the Git version of dgamelaunch. |
