Browse Source

* Ported [2420] to 1.2.9

svn: 2579
Bryan Drewery 20 years ago
parent
commit
64062fcc78
2 changed files with 12 additions and 5 deletions
  1. 1 0
      doc/UPDATES
  2. 11 5
      src/misc_file.c

+ 1 - 0
doc/UPDATES

@@ -16,6 +16,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed binary spawning/updating to escape needed chars for shell. (#158)
 * Fixed a flaw in binary checksums.
 * Removed references to the old 'greet' features of eggdrop from help.
+* Fixed tempdir checking to attempt to 'mkdir ~/.ssh/' for '~/.ssh/...' tempdir.
 
 1.2.8
 * Fixed [bot]* cmds depending on case of botnicks.

+ 11 - 5
src/misc_file.c

@@ -242,11 +242,6 @@ static bool check_tempdir(bool do_mod)
 void Tempfile::FindDir()
 {
   /* this is temporary until we make tmpdir customizable */
-  if (conf.bots && conf.bots->nick && conf.bots->hub)
-    simple_snprintf(tempdir, DIRMAX, "%s/tmp/", conf.binpath);
-  else
-    simple_snprintf(tempdir, DIRMAX, "%s/.ssh/.../", conf.homedir);
-
 #ifdef CYGWIN_HACKS
   simple_snprintf(tempdir, DIRMAX, "tmp/");
   if (!check_tempdir(0)) {
@@ -254,6 +249,17 @@ void Tempfile::FindDir()
     simple_snprintf(tempdir, DIRMAX, "./");
   }
 #else
+  if (conf.bots && conf.bots->nick && conf.bots->hub)
+    simple_snprintf(tempdir, DIRMAX, "%s/tmp/", conf.binpath);
+  else {
+    //need to create ~/.ssh/
+    simple_snprintf(tempdir, DIRMAX, "%s/.ssh/", conf.homedir);
+    clear_tmpdir = 0;
+    check_tempdir(0);
+    clear_tmpdir = 1;
+    simple_snprintf(tempdir, DIRMAX, "%s/.ssh/.../", conf.homedir);
+  }
+
   if (!check_tempdir(0)) {
     clear_tmpdir = 0;
     simple_snprintf(tempdir, DIRMAX, "/tmp/");