You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
shadow-utils write locks with NUL-terminated contents while uutils/shadow does not. #399
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.
Thanks @cqjjjzr, confirmed on Ubuntu 26.04: vipw, vigr and useradd all write the pid followed by a NUL, and our parser deleted such a live lock as stale. Fixed in #427, which writes the same bytes and reads both forms; you are credited in the commit.
Activity
pierre-warnier commentedon Dec 5, 2026
Thanks @cqjjjzr, confirmed on Ubuntu 26.04: vipw, vigr and useradd all write the pid followed by a NUL, and our parser deleted such a live lock as stale. Fixed in #427, which writes the same bytes and reads both forms; you are credited in the commit.
cqjjjzr commentedon Dec 5, 2026
@pierre-warnier Thank you very much for working on this!