$Log$
+ Revision 573.59 2000/12/27 20:19:51 ajc
+ * The size constant "256" which shows up everywhere as a buffer size has now
+ been changed to SIZ. And, SIZ has been defined now as 1024, not 256, because
+ we need 1024 byte buffers for most Internet protocols.
+
Revision 573.58 2000/12/27 05:09:58 ajc
* Added a skeleton IMAP "SEARCH" command (based on the FETCH logic)
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
UTIL_TARGETS=aidepost netmailer netproc netsetup msgform readlog rcit \
stats citmail netpoll mailinglist userlist sendcommand \
base64 qpdecode
-PROXY_TARGETS=proxy
prefix=@prefix@
srcdir=@srcdir@
config.c control.c $(DATABASE) dynloader.c file_ops.c \
housekeeping.c internetmail.c ipc_c_tcp.c locate_host.c \
logging.c mailinglist.c messages.c msgbase.c msgform.c netmailer.c \
- netpoll.c netproc.c netsetup.c policy.c proxy.c rcit.c readlog.c \
+ netpoll.c netproc.c netsetup.c policy.c rcit.c readlog.c \
room_ops.c rooms.c routines.c routines2.c serv_chat.c \
serv_info.c serv_test.c setup.c snprintf.c stats.c serv_vcard.c \
support.c sysdep.c tools.c user_ops.c userlist.c serv_expire.c \
netsetup: netsetup.o config.o
$(CC) netsetup.o config.o $(LDFLAGS) -o netsetup
-proxy: proxy.o ipc_c_tcp.o
- $(CC) proxy.o ipc_c_tcp.o $(LDFLAGS) -o proxy $(NETLIBS)
-
whobbs$(EXEEXT): whobbs.o ipc_c_tcp.o tools.o $(LIBOBJS)
$(CC) whobbs.o ipc_c_tcp.o tools.o $(LIBOBJS) $(LDFLAGS) -o whobbs $(NETLIBS)
$(srcdir)/mkinstalldirs $(root)$(prefix)/$$i; \
done
@for i in $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS) \
- $(PROXY_TARGETS) $(SERV_MODULES) ; do \
+ $(SERV_MODULES) ; do \
if test -f $$i; then \
echo $(INSTALL) $$i $(root)$(prefix)/$$i; \
$(INSTALL) $$i $(root)$(prefix)/$$i; \
cleaner: clean
rm -f $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS) \
- modules/*.[ms]o $(PROXY_TARGETS) so_locations
+ modules/*.[ms]o so_locations
distclean: cleaner
find . -name '*~' -o -name '.#*' | xargs rm -f
if (ateof) {
return FALSE;
}
- l = fread(iobuf, 1, 256, fi); /* Read input buffer */
+ l = fread(iobuf, 1, sizeof iobuf, fi); /* Read input buffer */
if (l <= 0) {
if (ferror(fi)) {
exit(1);
{
uid_t uid;
struct passwd *pw;
- char buf[256];
+ char buf[SIZ];
get_config();
uid = getuid();
char temp[PATH_MAX]; /* Name of general temp file */
char temp2[PATH_MAX]; /* Name of general temp file */
char tempdir[PATH_MAX]; /* Name of general temp dir */
-char editor_path[256]; /* path to external editor */
-char printcmd[256]; /* print command */
+char editor_path[SIZ]; /* path to external editor */
+char printcmd[SIZ]; /* print command */
int editor_pid = (-1);
char fullname[32];
jmp_buf nextbuf;
char have_xterm = 0; /* are we running on an xterm? */
char rc_username[32];
char rc_password[32];
-char hostbuf[256];
-char portbuf[256];
+char hostbuf[SIZ];
+char portbuf[SIZ];
char rc_floor_mode;
char floor_mode;
char curr_floor = 0; /* number of current floor */
-char floorlist[128][256]; /* names of floors */
+char floorlist[128][SIZ]; /* names of floors */
char express_msgs = 0; /* express messages waiting! */
int termn8 = 0; /* Set to nonzero to cause a logoff */
void formout(char *name)
{ /* display a file */
- char cmd[256];
+ char cmd[SIZ];
snprintf(cmd, sizeof cmd, "MESG %s", name);
serv_puts(cmd);
serv_gets(cmd);
void userlist(char *patn)
{
- char buf[256];
- char fl[256];
+ char buf[SIZ];
+ char fl[SIZ];
struct tm *tmbuf;
time_t lc;
*/
void dotgoto(char *towhere, int display_name)
{
- char aaa[256], bbb[256], psearch[256];
+ char aaa[SIZ], bbb[SIZ], psearch[SIZ];
static long ls = 0L;
int newmailcount;
static int oldmailcount = (-1);
*/
void gotonext(void)
{
- char buf[256];
+ char buf[SIZ];
struct march *mptr, *mptr2;
char next_room[ROOMNAMELEN];
*/
void forget_all_rooms_on(int ffloor)
{
- char buf[256];
+ char buf[SIZ];
struct march *flist, *fptr;
printf("Forgetting all rooms on %s...\r", &floorlist[ffloor][0]);
{
int a, tofloor;
struct march *mptr;
- char buf[256], targ[256];
+ char buf[SIZ], targ[SIZ];
if (floorlist[0][0] == 0)
load_floorlist();
{
char pass1[20];
char pass2[20];
- char buf[256];
+ char buf[SIZ];
if (strlen(rc_password) > 0) {
strcpy(pass1, rc_password);
*/
void who_is_online(int longlist)
{
- char buf[256], username[256], roomname[256], fromhost[256];
- char flags[256];
- char actual_user[256], actual_room[256], actual_host[256];
- char tbuf[256], clientsoft[256];
+ char buf[SIZ], username[SIZ], roomname[SIZ], fromhost[SIZ];
+ char flags[SIZ];
+ char actual_user[SIZ], actual_room[SIZ], actual_host[SIZ];
+ char tbuf[SIZ], clientsoft[SIZ];
time_t timenow = 0;
time_t idletime, idlehours, idlemins, idlesecs;
int last_session = (-1);
char *sptr, *sptr2; /* USed to extract the nonce */
char hexstring[MD5_HEXSTRING_SIZE];
int stored_password = 0;
- char password[256];
+ char password[SIZ];
sttybbs(SB_SAVE); /* Store the old terminal parameters */
load_command_set(); /* parse the citadel.rc file */
extern char is_room_aide;
extern unsigned userflags;
extern char sigcaught;
-extern char editor_path[256];
-extern char printcmd[256];
+extern char editor_path[SIZ];
+extern char printcmd[SIZ];
extern char have_xterm;
extern char rc_username[32];
extern char rc_password[32];
*/
int is_public_client(char *where)
{
- char buf[256];
+ char buf[SIZ];
FILE *fp;
lprintf(9, "Checking whether %s is a public client\n", where);
fp = fopen("public_clients","r");
if (fp == NULL) return(0);
- while (fgets(buf,256,fp)!=NULL) {
+ while (fgets(buf, sizeof buf, fp)!=NULL) {
while (isspace((buf[strlen(buf)-1])))
buf[strlen(buf)-1] = 0;
if (hostnames_match(where,buf)) {
int dev_code;
int cli_code;
int rev_level;
- char desc[256];
- char from_host[256];
+ char desc[SIZ];
+ char from_host[SIZ];
struct in_addr addr;
int do_lookup = 0;
void cmd_mesg(char *mname)
{
FILE *mfp;
- char targ[256];
- char buf[256];
+ char targ[SIZ];
+ char buf[SIZ];
char *dirs[2];
extract(buf,mname,0);
void cmd_emsg(char *mname)
{
FILE *mfp;
- char targ[256];
- char buf[256];
+ char targ[SIZ];
+ char buf[SIZ];
char *dirs[2];
int a;
* This loop recognizes all server commands.
*/
void do_command_loop(void) {
- char cmdbuf[256];
+ char cmdbuf[SIZ];
time(&CC->lastcmd);
memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
void chatmode(void)
{
- char wbuf[256];
- char buf[256];
- char c_user[256];
- char c_text[256];
- char c_room[256];
- char last_user[256];
+ char wbuf[SIZ];
+ char buf[SIZ];
+ char c_user[SIZ];
+ char c_text[SIZ];
+ char c_room[SIZ];
+ char last_user[SIZ];
int send_complete_line;
int recv_complete_line;
char ch;
void page_user()
{
static char last_paged[32] = "";
- char buf[256], touser[256], msg[256];
+ char buf[SIZ], touser[SIZ], msg[SIZ];
FILE *pagefp;
strcpy(touser, last_paged);
serv_gets(buf);
if (buf[0] == '4') {
strcpy(last_paged, touser);
- while (fgets(buf, 256, pagefp) != NULL) {
+ while (fgets(buf, sizeof buf, pagefp) != NULL) {
buf[strlen(buf) - 1] = 0;
serv_puts(buf);
}
void quiet_mode(void)
{
int qstate;
- char buf[256];
+ char buf[SIZ];
serv_puts("DEXP 2");
serv_gets(buf);
#include <sys/stat.h>
#include <limits.h>
#include <stdio.h>
+#include "citadel.h"
#include "tools.h"
#include "commands.h"
char pwfile[PATH_MAX];
FILE *fp;
- char buf[256];
- char buf64[256];
- char hostbuf[256], portbuf[256], ubuf[256], pbuf[256];
+ char buf[SIZ];
+ char buf64[SIZ];
+ char hostbuf[SIZ], portbuf[SIZ], ubuf[SIZ], pbuf[SIZ];
strcpy(username, "");
strcpy(password, "");
char pwfile[PATH_MAX];
FILE *fp, *oldfp;
- char buf[256];
- char buf64[256];
- char hostbuf[256], portbuf[256], ubuf[256], pbuf[256];
+ char buf[SIZ];
+ char buf64[SIZ];
+ char hostbuf[SIZ], portbuf[SIZ], ubuf[SIZ], pbuf[SIZ];
determine_pwfilename(pwfile);
if (strlen(pwfile)==0) return;
int rc_exp_beep;
-char rc_exp_cmd[256];
+char rc_exp_cmd[1024];
int rc_allow_attachments;
int rc_display_message_numbers;
int rc_force_mail_prompts;
int rc_remember_passwords;
int rc_ansi_color;
int num_urls = 0;
-char urls[MAXURLS][256];
-char rc_url_cmd[256];
+char urls[MAXURLS][1024];
+char rc_url_cmd[1024];
char *gl_string;
int next_lazy_cmd = 5;
*/
void print_express(void)
{
- char buf[256];
+ char buf[1024];
FILE *outpipe;
time_t timestamp;
struct tm *stamp;
static time_t idlet = 0;
static void really_do_keepalive(void) {
- char buf[256];
+ char buf[1024];
time(&idlet);
if (keepalives_enabled == KA_YES) {
void load_command_set(void)
{
FILE *ccfile;
- char buf[256];
+ char buf[1024];
struct citcmd *cptr;
struct citcmd *lastcmd = NULL;
int a, d;
perror("commands: cannot open citadel.rc");
logoff(errno);
}
- while (fgets(buf, 256, ccfile) != NULL) {
+ while (fgets(buf, sizeof buf, ccfile) != NULL) {
while ((strlen(buf) > 0) ? (isspace(buf[strlen(buf) - 1])) : 0)
buf[strlen(buf) - 1] = 0;
{
int a;
static char exp[64];
- char buf[256];
+ char buf[1024];
strcpy(exp, strbuf);
int i, c, a;
int choices;
int do_prompt = 0;
- char buf[256];
+ char buf[1024];
int ch;
int display_prompt = 1;
extern int num_urls;
-extern char urls[MAXURLS][256];
-extern char rc_url_cmd[256];
+extern char urls[MAXURLS][SIZ];
+extern char rc_url_cmd[SIZ];
extern int lines_printed;
extern int rc_remember_passwords;
* Get or set global configuration options
*/
void cmd_conf(char *argbuf) {
- char cmd[256];
- char buf[256];
+ char cmd[SIZ];
+ char buf[SIZ];
int a;
char *confptr;
- char confname[256];
+ char confname[SIZ];
if (!(CC->logged_in)) {
cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
{
int ret;
int i;
- char dbfilename[256];
+ char dbfilename[SIZ];
u_int32_t flags = 0;
lprintf(9, "open_databases() starting\n");
int get_smarthosts(char *mxbuf) {
int config_lines;
int i;
- char buf[256];
- char host[256], type[256];
+ char buf[SIZ];
+ char host[SIZ], type[SIZ];
int total_smarthosts = 0;
if (inetcfg == NULL) return(0);
void DLoader_Init(char *pathname)
{
void *fcn_handle;
- char dl_error[256];
+ char dl_error[SIZ];
DIR *dir;
int i;
struct dirent *dptr;
void (*h_command_function) (void) )
{
struct ServiceFunctionHook *newfcn;
- char message[256];
+ char message[SIZ];
newfcn = (struct ServiceFunctionHook *)
mallok(sizeof(struct ServiceFunctionHook));
*/
void cmd_movf(char *cmdbuf)
{
- char filename[256];
- char pathname[256];
- char newpath[256];
- char newroom[256];
- char buf[256];
+ char filename[SIZ];
+ char pathname[SIZ];
+ char newpath[SIZ];
+ char newroom[SIZ];
+ char buf[SIZ];
int a;
struct quickroom qrbuf;
*/
void cmd_netf(char *cmdbuf)
{
- char pathname[256],filename[256],destsys[256],buf[256],outfile[256];
+ char pathname[SIZ],filename[SIZ],destsys[SIZ],buf[SIZ],outfile[SIZ];
int a,e;
time_t now;
FILE *ofp;
*/
void cmd_open(char *cmdbuf)
{
- char filename[256];
- char pathname[256];
+ char filename[SIZ];
+ char pathname[SIZ];
int a;
extract(filename,cmdbuf,0);
*/
void cmd_oimg(char *cmdbuf)
{
- char filename[256];
- char pathname[256];
+ char filename[SIZ];
+ char pathname[SIZ];
struct usersupp usbuf;
char which_user[32];
int which_floor;
void cmd_uimg(char *cmdbuf)
{
int is_this_for_real;
- char basenm[256];
+ char basenm[SIZ];
int which_floor;
int a;
* close the download file
*/
void cmd_clos(void) {
- char buf[256];
+ char buf[SIZ];
if (CC->download_fp == NULL) {
cprintf("%d You don't have a download file open.\n",ERROR);
*/
void cmd_netp(char *cmdbuf)
{
- char buf[256];
+ char buf[SIZ];
extract(buf,cmdbuf,1);
if (strcasecmp(buf,config.c_net_password)) {
*/
void cmd_ndop(char *cmdbuf)
{
- char pathname[256];
+ char pathname[SIZ];
struct stat statbuf;
if (strlen(CC->net_node)==0) {
* do_citaformat = set to 1 to indent newlines with spaces
*/
char *html_to_ascii(char *inputmsg, int screenwidth, int do_citaformat) {
- char inbuf[256];
- char outbuf[256];
+ char inbuf[SIZ];
+ char outbuf[SIZ];
char tag[1024];
int done_reading = 0;
char *inptr;
strcpy(inbuf, "");
strcpy(outbuf, "");
- outptr = mallok(strlen(inptr) + 256);
+ outptr = mallok(strlen(inptr) + SIZ);
if (outptr == NULL) return NULL;
strcpy(outptr, "");
outlen = 0;
struct imap_fetch_part {
- char desired_section[256];
+ char desired_section[SIZ];
FILE *output_fp;
};
}
void imap_fetch_internaldate(struct CtdlMessage *msg) {
- char buf[256];
+ char buf[SIZ];
time_t msgdate;
if (msg->cm_fields['T'] != NULL) {
* so we don't have to check for that condition like we do elsewhere.
*/
void imap_fetch_envelope(long msgnum, struct CtdlMessage *msg) {
- char datestringbuf[256];
+ char datestringbuf[SIZ];
time_t msgdate;
char *fieldptr = NULL;
*/
void imap_fetch(int num_parms, char *parms[]) {
char items[1024];
- char *itemlist[256];
+ char *itemlist[SIZ];
int num_items;
int i;
*/
void imap_uidfetch(int num_parms, char *parms[]) {
char items[1024];
- char *itemlist[256];
+ char *itemlist[SIZ];
int num_items;
int i;
int have_uid_item = 0;
struct trynamebuf {
- char buffer1[256];
- char buffer2[256];
+ char buffer1[SIZ];
+ char buffer2[SIZ];
};
char *inetcfg = NULL;
int CtdlHostAlias(char *fqdn) {
int config_lines;
int i;
- char buf[256];
- char host[256], type[256];
+ char buf[SIZ];
+ char host[SIZ], type[SIZ];
if (!strcasecmp(fqdn, config.c_fqdn)) return(hostalias_localhost);
if (!strcasecmp(fqdn, config.c_nodename)) return(hostalias_localhost);
*/
int convert_internet_address(char *destuser, char *desthost, char *source)
{
- char user[256];
- char node[256];
- char name[256];
+ char user[SIZ];
+ char node[SIZ];
+ char name[SIZ];
struct quickroom qrbuf;
int i;
int hostalias;
struct trynamebuf tnb;
- char buf[256];
+ char buf[SIZ];
int passes = 0;
char sourcealias[1024];
int i;
int colonpos = (-1);
int processed = 0;
- char buf[256];
+ char buf[SIZ];
char user[1024];
char node[1024];
char name[1024];
struct CtdlMessage *msg;
int pos, beg, end;
int done;
- char buf[256];
+ char buf[SIZ];
int converted;
msg = mallok(sizeof(struct CtdlMessage));
struct internet_address_list {
struct internet_address_list *next;
- char ial_user[256];
- char ial_node[256];
- char ial_name[256];
+ char ial_user[SIZ];
+ char ial_node[SIZ];
+ char ial_name[SIZ];
};
void LoadInternetConfig(void)
{
- char ParamName[256], ParamValue[256], buf[256];
+ char ParamName[SIZ], ParamValue[SIZ], buf[SIZ];
FILE *conf;
int a, eqpos;
syslog(LOG_NOTICE, "Couldn't load internetmail.config");
exit(1);
}
- while (fgets(buf, 256, conf) != NULL) {
+ while (fgets(buf, sizeof buf, conf) != NULL) {
if (strlen(buf) > 0)
buf[strlen(buf) - 1] = 0;
strcpy(ParamName, "");
void attach_to_server(int argc, char **argv, char *hostbuf, char *portbuf)
{
int a;
- char cithost[256];
+ char cithost[SIZ];
int host_copied = 0;
- char citport[256];
+ char citport[SIZ];
int port_copied = 0;
- char socks4[256];
- char buf[256];
+ char socks4[SIZ];
+ char buf[SIZ];
struct passwd *p;
- char sockpath[256];
+ char sockpath[SIZ];
strcpy(cithost, DEFAULT_HOST); /* default host */
strcpy(citport, DEFAULT_PORT); /* default port */
int in_header;
int is_good;
char listaddr[512];
- char mailcmd[256];
+ char mailcmd[SIZ];
FILE *nm;
char tempfile[64];
#include "snprintf.h"
#endif
-#define MAXWORDBUF 256
+#define MAXWORDBUF SIZ
#define MAXMSGS 512
struct cittext {
void ka_sigcatch(int signum)
{
- char buf[256];
+ char buf[SIZ];
alarm(S_KEEPALIVE);
signal(SIGALRM, ka_sigcatch);
serv_puts("NOOP");
long num, /* message number */
char pagin) /* 0 = normal read, 1 = read with pagination, 2 = header */
{
- char buf[256];
- char m_subject[256];
- char from[256], node[256], rfca[256];
- char now[256];
+ char buf[SIZ];
+ char m_subject[SIZ];
+ char from[SIZ], node[SIZ], rfca[SIZ];
+ char now[SIZ];
int format_type = 0;
int fr = 0;
int nhdr = 0;
*/
void transmit_message(FILE *fp)
{
- char buf[256];
+ char buf[SIZ];
int ch, a;
long msglen;
time_t lasttick;
int c) /* */
{
char buf[300];
- char cmd[256];
+ char cmd[SIZ];
int a, b;
int need_recp = 0;
int mode;
void list_urls()
{
int i;
- char cmd[256];
+ char cmd[SIZ];
if (num_urls == 0) {
printf("There were no URL's in the previous message.\n\n");
int hold_color = 0;
char prtfile[PATH_MAX];
char pagin;
- char cmd[256];
+ char cmd[SIZ];
char targ[ROOMNAMELEN];
- char filename[256];
+ char filename[SIZ];
if (c < 0)
b = (MAXMSGS - 1);
*/
void check_message_base(void)
{
- char buf[256];
+ char buf[SIZ];
printf
("Please read the documentation before running this command.\n"
char *ptr;
char *part_start, *part_end;
- char buf[256];
- char header[256];
- char boundary[256];
- char startary[256];
- char endary[256];
- char content_type[256];
- char encoding[256];
- char disposition[256];
- char name[256];
- char filename[256];
+ char buf[SIZ];
+ char header[SIZ];
+ char boundary[SIZ];
+ char startary[SIZ];
+ char endary[SIZ];
+ char content_type[SIZ];
+ char encoding[SIZ];
+ char disposition[SIZ];
+ char name[SIZ];
+ char filename[SIZ];
int is_multipart;
int part_seq = 0;
int i;
size_t length;
- char nested_partnum[256];
+ char nested_partnum[SIZ];
lprintf(9, "the_mime_parser() called\n");
ptr = content_start;
void cmd_msgs(char *cmdbuf)
{
int mode = 0;
- char which[256];
- char buf[256];
- char tfield[256];
- char tvalue[256];
+ char which[SIZ];
+ char buf[SIZ];
+ char tfield[SIZ];
+ char tvalue[SIZ];
int cm_ref = 0;
int i;
int with_template = 0;
*/
void help_subst(char *strbuf, char *source, char *dest)
{
- char workbuf[256];
+ char workbuf[SIZ];
int p;
while (p = pattern2(strbuf, source), (p >= 0)) {
int old = 0;
CIT_UBYTE ch;
char aaa[140];
- char buffer[256];
+ char buffer[SIZ];
strcpy(aaa, "");
old = 255;
if (is_valid_message(msg) == 0) return;
- for (i = 0; i < 256; ++i)
+ for (i = 0; i < SIZ; ++i)
if (msg->cm_fields[i] != NULL) {
phree(msg->cm_fields[i]);
}
int i, k;
char buf[1024];
CIT_UBYTE ch;
- char allkeys[256];
- char display_name[256];
+ char allkeys[SIZ];
+ char display_name[SIZ];
char *mptr;
char *nl; /* newline string */
/* buffers needed for RFC822 translation */
- char suser[256];
- char luser[256];
- char fuser[256];
- char snode[256];
- char lnode[256];
- char mid[256];
- char datestamp[256];
+ char suser[SIZ];
+ char luser[SIZ];
+ char fuser[SIZ];
+ char snode[SIZ];
+ char lnode[SIZ];
+ char mid[SIZ];
+ char datestamp[SIZ];
/* */
sprintf(mid, "%ld", msg_num);
strcpy(lnode, HUMANNODE);
if (mode == MT_RFC822) {
cprintf("X-UIDL: %ld%s", msg_num, nl);
- for (i = 0; i < 256; ++i) {
+ for (i = 0; i < SIZ; ++i) {
if (TheMessage->cm_fields[i]) {
mptr = TheMessage->cm_fields[i];
{
long msgid;
- CtdlAllocUserData(SYM_DESIRED_SECTION, 256);
+ CtdlAllocUserData(SYM_DESIRED_SECTION, SIZ);
msgid = extract_long(cmdbuf, 0);
extract(desired_section, cmdbuf, 1);
{
long newmsgid;
long retval;
- char msgidbuf[256];
+ char msgidbuf[SIZ];
struct ser_ret smr;
/* Get a new message number */
char hold_rm[ROOMNAMELEN];
char actual_rm[ROOMNAMELEN];
char force_room[ROOMNAMELEN];
- char content_type[256]; /* We have to learn this */
- char recipient[256];
+ char content_type[SIZ]; /* We have to learn this */
+ char recipient[SIZ];
long newmsgid;
char *mptr = NULL;
struct usersupp userbuf;
char *exist /* if non-null, append to it;
exist is ALWAYS freed */
) {
- char buf[256];
+ char buf[SIZ];
int linelen;
size_t message_len = 0;
size_t buffer_len = 0;
int a;
char dest_node[32];
- char buf[256];
+ char buf[SIZ];
struct CtdlMessage *msg;
msg = mallok(sizeof(struct CtdlMessage));
void cmd_ent0(char *entargs)
{
int post = 0;
- char recipient[256];
+ char recipient[SIZ];
int anon_flag = 0;
int format_type = 0;
- char newusername[256];
+ char newusername[SIZ];
struct CtdlMessage *msg;
int a, b;
int e = 0;
int mtsflag = 0;
struct usersupp tempUS;
- char buf[256];
+ char buf[SIZ];
post = extract_int(entargs, 0);
extract(recipient, entargs, 1);
*/
void cmd_ent3(char *entargs)
{
- char recp[256];
+ char recp[SIZ];
int a;
int e = 0;
int valid_msg = 1;
void cmd_move(char *args)
{
long num;
- char targ[256];
+ char targ[SIZ];
struct quickroom qtemp;
int err;
int is_copy = 0;
FILE *fp, *tempfp;
char filename[PATH_MAX];
- char cmdbuf[256];
+ char cmdbuf[SIZ];
char ch;
struct quickroom qrbuf;
char roomname[ROOMNAMELEN];
long msgnum;
char *conf;
struct CtdlMessage *msg;
- char buf[256];
+ char buf[SIZ];
strcpy(hold_rm, CC->quickroom.QRname);
if (getroom(&CC->quickroom, SYSCONFIGROOM) != 0) {
struct ma_info {
- char prefix[256]; /* Prefix for a multipart/alternative */
+ char prefix[SIZ]; /* Prefix for a multipart/alternative */
int is_ma; /* Set to 1 if we are using this stuff */
int did_print; /* One alternative has been displayed */
};
struct repl { /* Info for replication checking */
- char extended_id[256];
+ char extended_id[SIZ];
time_t highest;
};
FILE *fp, *rmail;
char sbuf[200], rbuf[200], cstr[100], fstr[128];
char nbuf[64], pbuf[128], rmname[128], buf[128];
- char datestamp[256];
- char subject[256];
+ char datestamp[SIZ];
+ char subject[SIZ];
time_t mid_buf;
time_t now;
int mlist = 0;
{
long download_len;
long bytes_received;
- char buf[256];
+ char buf[SIZ];
static char pbuf[IGNET_PACKET_SIZE];
char tempfilename[PATH_MAX];
long plen;
*/
void transmit_spool(char *remote_nodename)
{
- char buf[256];
+ char buf[SIZ];
char pbuf[4096];
long plen;
long bytes_to_write, thisblock;
int main(int argc, char **argv)
{
- char buf[256];
+ char buf[SIZ];
char remote_nodename[32];
int a;
fp = fopen("./network/filterlist", "r");
if (fp == NULL)
return;
- while (fgets(sbuf, 256, fp) != NULL) {
+ while (fgets(sbuf, sizeof sbuf, fp) != NULL) {
if (sbuf[0] != '#') {
sbuf[strlen(sbuf) - 1] = 0;
fbuf = (struct filterlist *)
struct netnode {
char nn_nodename[32];
- char nn_spoolcmd[256];
+ char nn_spoolcmd[SIZ];
struct roomshare *nn_first;
};
struct netnode *load_node(char *nodename)
{
FILE *fp;
- char buf[256];
- char filename[256];
+ char buf[SIZ];
+ char filename[SIZ];
struct netnode *newnn;
struct roomshare *newrs;
{
FILE *fp;
- char filename[256];
+ char filename[SIZ];
struct roomshare *rsptr = NULL;
sprintf(filename, "./network/systems/%s", nnptr->nn_nodename);
*/
void display_nodelist(void) {
FILE *ls;
- char buf[256];
+ char buf[SIZ];
ls = (FILE *) popen("cd ./network/systems; ls", "r");
if (ls == NULL) {
void add_node(char *NewNodeName)
{
FILE *fp;
- char sysfilename[256];
+ char sysfilename[SIZ];
sprintf(sysfilename, "./network/systems/%s", NewNodeName);
void delete_node(char *NodeName)
{
FILE *fp;
- char sysfilename[256];
- char spooloutfilename[256];
+ char sysfilename[SIZ];
+ char spooloutfilename[SIZ];
sprintf(sysfilename, "./network/systems/%s", NodeName);
sprintf(spooloutfilename, "./network/spoolout/%s", NodeName);
void do_roomlist(char *NodeName)
{
FILE *fp;
- char sysfilename[256];
- char buf[256];
+ char sysfilename[SIZ];
+ char buf[SIZ];
sprintf(sysfilename, "./network/systems/%s", NodeName);
void show_spool_cmd(char *NodeName)
{
FILE *fp;
- char sysfilename[256];
- char buf[256];
+ char sysfilename[SIZ];
+ char buf[SIZ];
sprintf(sysfilename, "./network/systems/%s", NodeName);
void cmd_gpex(char *argbuf) {
struct ExpirePolicy exp;
struct floor flbuf;
- char which[256];
+ char which[SIZ];
extract(which, argbuf, 0);
if (!strcasecmp(which, "room")) {
void cmd_spex(char *argbuf) {
struct ExpirePolicy exp;
struct floor flbuf;
- char which[256];
+ char which[SIZ];
memset(&exp, 0, sizeof(struct ExpirePolicy));
extract(which, argbuf, 0);
+++ /dev/null
-/*
- * $Id$
- *
- * A partially functional session layer proxy for Citadel
- * (c) 1998 by Art Cancro, All Rights Reserved, released under GNU GPL v2
- * NOTE: this isn't finished, so don't use it!!
- *
- */
-
-/* Directory to put the message cache in */
-#define CACHE_DIR "/var/citadelproxy"
-
-/* Number of days to keep messages in the cache */
-#define CACHE_EXPIRE 60
-
-/* Uncomment to enable prefetch */
-/* #define ENABLE_PREFETCH */
-
-/* Name and password to use for caching */
-#define PREFETCH_USER_NAME "cypherpunks"
-#define PREFETCH_USER_PASSWORD "cypherpunks"
-
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <errno.h>
-#include "citadel.h"
-
-struct RoomList {
- struct RoomList *next;
- char roomname[32];
- };
-
-struct MsgList {
- struct MsgList *next;
- long msgnum;
- };
-
-
-/*
- * num_parms() - discover number of parameters...
- */
-int num_parms(char *source)
-{
- int a;
- int count = 1;
-
- for (a=0; a<strlen(source); ++a)
- if (source[a]=='|') ++count;
- return(count);
- }
-
-
-/*
- * extract() - extract a parameter from a series of "|" separated...
- */
-void extract(char *dest, char *source, int parmnum)
-{
- char buf[256];
- int count = 0;
- int n;
-
- n = num_parms(source);
-
- if (parmnum >= n) {
- strcpy(dest,"");
- return;
- }
- strcpy(buf,source);
- if ( (parmnum == 0) && (n == 1) ) {
- strcpy(dest,buf);
- return;
- }
-
- while (count++ < parmnum) do {
- strcpy(buf,&buf[1]);
- } while( (strlen(buf)>0) && (buf[0]!='|') );
- if (buf[0]=='|') strcpy(buf,&buf[1]);
- for (count = 0; count<strlen(buf); ++count)
- if (buf[count] == '|') buf[count] = 0;
- strcpy(dest,buf);
- }
-
-
-
-
-
-
-
-void logoff(int code) {
- exit(code);
- }
-
-
-/* Fetch a message (or check its status in the cache)
- */
-void fetch_message(long msgnum) {
- char filename[64];
- char temp[64];
- FILE *fp;
- char buf[256];
-
- sprintf(filename, "%ld", msgnum);
-
- if (access(filename, F_OK)==0) {
- return; /* Already on disk */
- }
-
- /* The message is written to a file with a temporary name, in
- * order to avoid another user accidentally fetching a
- * partially written message from the cache.
- */
- sprintf(buf, "MSG0 %ld", msgnum);
- serv_puts(buf);
- serv_gets(buf);
- if (buf[0] != '1') return;
- sprintf(temp, "%ld.%d", msgnum, getpid());
- fp = fopen(temp, "w");
- while (serv_gets(buf), strcmp(buf, "000")) {
- fprintf(fp, "%s\n", buf);
- }
- fclose(fp);
-
- /* Now that the message is complete, it can be renamed to the
- * filename that the cache manager will recognize it with.
- */
- link(temp, filename);
- unlink(temp);
- }
-
-
-/*
- * This loop pre-fetches lots of messages
- */
-void do_prefetch() {
- char buf[256];
- struct RoomList *rl = NULL;
- struct RoomList *rlptr;
- struct MsgList *ml = NULL;
- struct MsgList *mlptr;
-
- close(0);
- close(1);
- close(2);
-
- serv_gets(buf);
- if (buf[0] != '2') {
- exit(0);
- }
-
- /* Log in (this is kind of arbitrary) */
- sprintf(buf, "USER %s", PREFETCH_USER_NAME);
- serv_puts(buf);
- serv_gets(buf);
- if (buf[0]=='3') {
- sprintf(buf, "PASS %s", PREFETCH_USER_PASSWORD);
- serv_puts(buf);
- serv_gets(buf);
- if (buf[0] != '2') exit(1);
- }
- else {
- sprintf(buf, "NEWU %s", PREFETCH_USER_NAME);
- serv_puts(buf);
- serv_gets(buf);
- if (buf[0] != '2') exit(1);
- sprintf(buf, "SETP %s", PREFETCH_USER_PASSWORD);
- serv_puts(buf);
- serv_gets(buf);
- if (buf[0] != '2') exit(1);
- }
-
- /* Fetch the roomlist (rooms with new messages only) */
- serv_puts("LKRN");
- serv_gets(buf);
- if (buf[0] != '1') exit(2);
- while (serv_gets(buf), strcmp(buf, "000")) {
- rlptr = (struct rlptr *) malloc(sizeof(struct RoomList));
- rlptr->next = rl;
- rl = rlptr;
- extract(rlptr->roomname, buf, 0);
- }
-
- /* Go to each room, fetching new messages */
- while (rl != NULL) {
- sprintf(buf, "GOTO %s", rl->roomname);
- serv_puts(buf);
- serv_gets(buf);
- if (buf[0]=='2') {
- serv_puts("MSGS NEW");
- serv_gets(buf);
- ml = NULL;
- if (buf[0]=='1') {
- while (serv_gets(buf), strcmp(buf, "000")) {
- mlptr = (struct mlptr *)
- malloc(sizeof(struct MsgList));
- mlptr->next = ml;
- ml = mlptr;
- mlptr->msgnum = atol(buf);
- }
- }
- }
-
- /* Fetch each message */
- while (ml != NULL) {
- fetch_message(ml->msgnum);
- mlptr = ml;
- ml = ml->next;
- free(mlptr);
- }
-
- /* Free the room list pointer */
- rlptr = rl;
- rl = rl->next;
- free(rlptr);
- }
-
- /* Now log out. */
- serv_puts("QUIT");
- exit(0);
- }
-
-void do_msg0(char cmd[]) {
- long msgnum;
- char filename[32];
- char temp[32];
- char buf[256];
- FILE *fp;
-
- msgnum = atol(&cmd[5]);
- sprintf(filename, "%ld", msgnum);
-
- /* If the message is cached, use the copy on disk */
- fp = fopen(filename, "r");
- if (fp != NULL) {
- printf("%d Cached message %ld:\n", LISTING_FOLLOWS, msgnum);
- while (fgets(buf, 256, fp) != NULL) {
- buf[strlen(buf)-1]=0;
- printf("%s\n", buf);
- }
- fclose(fp);
- printf("000\n");
- fflush(stdout);
- }
-
- /* Otherwise, fetch the message from the server and cache it */
- else {
- sprintf(buf, "MSG0 %ld", msgnum);
- serv_puts(buf);
- serv_gets(buf);
- printf("%s\n", buf);
- fflush(stdout);
- if (buf[0] != '1') {
- return;
- }
-
- /* The message is written to a file with a temporary name, in
- * order to avoid another user accidentally fetching a
- * partially written message from the cache.
- */
- sprintf(temp, "%ld.%d", msgnum, getpid());
- fp = fopen(temp, "w");
- while (serv_gets(buf), strcmp(buf, "000")) {
- printf("%s\n", buf);
- fprintf(fp, "%s\n", buf);
- }
- printf("%s\n", buf);
- fflush(stdout);
- fclose(fp);
-
- /* Now that the message is complete, it can be renamed to the
- * filename that the cache manager will recognize it with.
- */
- link(temp, filename);
- unlink(temp);
- }
-
- }
-
-
-void do_mainloop() {
- char cmd[256];
- char resp[256];
- char buf[4096];
- int bytes;
-
- while(1) {
- fflush(stdout);
- if (fgets(cmd, 256, stdin) == NULL) {
- serv_puts("QUIT");
- exit(1);
- }
- cmd[strlen(cmd)-1] = 0;
-
- /* QUIT commands are handled specially */
- if (!strncasecmp(cmd, "QUIT", 4)) {
- serv_puts("QUIT");
- printf("%d Proxy says: Bye!\n", OK);
- fflush(stdout);
- sprintf(buf,
- "/usr/bin/find %s -mtime +%d -exec rm -f {} \\; &",
- CACHE_DIR, CACHE_EXPIRE);
- system(buf);
- exit(0);
- }
-
- else if (!strncasecmp(cmd, "CHAT", 4)) {
- printf("%d Can't chat through the proxy ... yet.\n",
- ERROR);
- }
-
- else if (!strncasecmp(cmd, "MSG0", 4)) {
- do_msg0(cmd);
- }
-
- /* Other commands, just pass through. */
- else {
-
- serv_puts(cmd);
- serv_gets(resp);
- printf("%s\n", resp);
- fflush(stdout);
-
- /* Simple command-response... */
- if ( (resp[0]=='2')||(resp[0]=='3')||(resp[0]=='5') ) {
- }
-
- /* Textual input... */
- else if (resp[0] == '4') {
- do {
- if (fgets(buf, 256, stdin) == NULL) {
- exit(errno);
- }
- buf[strlen(buf)-1] = 0;
- serv_puts(buf);
- } while (strcmp(buf, "000"));
- }
-
- /* Textual output... */
- else if (resp[0] == '1') {
- do {
- serv_gets(buf);
- printf("%s\n", buf);
- } while (strcmp(buf, "000"));
- }
-
- /* Binary output... */
- else if (resp[0] == '6') {
- bytes = atol(&resp[4]);
- serv_read(buf, bytes);
- fwrite(buf, bytes, 1, stdout);
- fflush(stdout);
- }
-
- /* Binary input... */
- else if (resp[0] == '7') {
- bytes = atol(&resp[4]);
- fread(buf, bytes, 1, stdin);
- serv_write(buf, bytes);
- }
-
- /* chat... */
- else if (resp[0] == '8') {
- sleep(2);
- serv_puts("/quit");
- do {
- fgets(buf, 256, stdin);
- buf[strlen(buf)-1] = 0;
- serv_puts(buf);
- } while (strcmp(buf, "000"));
- }
-
-
- }
- }
- }
-
-
-
-void main(int argc, char *argv[]) {
- char buf[256];
- int pid;
-
- /* Create the cache directory. Die on any error *except* EEXIST
- * because it's perfectly ok if the cache already exists.
- */
- if (mkdir(CACHE_DIR, 0700)!=0) {
- if (errno != EEXIST) {
- printf("%d Error creating cache directory: %s\n",
- ERROR+INTERNAL_ERROR,
- strerror(errno));
- exit(errno);
- }
- }
-
- /* Now go there */
- if (chdir(CACHE_DIR) != 0) exit(errno);
-
-#ifdef ENABLE_PREFETCH
- pid = fork();
-#endif
- attach_to_server(argc, argv, NULL, NULL);
-#ifdef ENABLE_PREFETCH
- if (pid == 0) do_prefetch();
-#endif
-
- serv_gets(buf);
- strcat(buf, " (VIA PROXY)");
- printf("%s\n", buf);
- fflush(stdout);
- if (buf[0] != '2') exit(0);
-
- do_mainloop();
- }
{
time_t LogTime;
unsigned int LogType;
- char LogName[256];
+ char LogName[SIZ];
- char buf[256];
+ char buf[SIZ];
char aaa[100];
struct tm *tm;
char *tstring;
}
else
{
- while (fgets (buf, 256, logfp) != NULL)
+ while (fgets (buf, sizeof buf, logfp) != NULL)
{
buf[strlen (buf) - 1] = 0;
strcat(buf, " ");
int c;
int ok = 0;
int ra;
- char augmented_roomname[256];
- char towhere[256];
- char password[256];
+ char augmented_roomname[SIZ];
+ char towhere[SIZ];
+ char password[SIZ];
if (CtdlAccessCheck(ac_logged_in)) return;
*/
void cmd_rdir(void)
{
- char buf[256];
- char flnm[256];
- char comment[256];
+ char buf[SIZ];
+ char flnm[SIZ];
+ char comment[SIZ];
FILE *ls, *fd;
struct stat statbuf;
fd = fopen("/dev/null", "r");
ls = fopen(CC->temp, "r");
- while (fgets(flnm, 256, ls) != NULL) {
+ while (fgets(flnm, sizeof flnm, ls) != NULL) {
flnm[strlen(flnm) - 1] = 0;
if (strcasecmp(flnm, "filedir")) {
sprintf(buf, "%s/files/%s/%s",
stat(buf, &statbuf);
strcpy(comment, "");
fseek(fd, 0L, 0);
- while ((fgets(buf, 256, fd) != NULL)
+ while ((fgets(buf, sizeof buf, fd) != NULL)
&& (strlen(comment) == 0)) {
buf[strlen(buf) - 1] = 0;
if ((!strncasecmp(buf, flnm, strlen(flnm)))
*/
void cmd_setr(char *args)
{
- char buf[256];
+ char buf[SIZ];
struct floor flbuf;
char old_name[ROOMNAMELEN];
int old_floor;
{
struct usersupp usbuf;
long newu;
- char buf[256];
+ char buf[SIZ];
int post_notice;
if (CtdlAccessCheck(ac_room_aide)) return;
void cmd_rinf(void)
{
char filename[128];
- char buf[256];
+ char buf[SIZ];
FILE *info_fp;
assoc_file_name(filename, &CC->quickroom, "info");
return;
}
cprintf("%d Info:\n", LISTING_FOLLOWS);
- while (fgets(buf, 256, info_fp) != NULL) {
+ while (fgets(buf, sizeof buf, info_fp) != NULL) {
if (strlen(buf) > 0)
buf[strlen(buf) - 1] = 0;
cprintf("%s\n", buf);
void cmd_cre8(char *args)
{
int cre8_ok;
- char new_room_name[256];
+ char new_room_name[SIZ];
int new_room_type;
- char new_room_pass[256];
+ char new_room_pass[SIZ];
int new_room_floor;
- char aaa[256];
+ char aaa[SIZ];
unsigned newflags;
struct quickroom qrbuf;
struct floor flbuf;
void cmd_einf(char *ok)
{ /* enter info file for current room */
FILE *fp;
- char infofilename[256];
- char buf[256];
+ char infofilename[SIZ];
+ char buf[SIZ];
if (CtdlAccessCheck(ac_room_aide)) return;
*/
void cmd_cflr(char *argbuf)
{
- char new_floor_name[256];
+ char new_floor_name[SIZ];
struct floor flbuf;
int cflr_ok;
int free_slot = (-1);
extern long uglsn;
extern char ugname[];
-extern char floorlist[128][256];
+extern char floorlist[128][SIZ];
void load_floorlist(void) {
int a;
- char buf[256];
+ char buf[SIZ];
for (a=0; a<128; ++a) floorlist[a][0] = 0;
*/
void listrms(char *variety)
{
- char buf[256];
+ char buf[SIZ];
struct roomlisting *rl = NULL;
struct roomlisting *rp;
*/
void knrooms(int kn_floor_mode)
{
- char buf[256];
+ char buf[SIZ];
int a;
load_floorlist();
int select_floor(int rfloor)
{
int a, newfloor;
- char floorstr[256];
+ char floorstr[SIZ];
if (floor_mode == 1) {
if (floorlist[(int)curr_floor][0]==0) load_floorlist();
do {
newfloor = (-1);
safestrncpy(floorstr,floorlist[rfloor],sizeof floorstr);
- strprompt("Which floor",floorstr,256);
+ strprompt("Which floor",floorstr,SIZ);
for (a=0; a<128; ++a) {
if (!strcasecmp(floorstr,&floorlist[a][0]))
newfloor = a;
unsigned rflags;
int rbump;
char raide[32];
- char buf[256];
+ char buf[SIZ];
int rfloor;
int rorder;
int expire_mode = 0;
* un-goto the previous room
*/
void ungoto(void) {
- char buf[256];
+ char buf[SIZ];
if (!strcmp(ugname,"")) return;
snprintf(buf,sizeof buf,"GOTO %s",ugname);
*/
void download_to_local_disk(char *supplied_filename, long total_bytes)
{
- char buf[256];
+ char buf[SIZ];
char dbuf[4096];
long transmitted_bytes = 0L;
long aa,bb;
FILE *savefp;
int broken = 0;
int packet;
- char filename[256];
+ char filename[SIZ];
strcpy(filename, supplied_filename);
if (strlen(filename)==0) {
printf("Enter the name of the directory to save '%s'\n",
filename);
printf("to, or press return for the current directory.\n");
- newprompt("Directory: ",dbuf,256);
+ newprompt("Directory: ", dbuf, sizeof dbuf);
if (strlen(dbuf)==0) strcpy(dbuf,".");
strcat(dbuf,"/");
strcat(dbuf,filename);
*/
void download(int proto)
{
- char buf[256];
- char filename[256];
- char tempname[256];
- char transmit_cmd[256];
+ char buf[SIZ];
+ char filename[SIZ];
+ char tempname[SIZ];
+ char transmit_cmd[SIZ];
long total_bytes = 0L;
char dbuf[4096];
long transmitted_bytes = 0L;
* read directory of this room
*/
void roomdir(void) {
- char flnm[256];
+ char flnm[SIZ];
char flsz[32];
- char comment[256];
- char buf[256];
+ char comment[SIZ];
+ char buf[SIZ];
serv_puts("RDIR");
serv_gets(buf);
* add a user to a private room
*/
void invite(void) {
- char aaa[31],bbb[256];
+ char aaa[31],bbb[SIZ];
if ((room_flags & QR_PRIVATE)==0) {
printf("This is not a private room.\n");
* kick a user out of a room
*/
void kickout(void) {
- char aaa[31],bbb[256];
+ char aaa[31],bbb[SIZ];
newprompt("Name of user? ",aaa,30);
if (aaa[0]==0) return;
}
void forget(void) { /* forget the current room */
- char cmd[256];
+ char cmd[SIZ];
printf("Are you sure you want to forget this room? ");
if (yesno()==0) return;
* create a new room
*/
void entroom(void) {
- char cmd[256];
+ char cmd[SIZ];
char new_room_name[ROOMNAMELEN];
int new_room_type;
char new_room_pass[10];
void readinfo(void) { /* read info file for current room */
- char cmd[256];
+ char cmd[SIZ];
sprintf(cmd,"RINF");
serv_puts(cmd);
* <W>ho knows room...
*/
void whoknows(void) {
- char buf[256];
+ char buf[SIZ];
serv_puts("WHOK");
serv_gets(buf);
if (buf[0]!='1') {
void do_edit(char *desc, char *read_cmd, char *check_cmd, char *write_cmd)
{
FILE *fp;
- char cmd[256];
+ char cmd[SIZ];
int b,cksum,editor_exit;
}
void enter_bio(void) {
- char cmd[256];
+ char cmd[SIZ];
snprintf(cmd,sizeof cmd,"RBIO %s",fullname);
do_edit("your Bio",cmd,"NOOP","EBIO");
}
* create a new floor
*/
void create_floor(void) {
- char buf[256];
- char newfloorname[256];
+ char buf[SIZ];
+ char newfloorname[SIZ];
serv_puts("CFLR xx|0");
serv_gets(buf);
* edit the current floor
*/
void edit_floor(void) {
- char buf[256];
+ char buf[SIZ];
int expire_mode = 0;
int expire_value = 0;
*/
void kill_floor(void) {
int floornum_to_delete,a;
- char buf[256];
+ char buf[SIZ];
if (floorlist[(int)curr_floor][0]==0) load_floorlist();
do {
*/
void edituser(void)
{
- char buf[256];
- char who[256];
- char pass[256];
+ char buf[SIZ];
+ char who[SIZ];
+ char pass[SIZ];
int flags;
int timescalled;
int posted;
void locate_host(char *hbuf)
{
#ifndef HAVE_UTMP_H
- char buf[256];
+ char buf[SIZ];
FILE *who;
int a,b;
strcpy(hbuf,serv_info.serv_fqdn);
return;
}
- fgets(buf,256,who);
+ fgets(buf,sizeof buf,who);
pclose(who);
b = 0;
* miscellaneous server commands (testing, etc.)
*/
void misc_server_cmd(char *cmd) {
- char buf[256];
+ char buf[SIZ];
serv_puts(cmd);
serv_gets(buf);
{
DIR *dp;
struct dirent *d;
- char filename[256];
+ char filename[SIZ];
dp = opendir(dirname);
if (dp == NULL) {
void entregis(void)
{ /* register with name and address */
- char buf[256];
- char tmpname[256];
- char tmpaddr[256];
- char tmpcity[256];
- char tmpstate[256];
- char tmpzip[256];
- char tmpphone[256];
- char tmpemail[256];
- char tmpcountry[256];
+ char buf[SIZ];
+ char tmpname[SIZ];
+ char tmpaddr[SIZ];
+ char tmpcity[SIZ];
+ char tmpstate[SIZ];
+ char tmpzip[SIZ];
+ char tmpphone[SIZ];
+ char tmpemail[SIZ];
+ char tmpcountry[SIZ];
int a;
strcpy(tmpname, "");
void updatels(void)
{ /* make all messages old in current room */
- char buf[256];
+ char buf[SIZ];
serv_puts("SLRP HIGHEST");
serv_gets(buf);
if (buf[0] != '2')
*/
void updatelsa(void)
{
- char buf[256];
+ char buf[SIZ];
sprintf(buf, "SLRP %ld", highest_msg_read);
serv_puts(buf);
serv_gets(buf);
*/
void do_upload(int fd)
{
- char buf[256];
+ char buf[SIZ];
char tbuf[4096];
long transmitted_bytes, total_bytes;
int bytes_to_send;
*/
void cli_upload(void)
{
- char flnm[256];
+ char flnm[SIZ];
char desc[151];
- char buf[256];
- char tbuf[256];
+ char buf[SIZ];
+ char tbuf[SIZ];
int a;
int fd;
*/
void cli_image_upload(char *keyname)
{
- char flnm[256];
- char buf[256];
+ char flnm[SIZ];
+ char buf[SIZ];
int fd;
sprintf(buf, "UIMG 0|%s", keyname);
*/
void upload(int c)
{ /* c = upload mode */
- char flnm[256];
+ char flnm[SIZ];
char desc[151];
- char buf[256];
+ char buf[SIZ];
char tbuf[4096];
int xfer_pid;
int a, b;
sprintf(buf, "cd %s; ls", tempdir);
lsfp = popen(buf, "r");
if (lsfp != NULL) {
- while (fgets(flnm, 256, lsfp) != NULL) {
+ while (fgets(flnm, sizeof flnm, lsfp) != NULL) {
flnm[strlen(flnm) - 1] = 0;
sprintf(buf, "%s/%s", tempdir, flnm);
fd = open(buf, O_RDONLY);
void val_user(char *user, int do_validate)
{
int a;
- char cmd[256];
- char buf[256];
+ char cmd[SIZ];
+ char buf[SIZ];
int ax = 0;
sprintf(cmd, "GREG %s", user);
void validate(void)
{ /* validate new users */
- char cmd[256];
- char buf[256];
+ char cmd[SIZ];
+ char buf[SIZ];
int finished = 0;
do {
void deletefile(void)
{
char filename[32];
- char cmd[256];
+ char cmd[SIZ];
newprompt("Filename: ", filename, 31);
if (strlen(filename) == 0)
*/
void netsendfile(void)
{
- char filename[32], destsys[20], cmd[256];
+ char filename[32], destsys[20], cmd[SIZ];
newprompt("Filename: ", filename, 31);
if (strlen(filename) == 0)
{
char filename[64];
char newroom[ROOMNAMELEN];
- char cmd[256];
+ char cmd[SIZ];
newprompt("Filename: ", filename, 63);
if (strlen(filename) == 0)
*/
void list_bio(void)
{
- char buf[256];
+ char buf[SIZ];
int pos = 1;
serv_puts("LBIO");
*/
void read_bio(void)
{
- char who[256];
- char buf[256];
+ char who[SIZ];
+ char buf[SIZ];
do {
newprompt("Read bio for who ('?' for list) : ", who, 25);
*/
void do_system_configuration(void)
{
- char buf[256];
- char sc[28][256];
+ char buf[SIZ];
+ char sc[28][SIZ];
int expire_mode = 0;
int expire_value = 0;
int a;
* Internet mail configuration
*/
void do_internet_configuration(void) {
- char buf[256];
+ char buf[SIZ];
int num_recs = 0;
char **recs = NULL;
char ch;
++num_recs;
if (num_recs == 1) recs = malloc(sizeof(char *));
else recs = realloc(recs, (sizeof(char *)) * num_recs);
- recs[num_recs-1] = malloc(256);
+ recs[num_recs-1] = malloc(SIZ);
strcpy(recs[num_recs-1], buf);
}
*/
void np_attach_to_server(void)
{
- char hostbuf[256], portbuf[256];
- char buf[256];
+ char hostbuf[SIZ], portbuf[SIZ];
+ char buf[SIZ];
char *args[] =
{"sendcommand", NULL};
int main(int argc, char **argv)
{
int a;
- char cmd[256];
- char buf[256];
+ char cmd[SIZ];
+ char buf[SIZ];
strcpy(bbs_home_directory, BBSDIR);
* enter user bio
*/
void cmd_ebio(char *cmdbuf) {
- char buf[256];
+ char buf[SIZ];
FILE *fp;
if (!(CC->logged_in)) {
void cmd_rbio(char *cmdbuf)
{
struct usersupp ruser;
- char buf[256];
+ char buf[SIZ];
FILE *fp;
extract(buf,cmdbuf,0);
return;
}
cprintf("%d \n",LISTING_FOLLOWS);
- while (fgets(buf,256,fp)!=NULL) cprintf("%s",buf);
+ while (fgets(buf,sizeof buf,fp)!=NULL) cprintf("%s",buf);
fclose(fp);
cprintf("000\n");
}
* list of users who have entered bios
*/
void cmd_lbio(char *cmdbuf) {
- char buf[256];
+ char buf[SIZ];
FILE *ls;
struct usersupp usbuf;
void allwrite(char *cmdbuf, int flag, char *username)
{
FILE *fp;
- char bcast[256];
+ char bcast[SIZ];
char *un;
struct ChatLine *clptr, *clnew;
time_t now;
void cmd_chat(char *argbuf)
{
- char cmdbuf[256];
+ char cmdbuf[SIZ];
char *un;
char *strptr1;
int MyLastMsg, ThisLastMsg;
void cmd_sexp(char *argbuf)
{
int message_sent = 0;
- char x_user[256];
- char x_msg[256];
+ char x_user[SIZ];
+ char x_msg[SIZ];
char *lun; /* <bc> */
char *x_big_msgbuf = NULL;
}
cprintf("%d Transmit message (will deliver to %d users)\n",
SEND_LISTING, message_sent);
- x_big_msgbuf = mallok(256);
- memset(x_big_msgbuf, 0, 256);
+ x_big_msgbuf = mallok(SIZ);
+ memset(x_big_msgbuf, 0, SIZ);
while (client_gets(x_msg), strcmp(x_msg, "000")) {
x_big_msgbuf = reallok(x_big_msgbuf,
strlen(x_big_msgbuf) + strlen(x_msg) + 4);
}
- transcript = mallok(256);
+ transcript = mallok(SIZ);
strcpy(transcript, "The following rooms have been auto-purged:\n");
while (RoomPurgeList != NULL) {
if (getroom(&qrbuf, RoomPurgeList->name) == 0) {
- transcript=reallok(transcript, strlen(transcript)+256);
+ transcript=reallok(transcript, strlen(transcript)+SIZ);
sprintf(&transcript[strlen(transcript)], " %s\n",
qrbuf.QRname);
delete_room(&qrbuf);
ForEachUser(do_user_purge, NULL);
}
- transcript = mallok(256);
+ transcript = mallok(SIZ);
strcpy(transcript, "The following users have been auto-purged:\n");
while (UserPurgeList != NULL) {
- transcript=reallok(transcript, strlen(transcript)+256);
+ transcript=reallok(transcript, strlen(transcript)+SIZ);
sprintf(&transcript[strlen(transcript)], " %s\n",
UserPurgeList->name);
purge_user(UserPurgeList->name);
void cmd_expi(char *argbuf) {
- char cmd[256];
+ char cmd[SIZ];
int retval;
if (CtdlAccessCheck(ac_aide)) return;
* Implements the AYTHENTICATE command
*/
void imap_authenticate(int num_parms, char *parms[]) {
- char buf[256];
+ char buf[SIZ];
if (num_parms != 3) {
cprintf("%s BAD incorrect number of parameters\r\n", parms[0]);
}
void imap_auth_login_user(char *cmd) {
- char buf[256];
+ char buf[SIZ];
decode_base64(buf, cmd);
CtdlLoginExistingUser(buf);
}
void imap_auth_login_pass(char *cmd) {
- char buf[256];
+ char buf[SIZ];
decode_base64(buf, cmd);
if (CtdlTryPassword(buf) == pass_ok) {
* implements the SELECT command
*/
void imap_select(int num_parms, char *parms[]) {
- char towhere[256];
- char augmented_roomname[256];
+ char towhere[SIZ];
+ char augmented_roomname[SIZ];
int c = 0;
int ok = 0;
int ra = 0;
* may or may not be the desired behavior in the future.
*/
void imap_lsub_listroom(struct quickroom *qrbuf, void *data) {
- char buf[256];
+ char buf[SIZ];
int ra;
/* Only list rooms to which the user has access!! */
* Back end for imap_list()
*/
void imap_list_listroom(struct quickroom *qrbuf, void *data) {
- char buf[256];
+ char buf[SIZ];
int ra;
/* Only list rooms to which the user has access!! */
* Main command loop for IMAP sessions.
*/
void imap_command_loop(void) {
- char cmdbuf[256];
- char *parms[256];
+ char cmdbuf[SIZ];
+ char *parms[SIZ];
int num_parms;
time(&CC->lastcmd);
struct citimap {
int authstate;
- char authseq[256];
+ char authseq[SIZ];
int selected; /* set to 1 if in the SELECTED state */
int readonly; /* mailbox is open read only */
int num_msgs; /* Number of messages being mapped */
void inetcfg_setTo(struct CtdlMessage *msg) {
char *conf;
- char buf[256];
+ char buf[SIZ];
if (msg->cm_fields['M']==NULL) return;
conf = strdoop(msg->cm_fields['M']);
#include "serv_info.h"
void CtdlInternalGetServInfo(struct CtdlServInfo *infobuf) {
- char buf[256];
+ char buf[SIZ];
int a;
/* fetch info */
void cmd_gnet(char *argbuf) {
- char filename[256];
- char buf[256];
+ char filename[SIZ];
+ char buf[SIZ];
FILE *fp;
if (CtdlAccessCheck(ac_room_aide)) return;
void cmd_snet(char *argbuf) {
- char tempfilename[256];
- char filename[256];
- char buf[256];
+ char tempfilename[SIZ];
+ char filename[SIZ];
+ char buf[SIZ];
FILE *fp;
if (CtdlAccessCheck(ac_room_aide)) return;
/* Generate delivery instructions for each recipient */
for (nptr = sc->listrecps; nptr != NULL; nptr = nptr->next) {
- if (instr_len - strlen(instr) < 256) {
+ if (instr_len - strlen(instr) < SIZ) {
instr_len = instr_len * 2;
instr = reallok(instr, instr_len);
}
* Batch up and send all outbound traffic from the current room
*/
void network_spoolout_current_room(void) {
- char filename[256];
- char buf[256];
- char instr[256];
+ char filename[SIZ];
+ char buf[SIZ];
+ char instr[SIZ];
FILE *fp;
struct SpoolControl sc;
/* struct namelist *digestrecps = NULL; */
struct namelist {
struct namelist *next;
- char name[256];
+ char name[SIZ];
};
struct SpoolControl {
void cmd_pas2(char *argbuf)
{
- char pw[256];
+ char pw[SIZ];
char hexstring[MD5_HEXSTRING_SIZE];
* Specify user name (implements POP3 "USER" command)
*/
void pop3_user(char *argbuf) {
- char username[256];
+ char username[SIZ];
if (CC->logged_in) {
cprintf("-ERR You are already logged in.\r\n");
void pop3_apop(char *argbuf)
{
- char username[256];
+ char username[SIZ];
char userdigest[MD5_HEXSTRING_SIZE];
char realdigest[MD5_HEXSTRING_SIZE];
char *sptr;
* Authorize with password (implements POP3 "PASS" command)
*/
void pop3_pass(char *argbuf) {
- char password[256];
+ char password[SIZ];
strcpy(password, argbuf);
striplt(password);
* Main command loop for POP3 sessions.
*/
void pop3_command_loop(void) {
- char cmdbuf[256];
+ char cmdbuf[SIZ];
time(&CC->lastcmd);
memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
*/
void cmd_rchg(char *argbuf)
{
- char newroomname[256];
+ char newroomname[SIZ];
extract(newroomname, argbuf, 0);
newroomname[ROOMNAMELEN-1] = 0;
*/
void cmd_hchg(char *argbuf)
{
- char newhostname[256];
+ char newhostname[SIZ];
extract(newhostname, argbuf, 0);
if (strlen(newhostname) > 0) {
void cmd_uchg(char *argbuf)
{
- char newusername[256];
+ char newusername[SIZ];
extract(newusername, argbuf, 0);
struct citsmtp { /* Information about the current session */
int command_state;
- char helo_node[256];
+ char helo_node[SIZ];
struct usersupp vrfy_buffer;
int vrfy_count;
- char vrfy_match[256];
- char from[256];
+ char vrfy_match[SIZ];
+ char from[SIZ];
int number_of_recipients;
int delivery_mode;
int message_originated_locally;
CC->internal_pgm = 1;
CC->cs_flags |= CS_STEALTH;
CtdlAllocUserData(SYM_SMTP, sizeof(struct citsmtp));
- CtdlAllocUserData(SYM_SMTP_RECP, 256);
+ CtdlAllocUserData(SYM_SMTP_RECP, SIZ);
sprintf(SMTP_RECP, "%s", "");
cprintf("220 Welcome to the Citadel/UX ESMTP server at %s\r\n",
*
*/
void smtp_get_user(char *argbuf) {
- char buf[256];
- char username[256];
+ char buf[SIZ];
+ char username[SIZ];
decode_base64(username, argbuf);
lprintf(9, "Trying <%s>\n", username);
*
*/
void smtp_get_pass(char *argbuf) {
- char password[256];
+ char password[SIZ];
decode_base64(password, argbuf);
lprintf(9, "Trying <%s>\n", password);
*
*/
void smtp_auth(char *argbuf) {
- char buf[256];
+ char buf[SIZ];
if (strncasecmp(argbuf, "login", 5) ) {
cprintf("550 We only support LOGIN authentication.\r\n");
* Implements the "MAIL From:" command
*/
void smtp_mail(char *argbuf) {
- char user[256];
- char node[256];
+ char user[SIZ];
+ char node[SIZ];
int cvt;
if (strlen(SMTP->from) != 0) {
*/
void smtp_rcpt(char *argbuf) {
int cvt;
- char user[256];
- char node[256];
- char recp[256];
+ char user[SIZ];
+ char node[SIZ];
+ char recp[SIZ];
if (strlen(SMTP->from) == 0) {
cprintf("503 Need MAIL before RCPT\r\n");
struct ser_ret smr;
char *hold_R, *hold_D, *hold_O;
FILE *fp;
- char filename[256];
+ char filename[SIZ];
static int seq = 0;
lprintf(9, "smtp_deliver_ignet(msg, %s, %s)\n", user, dest);
char *body;
struct CtdlMessage *msg;
int retval;
- char nowstamp[256];
+ char nowstamp[SIZ];
if (strlen(SMTP->from) == 0) {
cprintf("503 Need MAIL command first.\r\n");
* Main command loop for SMTP sessions.
*/
void smtp_command_loop(void) {
- char cmdbuf[256];
+ char cmdbuf[SIZ];
time(&CC->lastcmd);
memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
int num_mxhosts;
int mx;
int i;
- char user[256], node[256], name[256];
+ char user[SIZ], node[SIZ], name[SIZ];
char buf[1024];
char mailfrom[1024];
int lp, rp;
lprintf(9, "Number of MX hosts for <%s> is %d\n", node, num_mxhosts);
if (num_mxhosts < 1) {
*status = 5;
- snprintf(dsn, 256, "No MX hosts found for <%s>", node);
+ snprintf(dsn, SIZ, "No MX hosts found for <%s>", node);
return;
}
extract(buf, mxhosts, mx);
lprintf(9, "Trying <%s>\n", buf);
sock = sock_connect(buf, "25", "tcp");
- snprintf(dsn, 256, "Could not connect: %s", strerror(errno));
+ snprintf(dsn, SIZ, "Could not connect: %s", strerror(errno));
if (sock >= 0) lprintf(9, "Connected!\n");
- if (sock < 0) snprintf(dsn, 256, "%s", strerror(errno));
+ if (sock < 0) snprintf(dsn, SIZ, "%s", strerror(errno));
if (sock >= 0) break;
}
msg->cm_magic = CTDLMESSAGE_MAGIC;
msg->cm_anon_type = MES_NORMAL;
msg->cm_format_type = FMT_RFC822;
- msg->cm_fields['M'] = malloc(strlen(instr)+256);
+ msg->cm_fields['M'] = malloc(strlen(instr)+SIZ);
snprintf(msg->cm_fields['M'],
- strlen(instr)+256,
+ strlen(instr)+SIZ,
"Content-type: %s\n\n%s\n"
"attempted|%ld\n"
"retry|%ld\n",
#define END_OF_MESSAGE "---eom---dbd---"
-char artv_tempfilename1[256];
-char artv_tempfilename2[256];
+char artv_tempfilename1[PATH_MAX];
+char artv_tempfilename2[PATH_MAX];
FILE *artv_global_message_list;
void artv_export_users_backend(struct usersupp *usbuf, void *data) {
void artv_export_rooms(void) {
- char cmd[256];
+ char cmd[SIZ];
artv_global_message_list = fopen(artv_tempfilename1, "w");
ForEachRoom(artv_export_rooms_backend, NULL);
fclose(artv_global_message_list);
struct CtdlMessage *msg;
struct ser_ret smr;
FILE *fp;
- char buf[256];
- char tempfile[256];
+ char buf[SIZ];
+ char tempfile[SIZ];
msg = CtdlFetchMessage(msgnum);
if (msg == NULL) return; /* fail silently */
void artv_export_messages(void) {
- char buf[256];
+ char buf[SIZ];
long msgnum;
int count = 0;
void artv_import_config(void) {
- char buf[256];
+ char buf[SIZ];
lprintf(9, "Importing config file\n");
client_gets(config.c_nodename);
void artv_import_control(void) {
- char buf[256];
+ char buf[SIZ];
lprintf(9, "Importing control file\n");
client_gets(buf); CitControl.MMhighest = atol(buf);
void artv_import_user(void) {
- char buf[256];
+ char buf[SIZ];
struct usersupp usbuf;
client_gets(buf); usbuf.version = atoi(buf);
void artv_import_room(void) {
- char buf[256];
+ char buf[SIZ];
struct quickroom qrbuf;
long msgnum;
int msgcount = 0;
void artv_import_floor(void) {
struct floor flbuf;
int i;
- char buf[256];
+ char buf[SIZ];
client_gets(buf); i = atoi(buf);
client_gets(buf); flbuf.f_flags = atoi(buf);
*/
void artv_import_visit(void) {
struct visit vbuf;
- char buf[256];
+ char buf[SIZ];
client_gets(buf); vbuf.v_roomnum = atol(buf);
client_gets(buf); vbuf.v_roomgen = atol(buf);
long msgnum;
int msglen;
FILE *fp;
- char buf[256];
- char tempfile[256];
+ char buf[SIZ];
+ char tempfile[SIZ];
char *mbuf;
memset(&smi, 0, sizeof(struct SuppMsgInfo));
void artv_do_import(void) {
- char buf[256];
- char s_version[256];
+ char buf[SIZ];
+ char s_version[SIZ];
int version;
cprintf("%d sock it to me\n", SEND_LISTING);
void cmd_artv(char *cmdbuf) {
- char cmd[256];
+ char cmd[SIZ];
static int is_running = 0;
if (CtdlAccessCheck(ac_aide)) return; /* FIXME should be intpgm */
char *ptr;
int linelen;
char config_rm[ROOMNAMELEN];
- char buf[256];
+ char buf[SIZ];
if (!CC->logged_in) return(0); /* Only do this if logged in. */
*/
void cmd_regi(char *argbuf) {
int a,b,c;
- char buf[256];
+ char buf[SIZ];
struct vCard *my_vcard;
- char tmpaddr[256];
- char tmpcity[256];
- char tmpstate[256];
- char tmpzip[256];
- char tmpaddress[512];
- char tmpcountry[256];
+ char tmpaddr[SIZ];
+ char tmpcity[SIZ];
+ char tmpstate[SIZ];
+ char tmpzip[SIZ];
+ char tmpaddress[SIZ];
+ char tmpcountry[SIZ];
if (!(CC->logged_in)) {
cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
struct usersupp usbuf;
struct vCard *v;
char *s;
- char who[256];
- char adr[256];
- char buf[256];
+ char who[SIZ];
+ char adr[SIZ];
+ char buf[SIZ];
extract(who, argbuf, 0);
*/
void vcard_purge(char *username, long usernum) {
struct CtdlMessage *msg;
- char buf[256];
+ char buf[SIZ];
msg = (struct CtdlMessage *) mallok(sizeof(struct CtdlMessage));
if (msg == NULL) return;
FILE *download_fp; /* Fields relating to file transfer */
FILE *upload_fp;
- char upl_file[256];
- char upl_path[256];
- char upl_comment[256];
- char upl_filedir[256];
+ char upl_file[SIZ];
+ char upl_path[SIZ];
+ char upl_comment[SIZ];
+ char upl_filedir[SIZ];
char dl_is_net;
char upload_type;
struct ChatLine *next;
int chat_seq;
time_t chat_time;
- char chat_text[256];
+ char chat_text[SIZ];
char chat_username[USERNAME_SIZE];
char chat_room[ROOMNAMELEN];
};
void check_inittab_entry(void)
{
FILE *infp;
- char buf[256];
- char looking_for[256];
+ char buf[SIZ];
+ char looking_for[SIZ];
char question[128];
char *ptr;
int have_entry = 0;
if (infp == NULL) {
return;
} else {
- while (fgets(buf, 256, infp) != NULL) {
+ while (fgets(buf, sizeof buf, infp) != NULL) {
buf[strlen(buf) - 1] = 0;
ptr = strtok(buf, ":");
ptr = strtok(NULL, ":");
{
char buf[4096];
char tempfile[64];
- char setupmsg[256];
+ char setupmsg[SIZ];
strcpy(tempfile, tmpnam(NULL));
strcpy(setupmsg, "");
int main(int argc, char **argv)
{
- char hostbuf[256], portbuf[256];
+ char hostbuf[SIZ], portbuf[SIZ];
time_t LogTime, now;
unsigned int LogType;
- char LogName[256];
+ char LogName[SIZ];
int a, b, lowest;
float p, q;
long timeon[72];
FILE *sortpipe;
char thegraph[GRANULARITY][73];
int pc_only = 0;
- char buf[256];
+ char buf[SIZ];
FILE *logfp;
char *fakeargs[4];
if (!batch_mode) {
printf("Scanning call log, please wait...\n");
}
- while (fgets(buf, 256, logfp) != NULL) {
+ while (fgets(buf, sizeof buf, logfp) != NULL) {
buf[strlen(buf) - 1] = 0;
strcat(buf, "| ");
void mesg_locate(char *targ, char *searchfor, int numdirs, char **dirs)
{
int a;
- char buf[256];
+ char buf[SIZ];
FILE *ls;
for (a=0; a<numdirs; ++a) {
#define MAXFLOORS 16
+/*
+ * Command buffer size (do not change!)
+ */
+#define SIZ 1024
+
/*
* SMTP delivery retry and give-up times
*/
*/
void cprintf(const char *format, ...) {
va_list arg_ptr;
- char buf[256];
+ char buf[SIZ];
va_start(arg_ptr, format);
if (vsnprintf(buf, sizeof buf, format, arg_ptr) == -1)
FILE *netsetup;
int ch;
int a, b;
- char netsetup_args[3][256];
+ char netsetup_args[3][SIZ];
if (CC->usersupp.axlevel < 6) {
cprintf("%d Higher access required.\n",
#include <string.h>
#include <sys/time.h>
#include "tools.h"
+#include "citadel.h"
#define TRUE 1
#define FALSE 0
*/
int extract_int(char *source, int parmnum)
{
- char buf[256];
+ char buf[SIZ];
extract_token(buf, source, parmnum, '|');
return(atoi(buf));
*/
long extract_long(char *source, long int parmnum)
{
- char buf[256];
+ char buf[SIZ];
extract_token(buf, source, parmnum, '|');
return(atol(buf));
*/
int CtdlLoginExistingUser(char *username)
{
- char autoname[256];
+ char autoname[SIZ];
int found_user = 0;
struct passwd *p;
int a;
*/
void cmd_user(char *cmdbuf)
{
- char username[256];
+ char username[SIZ];
int a;
extract(username, cmdbuf, 0);
void cmd_pass(char *buf)
{
- char password[256];
+ char password[SIZ];
int a;
extract(password, buf, 0);
void cmd_newu(char *cmdbuf)
{
int a;
- char username[256];
+ char username[SIZ];
if ((CC->logged_in)) {
cprintf("%d Already logged in.\n", ERROR);
/* user name */
{ /* 1 = invite, 0 = kick out */
struct usersupp USscratch;
- char bbb[256];
+ char bbb[SIZ];
struct visit vbuf;
if (CtdlAccessCheck(ac_room_aide))
*/
void cmd_vali(char *v_args)
{
- char user[256];
+ char user[SIZ];
int newax;
struct usersupp userbuf;
void cmd_agup(char *cmdbuf)
{
struct usersupp usbuf;
- char requested_user[256];
+ char requested_user[SIZ];
if (CtdlAccessCheck(ac_aide)) {
return;
void cmd_asup(char *cmdbuf)
{
struct usersupp usbuf;
- char requested_user[256];
+ char requested_user[SIZ];
int np;
int newax;
int deleted = 0;
}
void userlist(void) {
- char buf[256];
- char fl[256];
+ char buf[SIZ];
+ char fl[SIZ];
struct tm *tmbuf;
time_t lc;
int main(int argc, char **argv)
{
- char buf[256];
- char hostbuf[256], portbuf[256];
+ char buf[SIZ];
+ char hostbuf[SIZ], portbuf[SIZ];
attach_to_server(argc, argv, hostbuf, portbuf);
serv_gets(buf);
int main(int argc, char **argv)
{
char buf[512];
- char nodetitle[256];
+ char nodetitle[SIZ];
int a;
int www = 0;
int s_pid = 0;
int my_pid = 0;
- char hostbuf[256];
- char portbuf[256];
- char s_user[256];
- char s_room[256];
- char s_host[256];
- char s_client[256];
+ char hostbuf[SIZ];
+ char portbuf[SIZ];
+ char s_user[SIZ];
+ char s_room[SIZ];
+ char s_host[SIZ];
+ char s_client[SIZ];
/* If this environment variable is set, we assume that the program
* is being called as a cgi-bin from a webserver and will output