If you aren't in the golang group, you don't have write permission. Have you tried joining the group?
If it's trying to open runtime.a writable, it sounds like it tried to rebuild runtime.a. I dtraced both "go build" and "go install" and saw no instances of opening anything in GOROOT for writing.
On Fri, Feb 24, 2012 at 5:57 PM, dlin wrote:I just try to NOT join golang group.I know, if I join, the process will be successful.But, why general user can get the write permission to library?We have GOPATH. That's enough.If not, that will cause security hole.
Kyle Lemons於 2012年2月25日星期六UTC+8上午8時54分23秒寫道:If you aren't in the golang group, you don't have write permission. Have you tried joining the group?On Fri, Feb 24, 2012 at 4:40 PM, dlin wrote:
$pwd/var/abs/local/gocode-git/src/src/gocode$GOPATH=$PWD/../.. go installopen /opt/go/pkg/linux_amd64/runtime.a: permission deniedI think this problem will let Go's system runtime may be hack by general user.I'm runing ArchLinux system. And trying to make gocode-git package but failed.The go-hg package is installed Go as (root owner, golang group), so the file permission is:$ls -l /opt/go/pkg/linux_amd64/runtime.a-rw-rw-r-- 1 root golang 887736 Feb 25 07:52 /opt/go/pkg/linux_amd64/runtime.aI don't think it is required to build another 'golang' group and let it be written by general user, so I try to 'strace'.$GOPATH=$PWD/../.. strace go install.... # finally it show an error messagefutex(0x7f7b33469f48, FUTEX_WAIT, 0, {60, 0}open /opt/go/pkg/linux_amd64/runtime.a: permission denied
<unfinished ... exit status 1>If your system don't have such problem, could you tell me what's your owner & group id of the installed runtime.a.
If it's trying to open runtime.a writable, it sounds like it tried to rebuild runtime.a. I dtraced both "go build" and "go install" and saw no instances of opening anything in GOROOT for writing.
On Fri, Feb 24, 2012 at 5:57 PM, dlin wrote:I just try to NOT join golang group.I know, if I join, the process will be successful.But, why general user can get the write permission to library?We have GOPATH. That's enough.If not, that will cause security hole.
Kyle Lemons於 2012年2月25日星期六UTC+8上午8時54分23秒寫道:If you aren't in the golang group, you don't have write permission. Have you tried joining the group?On Fri, Feb 24, 2012 at 4:40 PM, dlin wrote:
$pwd/var/abs/local/gocode-git/src/src/gocode$GOPATH=$PWD/../.. go installopen /opt/go/pkg/linux_amd64/runtime.a: permission deniedI think this problem will let Go's system runtime may be hack by general user.I'm runing ArchLinux system. And trying to make gocode-git package but failed.The go-hg package is installed Go as (root owner, golang group), so the file permission is:$ls -l /opt/go/pkg/linux_amd64/runtime.a-rw-rw-r-- 1 root golang 887736 Feb 25 07:52 /opt/go/pkg/linux_amd64/runtime.aI don't think it is required to build another 'golang' group and let it be written by general user, so I try to 'strace'.$GOPATH=$PWD/../.. strace go install.... # finally it show an error messagefutex(0x7f7b33469f48, FUTEX_WAIT, 0, {60, 0}open /opt/go/pkg/linux_amd64/runtime.a: permission denied
<unfinished ... exit status 1>If your system don't have such problem, could you tell me what's your owner & group id of the installed runtime.a.
If it's trying to open runtime.a writable, it sounds like it tried to rebuild runtime.a. I dtraced both "go build" and "go install" and saw no instances of opening anything in GOROOT for writing.
I think 'go install' lack a function to install on $GOPATH if $GOROOT is not writable.In my case, 'go build' works fine, because it only write to local directory.
I had the same problem on Windows:
https://code.google.com/p/go/issues/detail?id=1739#c5
At the time, there were no binary packages for other systems. Perhaps
the new Linux/Mac binary packages are broken the same way?
Peter Harris
Were you previously using a packaged go installation from another vendor ?
Is your user permitted to write to /opt/go ?Were you previously using a packaged go installation from another vendor ?
However, unless you built your go installation in /opt/go, you may
have other problems
I suggest this
export GOROOT=$HOME/go
export GOROOT_FINAL=/opt/go
build go as normal
cp $HOME/go to $GOROOT_FINAL
then unset both variables, ensure /opt/go/bin is in your path.
Also, check out the build scripts in misc/ adg has done some work
creating scripts to build for various distributions that should
automate this work.
Cheers
Dave
I think he's saying that he thinks the binary package is broken. He doesn't want to build GO at all, he just wants to install it and have it magically work even as users who can't modify GOROOT (which is proscribed by the binary distro, I think).
2012/2/28 Kyle Lemons
That doesn't answer the question, but I use Archlinux, and I don't
have the problem. I can run ./all.bash, then set the whole Go tree to
read-only, then do other things.
Rémy.
Oh, I didn't see you were using Go packaged using your PKGBUILD. Yes
the Go tool may mishandle read-only trees. However, you should take
this into consideration when writing the packaging script and do the
appropriate "touch" so that mod times are correctly ordered after
packaging.
I also think the title of issue 3149 is incorrect and that the problem
is not with "outside current root" but with "read-only GOROOT".
Rémy.
Do you mean, if I touch all file packaged with the same timestamp will it solve this problem?