qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Konstantin Kostiuk <kkostiuk@redhat.com>,
	qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Subject: Re: [PULL 7/9] qga/commands-posix: qmp_guest_set_user_password: use ga_run_command helper
Date: Fri, 3 May 2024 08:45:34 +0200	[thread overview]
Message-ID: <0ea35d63-c6fa-4ad6-b1af-5c0dca2a3e80@redhat.com> (raw)
In-Reply-To: <20240501074340.19641-8-kkostiuk@redhat.com>

On 01/05/2024 09.43, Konstantin Kostiuk wrote:
> From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
> 
> There's no need to check for the existence of the "chpasswd", "pw"
> executables, as the exec() call will do that for us.
> 
> Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
> Link: https://lore.kernel.org/r/20240320161648.158226-8-andrey.drobyshev@virtuozzo.com
> Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
> ---
>   qga/commands-posix.c | 96 ++++++--------------------------------------
>   1 file changed, 13 insertions(+), 83 deletions(-)
> 
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index 9910957ff5..7a065c4085 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -2151,14 +2151,8 @@ void qmp_guest_set_user_password(const char *username,
>                                    Error **errp)
>   {
>       Error *local_err = NULL;
> -    char *passwd_path = NULL;
> -    pid_t pid;
> -    int status;
> -    int datafd[2] = { -1, -1 };
> -    char *rawpasswddata = NULL;
> +    g_autofree char *rawpasswddata = NULL;
>       size_t rawpasswdlen;
> -    char *chpasswddata = NULL;
> -    size_t chpasswdlen;
>   
>       rawpasswddata = (char *)qbase64_decode(password, -1, &rawpasswdlen, errp);
>       if (!rawpasswddata) {
> @@ -2169,95 +2163,31 @@ void qmp_guest_set_user_password(const char *username,
>   
>       if (strchr(rawpasswddata, '\n')) {
>           error_setg(errp, "forbidden characters in raw password");
> -        goto out;
> +        return;
>       }
>   
>       if (strchr(username, '\n') ||
>           strchr(username, ':')) {
>           error_setg(errp, "forbidden characters in username");
> -        goto out;
> +        return;
>       }
>   
>   #ifdef __FreeBSD__
> -    chpasswddata = g_strdup(rawpasswddata);
> -    passwd_path = g_find_program_in_path("pw");
> +    g_autofree char *chpasswdata = g_strdup(rawpasswddata);

  Hi!

This broke compilation on FreeBSD:

  https://gitlab.com/qemu-project/qemu/-/jobs/6760232764#L7125

Looks like a typo in the variable name?

  Thomas



  reply	other threads:[~2024-05-03  6:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-01  7:43 [PULL 0/9] QGA misc changes for 2024-05-01 Konstantin Kostiuk
2024-05-01  7:43 ` [PULL 1/9] qga: guest-get-fsinfo: add optional 'total-bytes-privileged' field Konstantin Kostiuk
2024-05-01  7:43 ` [PULL 2/9] qga: introduce ga_run_command() helper for guest cmd execution Konstantin Kostiuk
2024-05-01  7:43 ` [PULL 3/9] qga/commands-posix: qmp_guest_shutdown: use ga_run_command helper Konstantin Kostiuk
2024-05-01  7:43 ` [PULL 4/9] qga/commands-posix: qmp_guest_set_time: " Konstantin Kostiuk
2024-05-01  7:43 ` [PULL 5/9] qga/commands-posix: execute_fsfreeze_hook: " Konstantin Kostiuk
2024-05-01  7:43 ` [PULL 6/9] qga/commands-posix: don't do fork()/exec() when suspending via sysfs Konstantin Kostiuk
2024-05-01  7:43 ` [PULL 7/9] qga/commands-posix: qmp_guest_set_user_password: use ga_run_command helper Konstantin Kostiuk
2024-05-03  6:45   ` Thomas Huth [this message]
2024-05-01  7:43 ` [PULL 8/9] qga: Refactor common SSH functions Konstantin Kostiuk
2024-05-01  7:43 ` [PULL 9/9] qga: Implement SSH commands for Windows Konstantin Kostiuk
2024-05-01 22:15 ` [PULL 0/9] QGA misc changes for 2024-05-01 Richard Henderson

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=0ea35d63-c6fa-4ad6-b1af-5c0dca2a3e80@redhat.com \
    --to=thuth@redhat.com \
    --cc=andrey.drobyshev@virtuozzo.com \
    --cc=kkostiuk@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stefanha@redhat.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;
as well as URLs for NNTP newsgroup(s).