X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Ffile_ops.c;h=1424e33e18aec2b64572befe4cf276502d6b9dcf;hb=c06c13be2c225fb46cedd4256e4adeaab9d51cd2;hp=af4a872a1d5a43bbd840e0193a3c2d018f3f0f82;hpb=35c0bb4855efbc0b20aef1933c9e9411efd5205d;p=citadel.git diff --git a/citadel/file_ops.c b/citadel/file_ops.c index af4a872a1..1424e33e1 100644 --- a/citadel/file_ops.c +++ b/citadel/file_ops.c @@ -219,102 +219,6 @@ void cmd_movf(char *cmdbuf) } -/* - * send a file over the net - */ -void cmd_netf(char *cmdbuf) -{ - char pathname[256], filename[256], destsys[256], buf[256]; - char outfile[256]; - int a, e; - time_t now; - FILE *ofp; - static int seq = 1; - - extract_token(filename, cmdbuf, 0, '|', sizeof filename); - extract_token(destsys, cmdbuf, 1, '|', sizeof destsys); - - if (CtdlAccessCheck(ac_room_aide)) return; - - if ((CC->room.QRflags & QR_DIRECTORY) == 0) { - cprintf("%d No directory in this room.\n", - ERROR + NOT_HERE); - return; - } - - if (IsEmptyStr(filename)) { - cprintf("%d You must specify a file name.\n", - ERROR + FILE_NOT_FOUND); - return; - } - - for (a = 0; !IsEmptyStr(&filename[a]); ++a) { - if ( (filename[a] == '/') || (filename[a] == '\\') ) { - filename[a] = '_'; - } - } - snprintf(pathname, sizeof pathname, "./files/%s/%s", - CC->room.QRdirname, filename); - if (access(pathname, 0) != 0) { - cprintf("%d File '%s' not found.\n", - ERROR + FILE_NOT_FOUND, pathname); - return; - } - snprintf(buf, sizeof buf, "sysop@%s", destsys); - e = alias(buf); - if (e != MES_IGNET) { - cprintf("%d No such system: '%s'\n", - ERROR + NO_SUCH_SYSTEM, destsys); - return; - } - snprintf(outfile, sizeof outfile, - "%s/nsf.%04lx.%04x", - ctdl_netin_dir, - (long)getpid(), ++seq); - ofp = fopen(outfile, "a"); - if (ofp == NULL) { - cprintf("%d internal error\n", ERROR + INTERNAL_ERROR); - return; - } - - putc(255, ofp); - putc(MES_NORMAL, ofp); - putc(0, ofp); - fprintf(ofp, "P%s", CC->user.fullname); - putc(0, ofp); - time(&now); - fprintf(ofp, "T%ld", (long) now); - putc(0, ofp); - fprintf(ofp, "A%s", CC->user.fullname); - putc(0, ofp); - fprintf(ofp, "O%s", CC->room.QRname); - putc(0, ofp); - fprintf(ofp, "N%s", NODENAME); - putc(0, ofp); - fprintf(ofp, "D%s", destsys); - putc(0, ofp); - fprintf(ofp, "SFILE"); - putc(0, ofp); - putc('M', ofp); - fclose(ofp); - - snprintf(buf, sizeof buf, - "cd %s/%s; uuencode %s <%s 2>/dev/null >>%s", - ctdl_file_dir, - /* FIXME: detect uuencode while installation? or inline */ - CC->room.QRdirname, filename, filename, outfile); - system(buf); - - ofp = fopen(outfile, "a"); - putc(0, ofp); - fclose(ofp); - - cprintf("%d File '%s' has been sent to %s.\n", CIT_OK, filename, - destsys); - /* FIXME start a network run here. */ - return; -} - /* * This code is common to all commands which open a file for downloading, * regardless of whether it's a file from the directory, an image, a network