X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Frwho%2Fserv_rwho.c;h=79ea2c6bda50acbb365e14605d21845d4383c289;hp=8967aca3610d2b50c01547aae540838dccdc658e;hb=58c77aea1dda7b206b900bafb9278237456ef737;hpb=25220160fc09e185bbf9f13f7565bb568cc5a463 diff --git a/citadel/modules/rwho/serv_rwho.c b/citadel/modules/rwho/serv_rwho.c index 8967aca36..79ea2c6bd 100644 --- a/citadel/modules/rwho/serv_rwho.c +++ b/citadel/modules/rwho/serv_rwho.c @@ -2,7 +2,7 @@ * This module implements server commands related to the display and * manipulation of the "Who's online" list. * - * Copyright (c) 1987-2012 by the citadel.org team + * Copyright (c) 1987-2019 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -90,13 +90,9 @@ void cmd_rwho(char *argbuf) { struct CitContext *nptr; int nContexts, i; int spoofed = 0; - int user_spoofed = 0; - int room_spoofed = 0; - int host_spoofed = 0; int aide; - char un[40]; char real_room[ROOMNAMELEN], room[ROOMNAMELEN]; - char host[64], flags[5]; + char flags[5]; /* So that we don't keep the context list locked for a long time * we create a copy of it first @@ -113,13 +109,9 @@ void cmd_rwho(char *argbuf) { aide = ( (CC->user.axlevel >= AxAideU) || (CC->internal_pgm) ) ; cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() ); - for (i=0; ifake_roomname, newroomname, - sizeof(CC->fake_roomname) ); - } - else { - safestrncpy(CC->fake_roomname, "", sizeof CC->fake_roomname); - } - cprintf("%d OK\n", CIT_OK); -} - -/* - * Masquerade hostname - */ -void cmd_hchg(char *argbuf) -{ - char newhostname[64]; - - extract_token(newhostname, argbuf, 0, '|', sizeof newhostname); - if (!IsEmptyStr(newhostname)) { - safestrncpy(CC->fake_hostname, newhostname, - sizeof(CC->fake_hostname) ); - } - else { - safestrncpy(CC->fake_hostname, "", sizeof CC->fake_hostname); - } - cprintf("%d OK\n", CIT_OK); -} - - -/* - * Masquerade username (aides only) - */ -void cmd_uchg(char *argbuf) -{ - - char newusername[USERNAME_SIZE]; - - extract_token(newusername, argbuf, 0, '|', sizeof newusername); - - if (CtdlAccessCheck(ac_aide)) return; - - if (!IsEmptyStr(newusername)) { - CC->cs_flags &= ~CS_STEALTH; - memset(CC->fake_username, 0, 32); - if (strncasecmp(newusername, CC->curr_user, - strlen(CC->curr_user))) - safestrncpy(CC->fake_username, newusername, - sizeof(CC->fake_username)); - } - else { - CC->fake_username[0] = '\0'; - CC->cs_flags |= CS_STEALTH; - } - cprintf("%d\n",CIT_OK); -} - - - /* * enter or exit "stealth mode" @@ -378,9 +195,6 @@ CTDL_MODULE_INIT(rwho) if(!threading) { CtdlRegisterProtoHook(cmd_rwho, "RWHO", "Display who is online"); - CtdlRegisterProtoHook(cmd_hchg, "HCHG", "Masquerade hostname"); - CtdlRegisterProtoHook(cmd_rchg, "RCHG", "Masquerade roomname"); - CtdlRegisterProtoHook(cmd_uchg, "UCHG", "Masquerade username"); CtdlRegisterProtoHook(cmd_stel, "STEL", "Enter/exit stealth mode"); //CtdlRegisterSessionHook(dead_io_check, EVT_TIMER, PRIO_QUEUE + 50);