public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Schaffner, Tobias" <tobias.schaffner@siemens.com>
To: "MOESSBAUER, FELIX JONATHAN" <felix.moessbauer@siemens.com>,
	"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Subject: Re: [PATCH v2 1/2] fix group splitting in user creation
Date: Tue, 1 Aug 2023 07:21:58 +0000	[thread overview]
Message-ID: <378abcac-2f86-f586-a3f4-4ca7c8f0e06f@siemens.com> (raw)
In-Reply-To: <20230727032415.3366650-1-felix.moessbauer@siemens.com>

On 27.07.23 05:24, MOESSBAUER, Felix (T CED INW-CN) wrote:
> There is a bug when converting the USER_<foo>[groups] configuration
> from the bitbake format (space separated) to the format useradd
> expects (comma separated). We cannot simply replace spaces with commas,
> as then multiple spaces in a row would create multiple commas. Instead,
> we need to split it first into the tokens and then join these tokens by
> comma.
> 
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
>   meta/classes/image-account-extension.bbclass | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/classes/image-account-extension.bbclass b/meta/classes/image-account-extension.bbclass
> index e783c135..6f67f459 100644
> --- a/meta/classes/image-account-extension.bbclass
> +++ b/meta/classes/image-account-extension.bbclass
> @@ -98,10 +98,10 @@ def image_create_users(d: "DataSmart") -> None:
>           add_user_option("--comment", "comment")
>           add_user_option("--shell", "shell")
>   
> -        groups = d.getVarFlag(user_entry, "groups") or ""
> +        groups = (d.getVarFlag(user_entry, "groups") or "").split()
>           if groups:
>               args.append("--groups")
> -            args.append(groups.replace(' ', ','))
> +            args.append(','.join(groups))
>   
>           flags = (d.getVarFlag(user_entry, "flags") or "").split()
>   

Acked-by: Tobias Schaffner <tobias.schaffner@siemens.com>

  parent reply	other threads:[~2023-08-01  7:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27  3:24 Felix Moessbauer
2023-07-27  3:24 ` [PATCH v2 2/2] add unit test for user creation with groups Felix Moessbauer
2023-08-01  7:21 ` Schaffner, Tobias [this message]
2023-08-02 21:31 ` [PATCH v2 1/2] fix group splitting in user creation Uladzimir Bely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=378abcac-2f86-f586-a3f4-4ca7c8f0e06f@siemens.com \
    --to=tobias.schaffner@siemens.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox