int main(int argc, char *argv[]) { chdir(BBSHOME); setuid(BBSUID); setgid(BBSGID); setreuid(BBSUID, BBSUID); setregid(BBSGID, BBSGID); #ifndef CYGWIN #undef time bbssettime(time(0)); sleep(1); #define time(x) bbstime(x) #endif setpublicshmreadonly(0); #ifndef CYGWIN setpublicshmreadonly(1); #endif init_bbslog(); if (argc > 1) { if (strcasecmp(argv[1], "killuser") == 0) { //Added by Marvel resolve_utmp(); if (resolve_ucache() != 0) return -1; return dokilluser(); } if (strcasecmp(argv[1], "giveup") == 0) { if (resolve_ucache() != 0) return -1; return doupdategiveupuser(); } if (strcasecmp(argv[1], "allboards") == 0) return dokillalldir(); if (strcasecmp(argv[1], "daemon") == 0) return miscd_dodaemon(argv[1], argv[2]); if (strcasecmp(argv[1], "killdir") == 0) return dokilldir(argv[2]); if (strcasecmp(argv[1], "flush") == 0) { if (resolve_ucache() != 0) return -1; resolve_boards(); flushdata(); return 0; } return miscd_dodaemon(NULL, argv[1]); } printf("Usage : %s daemon: to run as a daemon (this is the most common use)\n", argv[0]); printf(" %s killuser: to kill old users\n", argv[0]); printf(" %s giveup: to unlock given-up users\n", argv[0]); printf(" %s killdir <BOARDNAME>: to delete old file in <BOARDNAME>\n", argv[0]); printf(" %s allboards: to delete old files in all boards\n", argv[0]); printf(" %s flush: to synchronize .PASSWDS and .BOARDS to disk\n", argv[0]); printf("That's all, folks. See doc/README.SYSOP for more details\n"); return 0; }
int doaboard(struct boardheader *brd,void* arg) { if (!brd) return 0; return dokilldir(brd->filename); }