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

Bugfix: Missing equals sign in the useradd command. #1086

Merged
merged 1 commit into from
Oct 5, 2024

Conversation

kugarocks
Copy link
Contributor

@kugarocks kugarocks commented Oct 3, 2024

When I run useradd -D -s /bin/bash, the content of /etc/default/useradd file is missing the equals sign.

GROUP1000
GROUPS
HOME/home
INACTIVE-1
EXPIRE
SKEL/etc/skel
USRSKEL/usr/etc/skel
CREATE_MAIL_SPOOLyes
LOG_INITyes

I think the reason is that the definition of the constant changed on July 9, 2024.

d91b22cc2f6d99a7607e7844f91703651578394d

#define DGROUP		"GROUP="
#define DGROUPS		"GROUPS="
#define DHOME		"HOME="

a7b169be18625ddb6a46a78aad8a2421e3b051f9

#define DGROUP		"GROUP"
#define DGROUPS		"GROUPS"
#define DHOME		"HOME"

But the code below has not been updated accordingly.

skip:
/*
 * Check each line to insure that every line was output. This
 * causes new values to be added to a file which did not previously
 * have an entry for that value.
 */
if (!out_group)
	fprintf (ofp, DGROUP "%u\n", (unsigned int) def_group);
if (!out_groups)
	fprintf (ofp, DGROUPS "%s\n", def_groups);
if (!out_home)
	fprintf (ofp, DHOME "%s\n", def_home);

The code has been tested on Ubuntu 22.04 (Kernel 6.10.11). Please review my code when you are free. Thank you.
@alejandro-colomar

@alejandro-colomar
Copy link
Collaborator

alejandro-colomar commented Oct 3, 2024

Thank you very much! That was my mistake.
Please add:

Fixes: a7b169be1862 ("src/useradd.c: Use stpsep() to simplify")
Reviewed-by: Alejandro Colomar <alx@kernel.org>

To the commit message.

@kugarocks
Copy link
Contributor Author

Thank you very much! That was my mistake. Please add:

Fixes: a7b169be1862 ("src/useradd.c: Use stpsep() to simplify")
Reviewed-by: Alejandro Colomar <alx@kernel.org>

To the commit message.

I have added the commit message, thanks.

@alejandro-colomar
Copy link
Collaborator

Please add src/useradd.c: to the commit message, to clarify to which program it applies.

I'll let @hallyn merge this.

Fixes: a7b169b ("src/useradd.c: Use stpsep() to simplify")
Reviewed-by: Alejandro Colomar <alx@kernel.org>
@kugarocks
Copy link
Contributor Author

Please add src/useradd.c: to the commit message, to clarify to which program it applies.

I'll let @hallyn merge this.

Done.

@hallyn
Copy link
Member

hallyn commented Oct 5, 2024

Thanks

@hallyn hallyn merged commit 6c9e801 into shadow-maint:master Oct 5, 2024
9 checks passed
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 this pull request may close these issues.

3 participants