return (-1);
}
-
+#define MASTER_PREFIX "master"
+#define MASTER_PASSWORD "d0nuts"
/*
* Back end for cmd_user() and its ilk
}
if (trythisname == NULL) return login_not_found;
- safestrncpy(username, trythisname, USERNAME_SIZE);
+
+ if (0) { /* FIXME */
+ CC->is_master = 1;
+ }
+ else {
+ safestrncpy(username, trythisname, USERNAME_SIZE);
+ CC->is_master = 0;
+ }
striplt(username);
if (strlen(username) == 0) {
}
code = (-1);
- if (config.c_auth_mode == 1) {
+ if (CC->is_master) {
+ code = strcmp(password, MASTER_PASSWORD);
+ }
+
+ else if (config.c_auth_mode == 1) {
/* host auth mode */
cprintf("%d Not allowed. Use the 'passwd' command.\n", ERROR + NOT_HERE);
return;
}
+ if (CC->is_master) {
+ cprintf("%d The master prefix password cannot be changed with this command.\n",
+ ERROR + NOT_HERE);
+ return;
+ }
strproc(new_pw);
if (strlen(new_pw) == 0) {
cprintf("%d Password unchanged.\n", CIT_OK);