英文:
go get golang package and run a script automatically
问题
当我们发布Python包时,我们使用pip,它会触发setup.py来构建一些必要的包。
我正在发布一个Golang包,我希望当我的用户获取我的包时,在安装之前能自动触发一个makefile(一些准备环境的脚本)。这种情况是否可能?
英文:
when we publish python package, we use pip, which will trigger setup.py to build some necessary packages.
I'm publishing a golang package, I wish when my user gets my package, it will auto trigger a makefile (some scripts to prepare environment) before installation. Is it possible?
答案1
得分: 2
当我的用户收到我的软件包时,我希望在安装之前能自动触发一个makefile(一些脚本)。
这将允许你在我执行一些看似无害的go get github.com/yiw/totallyharmless
时,在我的机器上执行任意命令。
我希望这是不可能的。过去曾发生过类似情况(通过巧妙的cgo技巧),但已经修复,因为这是一个重大的安全问题。
英文:
> I wish when my user get my package, it will auto trigger an makefile (some scirpts) before installation.
That would allow you to execute arbitrary commands on my machine while I do some innocent looking go get github.com/yiw/totallyharmless
because I want to use that package.
> Is it possible?
I hope not. This happened in the past (through clever cgo stuff) and was fixed as this is a major security issue.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论