Skip to content
New issue

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

chfn -w "" fails #1210

Open
zeha opened this issue Feb 17, 2025 · 4 comments · May be fixed by #1212
Open

chfn -w "" fails #1210

zeha opened this issue Feb 17, 2025 · 4 comments · May be fixed by #1212

Comments

@zeha
Copy link
Contributor

zeha commented Feb 17, 2025

This was found by systemd tests, involving adduser.

However it seems like it ought to work?

# useradd test1
# /bin/chfn "-f" "foo" "-r" "" "test1"
# /bin/chfn -w "" "test1"
chfn: invalid name: ',,'

# getent passwd test1
test1:x:1001:1001:foo,,,:/home/test1:/bin/sh

Would be a regression from 4.16.

https://bugs.debian.org/1096187

@zeha
Copy link
Contributor Author

zeha commented Feb 17, 2025

git bisect points to commit 16cb664

@zeha
Copy link
Contributor Author

zeha commented Feb 17, 2025

git bisect points to commit 16cb664

Reverting just the chfn.c change from that commit seems to unbreak it.

@alejandro-colomar
Copy link
Collaborator

Ughhh. Thanks for the report! I'll try to have priority for this.

@alejandro-colomar

This comment has been minimized.

alejandro-colomar added a commit to alejandro-colomar/shadow that referenced this issue Feb 17, 2025
…s pattern"

This partially reverts commit 16cb664.

I'll try to reintroduce this change more carefully after investigation.
For now, let's revert to a known-good state.

Fixes: 16cb664 (2024-07-01; "lib/, src/: Use strsep(3) instead of its pattern")
Closes: <shadow-maint#1210>
Reported-by: Chris Hofstaedtler <[email protected]>
Suggested-by: Chris Hofstaedtler <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>
@alejandro-colomar alejandro-colomar linked a pull request Feb 17, 2025 that will close this issue
alejandro-colomar added a commit to alejandro-colomar/shadow that referenced this issue Feb 17, 2025
…s pattern"

This partially reverts commit 16cb664.

I'll try to reintroduce this change more carefully.
For now, let's revert to a known-good state.

The problem was due to accidentally ignoring the effects of the 'break'
on the 'cp' variable.

Fixes: 16cb664 (2024-07-01; "lib/, src/: Use strsep(3) instead of its pattern")
Closes: <shadow-maint#1210>
Link: <shadow-maint#1213>
Link: <shadow-maint#1212>
Reported-by: Chris Hofstaedtler <[email protected]>
Suggested-by: Chris Hofstaedtler <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>
alejandro-colomar added a commit to alejandro-colomar/shadow that referenced this issue Feb 18, 2025
…s pattern"

This partially reverts commit 16cb664.

I'll try to reintroduce this change more carefully.
For now, let's revert to a known-good state.

The problem was due to accidentally ignoring the effects of the 'break'
on the 'cp' variable.

Fixes: 16cb664 (2024-07-01; "lib/, src/: Use strsep(3) instead of its pattern")
Closes: <shadow-maint#1210>
Link: <shadow-maint#1213>
Link: <shadow-maint#1212>
Reported-by: Chris Hofstaedtler <[email protected]>
Suggested-by: Chris Hofstaedtler <[email protected]>
Tested-by: Chris Hofstaedtler <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants