commit go1.6 for openSUSE:Factory

2018-12-18 Thread root
Hello community,

here is the log from the commit of package go1.6 for openSUSE:Factory checked 
in at 2018-12-18 14:58:37

Comparing /work/SRC/openSUSE:Factory/go1.6 (Old)
 and  /work/SRC/openSUSE:Factory/.go1.6.new.28833 (New)


Package is "go1.6"

Tue Dec 18 14:58:37 2018 rev:7 rq:658803 version:1.6.4

Changes:

--- /work/SRC/openSUSE:Factory/go1.6/go1.6.changes  2018-02-27 
17:00:53.773671954 +0100
+++ /work/SRC/openSUSE:Factory/.go1.6.new.28833/go1.6.changes   2018-12-18 
15:00:03.342100903 +0100
@@ -1,0 +2,7 @@
+Sat Dec 15 12:45:31 UTC 2018 - Aleksa Sarai 
+
+- Make our profile.d/go.sh no longer set GOROOT=, in order to make switching
+  between versions no longer break. This ends up removing the need for go.sh
+  entirely (because GOPATH is also set automatically). boo#1119634
+
+---

Old:

  go.sh



Other differences:
--
++ go1.6.spec ++
--- /var/tmp/diff_new_pack.c6O3P7/_old  2018-12-18 15:00:04.826098672 +0100
+++ /var/tmp/diff_new_pack.c6O3P7/_new  2018-12-18 15:00:04.834098660 +0100
@@ -12,7 +12,7 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 # nodebuginfo
 
@@ -80,7 +80,6 @@
 Url:http://golang.org
 Source0:http://golang.org/dl/go%{version}.src.tar.gz
 Source1:go-rpmlintrc
-Source2:go.sh
 Source4:README.SUSE
 Source6:go.gdbinit
 # We have to compile TSAN ourselves. boo#1052528
@@ -290,8 +289,6 @@
 
 %install
 export GOROOT="%{buildroot}%{_libdir}/go/%{go_api}"
-install -Dm644 %{SOURCE2} $GOROOT/bin/profile.d/go.sh
-sed -i "s/\$go_api/%{go_api}/" $GOROOT/bin/profile.d/go.sh
 
 # locations for third party libraries, see README-openSUSE for info about 
locations.
 install -d  %{buildroot}%{_datadir}/go/%{go_api}//contrib
@@ -336,10 +333,9 @@
 mkdir -p %{buildroot}%{_bindir}
 mkdir -p %{buildroot}%{_sysconfdir}/profile.d
 mkdir -p %{buildroot}%{_sysconfdir}/gdbinit.d
-touch %{buildroot}%{_sysconfdir}/alternatives/{go,gofmt,go.sh,go.gdb}
+touch %{buildroot}%{_sysconfdir}/alternatives/{go,gofmt,go.gdb}
 ln -sf %{_sysconfdir}/alternatives/go %{buildroot}%{_bindir}/go
 ln -sf %{_sysconfdir}/alternatives/gofmt %{buildroot}%{_bindir}/gofmt
-ln -sf %{_sysconfdir}/alternatives/go.sh 
%{buildroot}%{_sysconfdir}/profile.d/go.sh
 ln -sf %{_sysconfdir}/alternatives/go.gdb 
%{buildroot}%{_sysconfdir}/gdbinit.d/go.gdb
 
 # documentation and examples
@@ -360,8 +356,7 @@
 update-alternatives \
 --install %{_bindir}/go go %{_libdir}/go/%{go_api}/bin/go 30 \
--slave %{_bindir}/gofmt gofmt %{_libdir}/go/%{go_api}/bin/gofmt \
-   --slave %{_sysconfdir}/gdbinit.d/go.gdb go.gdb 
%{_libdir}/go/%{go_api}/bin/gdbinit.d/go.gdb \
-   --slave %{_sysconfdir}/profile.d/go.sh go.sh 
%{_libdir}/go/%{go_api}/bin/profile.d/go.sh
+   --slave %{_sysconfdir}/gdbinit.d/go.gdb go.gdb 
%{_libdir}/go/%{go_api}/bin/gdbinit.d/go.gdb
 
 %postun
 if [ $1 -eq 0 ] ; then
@@ -376,11 +371,9 @@
 %{_libdir}/go/%{go_api}
 %{_datadir}/go
 %{_datadir}/go/%{go_api}
-%config %{_sysconfdir}/profile.d/go.sh
 %config %{_sysconfdir}/gdbinit.d/go.gdb
 %ghost %{_sysconfdir}/alternatives/go
 %ghost %{_sysconfdir}/alternatives/gofmt
-%ghost %{_sysconfdir}/alternatives/go.sh
 %ghost %{_sysconfdir}/alternatives/go.gdb
 %dir %{_docdir}/go
 %dir %{_docdir}/go/%{go_api}




commit go1.6 for openSUSE:Factory

2018-02-27 Thread root
Hello community,

here is the log from the commit of package go1.6 for openSUSE:Factory checked 
in at 2018-02-27 17:00:25

Comparing /work/SRC/openSUSE:Factory/go1.6 (Old)
 and  /work/SRC/openSUSE:Factory/.go1.6.new (New)


Package is "go1.6"

Tue Feb 27 17:00:25 2018 rev:6 rq:580587 version:1.6.4

Changes:

--- /work/SRC/openSUSE:Factory/go1.6/go1.6.changes  2018-01-19 
11:53:24.963064602 +0100
+++ /work/SRC/openSUSE:Factory/.go1.6.new/go1.6.changes 2018-02-27 
17:00:53.773671954 +0100
@@ -1,0 +2,5 @@
+Sat Feb 24 19:00:42 UTC 2018 - jmassaguer...@suse.com
+
+- fix bsc#1082409: Review dependencies (requires, recommends and supports) 
+
+---



Other differences:
--
++ go1.6.spec ++
--- /var/tmp/diff_new_pack.H1BCsP/_old  2018-02-27 17:00:55.361614580 +0100
+++ /var/tmp/diff_new_pack.H1BCsP/_new  2018-02-27 17:00:55.365614435 +0100
@@ -135,7 +135,7 @@
 %endif
 %if 0%{?suse_version} >= 1100
 BuildRequires:  fdupes
-Recommends: go-doc = %{version}
+Recommends: %{name}-doc = %{version}
 %ifarch %{tsan_arch}
 # Needed to compile compiler-rt/TSAN.
 BuildRequires:  gcc-c++
@@ -172,7 +172,7 @@
 Summary:Go documentation
 License:BSD-3-Clause
 Group:  Documentation/Other
-Requires:   go = %{version}
+Requires:   %{name} = %{version}
 Provides:   go-doc = %{version}
 
 %description doc
@@ -182,11 +182,11 @@
 # boo#1052528
 %package race
 Summary:Go runtime race detector
-License:NCSA or MIT
+License:NCSA OR MIT
 Group:  Development/Languages/Other
 Url:https://compiler-rt.llvm.org/
-Requires:   go = %{version}
-Supplements:go
+Requires:   %{name} = %{version}
+Supplements:%{name} = %{version}
 ExclusiveArch:  %{tsan_arch}
 
 %description race




commit go1.6 for openSUSE:Factory

2018-01-19 Thread root
Hello community,

here is the log from the commit of package go1.6 for openSUSE:Factory checked 
in at 2018-01-19 11:53:11

Comparing /work/SRC/openSUSE:Factory/go1.6 (Old)
 and  /work/SRC/openSUSE:Factory/.go1.6.new (New)


Package is "go1.6"

Fri Jan 19 11:53:11 2018 rev:5 rq:566416 version:1.6.4

Changes:

--- /work/SRC/openSUSE:Factory/go1.6/go1.6.changes  2017-10-23 
16:53:39.951634473 +0200
+++ /work/SRC/openSUSE:Factory/.go1.6.new/go1.6.changes 2018-01-19 
11:53:24.963064602 +0100
@@ -41,0 +42,16 @@
+Thu Aug 31 18:46:47 UTC 2017 - th...@suse.de
+
+- add fix-sanitizer-build-against-latest-glibc.patch which fixes
+  the sanitizer built against certain glibc versions
+
+---
+Wed Aug  9 07:45:47 UTC 2017 - asa...@suse.com
+
+- go-race: add compiler-rt TSAN binary, necessary for the race detector builds
+  to work. This requires building compiler-rt from source (becuase upstream Go
+  stores precompiled binaries in the tree, and we cannot use them). In
+  addition, a %check was added purely to ensure that we don't install the wrong
+  version of compiler-rt. boo#1052528
+- go-rpmlintrc: add some entries to address the .syso additions.
+
+---

New:

  _service
  compiler-rt-g389d49d4943780efbfcd2a434f4462b6d0f23c44.tar.xz
  fix-sanitizer-build-against-latest-glibc.patch



Other differences:
--
++ go1.6.spec ++
--- /var/tmp/diff_new_pack.pCltwK/_old  2018-01-19 11:53:25.959017663 +0100
+++ /var/tmp/diff_new_pack.pCltwK/_new  2018-01-19 11:53:25.959017663 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package go1.6
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -14,6 +14,7 @@
 
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
+# nodebuginfo
 
 
 # The fallback boostrap method via go1.4 does not work for Factory because
@@ -58,6 +59,16 @@
 %define with_shared 0
 %endif
 
+# By default we don't include tsan. It's only supported on amd64.
+%define tsan_arch x86_64
+
+# Go has precompiled versions of LLVM's compiler-rt inside their source code.
+# We cannot ship pre-compiled binaries so we have to recompile said source,
+# however they vendor specific commits from upstream. This value comes from
+# src/runtime/race/README (and we verify that it matches in check).
+# See boo#1052528 for more details.
+%define tsan_commit 389d49d4943780efbfcd2a434f4462b6d0f23c44
+
 %define _name go
 
 Name:   go1.6
@@ -72,6 +83,8 @@
 Source2:go.sh
 Source4:README.SUSE
 Source6:go.gdbinit
+# We have to compile TSAN ourselves. boo#1052528
+Source100:  compiler-rt-g%{tsan_commit}.tar.xz
 # PATCH-FIX-OPENSUSE add -s flag to 'go install' (don't rebuild/install std 
libs)
 Patch1: go-1.5-build-dont-reinstall-stdlibs.patch
 # PATCH-FIX-OPENSUSE re-enable build binary only packages (we are binary 
distro)
@@ -104,6 +117,8 @@
 Patch13:
net-smtp-fix-PlainAuth-to-refuse-to-send-passwords-to-non-TLS-servers.patch
 # PATCH-FIX-UPSTREAM cmd/go: reject update of VCS inside VCS
 Patch14:cmd-go-reject-update-of-VCS-inside-VCS.patch
+# PATCH-FIX-UPSTREAM (compiler-rt): Fix sanitizer build against latest glibc
+Patch100:   fix-sanitizer-build-against-latest-glibc.patch
 BuildRoot:  %{_tmppath}/%{name}-%{version}-build
 # boostrap
 %if %{with_gccgo}
@@ -121,6 +136,10 @@
 %if 0%{?suse_version} >= 1100
 BuildRequires:  fdupes
 Recommends: go-doc = %{version}
+%ifarch %{tsan_arch}
+# Needed to compile compiler-rt/TSAN.
+BuildRequires:  gcc-c++
+%endif
 #BNC#818502 debug edit tool of rpm fails on i586 builds
 %if 0%{?suse_version} > 1230
 BuildRequires:  rpm >= 4.11.1
@@ -151,6 +170,7 @@
 
 %package doc
 Summary:Go documentation
+License:BSD-3-Clause
 Group:  Documentation/Other
 Requires:   go = %{version}
 Provides:   go-doc = %{version}
@@ -158,7 +178,29 @@
 %description doc
 Go examples and documentation.
 
+%ifarch %{tsan_arch}
+# boo#1052528
+%package race
+Summary:Go runtime race detector
+License:NCSA or MIT
+Group:  Development/Languages/Other
+Url:https://compiler-rt.llvm.org/
+Requires:   go = %{version}
+Supplements:go
+ExclusiveArch:  %{tsan_arch}
+
+%description race
+Go runtime race detector libraries. Install this package if you wish to use the
+-race option, in order to detect race conditions present in your Go programs.
+%endif
+
 %prep
+%ifarch %{tsan_arch}
+# 

commit go1.6 for openSUSE:Factory

2017-10-23 Thread root
Hello community,

here is the log from the commit of package go1.6 for openSUSE:Factory checked 
in at 2017-10-23 16:53:15

Comparing /work/SRC/openSUSE:Factory/go1.6 (Old)
 and  /work/SRC/openSUSE:Factory/.go1.6.new (New)


Package is "go1.6"

Mon Oct 23 16:53:15 2017 rev:4 rq:535893 version:1.6.4

Changes:

--- /work/SRC/openSUSE:Factory/go1.6/go1.6.changes  2017-10-17 
01:53:59.802278936 +0200
+++ /work/SRC/openSUSE:Factory/.go1.6.new/go1.6.changes 2017-10-23 
16:53:39.951634473 +0200
@@ -1,0 +2,6 @@
+Sat Oct 21 11:39:37 UTC 2017 - asa...@suse.com
+
+- Install $GOROOT/lib packages, to include upstream files such as the timezone
+  database. bsc#1064522
+
+---



Other differences:
--
++ go1.6.spec ++
--- /var/tmp/diff_new_pack.X2piBR/_old  2017-10-23 16:53:40.771596098 +0200
+++ /var/tmp/diff_new_pack.X2piBR/_new  2017-10-23 16:53:40.771596098 +0200
@@ -250,10 +250,12 @@
 for i in $(ls %{buildroot}/usr/share/go/%{go_api}/src);do
   ln -s /usr/share/go/%{go_api}/src/$i $GOROOT/src/$i
 done
+# add lib files that are needed (such as the timezone database).
+install -d $GOROOT/lib
+find lib -type f -exec install -D -m644 {} $GOROOT/{} \;
 
 # copy document templates, packages, obj libs and command utilities
 mkdir -p $GOROOT/bin
-mkdir -p $GOROOT/lib
 # remove bootstrap
 rm -rf pkg/bootstrap
 mv pkg $GOROOT




commit go1.6 for openSUSE:Factory

2017-10-16 Thread root
Hello community,

here is the log from the commit of package go1.6 for openSUSE:Factory checked 
in at 2017-10-17 01:53:59

Comparing /work/SRC/openSUSE:Factory/go1.6 (Old)
 and  /work/SRC/openSUSE:Factory/.go1.6.new (New)


Package is "go1.6"

Tue Oct 17 01:53:59 2017 rev:3 rq:534232 version:1.6.4

Changes:

--- /work/SRC/openSUSE:Factory/go1.6/go1.6.changes  2017-10-09 
19:48:54.537770131 +0200
+++ /work/SRC/openSUSE:Factory/.go1.6.new/go1.6.changes 2017-10-17 
01:53:59.802278936 +0200
@@ -1,0 +2,16 @@
+Fri Oct 13 15:42:59 UTC 2017 - fst...@suse.com
+
+- Build with gcc7-go in openSUSE:Factory
+- Added path:
+  * gcc7-go.patch
++ execute %{_bindir}/go-7 instead of %{_bindir}/go
+
+---
+Tue Oct 10 13:40:30 UTC 2017 - th...@suse.de
+
+- Add patch to fix arbitrary code execution during “go get” or “go get -d”
+  (CVE-2017-15041).
+  bsc#1062085
+  + cmd-go-reject-update-of-VCS-inside-VCS.patch
+
+---

New:

  cmd-go-reject-update-of-VCS-inside-VCS.patch
  gcc7-go.patch



Other differences:
--
++ go1.6.spec ++
--- /var/tmp/diff_new_pack.YKibBw/_old  2017-10-17 01:54:01.534197820 +0200
+++ /var/tmp/diff_new_pack.YKibBw/_new  2017-10-17 01:54:01.534197820 +0200
@@ -89,7 +89,9 @@
 # PATCH-FIX-OPENSUSE fix_certificates_lookup.patch fcaste...@suse.com -- this 
patch forces Go to look for certificates only in the openSUSE/SLE locations. It 
also fixes certificate loading on SLE11, see 
https://github.com/golang/go/issues/6391
 # PATCH-FIX-SUSE fix_certificates_lookup.patch fcaste...@suse.com -- this 
patch forces Go to look for certificates only in the openSUSE/SLE locations. It 
also fixes certificate loading on SLE11, see 
https://github.com/golang/go/issues/6391
 Patch7: fix_certificates_lookup.patch
-# PATCH-FIX-UPSTREAM marguer...@opensuse.org - find /usr/bin/go-5 when 
bootstrapping with gcc5-go
+# PATCH-FIX-UPSTREAM marguer...@opensuse.org - find /usr/bin/go-7 when 
bootstrapping with gcc7-go
+Patch8: gcc7-go.patch
+# PATCH-FIX-UPSTREAM marguer...@opensuse.org - find /usr/bin/go-6 when 
bootstrapping with gcc6-go
 Patch9: gcc6-go.patch
 # PATCH-FIX-OPENSUSE: Bump _MaxGomaxprocs to a larger number for NUMA machines.
 Patch10:runtime-bump-MaxGomaxprocs.patch
@@ -100,10 +102,16 @@
 Patch12:fix-race-condition-bsc-1048899.diff
 # PATCH-FIX-UPSTREAM net/smtp: fix PlainAuth to refuse to send passwords to 
non-TLS servers
 Patch13:
net-smtp-fix-PlainAuth-to-refuse-to-send-passwords-to-non-TLS-servers.patch
+# PATCH-FIX-UPSTREAM cmd/go: reject update of VCS inside VCS
+Patch14:cmd-go-reject-update-of-VCS-inside-VCS.patch
 BuildRoot:  %{_tmppath}/%{name}-%{version}-build
 # boostrap
 %if %{with_gccgo}
+%if 0%{?suse_version} >= 1330
+BuildRequires:  gcc7-go
+%else
 BuildRequires:  gcc6-go
+%endif
 %else
 BuildRequires:  go1.4
 %endif
@@ -162,12 +170,17 @@
 %endif
 %patch7 -p1
 %if %{with_gccgo}
+%if 0%{?suse_version} >= 1330
+%patch8 -p1
+%else
 %patch9 -p1
 %endif
+%endif
 %patch10 -p1
 %patch11 -p1
 %patch12 -p1
 %patch13 -p1
+%patch14 -p1
 cp %{SOURCE4} .
 
 # setup go_arch (BSD-like scheme)

++ cmd-go-reject-update-of-VCS-inside-VCS.patch ++
>From a4544a0f8af001d1fb6df0e70750f570ec49ccf9 Mon Sep 17 00:00:00 2001
From: Russ Cox 
Date: Fri, 22 Sep 2017 12:17:21 -0400
Subject: [PATCH] [release-branch.go1.8] cmd/go: reject update of VCS inside
 VCS

Cherry-pick of CL 68110.

Change-Id: Iae84c6404ab5eeb6950faa2364f97a017c67c506
Reviewed-on: https://go-review.googlesource.com/68190
Run-TryBot: Russ Cox 
Reviewed-by: Chris Broadfoot 
---
 src/cmd/go/get.go |  5 +
 src/cmd/go/go_test.go | 19 +
 src/cmd/go/vcs.go | 58 ++-
 3 files changed, 81 insertions(+), 1 deletion(-)

Index: go/src/cmd/go/get.go
===
--- go.orig/src/cmd/go/get.go
+++ go/src/cmd/go/get.go
@@ -45,7 +45,7 @@ missing packages but does not use it to
 
 Get also accepts build flags to control the installation. See 'go help build'.
 
-When checking out a new package, get creates the target directory 
+When checking out a new package, get creates the target directory
 GOPATH/src/. If the GOPATH contains multiple entries,
 get uses the first one. See 'go help gopath'.
 
@@ -412,6 +412,11 @@ func downloadPackage(p *Package) error {
p.build.PkgRoot = filepath.Join(list[0], "pkg")
}
root := filepath.Join(p.build.SrcRoot, rootPath)
+
+   if err := checkNestedVCS(vcs, root, p.build.SrcRoot); 

commit go1.6 for openSUSE:Factory

2017-10-09 Thread root
Hello community,

here is the log from the commit of package go1.6 for openSUSE:Factory checked 
in at 2017-10-09 19:47:38

Comparing /work/SRC/openSUSE:Factory/go1.6 (Old)
 and  /work/SRC/openSUSE:Factory/.go1.6.new (New)


Package is "go1.6"

Mon Oct  9 19:47:38 2017 rev:2 rq:532733 version:1.6.4

Changes:

--- /work/SRC/openSUSE:Factory/go1.6/go1.6.changes  2017-09-15 
22:31:51.994772576 +0200
+++ /work/SRC/openSUSE:Factory/.go1.6.new/go1.6.changes 2017-10-09 
19:48:54.537770131 +0200
@@ -1,0 +2,8 @@
+Mon Oct  9 08:39:22 UTC 2017 - th...@suse.de
+
+- Add patch to fix PlainAuth to refuse to send passwords to non-TLS servers
+  (CVE-2017-15042).
+  bsc#1062087
+  + net-smtp-fix-PlainAuth-to-refuse-to-send-passwords-to-non-TLS-servers.patch
+
+---

New:

  net-smtp-fix-PlainAuth-to-refuse-to-send-passwords-to-non-TLS-servers.patch



Other differences:
--
++ go1.6.spec ++
--- /var/tmp/diff_new_pack.M31a0G/_old  2017-10-09 19:48:55.589723897 +0200
+++ /var/tmp/diff_new_pack.M31a0G/_new  2017-10-09 19:48:55.593723721 +0200
@@ -1,7 +1,7 @@
 #
-# spec file for package go
+# spec file for package go1.6
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -98,6 +98,8 @@
 # PATCH-FIX_UPSTREAM fix race condition 
https://go-review.googlesource.com/c/34835/6
 # fixes bsc#1048899
 Patch12:fix-race-condition-bsc-1048899.diff
+# PATCH-FIX-UPSTREAM net/smtp: fix PlainAuth to refuse to send passwords to 
non-TLS servers
+Patch13:
net-smtp-fix-PlainAuth-to-refuse-to-send-passwords-to-non-TLS-servers.patch
 BuildRoot:  %{_tmppath}/%{name}-%{version}-build
 # boostrap
 %if %{with_gccgo}
@@ -165,6 +167,7 @@
 %patch10 -p1
 %patch11 -p1
 %patch12 -p1
+%patch13 -p1
 cp %{SOURCE4} .
 
 # setup go_arch (BSD-like scheme)

++ 
net-smtp-fix-PlainAuth-to-refuse-to-send-passwords-to-non-TLS-servers.patch 
++
>From 4be3fc33ef512532b916aa14258087e89eb47347 Mon Sep 17 00:00:00 2001
From: Russ Cox 
Date: Wed, 4 Oct 2017 13:24:49 -0400
Subject: [PATCH] [release-branch.go1.8] net/smtp: fix PlainAuth to refuse to
 send passwords to non-TLS servers

PlainAuth originally refused to send passwords to non-TLS servers
and was documented as such.

In 2013, issue #5184 was filed objecting to the TLS requirement,
despite the fact that it is spelled out clearly in RFC 4954.
The only possibly legitimate use case raised was using PLAIN auth
for connections to localhost, and the suggested fix was to let the
server decide: if it advertises that PLAIN auth is OK, believe it.
That approach was adopted in CL 8279043 and released in Go 1.1.

Unfortunately, this is exactly wrong. The whole point of the TLS
requirement is to make sure not to send the password to the wrong
server or to a man-in-the-middle. Instead of implementing this rule,
CL 8279043 blindly trusts the server, so that if a man-in-the-middle
says "it's OK, you can send me your password," PlainAuth does.
And the documentation was not updated to reflect any of this.

This CL restores the original TLS check, as required by RFC 4954
and as promised in the documentation for PlainAuth.
It then carves out a documented exception for connections made
to localhost (defined as "localhost", "127.0.0.1", or "::1").

Cherry-pick of CL 68170.

Change-Id: I1d3729bbd33aa2f11a03f4c000e6bb473164957b
Reviewed-on: https://go-review.googlesource.com/68023
Run-TryBot: Russ Cox 
Reviewed-by: Chris Broadfoot 
---
 src/net/smtp/auth.go  | 33 ++---
 src/net/smtp/smtp_test.go | 32 ++--
 2 files changed, 40 insertions(+), 25 deletions(-)

diff --git a/src/net/smtp/auth.go b/src/net/smtp/auth.go
index 3f1339ebc56..fd1a472f930 100644
--- a/src/net/smtp/auth.go
+++ b/src/net/smtp/auth.go
@@ -44,26 +44,29 @@ type plainAuth struct {
 }
 
 // PlainAuth returns an Auth that implements the PLAIN authentication
-// mechanism as defined in RFC 4616.
-// The returned Auth uses the given username and password to authenticate
-// on TLS connections to host and act as identity. Usually identity will be
-// left blank to act as username.
+// mechanism as defined in RFC 4616. The returned Auth uses the given
+// username and password to authenticate to host and act as identity.
+// Usually identity should be the empty string, to act as username.
+//
+// PlainAuth will only send the credentials if the connection is using TLS
+// or is connected to localhost.