Repository navigation
2.0.0: error-contract fixes, callback bugs, non-root import - #30
Merged
Merged
Conversation
Breaking: spawnWrapper now returns Error|null (was stderr/true) and fires the
callback at most once; removeUser/addUserToGroup pass Error|null instead of the
raw exit code. addUser/addGroup propagate errors and no longer call back twice.
addSSHtoUser no longer crashes on a missing user and uses spawn (no shell exec)
to avoid homedir injection. getExpiration returns the error instead of throwing
and parses chage output under the C locale. setPassword reports non-zero exits.
build_user_command no longer injects null argv. getUsers/getGroups no longer
drop the last record without a trailing newline. promise() no longer hangs on
the synchronous validateUsername.
Added: require('linux-user/non-root') read-only subset (no root warning), read-
only promise set (promise.nonRoot()), and optional spawn timeout support.
Types: selinux_user -> string, other_args -> string|string[], plus nonRoot and
promise typings.
Tests now auto-skip root-dependent cases when not running as root.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bug-fix + feature release. Breaking error-contract change, plus a new read-only (non-root) import path. Bumps version to
2.0.0.Breaking
spawnWrappernow returnsError | null(wasstderr/true) and fires the callback at most once.removeUser/addUserToGrouppassError | nullinstead of the raw numeric exit code.addUser/addGrouppropagate errors and no longer invoke the callback a second time.Fixed
addUserno longer swallows theuseradderror or double-calls its callback.addSSHtoUserno longer crashes (Cannot read properties of null) on a missing user; usesspawnwith arg arrays instead of a shellexecstring, removing homedir injection risk.getExpirationreturns the error instead of throwing whenchagefails; parses under theClocale and is not index/order-dependent.setPasswordreports a non-zero exit instead of silently succeeding.build_user_commandno longer injectsnullargv entries.getUsers/getGroupsno longer drop the last record when the file has no trailing newline.promise()no longer hangs on the synchronousvalidateUsername.Added
require('linux-user/non-root')— read-only subset that does not require root and emits no root warning. Also available asrequire('linux-user').nonRoot.promise.nonRoot().opts.timeout).selinux_user→string,other_args→string | string[], plusnonRoot/promise typings.Tests
npm run lintclean.See
CHANGELOG.mdfor the full list.🤖 Generated with Claude Code