Просмотр исходного кода

* Now making a small attempt to auto make the tmpdir.

svn: 1668
Bryan Drewery 21 лет назад
Родитель
Сommit
6b44e07299
3 измененных файлов с 16 добавлено и 3 удалено
  1. 1 0
      doc/UPDATES
  2. 3 3
      src/conf.c
  3. 12 0
      src/main.c

+ 1 - 0
doc/UPDATES

@@ -34,6 +34,7 @@ This is a summary of ChangeLog basically.
 * Fixed a problem with dcc authing not being validated correctly
 * Fixed some *possible* problems with msgop/pass/invite/ident checking.
 * cmd_quit failed to log.
+* Now making a small attempt to auto make the tmpdir.
 
 1.2
 * No longer displaying SALTS on ./bin -v

+ 3 - 3
src/conf.c

@@ -271,9 +271,9 @@ init_conf()
   conffile.binpath = strdup(dirname(binname));
 #  endif /* HUB */
 #endif /* CYGWIN_HACKS */
-#ifdef LEAF
-  conffile.binname = strdup(STR(".sshrc"));
-#endif /* LEAF */
+//#ifdef LEAF
+//  conffile.binname = strdup(STR(".sshrc"));
+//#endif /* LEAF */
 #ifdef HUB
   {
     char *p = NULL;

+ 12 - 0
src/main.c

@@ -529,6 +529,18 @@ static void core_halfhourly()
 
 static void check_tempdir()
 {
+  char *_confdir = confdir();
+
+  if (_confdir && !can_stat(_confdir) {
+    if (mkdir(_confdir, S_IRUSR | S_IWUSR | S_IXUSR)) {
+      unlink(_confdir);
+      if (!can_stat(_confdir))
+        mkdir(_confdir, S_IRUSR | S_IWUSR | S_IXUSR);
+    }
+  }
+
+  fixmod(_confdir);
+
   if (!can_stat(tempdir)) {
     if (mkdir(tempdir,  S_IRUSR | S_IWUSR | S_IXUSR)) {
       unlink(tempdir);