Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1573899
 поиск   регистрация   авторизация 
 
Группа :: Система/Серверы
Пакет: squid

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: squid-2.5.STABLE10-chroot-2.patch


Index: squid/src/cache_cf.c
diff -c squid/src/cache_cf.c:1.396.2.26 squid/src/cache_cf.c:1.396.2.27
*** squid/src/cache_cf.c:1.396.2.26	Fri May  6 16:33:53 2005
--- squid/src/cache_cf.c	Mon Jun 13 16:26:21 2005
***************
*** 299,306 ****
      }
      fclose(fp);
      defaults_if_none();
      if (opt_send_signal == -1) {
- 	configDoConfigure();
  	cachemgrRegister("config",
  	    "Current Squid Configuration",
  	    dump_config,
--- 299,306 ----
      }
      fclose(fp);
      defaults_if_none();
+     configDoConfigure();
      if (opt_send_signal == -1) {
  	cachemgrRegister("config",
  	    "Current Squid Configuration",
  	    dump_config,
***************
*** 2567,2574 ****
  	snprintf(pathbuf, BUFSIZ, "%s/%s", Config.chroot_dir, path);
  	path = pathbuf;
      }
!     if (stat(path, &sb) < 0)
! 	fatalf("%s %s: %s", name, path, xstrerror());
  }
  
  char *
--- 2567,2578 ----
  	snprintf(pathbuf, BUFSIZ, "%s/%s", Config.chroot_dir, path);
  	path = pathbuf;
      }
!     if (stat(path, &sb) < 0) {
! 	if (opt_send_signal == -1 || opt_send_signal == SIGHUP)
! 	    fatalf("%s %s: %s", name, path, xstrerror());
! 	else
! 	    fprintf(stderr, "WARNING: %s %s: %s\n", name, path, xstrerror());
!     }
  }
  
  char *
Index: squid/src/globals.h
diff -c squid/src/globals.h:1.108.2.6 squid/src/globals.h:1.108.2.7
*** squid/src/globals.h:1.108.2.6	Wed Apr 20 15:52:26 2005
--- squid/src/globals.h	Mon Jun 13 16:26:21 2005
***************
*** 166,170 ****
--- 166,171 ----
  extern void *sbrk_start;	/* 0 */
  #endif
  extern int opt_send_signal;	/* -1 */
+ extern int opt_no_daemon;	/* 0 */
  
  #endif /* SQUID_GLOBALS_H */
Index: squid/src/main.c
diff -c squid/src/main.c:1.345.2.25 squid/src/main.c:1.345.2.27
*** squid/src/main.c:1.345.2.25	Wed Apr 20 15:52:26 2005
--- squid/src/main.c	Mon Jun 27 15:24:28 2005
***************
*** 38,44 ****
  /* for error reporting from xmalloc and friends */
  extern void (*failure_notify) (const char *);
  
- static int opt_no_daemon = 0;
  static int opt_parse_cfg_only = 0;
  static char *opt_syslog_facility = NULL;
  static int httpPortNumOverride = 1;
--- 38,43 ----
***************
*** 684,691 ****
      /* send signal to running copy and exit */
      if (opt_send_signal != -1) {
  	/* chroot if configured to run inside chroot */
! 	if (Config.chroot_dir && chroot(Config.chroot_dir)) {
! 	    fatal("failed to chroot");
  	}
  	sendSignal();
  	/* NOTREACHED */
--- 683,694 ----
      /* send signal to running copy and exit */
      if (opt_send_signal != -1) {
  	/* chroot if configured to run inside chroot */
! 	if (Config.chroot_dir) {
! 	    if (chroot(Config.chroot_dir))
! 		fatal("failed to chroot");
! 	    no_suid();
! 	} else {
! 	    leave_suid();
  	}
  	sendSignal();
  	/* NOTREACHED */
Index: squid/src/tools.c
diff -c squid/src/tools.c:1.213.2.15 squid/src/tools.c:1.213.2.16
*** squid/src/tools.c:1.213.2.15	Fri Apr 22 14:45:12 2005
--- squid/src/tools.c	Mon Jun 13 16:26:22 2005
***************
*** 491,497 ****
  	if (strchr(host, '.'))
  	    return host;
      }
!     fatal("Could not determine fully qualified hostname.  Please set 'visible_hostname'\n");
      return NULL;		/* keep compiler happy */
  }
  
--- 491,500 ----
  	if (strchr(host, '.'))
  	    return host;
      }
!     if (opt_send_signal == -1)
! 	fatal("Could not determine fully qualified hostname.  Please set 'visible_hostname'\n");
!     else
! 	return ("localhost");
      return NULL;		/* keep compiler happy */
  }
  
 
design & coding: Vladimir Lettiev aka crux © 2004-2005