mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-02-03 15:01:06 +00:00
Disable admin password by default
This commit is contained in:
parent
650e0eafce
commit
91081a3e53
2 changed files with 7 additions and 11 deletions
|
@ -1051,15 +1051,6 @@ void D_SRB2Main(void)
|
||||||
|
|
||||||
if (M_CheckParm("-password") && M_IsNextParm())
|
if (M_CheckParm("-password") && M_IsNextParm())
|
||||||
D_SetPassword(M_GetNextParm());
|
D_SetPassword(M_GetNextParm());
|
||||||
else
|
|
||||||
{
|
|
||||||
size_t z;
|
|
||||||
char junkpw[25];
|
|
||||||
for (z = 0; z < 24; z++)
|
|
||||||
junkpw[z] = (char)(rand() & 64)+32;
|
|
||||||
junkpw[24] = '\0';
|
|
||||||
D_SetPassword(junkpw);
|
|
||||||
}
|
|
||||||
|
|
||||||
// add any files specified on the command line with -file wadfile
|
// add any files specified on the command line with -file wadfile
|
||||||
// to the wad list
|
// to the wad list
|
||||||
|
|
|
@ -2656,10 +2656,12 @@ static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt,
|
||||||
|
|
||||||
#define BASESALT "basepasswordstorage"
|
#define BASESALT "basepasswordstorage"
|
||||||
static UINT8 adminpassmd5[16];
|
static UINT8 adminpassmd5[16];
|
||||||
|
static boolean adminpasswordset = false;
|
||||||
|
|
||||||
void D_SetPassword(const char *pw)
|
void D_SetPassword(const char *pw)
|
||||||
{
|
{
|
||||||
D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &adminpassmd5);
|
D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &adminpassmd5);
|
||||||
|
adminpasswordset = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remote Administration
|
// Remote Administration
|
||||||
|
@ -2728,6 +2730,9 @@ static void Got_Login(UINT8 **cp, INT32 playernum)
|
||||||
|
|
||||||
READMEM(*cp, sentmd5, 16);
|
READMEM(*cp, sentmd5, 16);
|
||||||
|
|
||||||
|
if (!adminpasswordset)
|
||||||
|
CONS_Printf(M_GetText("Password from %s failed (no password set).\n"), player_names[playernum]);
|
||||||
|
|
||||||
if (client)
|
if (client)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue