diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-proxy/squid/files | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-proxy/squid/files')
-rw-r--r-- | net-proxy/squid/files/squid-3.3.4-gentoo.patch | 131 | ||||
-rw-r--r-- | net-proxy/squid/files/squid-3.5.7-gentoo.patch | 100 | ||||
-rw-r--r-- | net-proxy/squid/files/squid.confd-r1 | 13 | ||||
-rw-r--r-- | net-proxy/squid/files/squid.cron | 5 | ||||
-rw-r--r-- | net-proxy/squid/files/squid.initd-r4 | 118 | ||||
-rw-r--r-- | net-proxy/squid/files/squid.logrotate | 8 | ||||
-rw-r--r-- | net-proxy/squid/files/squid.pam | 8 |
7 files changed, 383 insertions, 0 deletions
diff --git a/net-proxy/squid/files/squid-3.3.4-gentoo.patch b/net-proxy/squid/files/squid-3.3.4-gentoo.patch new file mode 100644 index 000000000000..fb049e9ce5d6 --- /dev/null +++ b/net-proxy/squid/files/squid-3.3.4-gentoo.patch @@ -0,0 +1,131 @@ +diff --git a/configure.ac b/configure.ac +index a863327..deb44ed 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -26,9 +26,9 @@ PRESET_CFLAGS="$CFLAGS" + PRESET_LDFLAGS="$LDFLAGS" + + dnl Set default LDFLAGS +-if test "x$LDFLAGS" = "x" ; then +- LDFLAGS="-g" +-fi ++dnl if test "x$LDFLAGS" = "x" ; then ++dnl LDFLAGS="-g" ++dnl fi + + # Check for GNU cc + AC_PROG_CC +diff --git a/helpers/basic_auth/SMB/basic_smb_auth.sh b/helpers/basic_auth/SMB/basic_smb_auth.sh +index 2a1abb3..b3ebb7a 100755 +--- a/helpers/basic_auth/SMB/basic_smb_auth.sh ++++ b/helpers/basic_auth/SMB/basic_smb_auth.sh +@@ -24,7 +24,7 @@ read NMBCAST + read AUTHSHARE + read AUTHFILE + read SMBUSER +-read SMBPASS ++read -r SMBPASS + + # Find domain controller + echo "Domain name: $DOMAINNAME" +@@ -47,7 +47,7 @@ else + addropt="" + fi + echo "Query address options: $addropt" +-dcip=`nmblookup $addropt "$PASSTHROUGH#1c" | awk '/^[0-9.]+ / { print $1 ; exit }'` ++dcip=`nmblookup $addropt "$PASSTHROUGH#1c" | awk '/^[0-9.]+\..+ / { print $1 ; exit }'` + echo "Domain controller IP address: $dcip" + [ -n "$dcip" ] || exit 1 + +diff --git a/src/Makefile.am b/src/Makefile.am +index 6b69267..10f506a 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -867,8 +867,8 @@ DEFAULT_LOG_PREFIX = $(DEFAULT_LOG_DIR) + DEFAULT_CACHE_LOG = $(DEFAULT_LOG_PREFIX)/cache.log + DEFAULT_ACCESS_LOG = $(DEFAULT_LOG_PREFIX)/access.log + DEFAULT_STORE_LOG = $(DEFAULT_LOG_PREFIX)/store.log +-DEFAULT_NETDB_FILE = $(DEFAULT_LOG_PREFIX)/netdb.state +-DEFAULT_SSL_DB_DIR = $(localstatedir)/lib/ssl_db ++DEFAULT_NETDB_FILE = $(localstatedir)/lib/squid/netdb.state ++DEFAULT_SSL_DB_DIR = $(localstatedir)/lib/squid/ssl_db + DEFAULT_PINGER = $(libexecdir)/`echo pinger | sed '$(transform);s/$$/$(EXEEXT)/'` + DEFAULT_UNLINKD = $(libexecdir)/`echo unlinkd | sed '$(transform);s/$$/$(EXEEXT)/'` + DEFAULT_LOGFILED = $(libexecdir)/`echo log_file_daemon | sed '$(transform);s/$$/$(EXEEXT)/'` +diff --git a/src/debug.cc b/src/debug.cc +index 64ab0ba..062119a 100644 +--- a/src/debug.cc ++++ b/src/debug.cc +@@ -450,7 +450,7 @@ _db_init(const char *logfile, const char *options) + #if HAVE_SYSLOG && defined(LOG_LOCAL4) + + if (Debug::log_syslog) +- openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, syslog_facility); ++ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY, syslog_facility); + + #endif /* HAVE_SYSLOG */ + +diff --git a/src/main.cc b/src/main.cc +index d6eb01a..0b93f0e 100644 +--- a/src/main.cc ++++ b/src/main.cc +@@ -1657,7 +1657,7 @@ watch_child(char *argv[]) + if (!IamMasterProcess()) + return; + +- openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4); ++ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY, LOG_LOCAL4); + + if ((pid = fork()) < 0) + syslog(LOG_ALERT, "fork failed: %s", xstrerror()); +@@ -1720,7 +1720,7 @@ watch_child(char *argv[]) + + if ((pid = fork()) == 0) { + /* child */ +- openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4); ++ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY, LOG_LOCAL4); + prog = argv[0]; + argv[0] = const_cast<char*>(kid.name().termedBuf()); + execvp(prog, argv); +@@ -1733,7 +1733,7 @@ watch_child(char *argv[]) + } + + /* parent */ +- openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4); ++ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY, LOG_LOCAL4); + + squid_signal(SIGINT, SIG_IGN, SA_RESTART); + +--- a/src/cf.data.pre 2013-04-29 11:17:59.256167134 +0300 ++++ b/src/cf.data.pre 2013-04-29 11:20:17.043924313 +0300 +@@ -1019,6 +1019,7 @@ + acl Safe_ports port 488 # gss-http + acl Safe_ports port 591 # filemaker + acl Safe_ports port 777 # multiling http ++acl Safe_ports port 901 # SWAT + acl CONNECT method CONNECT + NOCOMMENT_END + DOC_END +@@ -5300,11 +5301,11 @@ + + NAME: cache_mgr + TYPE: string +-DEFAULT: webmaster ++DEFAULT: root + LOC: Config.adminEmail + DOC_START + Email-address of local cache manager who will receive +- mail if the cache dies. The default is "webmaster". ++ mail if the cache dies. The default is "root". + DOC_END + + NAME: mail_from +@@ -8052,7 +8053,7 @@ + NAME: forwarded_for + COMMENT: on|off|transparent|truncate|delete + TYPE: string +-DEFAULT: on ++DEFAULT: delete + LOC: opt_forwarded_for + DOC_START + If set to "on", Squid will append your client's IP address diff --git a/net-proxy/squid/files/squid-3.5.7-gentoo.patch b/net-proxy/squid/files/squid-3.5.7-gentoo.patch new file mode 100644 index 000000000000..c4def050a2d0 --- /dev/null +++ b/net-proxy/squid/files/squid-3.5.7-gentoo.patch @@ -0,0 +1,100 @@ +diff --git a/configure.ac b/configure.ac +index a863327..deb44ed 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -26,9 +26,9 @@ PRESET_CFLAGS="$CFLAGS" + PRESET_LDFLAGS="$LDFLAGS" + + dnl Set default LDFLAGS +-if test "x$LDFLAGS" = "x" ; then +- LDFLAGS="-g" +-fi ++dnl if test "x$LDFLAGS" = "x" ; then ++dnl LDFLAGS="-g" ++dnl fi + + # Check for GNU cc + AC_PROG_CC +diff --git a/src/Makefile.am b/src/Makefile.am +index 6b69267..10f506a 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -867,8 +867,8 @@ DEFAULT_LOG_PREFIX = $(DEFAULT_LOG_DIR) + DEFAULT_CACHE_LOG = $(DEFAULT_LOG_PREFIX)/cache.log + DEFAULT_ACCESS_LOG = $(DEFAULT_LOG_PREFIX)/access.log + DEFAULT_STORE_LOG = $(DEFAULT_LOG_PREFIX)/store.log +-DEFAULT_NETDB_FILE = $(DEFAULT_LOG_PREFIX)/netdb.state +-DEFAULT_SSL_DB_DIR = $(localstatedir)/lib/ssl_db ++DEFAULT_NETDB_FILE = $(localstatedir)/lib/squid/netdb.state ++DEFAULT_SSL_DB_DIR = $(localstatedir)/lib/squid/ssl_db + DEFAULT_PINGER = $(libexecdir)/`echo pinger | sed '$(transform);s/$$/$(EXEEXT)/'` + DEFAULT_UNLINKD = $(libexecdir)/`echo unlinkd | sed '$(transform);s/$$/$(EXEEXT)/'` + DEFAULT_LOGFILED = $(libexecdir)/`echo log_file_daemon | sed '$(transform);s/$$/$(EXEEXT)/'` +diff --git a/src/debug.cc b/src/debug.cc +index 64ab0ba..062119a 100644 +--- a/src/debug.cc ++++ b/src/debug.cc +@@ -450,7 +450,7 @@ _db_init(const char *logfile, const char *options) + #if HAVE_SYSLOG && defined(LOG_LOCAL4) + + if (Debug::log_syslog) +- openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, syslog_facility); ++ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY, syslog_facility); + + #endif /* HAVE_SYSLOG */ + +diff --git a/src/main.cc b/src/main.cc +index d6eb01a..0b93f0e 100644 +--- a/src/main.cc ++++ b/src/main.cc +@@ -1657,7 +1657,7 @@ watch_child(char *argv[]) + if (!IamMasterProcess()) + return; + +- openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4); ++ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY, LOG_LOCAL4); + + if ((pid = fork()) < 0) + syslog(LOG_ALERT, "fork failed: %s", xstrerror()); +@@ -1720,7 +1720,7 @@ watch_child(char *argv[]) + + if ((pid = fork()) == 0) { + /* child */ +- openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4); ++ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY, LOG_LOCAL4); + prog = argv[0]; + argv[0] = const_cast<char*>(kid.name().termedBuf()); + execvp(prog, argv); +@@ -1733,7 +1733,7 @@ watch_child(char *argv[]) + } + + /* parent */ +- openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4); ++ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY, LOG_LOCAL4); + + squid_signal(SIGINT, SIG_IGN, SA_RESTART); + +--- a/src/cf.data.pre 2013-04-29 11:17:59.256167134 +0300 ++++ b/src/cf.data.pre 2013-04-29 11:20:17.043924313 +0300 +@@ -1019,6 +1019,7 @@ + acl Safe_ports port 488 # gss-http + acl Safe_ports port 591 # filemaker + acl Safe_ports port 777 # multiling http ++acl Safe_ports port 901 # SWAT + acl CONNECT method CONNECT + NOCOMMENT_END + DOC_END +@@ -5300,11 +5301,11 @@ + + NAME: cache_mgr + TYPE: string +-DEFAULT: webmaster ++DEFAULT: root + LOC: Config.adminEmail + DOC_START + Email-address of local cache manager who will receive +- mail if the cache dies. The default is "webmaster". ++ mail if the cache dies. The default is "root". + DOC_END + + NAME: mail_from diff --git a/net-proxy/squid/files/squid.confd-r1 b/net-proxy/squid/files/squid.confd-r1 new file mode 100644 index 000000000000..c42e04e11add --- /dev/null +++ b/net-proxy/squid/files/squid.confd-r1 @@ -0,0 +1,13 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +# Config file for /etc/init.d/squid + +SQUID_OPTS="-YC" + +# Kerberos keytab file to use. This is required if you enable kerberos authentication. +SQUID_KEYTAB="" + +# Use max_filedescriptors setting in squid.conf to determine the maximum number +# of filedescriptors squid can open. diff --git a/net-proxy/squid/files/squid.cron b/net-proxy/squid/files/squid.cron new file mode 100644 index 000000000000..8726ddd72955 --- /dev/null +++ b/net-proxy/squid/files/squid.cron @@ -0,0 +1,5 @@ +#!/bin/sh +if test -e /var/run/squid.pid ; then + test -n "$(cat /var/run/squid.pid|xargs ps -p|grep squid)" && \ + /usr/sbin/squid -k rotate +fi diff --git a/net-proxy/squid/files/squid.initd-r4 b/net-proxy/squid/files/squid.initd-r4 new file mode 100644 index 000000000000..29c299bd2ecc --- /dev/null +++ b/net-proxy/squid/files/squid.initd-r4 @@ -0,0 +1,118 @@ +#!/sbin/runscript +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +extra_started_commands="reload rotate" + +depend() { + use dns net +} + +checkconfig() { + if [ ! -f /etc/squid/${SVCNAME}.conf ]; then + eerror "You need to create /etc/squid/${SVCNAME}.conf first." + eerror "An example can be found in /etc/squid/squid.conf.default" + return 1 + fi + + local PIDFILE=$(awk '/^[ \t]*pid_filename[ \t]+/ { print $2 }' < /etc/squid/${SVCNAME}.conf) + [ -z ${PIDFILE} ] && PIDFILE=/run/squid.pid + if [ /run/${SVCNAME}.pid != ${PIDFILE} ]; then + eerror "/etc/squid/${SVCNAME}.conf must set pid_filename to" + eerror " /run/${SVCNAME}.pid" + eerror "CAUTION: http_port, cache_dir and *_log parameters must be different than" + eerror " in any other instance of squid." + return 1 + fi + + # Maximum file descriptors squid can open is determined by: + # a basic default of N=1024 + # ... altered by ./configure --with-filedescriptors=N + # ... overridden on production by squid.conf max_filedescriptors (if, + # and only if, setrlimit() RLIMIT_NOFILE is able to be built+used). + # Since we do not configure hard coded # of filedescriptors anymore, + # there is no need for ulimit calls in the init script. + # Use max_filedescriptors in squid.conf instead. + + local CACHE_SWAP=$(awk '/^[ \t]*cache_dir[ \t]+/ { if ( $2 == "rock" ) printf "%s/rock ", $3; else if ( $2 == "coss" ) printf "%s/stripe ", $3; else printf "%s/00 ", $3; }' < /etc/squid/${SVCNAME}.conf) + [ -z "$CACHE_SWAP" ] && CACHE_SWAP="/var/cache/squid/00" + + local x + for x in $CACHE_SWAP ; do + if [ ! -e $x ] ; then + ebegin "Initializing cache directory ${x%/*}" + local ORIG_UMASK=$(umask) + umask 027 + + if ! (mkdir -p ${x%/*} && chown squid ${x%/*}) ; then + eend 1 + return 1 + fi + + local INIT_CACHE_RESPONSE="$(/usr/sbin/squid -z -N -f /etc/squid/${SVCNAME}.conf 2>&1)" + if [ $? != 0 ] || echo "$INIT_CACHE_RESPONSE" | grep -q "erminated abnormally" ; then + umask $ORIG_UMASK + eend 1 + echo "$INIT_CACHE_RESPONSE" + return 1 + fi + + umask $ORIG_UMASK + eend 0 + break + fi + done + + return 0 +} + +start() { + checkconfig || return 1 + checkpath -d -q -m 0750 -o squid:squid /run/${SVCNAME} + + ebegin "Starting ${SVCNAME}" + KRB5_KTNAME="${SQUID_KEYTAB}" /usr/sbin/squid ${SQUID_OPTS} -f /etc/squid/${SVCNAME}.conf + eend $? && sleep 1 +} + +stop() { + ebegin "Stopping ${SVCNAME}" + if /usr/sbin/squid -k shutdown -f /etc/squid/${SVCNAME}.conf ; then + # Now we have to wait until squid has _really_ stopped. + sleep 1 + if [ -f /run/${SVCNAME}.pid ] ; then + einfon "Waiting for squid to shutdown ." + cnt=0 + while [ -f /run/${SVCNAME}.pid ] ; do + cnt=$(expr $cnt + 1) + if [ $cnt -gt 60 ] ; then + # Waited 120 seconds now. Fail. + echo + eend 1 "Failed." + break + fi + sleep 2 + echo -n "." + done + echo + fi + else + eerror "Squid shutdown failed, probably service is already down." + fi + eend 0 +} + +reload() { + checkconfig || return 1 + ebegin "Reloading ${SVCNAME}" + /usr/sbin/squid -k reconfigure -f /etc/squid/${SVCNAME}.conf + eend $? +} + +rotate() { + service_started ${SVCNAME} || return 1 + ebegin "Rotating ${SVCNAME} logs" + /usr/sbin/squid -k rotate -f /etc/squid/${SVCNAME}.conf + eend $? +} diff --git a/net-proxy/squid/files/squid.logrotate b/net-proxy/squid/files/squid.logrotate new file mode 100644 index 000000000000..5bf289691aec --- /dev/null +++ b/net-proxy/squid/files/squid.logrotate @@ -0,0 +1,8 @@ +/var/log/squid/*.log { + copytruncate + compress + notifempty + missingok + sharedscripts +} + diff --git a/net-proxy/squid/files/squid.pam b/net-proxy/squid/files/squid.pam new file mode 100644 index 000000000000..95fbe6bfd6b5 --- /dev/null +++ b/net-proxy/squid/files/squid.pam @@ -0,0 +1,8 @@ +#%PAM-1.0 +# $Id$ +auth required pam_nologin.so +auth include system-auth +account include system-auth +password include system-auth +session optional pam_limits.so +session include system-auth |