16 #include "sysdep_decls.h"
17 #include "citserver.h"
20 #include "housekeeping.h"
25 #include "locate_host.h"
28 #include "dynloader.h"
30 struct CitContext *ContextList = NULL;
31 int ScheduledShutdown = 0;
34 * Various things that need to be initialized at startup
36 void master_startup(void) {
37 lprintf(7, "Opening databases\n");
40 lprintf(7, "Checking floor reference counts\n");
45 * Cleanup routine to be called when the server is shutting down.
47 void master_cleanup(void) {
48 struct CleanupFunctionHook *fcn;
50 /* Cancel all running sessions */
51 lprintf(7, "Cancelling running sessions...\n");
52 while (ContextList != NULL) {
53 kill_session(ContextList->cs_pid);
56 /* Run any cleanup routines registered by loadable modules */
57 for (fcn = CleanupHookTable; fcn != NULL; fcn = fcn->next) {
58 (*fcn->h_function_pointer)();
62 lprintf(7, "Closing databases\n");
65 /* Do system-dependent stuff */
66 sysdep_master_cleanup();
69 lprintf(3, "citserver: exiting.\n");
75 * Gracefully terminate the session and thread.
76 * (This is called as a cleanup handler by the thread library.)
78 * All NON-system-dependent stuff is done in this function.
79 * System-dependent session/thread cleanup is in cleanup() in sysdep.c
81 void cleanup_stuff(void *arg)
83 struct ExpressMessage *emptr;
85 lprintf(9, "cleanup_stuff() called\n");
87 lprintf(7, "Calling logout(%d)\n", CC->cs_pid);
90 rec_log(CL_TERMINATE,CC->curr_user);
92 lprintf(3, "citserver[%3d]: ended.\n",CC->cs_pid);
94 /* Run any cleanup routines registered by loadable modules */
95 PerformSessionHooks(EVT_STOP);
97 syslog(LOG_NOTICE,"session %d ended", CC->cs_pid);
99 /* Deallocate any unsent express messages */
100 begin_critical_section(S_SESSION_TABLE);
101 while (CC->FirstExpressMessage != NULL) {
102 emptr = CC->FirstExpressMessage;
103 CC->FirstExpressMessage = CC->FirstExpressMessage->next;
106 end_critical_section(S_SESSION_TABLE);
108 /* Deallocate any message list we might have in memory */
109 if (CC->msglist != NULL) free(CC->msglist);
111 /* Now get rid of the session and context */
112 lprintf(7, "cleanup_stuff() is calling RemoveContext(%d)\n", CC->cs_pid);
115 /* While we still have an extra thread with no user attached to it,
116 * take the opportunity to do some housekeeping before exiting.
123 * set_wtmpsupp() - alter the session listing
125 void set_wtmpsupp(char *newtext)
127 strncpy(CC->cs_room,newtext,19);
129 time(&CC->cs_lastupdt);
131 /* Run any routines registered by loadable modules */
132 PerformSessionHooks(EVT_NEWROOM);
137 * cmd_info() - tell the client about this server
139 void cmd_info(void) {
140 cprintf("%d Server info:\n",LISTING_FOLLOWS);
141 cprintf("%d\n",CC->cs_pid);
142 cprintf("%s\n",config.c_nodename);
143 cprintf("%s\n",config.c_humannode);
144 cprintf("%s\n",config.c_fqdn);
145 cprintf("%s\n",CITADEL);
146 cprintf("%d\n",REV_LEVEL);
147 cprintf("%s\n",config.c_bbs_city);
148 cprintf("%s\n",config.c_sysadm);
149 cprintf("%d\n",SERVER_TYPE);
150 cprintf("%s\n",config.c_moreprompt);
151 cprintf("1\n"); /* 1 = yes, this system supports floors */
155 void cmd_rchg(char *newroomname)
157 if ((newroomname) && (newroomname[0]))
159 bzero(CC->fake_roomname, 20);
160 strncpy(CC->fake_roomname, newroomname, 19);
163 CC->fake_roomname[0] = '\0';
167 void cmd_hchg(char *newhostname)
169 if ((newhostname) && (newhostname[0]))
171 bzero(CC->fake_hostname, 25);
172 strncpy(CC->fake_hostname, newhostname, 24);
175 CC->fake_hostname[0] = '\0';
179 void cmd_uchg(char *newusername)
181 if (CC->usersupp.axlevel < 6)
183 cprintf("%d You must be an Aide to use UCHG.\n",
184 ERROR+HIGHER_ACCESS_REQUIRED);
187 if ((newusername) && (newusername[0]))
189 CC->cs_flags &= ~CS_STEALTH;
190 bzero(CC->fake_username, 32);
191 if (strncasecmp(newusername, CC->curr_user, strlen(CC->curr_user)))
192 strncpy(CC->fake_username, newusername, 31);
196 CC->fake_username[0] = '\0';
197 CC->cs_flags |= CS_STEALTH;
203 * returns an asterisk if there are any express messages waiting,
206 char check_express(void) {
207 if (CC->FirstExpressMessage == NULL) {
221 cprintf("%d %ld\n", OK, tv);
225 * check a hostname against the public_clients file
227 int is_public_client(char *where)
232 if (!strcasecmp(where,"localhost")) return(1);
233 if (!strcasecmp(where,config.c_fqdn)) return(1);
235 fp = fopen("public_clients","r");
236 if (fp == NULL) return(0);
238 while (fgets(buf,256,fp)!=NULL) {
239 while (isspace((buf[strlen(buf)-1])))
240 buf[strlen(buf)-1] = 0;
241 if (!strcasecmp(buf,where)) {
253 * the client is identifying itself to the server
255 void cmd_iden(char *argbuf)
263 if (num_parms(argbuf)<4) {
264 cprintf("%d usage error\n",ERROR);
268 dev_code = extract_int(argbuf,0);
269 cli_code = extract_int(argbuf,1);
270 rev_level = extract_int(argbuf,2);
271 extract(desc,argbuf,3);
273 strcpy(from_host,config.c_fqdn);
274 if (num_parms(argbuf)>=5) extract(from_host,argbuf,4);
276 CC->cs_clientdev = dev_code;
277 CC->cs_clienttyp = cli_code;
278 CC->cs_clientver = rev_level;
279 strncpy(CC->cs_clientname,desc,31);
280 CC->cs_clientname[31] = 0;
282 if ((strlen(from_host)>0) &&
283 (is_public_client(CC->cs_host))) {
284 strncpy(CC->cs_host,from_host,24);
287 set_wtmpsupp(CC->quickroom.QRname);
289 syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
295 cprintf("%d Ok\n",OK);
300 * enter or exit "stealth mode"
302 void cmd_stel(char *cmdbuf)
306 requested_mode = extract_int(cmdbuf,0);
307 if (requested_mode !=0) requested_mode = 1;
309 if (!CC->logged_in) {
310 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
314 if (CC->usersupp.axlevel < 6) {
315 cprintf("%d You must be an Aide to use stealth mode.\n",
316 ERROR+HIGHER_ACCESS_REQUIRED);
320 if (CC->cs_flags & CS_STEALTH) {
321 if (requested_mode == 0)
322 CC->cs_flags = CC->cs_flags-CS_STEALTH;
325 if (requested_mode == 1)
326 CC->cs_flags = CC->cs_flags|CS_STEALTH;
329 set_wtmpsupp(CC->quickroom.QRname);
330 cprintf("%d Ok\n",OK);
337 * display system messages or help
339 void cmd_mesg(char *mname)
346 extract(buf,mname,0);
351 strcpy(dirs[0],"messages");
352 strcpy(dirs[1],"help");
353 mesg_locate(targ,buf,2,dirs);
358 if (strlen(targ)==0) {
359 cprintf("%d '%s' not found.\n",ERROR,mname);
363 mfp = fopen(targ,"r");
365 cprintf("%d Cannot open '%s': %s\n",
366 ERROR,targ,strerror(errno));
369 cprintf("%d %s\n",LISTING_FOLLOWS,buf);
371 while (fgets(buf,255,mfp)!=NULL) {
372 buf[strlen(buf)-1] = 0;
383 * enter system messages or help
385 void cmd_emsg(char *mname)
393 if (CC->usersupp.axlevel < 6) {
394 cprintf("%d You must be an Aide to edit system messages.\n",
395 ERROR+HIGHER_ACCESS_REQUIRED);
399 extract(buf,mname,0);
400 for (a=0; a<strlen(buf); ++a) { /* security measure */
401 if (buf[a] == '/') buf[a] = '.';
406 strcpy(dirs[0],"messages");
407 strcpy(dirs[1],"help");
408 mesg_locate(targ,buf,2,dirs);
412 if (strlen(targ)==0) {
413 sprintf(targ, "./help/%s", buf);
416 mfp = fopen(targ,"w");
418 cprintf("%d Cannot open '%s': %s\n",
419 ERROR,targ,strerror(errno));
422 cprintf("%d %s\n", SEND_LISTING, targ);
424 while (client_gets(buf), strcmp(buf, "000")) {
425 fprintf(mfp, "%s\n", buf);
435 void cmd_rwho(void) {
436 struct CitContext *cptr;
439 char un[40], room[40], host[40], flags[5];
441 aide = CC->usersupp.axlevel >= 6;
442 cprintf("%d\n",LISTING_FOLLOWS);
444 for (cptr = ContextList; cptr != NULL; cptr = cptr->next)
449 if (cptr->cs_flags & CS_POSTING)
454 if (cptr->fake_username[0])
456 strcpy(un, cptr->fake_username);
460 strcpy(un, cptr->curr_user);
462 if (cptr->fake_hostname[0])
464 strcpy(host, cptr->fake_hostname);
468 strcpy(host, cptr->cs_host);
470 if (cptr->fake_roomname[0])
472 strcpy(room, cptr->fake_roomname);
476 strcpy(room, cptr->cs_room);
479 if ((aide) && (spoofed))
482 if ((cptr->cs_flags & CS_STEALTH) && (aide))
485 if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
487 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
488 cptr->cs_pid, un, room,
489 host, cptr->cs_clientname,
490 (long)(cptr->lastidle),
491 cptr->lastcmdname, flags);
493 if ((spoofed) && (aide))
495 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
496 cptr->cs_pid, cptr->curr_user, cptr->cs_room,
497 cptr->cs_host, cptr->cs_clientname,
498 (long)(cptr->lastidle),
499 cptr->lastcmdname, flags);
508 * Terminate another running session
510 void cmd_term(char *cmdbuf)
513 struct CitContext *ccptr;
515 if (!CC->logged_in) {
516 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
520 if (CC->usersupp.axlevel < 6) {
521 cprintf("%d You must be an Aide to terminate sessions.\n",
522 ERROR+HIGHER_ACCESS_REQUIRED);
526 session_num = extract_int(cmdbuf, 0);
527 if (session_num == CC->cs_pid) {
528 cprintf("%d You can't kill your own session.\n", ERROR);
532 for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
533 if (session_num == ccptr->cs_pid) {
534 kill_session(ccptr->cs_pid);
535 cprintf("%d Session terminated.\n", OK);
540 cprintf("%d No such session.\n", ERROR);
548 * get the paginator prompt
550 void cmd_more(void) {
551 cprintf("%d %s\n",OK,config.c_moreprompt);
557 void cmd_echo(char *etext)
559 cprintf("%d %s\n",OK,etext);
565 * identify as internal program
567 void cmd_ipgm(char *argbuf)
571 secret = extract_int(argbuf, 0);
572 if (secret == config.c_ipgm_secret) {
573 CC->internal_pgm = 1;
574 strcpy(CC->curr_user, "<internal program>");
575 CC->cs_flags = CC->cs_flags|CS_STEALTH;
576 cprintf("%d Authenticated as an internal program.\n",OK);
579 cprintf("%d Authentication failed.\n",ERROR);
585 * Shut down the server
587 void cmd_down(void) {
588 if (!CC->logged_in) {
589 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
593 if (CC->usersupp.axlevel < 6) {
594 cprintf("%d You must be an Aide to shut down the server.\n",
595 ERROR+HIGHER_ACCESS_REQUIRED);
599 cprintf("%d Shutting down server. Goodbye.\n", OK);
604 * Schedule or cancel a server shutdown
606 void cmd_scdn(char *argbuf)
610 if (!CC->logged_in) {
611 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
615 if (CC->usersupp.axlevel < 6) {
616 cprintf("%d You must be an Aide to schedule a shutdown.\n",
617 ERROR+HIGHER_ACCESS_REQUIRED);
621 new_state = extract_int(argbuf, 0);
622 if ((new_state == 0) || (new_state == 1)) {
623 ScheduledShutdown = new_state;
625 cprintf("%d %d\n", OK, ScheduledShutdown);
632 void *context_loop(struct CitContext *con)
638 * Wedge our way into the context table.
643 * Initialize some variables specific to our context.
647 CC->internal_pgm = 0;
648 CC->download_fp = NULL;
649 CC->upload_fp = NULL;
650 CC->cs_pid = con->client_socket; /* not necessarily portable */
651 CC->FirstExpressMessage = NULL;
656 strcpy(CC->lastcmdname, " ");
657 strcpy(CC->cs_clientname, "(unknown)");
658 strcpy(CC->curr_user,"");
659 strcpy(CC->net_node,"");
660 sprintf(CC->temp,"/tmp/CitServer.%d.%d", getpid(), CC->cs_pid);
661 strcpy(CC->cs_room, "");
662 strcpy(CC->cs_host, config.c_fqdn);
663 locate_host(CC->cs_host);
665 CC->upload_type = UPL_FILE;
668 session_num = session_count();
670 if ((config.c_maxsessions > 0)&&(session_num >= config.c_maxsessions))
673 if (CC->nologin==1) {
674 cprintf("%d %s: Too many users are already online (maximum is %d)\n",
675 ERROR+MAX_SESSIONS_EXCEEDED,
676 config.c_nodename,config.c_maxsessions);
679 cprintf("%d %s Citadel/UX server ready.\n",OK,config.c_nodename);
682 lprintf(3, "citserver[%3d]: started.\n", CC->cs_pid);
684 /* Run any session startup routines registered by loadable modules */
685 PerformSessionHooks(EVT_START);
687 rec_log(CL_CONNECT, "");
691 if (client_gets(cmdbuf) < 1) cleanup(EXIT_NULL);
692 lprintf(5, "citserver[%3d]: %s\n", CC->cs_pid, cmdbuf);
693 /* hook_command_received(CC->cs_pid, cmdbuf); FIX */
696 * Let other clients see the last command we executed, but
697 * exclude NOOP because that would be boring.
699 if (strncasecmp(cmdbuf, "NOOP", 4)) {
700 strcpy(CC->lastcmdname, " ");
701 strncpy(CC->lastcmdname, cmdbuf, 4);
705 if ((strncasecmp(cmdbuf, "ENT0", 4)) && (strncasecmp(cmdbuf, "MESG", 4)) && (strncasecmp(cmdbuf, "MSGS", 4)))
707 CC->cs_flags &= ~CS_POSTING;
711 * This loop recognizes all server commands.
714 if (!strncasecmp(cmdbuf,"NOOP",4)) {
715 cprintf("%d%cok\n",OK,check_express());
718 else if (!strncasecmp(cmdbuf,"QUIT",4)) {
719 cprintf("%d Goodbye.\n",OK);
722 else if (!strncasecmp(cmdbuf,"LOUT",4)) {
723 if (CC->logged_in) logout(CC);
724 cprintf("%d logged out.\n",OK);
727 else if (!strncasecmp(cmdbuf,"USER",4)) {
728 cmd_user(&cmdbuf[5]);
731 else if (!strncasecmp(cmdbuf,"PASS",4)) {
732 cmd_pass(&cmdbuf[5]);
735 else if (!strncasecmp(cmdbuf,"NEWU",4)) {
736 cmd_newu(&cmdbuf[5]);
739 else if (!strncasecmp(cmdbuf,"SETP",4)) {
740 cmd_setp(&cmdbuf[5]);
743 else if (!strncasecmp(cmdbuf,"LRMS",4)) {
744 cmd_lrms(&cmdbuf[5]);
747 else if (!strncasecmp(cmdbuf,"LKRA",4)) {
748 cmd_lkra(&cmdbuf[5]);
751 else if (!strncasecmp(cmdbuf,"LKRN",4)) {
752 cmd_lkrn(&cmdbuf[5]);
755 else if (!strncasecmp(cmdbuf,"LKRO",4)) {
756 cmd_lkro(&cmdbuf[5]);
759 else if (!strncasecmp(cmdbuf,"LZRM",4)) {
760 cmd_lzrm(&cmdbuf[5]);
763 else if (!strncasecmp(cmdbuf,"GETU",4)) {
767 else if (!strncasecmp(cmdbuf,"SETU",4)) {
768 cmd_setu(&cmdbuf[5]);
771 else if (!strncasecmp(cmdbuf,"GOTO",4)) {
772 cmd_goto(&cmdbuf[5]);
775 else if (!strncasecmp(cmdbuf,"MSGS",4)) {
776 cmd_msgs(&cmdbuf[5]);
779 else if (!strncasecmp(cmdbuf,"WHOK",4)) {
783 else if (!strncasecmp(cmdbuf,"RDIR",4)) {
787 else if (!strncasecmp(cmdbuf,"MSG0",4)) {
788 cmd_msg0(&cmdbuf[5]);
791 else if (!strncasecmp(cmdbuf,"MSG2",4)) {
792 cmd_msg2(&cmdbuf[5]);
795 else if (!strncasecmp(cmdbuf,"MSG3",4)) {
796 cmd_msg3(&cmdbuf[5]);
799 else if (!strncasecmp(cmdbuf,"INFO",4)) {
803 else if (!strncasecmp(cmdbuf,"SLRP",4)) {
804 cmd_slrp(&cmdbuf[5]);
807 else if (!strncasecmp(cmdbuf,"INVT",4)) {
808 cmd_invt_kick(&cmdbuf[5],1);
811 else if (!strncasecmp(cmdbuf,"KICK",4)) {
812 cmd_invt_kick(&cmdbuf[5],0);
815 else if (!strncasecmp(cmdbuf,"GETR",4)) {
819 else if (!strncasecmp(cmdbuf,"SETR",4)) {
820 cmd_setr(&cmdbuf[5]);
823 else if (!strncasecmp(cmdbuf,"GETA",4)) {
827 else if (!strncasecmp(cmdbuf,"SETA",4)) {
828 cmd_seta(&cmdbuf[5]);
831 else if (!strncasecmp(cmdbuf,"ENT0",4)) {
832 cmd_ent0(&cmdbuf[5]);
835 else if (!strncasecmp(cmdbuf,"ENT3",4)) {
836 cmd_ent3(&cmdbuf[5]);
839 else if (!strncasecmp(cmdbuf,"RINF",4)) {
843 else if (!strncasecmp(cmdbuf,"DELE",4)) {
844 cmd_dele(&cmdbuf[5]);
847 else if (!strncasecmp(cmdbuf,"KILL",4)) {
848 cmd_kill(&cmdbuf[5]);
851 else if (!strncasecmp(cmdbuf,"CRE8",4)) {
852 cmd_cre8(&cmdbuf[5]);
855 else if (!strncasecmp(cmdbuf,"MOVE",4)) {
856 cmd_move(&cmdbuf[5]);
859 else if (!strncasecmp(cmdbuf,"FORG",4)) {
863 else if (!strncasecmp(cmdbuf,"MESG",4)) {
864 cmd_mesg(&cmdbuf[5]);
867 else if (!strncasecmp(cmdbuf,"EMSG",4)) {
868 cmd_emsg(&cmdbuf[5]);
871 else if (!strncasecmp(cmdbuf,"GNUR",4)) {
875 else if (!strncasecmp(cmdbuf,"GREG",4)) {
876 cmd_greg(&cmdbuf[5]);
879 else if (!strncasecmp(cmdbuf,"VALI",4)) {
880 cmd_vali(&cmdbuf[5]);
883 else if (!strncasecmp(cmdbuf,"EINF",4)) {
884 cmd_einf(&cmdbuf[5]);
887 else if (!strncasecmp(cmdbuf,"LIST",4)) {
891 else if (!strncasecmp(cmdbuf,"REGI",4)) {
895 else if (!strncasecmp(cmdbuf,"CHEK",4)) {
899 else if (!strncasecmp(cmdbuf,"DELF",4)) {
900 cmd_delf(&cmdbuf[5]);
903 else if (!strncasecmp(cmdbuf,"MOVF",4)) {
904 cmd_movf(&cmdbuf[5]);
907 else if (!strncasecmp(cmdbuf,"NETF",4)) {
908 cmd_netf(&cmdbuf[5]);
911 else if (!strncasecmp(cmdbuf,"RWHO",4)) {
915 else if (!strncasecmp(cmdbuf,"OPEN",4)) {
916 cmd_open(&cmdbuf[5]);
919 else if (!strncasecmp(cmdbuf,"CLOS",4)) {
923 else if (!strncasecmp(cmdbuf,"UOPN",4)) {
924 cmd_uopn(&cmdbuf[5]);
927 else if (!strncasecmp(cmdbuf,"UCLS",4)) {
928 cmd_ucls(&cmdbuf[5]);
931 else if (!strncasecmp(cmdbuf,"READ",4)) {
932 cmd_read(&cmdbuf[5]);
935 else if (!strncasecmp(cmdbuf,"WRIT",4)) {
936 cmd_writ(&cmdbuf[5]);
939 else if (!strncasecmp(cmdbuf,"QUSR",4)) {
940 cmd_qusr(&cmdbuf[5]);
943 else if (!strncasecmp(cmdbuf,"ECHO",4)) {
944 cmd_echo(&cmdbuf[5]);
947 else if (!strncasecmp(cmdbuf,"OIMG",4)) {
948 cmd_oimg(&cmdbuf[5]);
951 else if (!strncasecmp(cmdbuf,"MORE",4)) {
955 else if (!strncasecmp(cmdbuf,"NETP",4)) {
956 cmd_netp(&cmdbuf[5]);
959 else if (!strncasecmp(cmdbuf,"NDOP",4)) {
960 cmd_ndop(&cmdbuf[5]);
963 else if (!strncasecmp(cmdbuf,"NUOP",4)) {
964 cmd_nuop(&cmdbuf[5]);
967 else if (!strncasecmp(cmdbuf,"LFLR",4)) {
971 else if (!strncasecmp(cmdbuf,"CFLR",4)) {
972 cmd_cflr(&cmdbuf[5]);
975 else if (!strncasecmp(cmdbuf,"KFLR",4)) {
976 cmd_kflr(&cmdbuf[5]);
979 else if (!strncasecmp(cmdbuf,"EFLR",4)) {
980 cmd_eflr(&cmdbuf[5]);
983 else if (!strncasecmp(cmdbuf,"IDEN",4)) {
984 cmd_iden(&cmdbuf[5]);
987 else if (!strncasecmp(cmdbuf,"IPGM",4)) {
988 cmd_ipgm(&cmdbuf[5]);
991 else if (!strncasecmp(cmdbuf,"EBIO",4)) {
995 else if (!strncasecmp(cmdbuf,"RBIO",4)) {
996 cmd_rbio(&cmdbuf[5]);
999 else if (!strncasecmp(cmdbuf,"LBIO",4)) {
1003 else if (!strncasecmp(cmdbuf,"STEL",4)) {
1004 cmd_stel(&cmdbuf[5]);
1007 else if (!strncasecmp(cmdbuf,"TERM",4)) {
1008 cmd_term(&cmdbuf[5]);
1011 else if (!strncasecmp(cmdbuf,"DOWN",4)) {
1015 else if (!strncasecmp(cmdbuf,"SCDN",4)) {
1016 cmd_scdn(&cmdbuf[5]);
1019 else if (!strncasecmp(cmdbuf, "NSET", 4)) {
1020 cmd_nset(&cmdbuf[5]);
1023 else if (!strncasecmp(cmdbuf, "UIMG", 4)) {
1024 cmd_uimg(&cmdbuf[5]);
1027 else if (!strncasecmp(cmdbuf, "UCHG", 4)) {
1028 cmd_uchg(&cmdbuf[5]);
1031 else if (!strncasecmp(cmdbuf, "TIME", 4)) {
1035 else if (!strncasecmp(cmdbuf, "HCHG", 4)) {
1036 cmd_hchg(&cmdbuf[5]);
1039 else if (!strncasecmp(cmdbuf, "RCHG", 4)) {
1040 cmd_rchg(&cmdbuf[5]);
1043 else if (!strncasecmp(cmdbuf, "AGUP", 4)) {
1044 cmd_agup(&cmdbuf[5]);
1047 else if (!strncasecmp(cmdbuf, "ASUP", 4)) {
1048 cmd_asup(&cmdbuf[5]);
1051 else if (!DLoader_Exec_Cmd(cmdbuf))
1053 cprintf("%d Unrecognized or unsupported command.\n",
1057 } while(strncasecmp(cmdbuf, "QUIT", 4));
1059 cleanup(EXIT_NORMAL);