From 8be9039d458b5b8f67870dfe29dbb3a12b289a83 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 19 Dec 2000 20:41:55 +0000 Subject: [PATCH] * Fixed generation of unique file names for network uploads etc. --- citadel/ChangeLog | 4 ++++ citadel/file_ops.c | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 50b0b1a0e..45841cc26 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 573.52 2000/12/19 20:41:55 ajc + * Fixed generation of unique file names for network uploads etc. + Revision 573.51 2000/12/14 18:36:34 ajc * Fixed the "users not in chat" wholist display @@ -2225,3 +2228,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/file_ops.c b/citadel/file_ops.c index e2db9eb56..fed2c0d89 100644 --- a/citadel/file_ops.c +++ b/citadel/file_ops.c @@ -134,6 +134,7 @@ void cmd_netf(char *cmdbuf) int a,e; time_t now; FILE *ofp; + static int seq = 1; extract(filename,cmdbuf,0); extract(destsys,cmdbuf,1); @@ -167,8 +168,9 @@ void cmd_netf(char *cmdbuf) ERROR+NO_SUCH_SYSTEM,destsys); return; } - snprintf(outfile,sizeof outfile,"%s/network/spoolin/nsf.%d",BBSDIR, - getpid()); + snprintf(outfile, sizeof outfile, + "%s/network/spoolin/nsf.%04x.%04x", + BBSDIR, getpid(), ++seq); ofp=fopen(outfile,"a"); if (ofp==NULL) { cprintf("%d internal error\n",ERROR); @@ -670,6 +672,8 @@ void cmd_ndop(char *cmdbuf) */ void cmd_nuop(char *cmdbuf) { + static int seq = 1; + if (strlen(CC->net_node)==0) { cprintf("%d Not authenticated as a network node.\n", ERROR+NOT_LOGGED_IN); @@ -681,8 +685,9 @@ void cmd_nuop(char *cmdbuf) return; } - snprintf(CC->upl_path,sizeof CC->upl_path,"%s/network/spoolin/%s.%d", - BBSDIR,CC->net_node,getpid()); + snprintf(CC->upl_path, sizeof CC->upl_path, + "%s/network/spoolin/%s.%04x.%04x", + BBSDIR, CC->net_node, getpid(), ++seq); CC->upload_fp = fopen(CC->upl_path,"r"); if (CC->upload_fp != NULL) { -- 2.30.2