go/go-1.5-install-dont-reinstall-stdlibs.patch
Thomas Boerger c7282e4f72 Accepting request 431323 from home:jordimassaguerpla:branch:d:l:g:update_go_1_7
- update to go1.7.0 (bsc#996303)
  Most of its changes are in the implementation of the toolchain,
  runtime, and libraries. There is one minor change to the language
  specification.
  The release adds a port to IBM LinuxOne; updates the x86-64 compiler
  back end to generate more efficient code; includes the context package,
  promoted from the x/net subrepository and now used in the standard
  library; and adds support in the testing package for creating
  hierarchies of tests and benchmarks. The release also finalizes
  the vendoring support started in Go 1.5, making it a standard feature. 
  more at: https://golang.org/doc/go1.7
  Review patches: 
    - armv6l.patch
    - fix_certificates_lookup.patch,
    - go-1.5-install-dont-reinstall-stdlibs.patch
    - gcc5-go.patch

OBS-URL: https://build.opensuse.org/request/show/431323
OBS-URL: https://build.opensuse.org/package/show/devel:languages:go/go?expand=0&rev=270
2016-10-07 10:13:54 +00:00

19 lines
581 B
Diff

diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go
index 07aa3ff..3f4836b 100644
--- a/src/cmd/go/pkg.go
+++ b/src/cmd/go/pkg.go
@@ -1457,6 +1457,13 @@ func isStale(p *Package) (bool, string) {
return false, "standard package in Go release distribution"
}
+ // openSUSE bnc#776058
+ // Only root user can reinstall a std library from a dependancy, all other
+ // users should *never* have to do this.
+ if os.Getuid() != 0 && p.Standard {
+ return false, "only root can reinstall a std library from a dependency"
+ }
+
// Time-based staleness.
built := fi.ModTime()