Pārlūkot izejas kodu

* Port [3604] to 1.2.14
* Userfile transfers now use a random filename instead of .share.botnick.users.timestamp



svn: 3605

Bryan Drewery 18 gadi atpakaļ
vecāks
revīzija
150db5af3b
2 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 1 0
      doc/UPDATES
  2. 5 2
      src/mod/share.mod/share.c

+ 1 - 0
doc/UPDATES

@@ -65,6 +65,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fix cmd/dcc prefix leaking to -p users (when chat is off) (fixes #376)
 * Fix checking for flood on hosts which are already ignored. (fixes #343)
 * Added OSVER entry for bots in .whois
+* Userfile transfers now use a random filename instead of .share.botnick.users.timestamp
 
 1.2.13 - http://wraith.shatow.net/milestone/1.2.13
 * Fix cmd_chanset accepting invalid flags

+ 5 - 2
src/mod/share.mod/share.c

@@ -905,7 +905,9 @@ share_ufsend(int idx, char *par)
   int i, sock;
   FILE *f = NULL;
 
-  egg_snprintf(s, sizeof s, "%s.share.%s.%li.users", tempdir, conf.bot->nick, now);
+  simple_snprintf(s, sizeof(s), "%s.share.XXXXXX", tempdir);
+  mktemp(s);
+
   if (!(b_status(idx) & STAT_SHARE)) {
     dprintf(idx, "s e You didn't ask; you just started sending.\n");
     dprintf(idx, "s e Ask before sending the userfile.\n");
@@ -1395,7 +1397,8 @@ start_sending_users(int idx)
   char share_file[1024] = "";
   int i = 1, j = -1;
 
-  egg_snprintf(share_file, sizeof share_file, "%s.share.%s.%li", tempdir, dcc[idx].nick, now);
+  simple_snprintf(share_file, sizeof(share_file), "%s.share.XXXXXX", tempdir);
+  mktemp(share_file);
 
   write_tmp_userfile(share_file, userlist, idx);