// Main source module for the client program.
//
-// Copyright (c) 1987-2019 by the citadel.org team
+// Copyright (c) 1987-2022 by the citadel.org team
//
// This program is open source software. Use, duplication, and/or
// disclosure are subject to the GNU General Purpose License version 3.
void userlist(CtdlIPC * ipc, char *patn) {
char buf[SIZ];
- char fl[SIZ];
+ char fl[26]; // a buffer this small will prevent it overrunning the column
struct tm tmbuf;
time_t lc;
int r; // IPC response code
scr_printf("%s\n", aaa);
return;
}
- safestrncpy(room_name, room->RRname, ROOMNAMELEN);
+ strncpy(room_name, room->RRname, ROOMNAMELEN);
room_flags = room->RRflags;
room_flags2 = room->RRflags2;
from_floor = curr_floor;
int a, b, mcmd;
char aaa[100], bbb[100]; /* general purpose variables */
char argbuf[64]; /* command line buf */
- char nonce[NONCE_SIZE];
char *telnet_client_host = NULL;
char *sptr, *sptr2; /* USed to extract the nonce */
- char hexstring[MD5_HEXSTRING_SIZE];
char password[SIZ];
struct ctdlipcmisc chek;
struct ctdluser *myself = NULL;
logoff(ipc, atoi(aaa));
}
- /* If there is a [nonce] at the end, put the nonce in <nonce>, else nonce
- * is zeroized.
- */
-
- if ((sptr = strchr(aaa, '<')) == NULL) {
- nonce[0] = '\0';
- } else {
- if ((sptr2 = strchr(sptr, '>')) == NULL) {
- nonce[0] = '\0';
- } else {
- sptr2++;
- *sptr2 = '\0';
- strncpy(nonce, sptr, (size_t) NONCE_SIZE);
- }
- }
-
-#ifdef HAVE_OPENSSL
+#ifdef HAVE_OPENSSLLLLLL
/* Evaluate encryption preferences */
if (arg_encrypt != RC_NO && rc_encrypt != RC_NO) {
if (!ipc->isLocal || arg_encrypt == RC_YES || rc_encrypt == RC_YES) {
if (!IsEmptyStr(fullname)) {
r = CtdlIPCTryLogin(ipc, fullname, aaa);
if (r / 100 == 3) {
- if (*nonce) {
- r = CtdlIPCTryApopPassword(ipc,
- make_apop_string(password, nonce, hexstring, sizeof hexstring),
- aaa);
- } else {
- r = CtdlIPCTryPassword(ipc, password, aaa);
- }
+ r = CtdlIPCTryPassword(ipc, password, aaa);
}
-
if (r / 100 == 2) {
load_user_info(aaa);
goto PWOK;
- } else {
+ }
+ else {
set_stored_password(hostbuf, portbuf, "", "");
}
}
newprompt("\rPlease enter your password: ", password, -(SIZ - 1));
}
- if (*nonce) {
- r = CtdlIPCTryApopPassword(ipc, make_apop_string(password, nonce, hexstring, sizeof hexstring), aaa);
- if (r / 100 != 2) {
- strproc(password);
- r = CtdlIPCTryApopPassword(ipc, make_apop_string(password, nonce, hexstring, sizeof hexstring), aaa);
- }
- } else {
+ r = CtdlIPCTryPassword(ipc, password, aaa);
+ if (r / 100 != 2) {
+ strproc(password);
r = CtdlIPCTryPassword(ipc, password, aaa);
- if (r / 100 != 2) {
- strproc(password);
- r = CtdlIPCTryPassword(ipc, password, aaa);
- }
}
if (r / 100 == 2) {