shadow-utils write locks with NUL-terminated contents while uutils/shadow does not.
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
The report points to shadow-utils' lib/commonio.c and describes lock parsing in uutils/shadow, but names no uutils file or test. Start by tracing lock creation and stale-lock parsing in uu_shadow_core, then look for lock tests. Done when a lock written with a NUL-terminated PID is handled without deleting a lock that is still held.
由索引模型根据 Issue 内容生成。
描述
stprintf_a(buf, "%lu", (unsigned long) pid);
len = (ssize_t) strlen (buf) + 1;
if (write_full(fd, buf, len) == -1) {
and with shadow-utils + strace I got:
write(5<.../etc/subuid.633201>, "633201\0", 7) = 7
write(6<.../etc/subgid.633201>, "633201\0", 7) = 7
while uutils/shadow doesn't.
This itself does not pose a compatibility issue since users are not expected to have both running on the same system live. However, there maybe edge cases (e.g. switching between the two). Additionally, I ran into this because I was trying to reuse uutils's uu_shadow_core in another small util of mine to handle locking.
This may cause the following:
- shadow-utils holds a lock containing 633201\0.
- uutils’
trim().parse::<i32>()rejects the NUL. - uutils interprets the parse failure as a stale lock and deletes it.
- uutils can then acquire the lock while shadow-utils is still working, breaking mutual exclusion.
A PR is possible if you decided this to be fixed.
- 主要语言
- Rust
- 星标
- 20
- 派生
- 10
- 平均合并
- 22 小时 17 分钟
- 30 天内合并 PR
- 37
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
uutils/shadow 的其他 Issue
-
chfn: writes five GECOS fields, GNU writes four when "other" is empty可能已有人在做 @pierre-warnier 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
-
chage -E, usermod -e: dates other than YYYY-MM-DD are rejected可能已有人在做 @pierre-warnier 于 4 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 62/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 20/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
pop-os/cosmic-applets#1619 ·
维护者通常 3 天内回复
-
binding:python bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
coollabsio/orbit#72 ·
维护者通常 1 天内回复
-
swc_common: Mark::least_ancestor never returns when the answer is the root mark (ANT-2026-JYDQGGRT)未关闭
难度 2/5 1-3 小时 新手友好度 72/100
swc-project/swc-ai-issues#137 ·
-
Synth suite fails unless run from the repo root: signal_flow's default machine path is cwd-relative未关闭bug
难度 2/5 1-3 小时 新手友好度 80/100
Nimblesite/osprey#370 ·
维护者通常 1 天内回复