Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我想在cdk tools模块添加网络连接的功能,发现编译的时候原来的某个模块报错 #96

Open
homelanmder opened this issue May 1, 2024 · 2 comments

Comments

@homelanmder
Copy link
Contributor

github.com/cdk-team/CDK/pkg/util

....\pkg\util\cgroup.go:174:19: undefined: unix.Utsname
....\pkg\util\cgroup.go:175:14: undefined: unix.Uname
....\pkg\util\file_io.go:72:32: undefined: syscall.Stat_t

github.com/cdk-team/CDK/pkg/exploit

....\pkg\exploit\rewrite_cgroup_devices.go:49:38: undefined: syscall.Stat_t
....\pkg\exploit\rewrite_cgroup_devices.go:147:18: undefined: syscall.Mknod

@neargle
Copy link
Member

neargle commented May 1, 2024

github.com/cdk-team/CDK/pkg/util

....\pkg\util\cgroup.go:174:19: undefined: unix.Utsname ....\pkg\util\cgroup.go:175:14: undefined: unix.Uname ....\pkg\util\file_io.go:72:32: undefined: syscall.Stat_t

github.com/cdk-team/CDK/pkg/exploit

....\pkg\exploit\rewrite_cgroup_devices.go:49:38: undefined: syscall.Stat_t ....\pkg\exploit\rewrite_cgroup_devices.go:147:18: undefined: syscall.Mknod

看起来,我猜测你的研发环境是 windows,这个两个函数在 windows 是不支持的,因为 syscall 和 unix 的包在 linux 上用的比较多。你可以使用交叉编译设定编译包为 linux,因为 cdk 是纯 golang 的,所以这个很方便。

https://www.topgoer.com/%E5%85%B6%E4%BB%96/%E8%B7%A8%E5%B9%B3%E5%8F%B0%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91.html

@neargle
Copy link
Member

neargle commented May 1, 2024

写完了欢迎 pr 上来让社区评审哈。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants