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

Fix to have bulleye accept usernames with underscore (Closes #678) #679

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

narc-Ontakac2
Copy link
Collaborator

I am still trying to get piuparts to run to test if this actually fixes the issue.

@narc-Ontakac2 narc-Ontakac2 changed the title Fix to have bulleye accept usernames with underscore Fix to have bulleye accept usernames with underscore (Closes #678) Oct 7, 2024
@@ -12,7 +18,7 @@ case "$1" in
groupmod --new-name _vzlogger vzlogger
fi
if ! id _vzlogger > /dev/null 2>&1 ; then
adduser --quiet --system --no-create-home --home /nonexistent \
adduser --quiet --system "$FORCE" --no-create-home --home /nonexistent \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(unlike in most other cases) you must not quote $FORCE here, the empty string would not be a valid parameter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(i prefer to use bash arrays for dynamically built commands, allowing to append argv entries conditionally, and executing via "${array[@]}", but for this simple case, unquoted expansion should do.)

@@ -2,8 +2,14 @@

set -e

ADDUSER_VER=$(dpkg-query --showformat='${Version}' --show adduser)
if dpkg --compare-versions "$ADDUSER_VER" lt 3.131; then
FORCE=" --force-badname "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be cleaner to provide a default value, $FORCE might exist in the environment already?

Copy link
Contributor

@r00t- r00t- Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, the space as part of the variable vaue is pointless.

@r00t-
Copy link
Contributor

r00t- commented Oct 9, 2024

see comments.
the general approach seems fine.
(it's fun how the adduser version check solves both the underscore bug and the option depreciation)

@narc-Ontakac2 narc-Ontakac2 merged commit b936b96 into volkszaehler:master Oct 10, 2024
2 checks passed
@narc-Ontakac2
Copy link
Collaborator Author

I could not get piuparts to work withour coudsmith repo, so I'll do a release without testing a bullseye install.

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.

2 participants