$Log$
+ Revision 645.14 2005/04/29 16:50:03 ajc
+ * Significantly reduced the memory footprint of struct CitContext.
+
Revision 645.13 2005/04/29 16:26:00 ajc
* Removed the CtdlRedirectOutput() API, as we are no longer using it.
(Oh happy day; no more temp files!)
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
lprintf(CTDL_DEBUG, "Calling logout(%d)\n", con->cs_pid);
logout(con);
- unlink(con->temp);
lprintf(CTDL_NOTICE, "[%3d] Session ended.\n", con->cs_pid);
/* If the client is still connected, blow 'em away. */
strcpy(con->lastcmdname, " ");
strcpy(con->cs_clientname, "(unknown)");
strcpy(con->curr_user, NLI);
- strcpy(con->net_node,"");
+ strcpy(con->net_node, "");
strcpy(con->fake_username, "");
strcpy(con->fake_postname, "");
strcpy(con->fake_hostname, "");
strcpy(con->fake_roomname, "");
generate_nonce(con);
- safestrncpy(con->temp, tmpnam(NULL), sizeof con->temp);
safestrncpy(con->cs_host, config.c_fqdn, sizeof con->cs_host);
safestrncpy(con->cs_addr, "", sizeof con->cs_addr);
con->cs_host[sizeof con->cs_host - 1] = 0;
char comment[256];
FILE *ls, *fd;
struct stat statbuf;
+ char tempfilename[PATH_MAX];
if (CtdlAccessCheck(ac_logged_in)) return;
+ tmpnam(tempfilename);
getroom(&CC->room, CC->room.QRname);
getuser(&CC->user, CC->curr_user);
LISTING_FOLLOWS, config.c_fqdn, CTDLDIR, CC->room.QRdirname);
snprintf(buf, sizeof buf, "ls %s/files/%s >%s 2> /dev/null",
- CTDLDIR, CC->room.QRdirname, CC->temp);
+ CTDLDIR, CC->room.QRdirname, tempfilename);
system(buf);
snprintf(buf, sizeof buf, "%s/files/%s/filedir", CTDLDIR, CC->room.QRdirname);
if (fd == NULL)
fd = fopen("/dev/null", "r");
- ls = fopen(CC->temp, "r");
+ ls = fopen(tempfilename, "r");
while (fgets(flnm, sizeof flnm, ls) != NULL) {
flnm[strlen(flnm) - 1] = 0;
if (strcasecmp(flnm, "filedir")) {
}
fclose(ls);
fclose(fd);
- unlink(CC->temp);
+ unlink(tempfilename);
cprintf("000\n");
}
* to be the user's Internet e-mail address as Citadel knows it.
*/
if (CC->logged_in) {
- strcpy(SMTP->from, CC->cs_inet_email);
+ safestrncpy(SMTP->from, CC->cs_inet_email, sizeof SMTP->from);
cprintf("250 2.1.0 Sender ok <%s>\r\n", SMTP->from);
SMTP->message_originated_locally = 1;
return;
char curr_user[USERNAME_SIZE]; /* name of current user */
int logged_in; /* logged in */
int internal_pgm; /* authenticated as internal program */
- char temp[PATH_MAX]; /* temp file name */
int nologin; /* not allowed to log in */
int is_local_socket; /* set to 1 if client is on unix domain sock */
int curr_view; /* The view type for the current user/room */
- char net_node[PATH_MAX];/* Is the client another Citadel server? */
+ char net_node[32] ;/* Is the client another Citadel server? */
time_t previous_login; /* Date/time of previous login */
char lastcmdname[5]; /* name of last command executed */
unsigned cs_flags; /* miscellaneous flags */
char cs_addr[64]; /* address logged in from */
/* The Internet type of thing */
- char cs_inet_email[SIZ];/* Return address of outbound Internet mail */
+ char cs_inet_email[128];/* Return address of outbound Internet mail */
FILE *download_fp; /* Fields relating to file transfer */
char download_desired_section[128];
FILE *upload_fp;
- char upl_file[PATH_MAX];
+ char upl_file[256];
char upl_path[PATH_MAX];
- char upl_comment[SIZ];
+ char upl_comment[256];
char upl_filedir[PATH_MAX];
char dl_is_net;
char upload_type;
char fake_hostname[64]; /* Fake hostname <bc> */
char fake_roomname[ROOMNAMELEN]; /* Fake roomname <bc> */
- char preferred_formats[SIZ]; /* Preferred MIME formats */
+ char preferred_formats[256]; /* Preferred MIME formats */
/* Dynamically allocated session data */
struct citimap *IMAP;