Bugfix: useradd: fix btrfs subvolume home creation#1617
Merged
alejandro-colomar merged 1 commit intoshadow-maint:masterfrom Apr 28, 2026
Merged
Bugfix: useradd: fix btrfs subvolume home creation#1617alejandro-colomar merged 1 commit intoshadow-maint:masterfrom
alejandro-colomar merged 1 commit intoshadow-maint:masterfrom
Conversation
Contributor
Author
0985b06 to
a7f67f8
Compare
45ba5b3 to
6fe1f17
Compare
Collaborator
|
CI seems to be consistently failing some test. Could you please check why? Cc: @ikerexxe |
Collaborator
I think this is the relevant part of the log: 2026-04-28T11:36:21.4888039Z ##[group]Run set -e
2026-04-28T11:36:21.4888283Z �[36;1mset -e�[0m
2026-04-28T11:36:21.4888453Z �[36;1mcd tests�[0m
2026-04-28T11:36:21.4888640Z �[36;1mtrap 'cat testsuite.log' ERR�[0m
2026-04-28T11:36:21.4888877Z �[36;1msudo ./run_some�[0m
2026-04-28T11:36:21.4889073Z �[36;1mtrap - ERR�[0m
2026-04-28T11:36:21.4932368Z shell: /usr/bin/script -q -e -c "bash {0}"
2026-04-28T11:36:21.4932644Z ##[endgroup]
2026-04-28T11:36:21.5270783Z +: test passed
2026-04-28T11:36:21.5271211Z -: test failed
2026-04-28T11:36:49.2061345Z .+-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2026-04-28T11:36:49.2061933Z 75 test(s) passed
2026-04-28T11:36:49.2062237Z 1 test(s) failed
2026-04-28T11:36:49.2062542Z log written in 'testsuite.log'
2026-04-28T11:36:49.2062908Z the following tests failed:
2026-04-28T11:36:49.2063248Z ./su/01/su_root.test
2026-04-28T11:36:49.2084657Z
2026-04-28T11:36:49.2085118Z ###############################################################################
2026-04-28T11:36:49.2085883Z #
2026-04-28T11:36:49.2086171Z # Test: ./su/01/su_user.test
2026-04-28T11:36:49.2086518Z #
2026-04-28T11:36:49.2086860Z ###############################################################################
2026-04-28T11:36:49.2092574Z #
2026-04-28T11:36:49.2093076Z # Rationale: su can be used to switch to a non-root user
2026-04-28T11:36:49.2093640Z #
2026-04-28T11:36:49.2094014Z ###############################################################################
2026-04-28T11:36:49.2094721Z # switch to the passwordless 'testsuite' user
2026-04-28T11:36:49.2095354Z # and expect a '$ ' prompt
2026-04-28T11:36:49.2095833Z spawn /bin/su testsuite
2026-04-28T11:36:49.2096082Z
2026-04-28T11:36:49.2096089Z
2026-04-28T11:36:49.2096219Z FAIL (timeout)
2026-04-28T11:36:49.2096620Z ###############################################################################
2026-04-28T11:36:49.2097674Z #
2026-04-28T11:36:49.2098525Z # Status of test ./su/01/su_user.test: FAILURE
2026-04-28T11:36:49.2099111Z #
2026-04-28T11:36:49.2099537Z ###############################################################################
2026-04-28T11:36:49.2100033Z
2026-04-28T11:36:49.2100234Z ###############################################################################
2026-04-28T11:36:49.2100740Z #
2026-04-28T11:36:49.2100982Z # Test: ./su/01/su_user.test
2026-04-28T11:36:49.2101289Z #
2026-04-28T11:36:49.2101576Z ###############################################################################
2026-04-28T11:36:49.2101991Z #
2026-04-28T11:36:49.2102313Z # Rationale: su can be used to switch to a non-root user
2026-04-28T11:36:49.2102761Z #
2026-04-28T11:36:49.2103049Z ###############################################################################
2026-04-28T11:36:49.2103533Z # switch to the passwordless 'testsuite' user
2026-04-28T11:36:49.2103962Z # and expect a '$ ' prompt
2026-04-28T11:36:49.2104294Z spawn /bin/su testsuite
2026-04-28T11:36:49.2104499Z
2026-04-28T11:36:49.2104661Z groups: cannot find name for group ID 424243
2026-04-28T11:36:49.2104962Z
2026-04-28T11:36:49.2105239Z testsuite@runnervmrc6n4:~/runner/work/shadow/shadow/tests/su/01$
2026-04-28T11:36:49.2105789Z # make sure we are now 'testsuite'
2026-04-28T11:36:49.2106285Z # id should return 'uid=424243(testsuite) gid=424243 groups=424243'
2026-04-28T11:36:49.2106694Z
2026-04-28T11:36:49.2106971Z testsuite@runnervmrc6n4:~/runner/work/shadow/shadow/tests/su/01$ id
2026-04-28T11:36:49.2107752Z
2026-04-28T11:36:49.2107911Z uid=424243(testsuite) gid=424243 groups=424243
2026-04-28T11:36:49.2108221Z
2026-04-28T11:36:49.2108491Z testsuite@runnervmrc6n4:~/runner/work/shadow/shadow/tests/su/01$
2026-04-28T11:36:49.2108909Z
2026-04-28T11:36:49.2109033Z # now switch to user 'myuser'
2026-04-28T11:36:49.2109478Z # and expect a password prompt
2026-04-28T11:36:49.2109735Z
2026-04-28T11:36:49.2110056Z testsuite@runnervmrc6n4:~/runner/work/shadow/shadow/tests/su/01$ su myuser
2026-04-28T11:36:49.2110589Z
2026-04-28T11:36:49.2110695Z Password:
2026-04-28T11:36:49.2111259Z # password 'myuserF00barbaz' sent
2026-04-28T11:36:49.2111536Z
2026-04-28T11:36:49.2111656Z # expect prompt '$ '
2026-04-28T11:36:49.2111852Z
2026-04-28T11:36:49.2112102Z myuser@runnervmrc6n4:~/runner/work/shadow/shadow/tests/su/01$
2026-04-28T11:36:49.2112507Z
2026-04-28T11:36:49.2112623Z # make sure we are 'myuser'
2026-04-28T11:36:49.2112992Z # id should return '(myuser).*(myuser).*(myuser)
2026-04-28T11:36:49.2113294Z
2026-04-28T11:36:49.2113552Z myuser@runnervmrc6n4:~/runner/work/shadow/shadow/tests/su/01$ id
2026-04-28T11:36:49.2113961Z
2026-04-28T11:36:49.2114166Z uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)
2026-04-28T11:36:49.2114401Z
2026-04-28T11:36:49.2114569Z myuser@runnervmrc6n4:~/runner/work/shadow/shadow/tests/su/01$ exit
2026-04-28T11:36:49.2114818Z
2026-04-28T11:36:49.2114873Z exit
2026-04-28T11:36:49.2114958Z |
dirname() replaces broken stpcpy index arithmetic that produced an empty string for single-component paths (e.g. /koolhome), causing statfs to fail and fall back to a regular directory. Use path in the error message since dirname() modifies btrfs_check in-place, making it unusable for logging after the call. Fixes: c1d36a8 (2019-05-04; "Add support for btrfs subvolumes for user homes") Signed-off-by: Hadi Chokr <hadichokr@icloud.com> Reviewed-by: Alejandro Colomar <alx@kernel.org>
alejandro-colomar
approved these changes
Apr 28, 2026
bd1ea38
into
shadow-maint:master
14 of 16 checks passed
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.
dirname() replaces broken stpcpy index arithmetic that produced an empty string for single-component paths, causing statfs to fail and fall back to a regular directory. Gate subvolume creation on user_id >= UID_MIN to exclude system users regardless of their home path.
Closes #1616