We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug 目前已知可以通过更改 argv 字符串来达到更改目的的 os kernel 有 linux, darwin, solaris/illumos, openbsd(尚未测试),且都保证 argv 和 environ 连续,且可以在 argv 长度不足的情况下继续写入 environ 的内存来展示更多 cmdline 字符串 但问题是,如果 argv + environ 长度大于 4096 且确实写了这么多,os 的行为是什么呢? omnios 在写了 4096 个以上的字符串时,只会展示 4095 个(排除 null),Linux 则是 4096 个,目前尚未测试 macos ,但当前 max_len() 方法只是简单地把 argv 和 environ 长度相加而没考虑 kernel 行为
To Reproduce Steps to reproduce the behavior:
new()
set("a".repeat(6144).as_bytes())
Expected behavior 根据 os 行为限制 max_len() 长度
Additional context 可能要考虑 argv 长度大于 4096 时不触碰 environ,如此长的 argv 对于大部分更改 cmdline 的需求绰绰有余,同时写入 environ 会导致 Linux 把 cmdline 固定为不允许插入 null 的 4096 字节,导致这种情况下写入 environ 没有意义
The text was updated successfully, but these errors were encountered:
refactor: eliminate duplicate code
4677a4f
Prepare to resolve issue #5 see: #5
unknowndevQwQ
No branches or pull requests
Describe the bug
目前已知可以通过更改 argv 字符串来达到更改目的的 os kernel 有 linux, darwin, solaris/illumos, openbsd(尚未测试),且都保证 argv 和 environ 连续,且可以在 argv 长度不足的情况下继续写入 environ 的内存来展示更多 cmdline 字符串
但问题是,如果 argv + environ 长度大于 4096 且确实写了这么多,os 的行为是什么呢?
omnios 在写了 4096 个以上的字符串时,只会展示 4095 个(排除 null),Linux 则是 4096 个
,目前尚未测试 macos,但当前 max_len() 方法只是简单地把 argv 和 environ 长度相加而没考虑 kernel 行为To Reproduce
Steps to reproduce the behavior:
new()
set("a".repeat(6144).as_bytes())
Expected behavior
根据 os 行为限制 max_len() 长度
Additional context
可能要考虑 argv 长度大于 4096 时不触碰 environ,如此长的 argv 对于大部分更改 cmdline 的需求绰绰有余,同时写入 environ 会导致 Linux 把 cmdline 固定为不允许插入 null 的 4096 字节,导致这种情况下写入 environ 没有意义
The text was updated successfully, but these errors were encountered: