File: 03-no-append-domain-localhost.dpatch

package info (click to toggle)
squid 2.6.5-6etch5
  • links: PTS
  • area: main
  • in suites: etch
  • size: 12,540 kB
  • ctags: 13,801
  • sloc: ansic: 105,278; sh: 6,083; makefile: 1,297; perl: 1,245; awk: 40
file content (28 lines) | stat: -rw-r--r-- 960 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /bin/sh -e
## 03-no-append-domain-localhost.dpatch by Luigi Gangitano <luigi@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Don't apply "append_domain" setting to "localhost" in unqualified URLs

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -f --no-backup-if-mismatch -p0 < $0;;
    -unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;;
    *)
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1;;
esac

exit 0
--- src/url.c	2002-09-12 07:21:00.000000000 +0200
+++ src/url.c	2002-10-10 19:37:43.000000000 +0200
@@ -313,5 +313,5 @@
     }
 #endif
-    if (Config.appendDomain && !strchr(host, '.'))
+    if (Config.appendDomain && !strchr(host, '.')&& strcasecmp(host,"localhost") != 0)
 	strncat(host, Config.appendDomain, SQUIDHOSTNAMELEN);
     /* remove trailing dots from hostnames */