citadel
About: Citadel is an advanced messaging and collaboration system for groupware and BBS applications (preferred OS: Linux).
  Fossies Dox: citadel.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Loading...
Searching...
No Matches
serv_file.c
Go to the documentation of this file.
1// Server functions which handle file transfers and room directories.
2//
3// Copyright (c) 1987-2022 by the citadel.org team
4//
5// This program is open source software. Use, duplication, or disclosure
6// is subject to the terms of the GNU General Public License, version 3.
7
8#include <stdlib.h>
9#include <unistd.h>
10#include <stdio.h>
11#include <netdb.h>
12#include <libcitadel.h>
13#include <dirent.h>
14#include <sys/types.h>
15#include <sys/stat.h>
16#include "../../ctdl_module.h"
17#include "../../citserver.h"
18#include "../../support.h"
19#include "../../config.h"
20#include "../../user_ops.h"
21
22
23// Server command to delete a file from a room's directory
24void cmd_delf(char *filename) {
25 char pathname[64];
26 int a;
27
29 return;
30
31 if ((CC->room.QRflags & QR_DIRECTORY) == 0) {
32 cprintf("%d No directory in this room.\n", ERROR + NOT_HERE);
33 return;
34 }
35
36 if (IsEmptyStr(filename)) {
37 cprintf("%d You must specify a file name.\n", ERROR + FILE_NOT_FOUND);
38 return;
39 }
40 for (a = 0; !IsEmptyStr(&filename[a]); ++a) {
41 if ((filename[a] == '/') || (filename[a] == '\\')) {
42 filename[a] = '_';
43 }
44 }
45 snprintf(pathname, sizeof pathname, "%s/%s/%s", ctdl_file_dir, CC->room.QRdirname, filename);
46 a = unlink(pathname);
47 if (a == 0) {
48 cprintf("%d File '%s' deleted.\n", CIT_OK, pathname);
49 }
50 else {
51 cprintf("%d File '%s' not found.\n", ERROR + FILE_NOT_FOUND, pathname);
52 }
53}
54
55
56// move a file from one room directory to another
57void cmd_movf(char *cmdbuf) {
58 char filename[PATH_MAX];
59 char pathname[PATH_MAX];
60 char newpath[PATH_MAX];
61 char newroom[ROOMNAMELEN];
62 char buf[PATH_MAX];
63 int a;
64 struct ctdlroom qrbuf;
65
66 extract_token(filename, cmdbuf, 0, '|', sizeof filename);
67 extract_token(newroom, cmdbuf, 1, '|', sizeof newroom);
68
70 return;
71
72 if ((CC->room.QRflags & QR_DIRECTORY) == 0) {
73 cprintf("%d No directory in this room.\n", ERROR + NOT_HERE);
74 return;
75 }
76
77 if (IsEmptyStr(filename)) {
78 cprintf("%d You must specify a file name.\n", ERROR + FILE_NOT_FOUND);
79 return;
80 }
81
82 for (a = 0; !IsEmptyStr(&filename[a]); ++a) {
83 if ((filename[a] == '/') || (filename[a] == '\\')) {
84 filename[a] = '_';
85 }
86 }
87 snprintf(pathname, sizeof pathname, "./files/%s/%s", CC->room.QRdirname, filename);
88 if (access(pathname, 0) != 0) {
89 cprintf("%d File '%s' not found.\n", ERROR + FILE_NOT_FOUND, pathname);
90 return;
91 }
92
93 if (CtdlGetRoom(&qrbuf, newroom) != 0) {
94 cprintf("%d '%s' does not exist.\n", ERROR + ROOM_NOT_FOUND, newroom);
95 return;
96 }
97 if ((qrbuf.QRflags & QR_DIRECTORY) == 0) {
98 cprintf("%d '%s' is not a directory room.\n", ERROR + NOT_HERE, qrbuf.QRname);
99 return;
100 }
101 snprintf(newpath, sizeof newpath, "./files/%s/%s", qrbuf.QRdirname, filename);
102 if (link(pathname, newpath) != 0) {
103 cprintf("%d Couldn't move file: %s\n", ERROR + INTERNAL_ERROR, strerror(errno));
104 return;
105 }
106 unlink(pathname);
107
108 // this is a crude method of copying the file description
109 snprintf(buf, sizeof buf, "cat ./files/%s/filedir |grep \"%s\" >>./files/%s/filedir", CC->room.QRdirname, filename,
111 system(buf);
112 cprintf("%d File '%s' has been moved.\n", CIT_OK, filename);
113}
114
115
116// This code is common to all commands which open a file for downloading,
117// regardless of whether it's a file from the directory, an image, a network
118// spool file, a MIME attachment, etc.
119// It examines the file and displays the OK result code and some information
120// about the file. NOTE: this stuff is Unix dependent.
121void OpenCmdResult(char *filename, const char *mime_type) {
122 struct stat statbuf;
123 time_t modtime;
124 long filesize;
125
126 fstat(fileno(CC->download_fp), &statbuf);
127 CC->download_fp_total = statbuf.st_size;
128 filesize = (long) statbuf.st_size;
129 modtime = (time_t) statbuf.st_mtime;
130
131 cprintf("%d %ld|%ld|%s|%s\n", CIT_OK, filesize, (long) modtime, filename, mime_type);
132}
133
134
135// open a file for downloading
136void cmd_open(char *cmdbuf) {
137 char filename[256];
138 char pathname[PATH_MAX];
139 int a;
140
141 extract_token(filename, cmdbuf, 0, '|', sizeof filename);
142
144 return;
145
146 if ((CC->room.QRflags & QR_DIRECTORY) == 0) {
147 cprintf("%d No directory in this room.\n", ERROR + NOT_HERE);
148 return;
149 }
150
151 if (IsEmptyStr(filename)) {
152 cprintf("%d You must specify a file name.\n", ERROR + FILE_NOT_FOUND);
153 return;
154 }
155 if (strstr(filename, "../") != NULL) {
156 cprintf("%d syntax error.\n", ERROR + ILLEGAL_VALUE);
157 return;
158 }
159
160 if (CC->download_fp != NULL) {
161 cprintf("%d You already have a download file open.\n", ERROR + RESOURCE_BUSY);
162 return;
163 }
164
165 for (a = 0; !IsEmptyStr(&filename[a]); ++a) {
166 if ((filename[a] == '/') || (filename[a] == '\\')) {
167 filename[a] = '_';
168 }
169 }
170
171 snprintf(pathname, sizeof pathname, "%s/%s/%s", ctdl_file_dir, CC->room.QRdirname, filename);
172 CC->download_fp = fopen(pathname, "r");
173
174 if (CC->download_fp == NULL) {
175 cprintf("%d cannot open %s: %s\n", ERROR + INTERNAL_ERROR, pathname, strerror(errno));
176 return;
177 }
178
179 OpenCmdResult(filename, "application/octet-stream");
180}
181
182
183// open an image file
184void cmd_oimg(char *cmdbuf) {
185 char filename[PATH_MAX];
186 char pathname[PATH_MAX];
187 char MimeTestBuf[32];
188 int rv;
189
190 extract_token(filename, cmdbuf, 0, '|', sizeof filename);
191
192 if (IsEmptyStr(filename)) {
193 cprintf("%d You must specify a file name.\n", ERROR + FILE_NOT_FOUND);
194 return;
195 }
196
197 if (CC->download_fp != NULL) {
198 cprintf("%d You already have a download file open.\n", ERROR + RESOURCE_BUSY);
199 return;
200 }
201
202 CC->download_fp = fopen(pathname, "rb");
203 if (CC->download_fp == NULL) {
204 strcat(pathname, ".gif");
205 CC->download_fp = fopen(pathname, "rb");
206 }
207 if (CC->download_fp == NULL) {
208 cprintf("%d Cannot open %s: %s\n", ERROR + FILE_NOT_FOUND, pathname, strerror(errno));
209 return;
210 }
211 rv = fread(&MimeTestBuf[0], 1, 32, CC->download_fp);
212 if (rv == -1) {
213 cprintf("%d Cannot access %s: %s\n", ERROR + FILE_NOT_FOUND, pathname, strerror(errno));
214 return;
215 }
216
217 rewind(CC->download_fp);
218 OpenCmdResult(pathname, GuessMimeType(&MimeTestBuf[0], 32));
219}
220
221
222// open a file for uploading
223void cmd_uopn(char *cmdbuf) {
224 int a;
225
226 extract_token(CC->upl_file, cmdbuf, 0, '|', sizeof CC->upl_file);
227 extract_token(CC->upl_mimetype, cmdbuf, 1, '|', sizeof CC->upl_mimetype);
228 extract_token(CC->upl_comment, cmdbuf, 2, '|', sizeof CC->upl_comment);
229
231 return;
232
233 if ((CC->room.QRflags & QR_DIRECTORY) == 0) {
234 cprintf("%d No directory in this room.\n", ERROR + NOT_HERE);
235 return;
236 }
237
238 if (IsEmptyStr(CC->upl_file)) {
239 cprintf("%d You must specify a file name.\n", ERROR + FILE_NOT_FOUND);
240 return;
241 }
242
243 if (CC->upload_fp != NULL) {
244 cprintf("%d You already have a upload file open.\n", ERROR + RESOURCE_BUSY);
245 return;
246 }
247
248 for (a = 0; !IsEmptyStr(&CC->upl_file[a]); ++a) {
249 if ((CC->upl_file[a] == '/') || (CC->upl_file[a] == '\\')) {
250 CC->upl_file[a] = '_';
251 }
252 }
253 snprintf(CC->upl_path, sizeof CC->upl_path, "%s/%s/%s", ctdl_file_dir, CC->room.QRdirname, CC->upl_file);
254 snprintf(CC->upl_filedir, sizeof CC->upl_filedir, "%s/%s/filedir", ctdl_file_dir, CC->room.QRdirname);
255
256 CC->upload_fp = fopen(CC->upl_path, "r");
257 if (CC->upload_fp != NULL) {
258 fclose(CC->upload_fp);
259 CC->upload_fp = NULL;
260 cprintf("%d '%s' already exists\n", ERROR + ALREADY_EXISTS, CC->upl_path);
261 return;
262 }
263
264 CC->upload_fp = fopen(CC->upl_path, "wb");
265 if (CC->upload_fp == NULL) {
266 cprintf("%d Cannot open %s: %s\n", ERROR + INTERNAL_ERROR, CC->upl_path, strerror(errno));
267 return;
268 }
269 cprintf("%d Ok\n", CIT_OK);
270}
271
272
273// open an image file for uploading
274void cmd_uimg(char *cmdbuf) {
275 int is_this_for_real;
276 char basenm[256];
277 int a;
278
279 if (num_parms(cmdbuf) < 2) {
280 cprintf("%d Usage error.\n", ERROR + ILLEGAL_VALUE);
281 return;
282 }
283
284 is_this_for_real = extract_int(cmdbuf, 0);
285 extract_token(CC->upl_mimetype, cmdbuf, 1, '|', sizeof CC->upl_mimetype);
286 extract_token(basenm, cmdbuf, 2, '|', sizeof basenm);
287 if (CC->upload_fp != NULL) {
288 cprintf("%d You already have an upload file open.\n", ERROR + RESOURCE_BUSY);
289 return;
290 }
291
292 strcpy(CC->upl_path, "");
293
294 for (a = 0; !IsEmptyStr(&basenm[a]); ++a) {
295 basenm[a] = tolower(basenm[a]);
296 if ((basenm[a] == '/') || (basenm[a] == '\\')) {
297 basenm[a] = '_';
298 }
299 }
300
301 if (CC->user.axlevel >= AxAideU) {
302 snprintf(CC->upl_path, sizeof CC->upl_path, "%s/%s", ctdl_image_dir, basenm);
303 }
304
305 if (IsEmptyStr(CC->upl_path)) {
306 cprintf("%d Higher access required.\n", ERROR + HIGHER_ACCESS_REQUIRED);
307 return;
308 }
309
310 if (is_this_for_real == 0) {
311 cprintf("%d Ok to send image\n", CIT_OK);
312 return;
313 }
314
315 CC->upload_fp = fopen(CC->upl_path, "wb");
316 if (CC->upload_fp == NULL) {
317 cprintf("%d Cannot open %s: %s\n", ERROR + INTERNAL_ERROR, CC->upl_path, strerror(errno));
318 return;
319 }
320 cprintf("%d Ok\n", CIT_OK);
321}
322
323
324// close the download file
325void cmd_clos(char *cmdbuf) {
326 if (CC->download_fp == NULL) {
327 cprintf("%d You don't have a download file open.\n", ERROR + RESOURCE_NOT_OPEN);
328 return;
329 }
330
331 fclose(CC->download_fp);
332 CC->download_fp = NULL;
333 cprintf("%d Ok\n", CIT_OK);
334}
335
336
337// abort an upload
339 if (who->upload_fp != NULL) {
340 fclose(who->upload_fp);
341 who->upload_fp = NULL;
342 unlink(CC->upl_path);
343 }
344}
345
346
347// close the upload file
348void cmd_ucls(char *cmd) {
349 FILE *fp;
350 char upload_notice[SIZ];
351
352 if (CC->upload_fp == NULL) {
353 cprintf("%d You don't have an upload file open.\n", ERROR + RESOURCE_NOT_OPEN);
354 return;
355 }
356
357 fclose(CC->upload_fp);
358 CC->upload_fp = NULL;
359
360 if (!strcasecmp(cmd, "1")) {
361 cprintf("%d File '%s' saved.\n", CIT_OK, CC->upl_path);
362 fp = fopen(CC->upl_filedir, "a");
363 if (fp == NULL) {
364 fp = fopen(CC->upl_filedir, "w");
365 }
366 if (fp != NULL) {
367 fprintf(fp, "%s %s %s\n", CC->upl_file, CC->upl_mimetype, CC->upl_comment);
368 fclose(fp);
369 }
370
371 if ((CC->room.QRflags2 & QR2_NOUPLMSG) == 0) {
372 /* put together an upload notice */
373 snprintf(upload_notice, sizeof upload_notice,
374 "NEW UPLOAD: '%s'\n %s\n%s\n", CC->upl_file, CC->upl_comment, CC->upl_mimetype);
375 quickie_message(CC->curr_user, NULL, NULL, CC->room.QRname, upload_notice, 0, NULL);
376 }
377 }
378 else {
379 abort_upl(CC);
380 cprintf("%d File '%s' aborted.\n", CIT_OK, CC->upl_path);
381 }
382}
383
384
385// read from the download file
386void cmd_read(char *cmdbuf) {
387 long start_pos;
388 size_t bytes;
389 char buf[SIZ];
390 int rc;
391
392 // The client will transmit its requested offset and byte count
393 start_pos = extract_long(cmdbuf, 0);
394 bytes = extract_int(cmdbuf, 1);
395 if ((start_pos < 0) || (bytes <= 0)) {
396 cprintf("%d you have to specify a value > 0.\n", ERROR + ILLEGAL_VALUE);
397 return;
398 }
399
400 if (CC->download_fp == NULL) {
401 cprintf("%d You don't have a download file open.\n", ERROR + RESOURCE_NOT_OPEN);
402 return;
403 }
404
405 // If necessary, reduce the byte count to the size of our buffer
406 if (bytes > sizeof(buf)) {
407 bytes = sizeof(buf);
408 }
409
410 rc = fseek(CC->download_fp, start_pos, 0);
411 if (rc < 0) {
412 cprintf("%d your file is smaller than %ld.\n", ERROR + ILLEGAL_VALUE, start_pos);
413 syslog(LOG_ERR, "serv_file: your file %s is smaller than %ld [%s]", CC->upl_path, start_pos, strerror(errno)
414 );
415
416 return;
417 }
418 bytes = fread(buf, 1, bytes, CC->download_fp);
419 if (bytes > 0) {
420 // Tell the client the actual byte count and transmit it
421 cprintf("%d %d\n", BINARY_FOLLOWS, (int) bytes);
422 client_write(buf, bytes);
423 }
424 else {
425 cprintf("%d %s\n", ERROR, strerror(errno));
426 }
427}
428
429
430// write to the upload file
431void cmd_writ(char *cmdbuf) {
432 int bytes;
433 char *buf;
434 int rv;
435
437
438 bytes = extract_int(cmdbuf, 0);
439
440 if (CC->upload_fp == NULL) {
441 cprintf("%d You don't have an upload file open.\n", ERROR + RESOURCE_NOT_OPEN);
442 return;
443 }
444 if (bytes <= 0) {
445 cprintf("%d you have to specify a value > 0.\n", ERROR + ILLEGAL_VALUE);
446 return;
447 }
448
449 if (bytes > 100000) {
450 bytes = 100000;
451 }
452
453 cprintf("%d %d\n", SEND_BINARY, bytes);
454 buf = malloc(bytes + 1);
455 client_read(buf, bytes);
456 rv = fwrite(buf, bytes, 1, CC->upload_fp);
457 if (rv == -1) {
458 syslog(LOG_ERR, "serv_file: %s", strerror(errno));
459 }
460 free(buf);
461}
462
463
465 CitContext *CCC = MyContext();
466
467 // If there is a download in progress, abort it.
468 if (CCC->download_fp != NULL) {
469 fclose(CCC->download_fp);
470 CCC->download_fp = NULL;
471 }
472
473 // If there is an upload in progress, abort it.
474 if (CCC->upload_fp != NULL) {
475 abort_upl(CCC);
476 }
477
478}
479
480
481// help_subst() - support routine for help file viewer
482void help_subst(char *strbuf, char *source, char *dest) {
483 char workbuf[SIZ];
484 int p;
485
486 while (p = pattern2(strbuf, source), (p >= 0)) {
487 strcpy(workbuf, &strbuf[p + strlen(source)]);
488 strcpy(&strbuf[p], dest);
489 strcat(strbuf, workbuf);
490 }
491}
492
493
494void do_help_subst(char *buffer) {
495 char buf2[16];
496
497 help_subst(buffer, "^nodename", CtdlGetConfigStr("c_nodename"));
498 help_subst(buffer, "^humannode", CtdlGetConfigStr("c_humannode"));
499 help_subst(buffer, "^fqdn", CtdlGetConfigStr("c_fqdn"));
500 help_subst(buffer, "^username", CC->user.fullname);
501 snprintf(buf2, sizeof buf2, "%ld", CC->user.usernum);
502 help_subst(buffer, "^usernum", buf2);
503 help_subst(buffer, "^sysadm", CtdlGetConfigStr("c_sysadm"));
504 help_subst(buffer, "^variantname", CITADEL);
505 help_subst(buffer, "^maxsessions", CtdlGetConfigStr("c_maxsessions")); // yes it's numeric but str is ok here
506 help_subst(buffer, "^bbsdir", ctdl_message_dir);
507}
508
509
510typedef const char *ccharp;
511
512// display system messages or help
513void cmd_mesg(char *mname) {
514 FILE *mfp;
515 char targ[256];
516 char buf[256];
517 char buf2[256];
518 DIR *dp;
519 struct dirent *d;
520
521 extract_token(buf, mname, 0, '|', sizeof buf);
522
523 snprintf(buf2, sizeof buf2, "%s.%d.%d", buf, CC->cs_clientdev, CC->cs_clienttyp);
524
525 // If the client requested "?" then produce a listing
526 if (!strcmp(buf, "?")) {
527 cprintf("%d %s\n", LISTING_FOLLOWS, buf);
528 dp = opendir(ctdl_message_dir);
529 if (dp != NULL) {
530 while (d = readdir(dp), d != NULL) {
531 if (d->d_name[0] != '.') {
532 cprintf(" %s\n", d->d_name);
533 }
534 }
535 closedir(dp);
536 }
537 cprintf("000\n");
538 return;
539 }
540
541 // Otherwise, look for the requested file by name.
542 snprintf(targ, sizeof targ, "%s/%s", ctdl_message_dir, buf);
543 mfp = fopen(targ, "r");
544 if (mfp == NULL) {
545 cprintf("%d Cannot open '%s': %s\n", ERROR + FILE_NOT_FOUND, targ, strerror(errno));
546 return;
547 }
548 cprintf("%d %s\n", LISTING_FOLLOWS, buf);
549
550 while (fgets(buf, (sizeof buf - 1), mfp) != NULL) {
551 buf[strlen(buf) - 1] = 0;
552 do_help_subst(buf);
553 cprintf("%s\n", buf);
554 }
555
556 fclose(mfp);
557 cprintf("000\n");
558}
559
560
561// enter system messages or help
562void cmd_emsg(char *mname) {
563 FILE *mfp;
564 char targ[256];
565 char buf[256];
566 int a;
567
569
571 return;
572
573 extract_token(buf, mname, 0, '|', sizeof buf);
574 for (a = 0; !IsEmptyStr(&buf[a]); ++a) { // security measure
575 if (buf[a] == '/')
576 buf[a] = '.';
577 }
578
579 if (IsEmptyStr(targ)) {
580 snprintf(targ, sizeof targ, "%s/%s", ctdl_message_dir, buf);
581 }
582
583 mfp = fopen(targ, "w");
584 if (mfp == NULL) {
585 cprintf("%d Cannot open '%s': %s\n", ERROR + INTERNAL_ERROR, targ, strerror(errno));
586 return;
587 }
588 cprintf("%d %s\n", SEND_LISTING, targ);
589
590 while (client_getln(buf, sizeof buf) >= 0 && strcmp(buf, "000")) {
591 fprintf(mfp, "%s\n", buf);
592 }
593
594 fclose(mfp);
595}
596
597
598// Initialization function, called from modules_init.c
600 if (!threading) {
602 CtdlRegisterProtoHook(cmd_delf, "DELF", "Delete a file");
603 CtdlRegisterProtoHook(cmd_movf, "MOVF", "Move a file");
604 CtdlRegisterProtoHook(cmd_open, "OPEN", "Open a download file transfer");
605 CtdlRegisterProtoHook(cmd_clos, "CLOS", "Close a download file transfer");
606 CtdlRegisterProtoHook(cmd_uopn, "UOPN", "Open an upload file transfer");
607 CtdlRegisterProtoHook(cmd_ucls, "UCLS", "Close an upload file transfer");
608 CtdlRegisterProtoHook(cmd_read, "READ", "File transfer read operation");
609 CtdlRegisterProtoHook(cmd_writ, "WRIT", "File transfer write operation");
610 CtdlRegisterProtoHook(cmd_oimg, "OIMG", "Open an image file for download");
611 CtdlRegisterProtoHook(cmd_uimg, "UIMG", "Upload an image file");
612 CtdlRegisterProtoHook(cmd_mesg, "MESG", "fetch system banners");
613 CtdlRegisterProtoHook(cmd_emsg, "EMSG", "submit system banners");
614 }
615 // return a module name for the log
616 return "file_ops";
617}
#define ROOMNAMELEN
Definition: citadel.h:51
#define CITADEL
Definition: citadel.h:37
#define ctdl_message_dir
Definition: citadel_dirs.h:20
#define ctdl_file_dir
Definition: citadel_dirs.h:15
#define ctdl_image_dir
Definition: citadel_dirs.h:17
char * CtdlGetConfigStr(char *key)
Definition: config.c:363
CitContext * MyContext(void)
Definition: context.c:187
#define CC
Definition: context.h:140
int CtdlAccessCheck(int)
Definition: user_ops.c:334
int CtdlGetRoom(struct ctdlroom *qrbuf, const char *room_name)
Definition: room_ops.c:309
#define PRIO_LOGOUT
Definition: ctdl_module.h:84
void CtdlRegisterSessionHook(void(*fcn_ptr)(void), int EventType, int Priority)
int threading
Definition: modules_init.c:24
@ ac_room_aide
Definition: ctdl_module.h:248
@ ac_aide
Definition: ctdl_module.h:249
@ ac_logged_in
Definition: ctdl_module.h:247
void CtdlRegisterProtoHook(void(*handler)(char *), char *cmd, char *desc)
#define CIT_OK
Definition: ipcdef.h:6
#define ILLEGAL_VALUE
Definition: ipcdef.h:16
#define INTERNAL_ERROR
Definition: ipcdef.h:14
#define LISTING_FOLLOWS
Definition: ipcdef.h:5
#define HIGHER_ACCESS_REQUIRED
Definition: ipcdef.h:23
#define ROOM_NOT_FOUND
Definition: ipcdef.h:31
#define SEND_BINARY
Definition: ipcdef.h:11
#define RESOURCE_BUSY
Definition: ipcdef.h:25
#define BINARY_FOLLOWS
Definition: ipcdef.h:10
#define FILE_NOT_FOUND
Definition: ipcdef.h:30
#define QR_DIRECTORY
Definition: ipcdef.h:44
#define ERROR
Definition: ipcdef.h:9
#define SEND_LISTING
Definition: ipcdef.h:8
#define ALREADY_EXISTS
Definition: ipcdef.h:33
#define RESOURCE_NOT_OPEN
Definition: ipcdef.h:26
#define NOT_HERE
Definition: ipcdef.h:27
long quickie_message(char *from, char *fromaddr, char *to, char *room, char *text, int format_type, char *subject)
Definition: msgbase.c:2906
void * malloc(unsigned)
void free(void *)
void cmd_read(char *cmdbuf)
Definition: serv_file.c:386
void cmd_movf(char *cmdbuf)
Definition: serv_file.c:57
void abort_upl(CitContext *who)
Definition: serv_file.c:338
void cmd_ucls(char *cmd)
Definition: serv_file.c:348
void cmd_mesg(char *mname)
Definition: serv_file.c:513
void cmd_clos(char *cmdbuf)
Definition: serv_file.c:325
void cmd_delf(char *filename)
Definition: serv_file.c:24
void cmd_uimg(char *cmdbuf)
Definition: serv_file.c:274
void cmd_oimg(char *cmdbuf)
Definition: serv_file.c:184
void cmd_writ(char *cmdbuf)
Definition: serv_file.c:431
char * ctdl_module_init_file_ops(void)
Definition: serv_file.c:599
void cmd_emsg(char *mname)
Definition: serv_file.c:562
void OpenCmdResult(char *filename, const char *mime_type)
Definition: serv_file.c:121
void do_help_subst(char *buffer)
Definition: serv_file.c:494
void files_logout_hook(void)
Definition: serv_file.c:464
void cmd_uopn(char *cmdbuf)
Definition: serv_file.c:223
void help_subst(char *strbuf, char *source, char *dest)
Definition: serv_file.c:482
void cmd_open(char *cmdbuf)
Definition: serv_file.c:136
const char * ccharp
Definition: serv_file.c:510
struct ctdlroom qrbuf
Definition: serv_migrate.c:497
#define EVT_LOGOUT
Definition: server.h:216
FILE * download_fp
Definition: context.h:99
FILE * upload_fp
Definition: context.h:102
char QRname[128]
Definition: citadel.h:94
unsigned QRflags
Definition: citadel.h:99
char QRdirname[15]
Definition: citadel.h:100
#define SIZ
Definition: sysconfig.h:33
void cprintf(const char *format,...)
Definition: sysdep.c:369
int client_getln(char *buf, int bufsize)
Definition: sysdep.c:528
int client_write(const char *buf, int nbytes)
Definition: sysdep.c:296
int client_read(char *buf, int bytes)
Definition: sysdep.c:494
void unbuffer_output(void)
Definition: sysdep.c:268