Skip to content

Commit f42dc41

Browse files
committed
Remove @password command in favor of @newpassword
@password and @newpassword were both wizard-only and functionally redundant. Point admins at @newpassword for changing the default God/Wizard passwords, and drop the now-unused PASS_MINE key.
1 parent cb88b90 commit f42dc41

8 files changed

Lines changed: 2 additions & 42 deletions

File tree

TODO

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
* Do we still need object ownership?
66
* verbs.c and verbs.h can probably be crunched elsewhere
7-
* Dedupe @newpassword and @password
87
* Offer a non-privileged way to change your own password.
98
* Add bad names list
109
* Unit and integration test strategy for Lua

docs/content/en/docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ If all goes well, you'll see a StompyMUX log stream.
4545
Use your preferred MUD client (or `telnet`) to connec to `localhost` port `5555`.
4646
There are two Wizard (admin) characters, `#1` (God) and `#2` (Wizard). They both
4747
have the same default password of `btmuxr0x`. Change these as soon as possible
48-
with the `@password` command.
48+
with the `@newpassword` command.
4949

5050
## Compile options
5151

game/aliases.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
"@oemi" = "@oemit"
7575
"@op" = "@open"
7676
"@ope" = "@open"
77-
"@pass" = "@password"
7877
"@pcre" = "@pcreate"
7978
"@pe" = "@pemit"
8079
"@pem" = "@pemit"

src/mux/commands/command.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,6 @@ CMDENT command_table[] = {
334334
CS_TWO_ARG,
335335
{.invoke = do_pemit}},
336336
{"@open", open_sw, CA_WIZARD, 0, CS_TWO_ARG | CS_ARGV, {.invoke = do_open}},
337-
{"@password",
338-
nullptr,
339-
CA_WIZARD,
340-
PASS_MINE,
341-
CS_TWO_ARG,
342-
{.invoke = do_password}},
343337
{"@pcreate",
344338
nullptr,
345339
CA_WIZARD,

src/mux/commands/command.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ void do_name(CommandInvocation *invocation);
8888
void do_newpassword(CommandInvocation *invocation);
8989
void do_notify(CommandInvocation *invocation); /* Notify or drain semaphore */
9090
void do_open(CommandInvocation *invocation);
91-
void do_page(CommandInvocation *invocation); /* Message a faraway player. */
92-
void do_password(CommandInvocation *invocation); /* Change my password */
91+
void do_page(CommandInvocation *invocation); /* Message a faraway player. */
9392
void do_pcreate(CommandInvocation *invocation);
9493
void do_pemit(CommandInvocation *invocation); /* Message a specific object. */
9594
void do_power(CommandInvocation *invocation); /* Sets powers */

src/mux/server/server_api.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ constexpr int NFY_DRAIN = 2; /* Delete waiting commands */
181181
constexpr int OPEN_LOCATION = 0; /* Open exit in my location */
182182
constexpr int OPEN_INVENTORY = 1; /* Open exit in me */
183183
constexpr int PASS_ANY = 1; /* name=newpass */
184-
constexpr int PASS_MINE = 2; /* oldpass=newpass */
185184
constexpr int PCRE_PLAYER = 1; /* create new player */
186185
constexpr int PEMIT_PEMIT = 1; /* emit to named player */
187186
constexpr int PEMIT_OEMIT = 2; /* emit to all in current room except named */

src/mux/world/player.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -286,35 +286,6 @@ DbRef create_player(EvaluationContext *evaluation, char *name, char *password) {
286286
return player;
287287
}
288288

289-
/**
290-
* Change the password for a player
291-
*/
292-
void do_password(CommandInvocation *invocation) {
293-
EvaluationContext *evaluation = &invocation->context->evaluation;
294-
DbRef player = invocation->player;
295-
char *oldpass = invocation->first;
296-
char *newpass = invocation->second;
297-
WorldContext *world = invocation->context->world;
298-
DbRef aowner;
299-
long aflags;
300-
char hashed_password[crypto_pwhash_STRBYTES];
301-
char *target;
302-
303-
target = attribute_get(world->database, player, A_PASS, &aowner, &aflags);
304-
if (!*target || !check_pass(world, player, oldpass)) {
305-
notify(evaluation, player, "Sorry.");
306-
} else if (!ok_password(world->configuration, newpass)) {
307-
notify(evaluation, player, "Bad new password.");
308-
} else if (!password_hash(world->configuration, newpass, hashed_password)) {
309-
notify(evaluation, player, "Unable to change password.");
310-
} else {
311-
attribute_add_raw(world->database, player, A_PASS, hashed_password);
312-
sodium_memzero(hashed_password, sizeof(hashed_password));
313-
notify(evaluation, player, "Password changed.");
314-
}
315-
free_lbuf(target);
316-
}
317-
318289
/**
319290
* Display login history data.
320291
*/

src/mux/world/player.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ void badname_remove(WorldContext *world, char *name);
2323
int badname_check(WorldContext *world, char *name);
2424
void badname_list(EvaluationContext *evaluation, WorldContext *world,
2525
DbRef player, const char *name);
26-
void do_password(CommandInvocation *invocation);
2726
void do_last(CommandInvocation *invocation);

0 commit comments

Comments
 (0)