Skip to content

Support UTF-8 and space characters in cibsecret#4118

Open
clumens wants to merge 6 commits into
ClusterLabs:mainfrom
clumens:cibsecret-utf8
Open

Support UTF-8 and space characters in cibsecret#4118
clumens wants to merge 6 commits into
ClusterLabs:mainfrom
clumens:cibsecret-utf8

Conversation

@clumens
Copy link
Copy Markdown
Contributor

@clumens clumens commented May 29, 2026

No description provided.

clumens added 6 commits May 28, 2026 15:04
We need to set LC_ALL before calling g_option_context_parse_strv so glib
knows how to handle UTF-8 parameters.  Otherwise, we'll get an invalid
byte sequence error.  This is not surrounded by #ifdef ENABLE_NLS since
it should be safe to do anyway.

Really, we should probably be doing this early in every command line
tool.  If NLS is enabled, we'll do this in crm_log_preinit but that's
too late - that function gets called by crm_log_init, which is called by
pcmk__cli_init_logging, which is typically called after command line
parameters are parsed (because we need to know how many -Vs were given).

Thus, it needs to be done separately and earlier.  However in the
interests of not introducing too many changes this late in a release,
I'm only making this change to the one tool that has a bug filed against
it.

This only started being a problem once cibsecret was rewritten in C.

Fixes RHEL-178864
Because cibsecret calls crm_resource in various places, it also needs to
call setlocale.  It's unclear to me why this needs to be done now
instead of always.  I don't see anything that's changed in crm_resource,
and the old bash-based cibsecret also called crm_resource.

Still, this should be safe to call from this tool as well.
When cibsecret was written in shell, it was quoting command line
arguments like this.  I'm not certain it's all strictly necessary (for
instance, are characters that would need to be quoted valid in resource
IDs?) it's best to follow what we were previously doing and be safe.

At the least, it's possible for the values of secrets to have spaces in
them which would require quoting.
@clumens clumens requested a review from nrwahl2 May 29, 2026 15:25
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.

1 participant