15 #include "sysdep_decls.h"
16 #include "citserver.h"
19 #include "housekeeping.h"
24 #include "locate_host.h"
27 #include "dynloader.h"
29 struct CitContext *ContextList = NULL;
30 int ScheduledShutdown = 0;
33 * Various things that need to be initialized at startup
35 void master_startup(void) {
36 lprintf(7, "Opening databases\n");
39 lprintf(7, "Checking floor reference counts\n");
44 * Cleanup routine to be called when the server is shutting down.
46 void master_cleanup(void) {
47 struct CleanupFunctionHook *fcn;
49 /* Cancel all running sessions */
50 lprintf(7, "Cancelling running sessions...\n");
51 while (ContextList != NULL) {
52 kill_session(ContextList->cs_pid);
55 /* Run any cleanup routines registered by loadable modules */
56 for (fcn = CleanupHookTable; fcn != NULL; fcn = fcn->next) {
57 (*fcn->h_function_pointer)();
61 lprintf(7, "Closing databases\n");
64 /* Do system-dependent stuff */
65 sysdep_master_cleanup();
68 lprintf(3, "citserver: exiting.\n");
74 * Gracefully terminate the session and thread.
75 * (This is called as a cleanup handler by the thread library.)
77 * All NON-system-dependent stuff is done in this function.
78 * System-dependent session/thread cleanup is in cleanup() in sysdep.c
80 void cleanup_stuff(void *arg)
82 struct ExpressMessage *emptr;
84 lprintf(9, "cleanup_stuff() called\n");
86 lprintf(7, "Calling logout(%d)\n", CC->cs_pid);
89 rec_log(CL_TERMINATE,CC->curr_user);
91 lprintf(3, "citserver[%3d]: ended.\n",CC->cs_pid);
93 /* Run any cleanup routines registered by loadable modules */
94 PerformSessionHooks(EVT_STOP);
96 syslog(LOG_NOTICE,"session %d ended", CC->cs_pid);
98 /* Deallocate any unsent express messages */
99 begin_critical_section(S_SESSION_TABLE);
100 while (CC->FirstExpressMessage != NULL) {
101 emptr = CC->FirstExpressMessage;
102 CC->FirstExpressMessage = CC->FirstExpressMessage->next;
105 end_critical_section(S_SESSION_TABLE);
107 /* Deallocate any message list we might have in memory */
108 if (CC->msglist != NULL) free(CC->msglist);
110 /* Now get rid of the session and context */
111 lprintf(7, "cleanup_stuff() is calling RemoveContext(%d)\n", CC->cs_pid);
114 /* While we still have an extra thread with no user attached to it,
115 * take the opportunity to do some housekeeping before exiting.
122 * set_wtmpsupp() - alter the session listing
124 void set_wtmpsupp(char *newtext)
126 strncpy(CC->cs_room,newtext,19);
128 time(&CC->cs_lastupdt);
130 /* Run any routines registered by loadable modules */
131 PerformSessionHooks(EVT_NEWROOM);
136 * cmd_info() - tell the client about this server
138 void cmd_info(void) {
139 cprintf("%d Server info:\n",LISTING_FOLLOWS);
140 cprintf("%d\n",CC->cs_pid);
141 cprintf("%s\n",config.c_nodename);
142 cprintf("%s\n",config.c_humannode);
143 cprintf("%s\n",config.c_fqdn);
144 cprintf("%s\n",CITADEL);
145 cprintf("%d\n",REV_LEVEL);
146 cprintf("%s\n",config.c_bbs_city);
147 cprintf("%s\n",config.c_sysadm);
148 cprintf("%d\n",SERVER_TYPE);
149 cprintf("%s\n",config.c_moreprompt);
150 cprintf("1\n"); /* 1 = yes, this system supports floors */
154 void cmd_rchg(char *newroomname)
156 if ((newroomname) && (newroomname[0]))
158 bzero(CC->fake_roomname, 20);
159 strncpy(CC->fake_roomname, newroomname, 19);
162 CC->fake_roomname[0] = '\0';
166 void cmd_hchg(char *newhostname)
168 if ((newhostname) && (newhostname[0]))
170 bzero(CC->fake_hostname, 25);
171 strncpy(CC->fake_hostname, newhostname, 24);
174 CC->fake_hostname[0] = '\0';
178 void cmd_uchg(char *newusername)
180 if (CC->usersupp.axlevel < 6)
182 cprintf("%d You must be an Aide to use UCHG.\n",
183 ERROR+HIGHER_ACCESS_REQUIRED);
186 if ((newusername) && (newusername[0]))
188 CC->cs_flags &= ~CS_STEALTH;
189 bzero(CC->fake_username, 32);
190 if (strncasecmp(newusername, CC->curr_user, strlen(CC->curr_user)))
191 strncpy(CC->fake_username, newusername, 31);
195 CC->fake_username[0] = '\0';
196 CC->cs_flags |= CS_STEALTH;
202 * returns an asterisk if there are any express messages waiting,
205 char check_express(void) {
206 if (CC->FirstExpressMessage == NULL) {
220 cprintf("%d %ld\n", OK, tv);
224 * check a hostname against the public_clients file
226 int is_public_client(char *where)
231 if (!strcasecmp(where,"localhost")) return(1);
232 if (!strcasecmp(where,config.c_fqdn)) return(1);
234 fp = fopen("public_clients","r");
235 if (fp == NULL) return(0);
237 while (fgets(buf,256,fp)!=NULL) {
238 while (isspace((buf[strlen(buf)-1])))
239 buf[strlen(buf)-1] = 0;
240 if (!strcasecmp(buf,where)) {
252 * the client is identifying itself to the server
254 void cmd_iden(char *argbuf)
262 if (num_parms(argbuf)<4) {
263 cprintf("%d usage error\n",ERROR);
267 dev_code = extract_int(argbuf,0);
268 cli_code = extract_int(argbuf,1);
269 rev_level = extract_int(argbuf,2);
270 extract(desc,argbuf,3);
272 strcpy(from_host,config.c_fqdn);
273 if (num_parms(argbuf)>=5) extract(from_host,argbuf,4);
275 CC->cs_clientdev = dev_code;
276 CC->cs_clienttyp = cli_code;
277 CC->cs_clientver = rev_level;
278 strncpy(CC->cs_clientname,desc,31);
279 CC->cs_clientname[31] = 0;
281 if ((strlen(from_host)>0) &&
282 (is_public_client(CC->cs_host))) {
283 strncpy(CC->cs_host,from_host,24);
286 set_wtmpsupp(CC->quickroom.QRname);
288 syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
294 cprintf("%d Ok\n",OK);
299 * enter or exit "stealth mode"
301 void cmd_stel(char *cmdbuf)
305 requested_mode = extract_int(cmdbuf,0);
306 if (requested_mode !=0) requested_mode = 1;
308 if (!CC->logged_in) {
309 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
313 if (CC->usersupp.axlevel < 6) {
314 cprintf("%d You must be an Aide to use stealth mode.\n",
315 ERROR+HIGHER_ACCESS_REQUIRED);
319 if (CC->cs_flags & CS_STEALTH) {
320 if (requested_mode == 0)
321 CC->cs_flags = CC->cs_flags-CS_STEALTH;
324 if (requested_mode == 1)
325 CC->cs_flags = CC->cs_flags|CS_STEALTH;
328 set_wtmpsupp(CC->quickroom.QRname);
329 cprintf("%d Ok\n",OK);
336 * display system messages or help
338 void cmd_mesg(char *mname)
345 extract(buf,mname,0);
350 strcpy(dirs[0],"messages");
351 strcpy(dirs[1],"help");
352 mesg_locate(targ,buf,2,dirs);
357 if (strlen(targ)==0) {
358 cprintf("%d '%s' not found.\n",ERROR,mname);
362 mfp = fopen(targ,"r");
364 cprintf("%d Cannot open '%s': %s\n",
365 ERROR,targ,strerror(errno));
368 cprintf("%d %s\n",LISTING_FOLLOWS,buf);
370 while (fgets(buf,255,mfp)!=NULL) {
371 buf[strlen(buf)-1] = 0;
382 * enter system messages or help
384 void cmd_emsg(char *mname)
392 if (CC->usersupp.axlevel < 6) {
393 cprintf("%d You must be an Aide to edit system messages.\n",
394 ERROR+HIGHER_ACCESS_REQUIRED);
398 extract(buf,mname,0);
399 for (a=0; a<strlen(buf); ++a) { /* security measure */
400 if (buf[a] == '/') buf[a] = '.';
405 strcpy(dirs[0],"messages");
406 strcpy(dirs[1],"help");
407 mesg_locate(targ,buf,2,dirs);
411 if (strlen(targ)==0) {
412 sprintf(targ, "./help/%s", buf);
415 mfp = fopen(targ,"w");
417 cprintf("%d Cannot open '%s': %s\n",
418 ERROR,targ,strerror(errno));
421 cprintf("%d %s\n", SEND_LISTING, targ);
423 while (client_gets(buf), strcmp(buf, "000")) {
424 fprintf(mfp, "%s\n", buf);
434 void cmd_rwho(void) {
435 struct CitContext *cptr;
438 char un[40], room[40], host[40], flags[5];
440 aide = CC->usersupp.axlevel >= 6;
441 cprintf("%d\n",LISTING_FOLLOWS);
443 for (cptr = ContextList; cptr != NULL; cptr = cptr->next)
448 if (cptr->cs_flags & CS_POSTING)
453 if (cptr->fake_username[0])
455 strcpy(un, cptr->fake_username);
459 strcpy(un, cptr->curr_user);
461 if (cptr->fake_hostname[0])
463 strcpy(host, cptr->fake_hostname);
467 strcpy(host, cptr->cs_host);
469 if (cptr->fake_roomname[0])
471 strcpy(room, cptr->fake_roomname);
475 strcpy(room, cptr->cs_room);
478 if ((aide) && (spoofed))
481 if ((cptr->cs_flags & CS_STEALTH) && (aide))
484 if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
486 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
487 cptr->cs_pid, un, room,
488 host, cptr->cs_clientname,
489 (long)(cptr->lastidle),
490 cptr->lastcmdname, flags);
492 if ((spoofed) && (aide))
494 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
495 cptr->cs_pid, cptr->curr_user, cptr->cs_room,
496 cptr->cs_host, cptr->cs_clientname,
497 (long)(cptr->lastidle),
498 cptr->lastcmdname, flags);
507 * Terminate another running session
509 void cmd_term(char *cmdbuf)
512 struct CitContext *ccptr;
514 if (!CC->logged_in) {
515 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
519 if (CC->usersupp.axlevel < 6) {
520 cprintf("%d You must be an Aide to terminate sessions.\n",
521 ERROR+HIGHER_ACCESS_REQUIRED);
525 session_num = extract_int(cmdbuf, 0);
526 if (session_num == CC->cs_pid) {
527 cprintf("%d You can't kill your own session.\n", ERROR);
531 for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
532 if (session_num == ccptr->cs_pid) {
533 kill_session(ccptr->cs_pid);
534 cprintf("%d Session terminated.\n", OK);
539 cprintf("%d No such session.\n", ERROR);
547 * get the paginator prompt
549 void cmd_more(void) {
550 cprintf("%d %s\n",OK,config.c_moreprompt);
556 void cmd_echo(char *etext)
558 cprintf("%d %s\n",OK,etext);
564 * identify as internal program
566 void cmd_ipgm(char *argbuf)
570 secret = extract_int(argbuf, 0);
571 if (secret == config.c_ipgm_secret) {
572 CC->internal_pgm = 1;
573 strcpy(CC->curr_user, "<internal program>");
574 CC->cs_flags = CC->cs_flags|CS_STEALTH;
575 cprintf("%d Authenticated as an internal program.\n",OK);
578 cprintf("%d Authentication failed.\n",ERROR);
584 * Shut down the server
586 void cmd_down(void) {
587 if (!CC->logged_in) {
588 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
592 if (CC->usersupp.axlevel < 6) {
593 cprintf("%d You must be an Aide to shut down the server.\n",
594 ERROR+HIGHER_ACCESS_REQUIRED);
598 cprintf("%d Shutting down server. Goodbye.\n", OK);
603 * Schedule or cancel a server shutdown
605 void cmd_scdn(char *argbuf)
609 if (!CC->logged_in) {
610 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
614 if (CC->usersupp.axlevel < 6) {
615 cprintf("%d You must be an Aide to schedule a shutdown.\n",
616 ERROR+HIGHER_ACCESS_REQUIRED);
620 new_state = extract_int(argbuf, 0);
621 if ((new_state == 0) || (new_state == 1)) {
622 ScheduledShutdown = new_state;
624 cprintf("%d %d\n", OK, ScheduledShutdown);
631 void *context_loop(struct CitContext *con)
637 * Wedge our way into the context table.
642 * Initialize some variables specific to our context.
646 CC->internal_pgm = 0;
647 CC->download_fp = NULL;
648 CC->upload_fp = NULL;
649 CC->cs_pid = con->client_socket; /* not necessarily portable */
650 CC->FirstExpressMessage = NULL;
655 strcpy(CC->lastcmdname, " ");
656 strcpy(CC->cs_clientname, "(unknown)");
657 strcpy(CC->curr_user,"");
658 strcpy(CC->net_node,"");
659 sprintf(CC->temp,"/tmp/CitServer.%d.%d", getpid(), CC->cs_pid);
660 strcpy(CC->cs_room, "");
661 strcpy(CC->cs_host, config.c_fqdn);
662 locate_host(CC->cs_host);
664 CC->upload_type = UPL_FILE;
667 session_num = session_count();
669 if ((config.c_maxsessions > 0)&&(session_num >= config.c_maxsessions))
672 if (CC->nologin==1) {
673 cprintf("%d %s: Too many users are already online (maximum is %d)\n",
674 ERROR+MAX_SESSIONS_EXCEEDED,
675 config.c_nodename,config.c_maxsessions);
678 cprintf("%d %s Citadel/UX server ready.\n",OK,config.c_nodename);
681 lprintf(3, "citserver[%3d]: started.\n", CC->cs_pid);
683 /* Run any session startup routines registered by loadable modules */
684 PerformSessionHooks(EVT_START);
686 rec_log(CL_CONNECT, "");
690 if (client_gets(cmdbuf) < 1) cleanup(EXIT_NULL);
691 lprintf(5, "citserver[%3d]: %s\n", CC->cs_pid, cmdbuf);
692 /* hook_command_received(CC->cs_pid, cmdbuf); FIX */
695 * Let other clients see the last command we executed, but
696 * exclude NOOP because that would be boring.
698 if (strncasecmp(cmdbuf, "NOOP", 4)) {
699 strcpy(CC->lastcmdname, " ");
700 strncpy(CC->lastcmdname, cmdbuf, 4);
704 if ((strncasecmp(cmdbuf, "ENT0", 4)) && (strncasecmp(cmdbuf, "MESG", 4)) && (strncasecmp(cmdbuf, "MSGS", 4)))
706 CC->cs_flags &= ~CS_POSTING;
710 * This loop recognizes all server commands.
713 if (!strncasecmp(cmdbuf,"NOOP",4)) {
714 cprintf("%d%cok\n",OK,check_express());
717 else if (!strncasecmp(cmdbuf,"QUIT",4)) {
718 cprintf("%d Goodbye.\n",OK);
721 else if (!strncasecmp(cmdbuf,"LOUT",4)) {
722 if (CC->logged_in) logout(CC);
723 cprintf("%d logged out.\n",OK);
726 else if (!strncasecmp(cmdbuf,"USER",4)) {
727 cmd_user(&cmdbuf[5]);
730 else if (!strncasecmp(cmdbuf,"PASS",4)) {
731 cmd_pass(&cmdbuf[5]);
734 else if (!strncasecmp(cmdbuf,"NEWU",4)) {
735 cmd_newu(&cmdbuf[5]);
738 else if (!strncasecmp(cmdbuf,"SETP",4)) {
739 cmd_setp(&cmdbuf[5]);
742 else if (!strncasecmp(cmdbuf,"LRMS",4)) {
743 cmd_lrms(&cmdbuf[5]);
746 else if (!strncasecmp(cmdbuf,"LKRA",4)) {
747 cmd_lkra(&cmdbuf[5]);
750 else if (!strncasecmp(cmdbuf,"LKRN",4)) {
751 cmd_lkrn(&cmdbuf[5]);
754 else if (!strncasecmp(cmdbuf,"LKRO",4)) {
755 cmd_lkro(&cmdbuf[5]);
758 else if (!strncasecmp(cmdbuf,"LZRM",4)) {
759 cmd_lzrm(&cmdbuf[5]);
762 else if (!strncasecmp(cmdbuf,"GETU",4)) {
766 else if (!strncasecmp(cmdbuf,"SETU",4)) {
767 cmd_setu(&cmdbuf[5]);
770 else if (!strncasecmp(cmdbuf,"GOTO",4)) {
771 cmd_goto(&cmdbuf[5]);
774 else if (!strncasecmp(cmdbuf,"MSGS",4)) {
775 cmd_msgs(&cmdbuf[5]);
778 else if (!strncasecmp(cmdbuf,"WHOK",4)) {
782 else if (!strncasecmp(cmdbuf,"RDIR",4)) {
786 else if (!strncasecmp(cmdbuf,"MSG0",4)) {
787 cmd_msg0(&cmdbuf[5]);
790 else if (!strncasecmp(cmdbuf,"MSG2",4)) {
791 cmd_msg2(&cmdbuf[5]);
794 else if (!strncasecmp(cmdbuf,"MSG3",4)) {
795 cmd_msg3(&cmdbuf[5]);
798 else if (!strncasecmp(cmdbuf,"INFO",4)) {
802 else if (!strncasecmp(cmdbuf,"SLRP",4)) {
803 cmd_slrp(&cmdbuf[5]);
806 else if (!strncasecmp(cmdbuf,"INVT",4)) {
807 cmd_invt_kick(&cmdbuf[5],1);
810 else if (!strncasecmp(cmdbuf,"KICK",4)) {
811 cmd_invt_kick(&cmdbuf[5],0);
814 else if (!strncasecmp(cmdbuf,"GETR",4)) {
818 else if (!strncasecmp(cmdbuf,"SETR",4)) {
819 cmd_setr(&cmdbuf[5]);
822 else if (!strncasecmp(cmdbuf,"GETA",4)) {
826 else if (!strncasecmp(cmdbuf,"SETA",4)) {
827 cmd_seta(&cmdbuf[5]);
830 else if (!strncasecmp(cmdbuf,"ENT0",4)) {
831 cmd_ent0(&cmdbuf[5]);
834 else if (!strncasecmp(cmdbuf,"ENT3",4)) {
835 cmd_ent3(&cmdbuf[5]);
838 else if (!strncasecmp(cmdbuf,"RINF",4)) {
842 else if (!strncasecmp(cmdbuf,"DELE",4)) {
843 cmd_dele(&cmdbuf[5]);
846 else if (!strncasecmp(cmdbuf,"KILL",4)) {
847 cmd_kill(&cmdbuf[5]);
850 else if (!strncasecmp(cmdbuf,"CRE8",4)) {
851 cmd_cre8(&cmdbuf[5]);
854 else if (!strncasecmp(cmdbuf,"MOVE",4)) {
855 cmd_move(&cmdbuf[5]);
858 else if (!strncasecmp(cmdbuf,"FORG",4)) {
862 else if (!strncasecmp(cmdbuf,"MESG",4)) {
863 cmd_mesg(&cmdbuf[5]);
866 else if (!strncasecmp(cmdbuf,"EMSG",4)) {
867 cmd_emsg(&cmdbuf[5]);
870 else if (!strncasecmp(cmdbuf,"GNUR",4)) {
874 else if (!strncasecmp(cmdbuf,"GREG",4)) {
875 cmd_greg(&cmdbuf[5]);
878 else if (!strncasecmp(cmdbuf,"VALI",4)) {
879 cmd_vali(&cmdbuf[5]);
882 else if (!strncasecmp(cmdbuf,"EINF",4)) {
883 cmd_einf(&cmdbuf[5]);
886 else if (!strncasecmp(cmdbuf,"LIST",4)) {
890 else if (!strncasecmp(cmdbuf,"REGI",4)) {
894 else if (!strncasecmp(cmdbuf,"CHEK",4)) {
898 else if (!strncasecmp(cmdbuf,"DELF",4)) {
899 cmd_delf(&cmdbuf[5]);
902 else if (!strncasecmp(cmdbuf,"MOVF",4)) {
903 cmd_movf(&cmdbuf[5]);
906 else if (!strncasecmp(cmdbuf,"NETF",4)) {
907 cmd_netf(&cmdbuf[5]);
910 else if (!strncasecmp(cmdbuf,"RWHO",4)) {
914 else if (!strncasecmp(cmdbuf,"OPEN",4)) {
915 cmd_open(&cmdbuf[5]);
918 else if (!strncasecmp(cmdbuf,"CLOS",4)) {
922 else if (!strncasecmp(cmdbuf,"UOPN",4)) {
923 cmd_uopn(&cmdbuf[5]);
926 else if (!strncasecmp(cmdbuf,"UCLS",4)) {
927 cmd_ucls(&cmdbuf[5]);
930 else if (!strncasecmp(cmdbuf,"READ",4)) {
931 cmd_read(&cmdbuf[5]);
934 else if (!strncasecmp(cmdbuf,"WRIT",4)) {
935 cmd_writ(&cmdbuf[5]);
938 else if (!strncasecmp(cmdbuf,"QUSR",4)) {
939 cmd_qusr(&cmdbuf[5]);
942 else if (!strncasecmp(cmdbuf,"ECHO",4)) {
943 cmd_echo(&cmdbuf[5]);
946 else if (!strncasecmp(cmdbuf,"OIMG",4)) {
947 cmd_oimg(&cmdbuf[5]);
950 else if (!strncasecmp(cmdbuf,"MORE",4)) {
954 else if (!strncasecmp(cmdbuf,"NETP",4)) {
955 cmd_netp(&cmdbuf[5]);
958 else if (!strncasecmp(cmdbuf,"NDOP",4)) {
959 cmd_ndop(&cmdbuf[5]);
962 else if (!strncasecmp(cmdbuf,"NUOP",4)) {
963 cmd_nuop(&cmdbuf[5]);
966 else if (!strncasecmp(cmdbuf,"LFLR",4)) {
970 else if (!strncasecmp(cmdbuf,"CFLR",4)) {
971 cmd_cflr(&cmdbuf[5]);
974 else if (!strncasecmp(cmdbuf,"KFLR",4)) {
975 cmd_kflr(&cmdbuf[5]);
978 else if (!strncasecmp(cmdbuf,"EFLR",4)) {
979 cmd_eflr(&cmdbuf[5]);
982 else if (!strncasecmp(cmdbuf,"IDEN",4)) {
983 cmd_iden(&cmdbuf[5]);
986 else if (!strncasecmp(cmdbuf,"IPGM",4)) {
987 cmd_ipgm(&cmdbuf[5]);
990 else if (!strncasecmp(cmdbuf,"EBIO",4)) {
994 else if (!strncasecmp(cmdbuf,"RBIO",4)) {
995 cmd_rbio(&cmdbuf[5]);
998 else if (!strncasecmp(cmdbuf,"LBIO",4)) {
1002 else if (!strncasecmp(cmdbuf,"STEL",4)) {
1003 cmd_stel(&cmdbuf[5]);
1006 else if (!strncasecmp(cmdbuf,"TERM",4)) {
1007 cmd_term(&cmdbuf[5]);
1010 else if (!strncasecmp(cmdbuf,"DOWN",4)) {
1014 else if (!strncasecmp(cmdbuf,"SCDN",4)) {
1015 cmd_scdn(&cmdbuf[5]);
1018 else if (!strncasecmp(cmdbuf, "NSET", 4)) {
1019 cmd_nset(&cmdbuf[5]);
1022 else if (!strncasecmp(cmdbuf, "UIMG", 4)) {
1023 cmd_uimg(&cmdbuf[5]);
1026 else if (!strncasecmp(cmdbuf, "UCHG", 4)) {
1027 cmd_uchg(&cmdbuf[5]);
1030 else if (!strncasecmp(cmdbuf, "TIME", 4)) {
1034 else if (!strncasecmp(cmdbuf, "HCHG", 4)) {
1035 cmd_hchg(&cmdbuf[5]);
1038 else if (!strncasecmp(cmdbuf, "RCHG", 4)) {
1039 cmd_rchg(&cmdbuf[5]);
1042 else if (!strncasecmp(cmdbuf, "AGUP", 4)) {
1043 cmd_agup(&cmdbuf[5]);
1046 else if (!strncasecmp(cmdbuf, "ASUP", 4)) {
1047 cmd_asup(&cmdbuf[5]);
1050 else if (!DLoader_Exec_Cmd(cmdbuf))
1052 cprintf("%d Unrecognized or unsupported command.\n",
1056 } while(strncasecmp(cmdbuf, "QUIT", 4));
1058 cleanup(EXIT_NORMAL);