Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9317C4338F for ; Wed, 25 Aug 2021 09:38:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5F893610CE for ; Wed, 25 Aug 2021 09:38:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5F893610CE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=proxmox.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:48120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIpMN-0003TP-DT for qemu-devel@archiver.kernel.org; Wed, 25 Aug 2021 05:38:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIpLd-0002C5-UZ for qemu-devel@nongnu.org; Wed, 25 Aug 2021 05:37:29 -0400 Received: from proxmox-new.maurer-it.com ([94.136.29.106]:8454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIpLb-0007SD-O2 for qemu-devel@nongnu.org; Wed, 25 Aug 2021 05:37:29 -0400 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2514F4376F; Wed, 25 Aug 2021 11:37:15 +0200 (CEST) From: Stefan Reiter To: "Dr. David Alan Gilbert" , Markus Armbruster , Paolo Bonzini , Eric Blake , Gerd Hoffmann , Wolfgang Bumiller , Thomas Lamprecht Subject: [PATCH 1/2] monitor/hmp: correctly invert password argument detection again Date: Wed, 25 Aug 2021 11:37:00 +0200 Message-Id: <20210825093701.668122-2-s.reiter@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210825093701.668122-1-s.reiter@proxmox.com> References: <20210825093701.668122-1-s.reiter@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=94.136.29.106; envelope-from=s.reiter@proxmox.com; helo=proxmox-new.maurer-it.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Commit cfb5387a1d 'hmp: remove "change vnc TARGET" command' claims to remove the HMP "change vnc" command, but doesn't actually do that. Instead if rewires it to use 'qmp_change_vnc_password', and in the process inverts the argument detection - ignoring the first issue, this inversion is wrong, as this will now ask the user for a password if one is already provided, and simply fail if none is given. Fixes: cfb5387a1d ("hmp: remove "change vnc TARGET" command") Signed-off-by: Stefan Reiter --- monitor/hmp-cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index f7a211e5a4..31366e6331 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1591,7 +1591,7 @@ void hmp_change(Monitor *mon, const QDict *qdict) } if (strcmp(target, "passwd") == 0 || strcmp(target, "password") == 0) { - if (arg) { + if (!arg) { MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common); monitor_read_password(hmp_mon, hmp_change_read_arg, NULL); return; -- 2.30.2