From nobody Sun May 19 01:26:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606133748; cv=none; d=zohomail.com; s=zohoarc; b=eQG6DjkOjo5+LCDzboU3v4ouyazApNF6Kvf14HV2FhiSR8eiTt6KYqbp+5w9rnfjLWAHIM6s9e1XVcf22rtETXPDTGJwASM0fP1ioZkFrDbJxmkEJuwPM7YQwmONHGw1i9+h3EL/XwyuuyyqdJtarlxdAxMPyHgDqorSnI0Oqro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606133748; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=a2fT7Igv4chjm56DhRb4+4UeaREZ97AjlNPA2DH7dWk=; b=hdpALLhIpttl+qmkBl4Uot0JAPdJAyVK/fVm7CMsf2uD738GYeyaNaUs+/CbG6BoYZ8qoZcxhCjpyOSuMsnEqqaKDk8B332SBCrAGnPar+u5xQpo0ah5QePh+N7CipLeZ1FOxweckRy7Vb0K143JerQyUuO6fvP3Q4G2luViGn4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1606133748466616.6355467680551; Mon, 23 Nov 2020 04:15:48 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-172-DPJKkFxCMvGC-73K02ritA-1; Mon, 23 Nov 2020 07:15:45 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 62E811074652; Mon, 23 Nov 2020 12:15:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 437071346D; Mon, 23 Nov 2020 12:15:40 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E26721809C9F; Mon, 23 Nov 2020 12:15:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0ANCFc6M014456 for ; Mon, 23 Nov 2020 07:15:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9DE5160871; Mon, 23 Nov 2020 12:15:38 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10C866086F for ; Mon, 23 Nov 2020 12:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606133747; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=a2fT7Igv4chjm56DhRb4+4UeaREZ97AjlNPA2DH7dWk=; b=BBD5pWQhPfyKqQtMYVAc5t7TEXhx6vXO4LGmiCCsrAeZ5Gt/8PEPAVkTla+aRtHsOb2IKu lTF0/M9voaXUCQGcUWfeQZvG1slzOii9rjKPnnWlQeFwOjB+d9Adgm/ryIg5jlxLyY0S63 05erElhMRhyNor54x4TtWrbXLvkbuYA= X-MC-Unique: DPJKkFxCMvGC-73K02ritA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] virDomainAuthorizedSSHKeysSet: Use uint for @nkeys Date: Mon, 23 Nov 2020 13:15:28 +0100 Message-Id: <8c46941a08f9aa0a938c666a2127f0aa8c7bfba7.1606133728.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) When introducing the API I've mistakenly used 'int' type for @nkeys argument which does nothing more than tells the API how many items there are in @keys array. Obviously, negative values are not expected and therefore 'unsigned int' should have been used. Reported-by: Daniel P. Berrang=C3=A9 Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- include/libvirt/libvirt-domain.h | 2 +- src/driver-hypervisor.h | 2 +- src/libvirt-domain.c | 4 ++-- src/qemu/qemu_driver.c | 2 +- src/remote/remote_driver.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index d81157ccaf..b929877643 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -5115,7 +5115,7 @@ typedef enum { int virDomainAuthorizedSSHKeysSet(virDomainPtr domain, const char *user, const char **keys, - int nkeys, + unsigned int nkeys, unsigned int flags); =20 #endif /* LIBVIRT_DOMAIN_H */ diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index 5a5ea95c51..9e8fe89921 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -1397,7 +1397,7 @@ typedef int (*virDrvDomainAuthorizedSSHKeysSet)(virDomainPtr domain, const char *user, const char **keys, - int nkeys, + unsigned int nkeys, unsigned int flags); =20 typedef struct _virHypervisorDriver virHypervisorDriver; diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 63d4954e68..0d0041f983 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -12853,12 +12853,12 @@ int virDomainAuthorizedSSHKeysSet(virDomainPtr domain, const char *user, const char **keys, - int nkeys, + unsigned int nkeys, unsigned int flags) { virConnectPtr conn; =20 - VIR_DOMAIN_DEBUG(domain, "user=3D%s, keys=3D%p, nkeys=3D%d, flags=3D0x= %x", + VIR_DOMAIN_DEBUG(domain, "user=3D%s, keys=3D%p, nkeys=3D%u, flags=3D0x= %x", user, keys, nkeys, flags); =20 virResetLastError(); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b69be1bedc..20e24e2479 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20134,7 +20134,7 @@ static int qemuDomainAuthorizedSSHKeysSet(virDomainPtr dom, const char *user, const char **keys, - int nkeys, + unsigned int nkeys, unsigned int flags) { virQEMUDriverPtr driver =3D dom->conn->privateData; diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 6c0e7f7514..b0af3ee88e 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -8066,7 +8066,7 @@ static int remoteDomainAuthorizedSSHKeysSet(virDomainPtr domain, const char *user, const char **keys, - int nkeys, + unsigned int nkeys, unsigned int flags) { int rv =3D -1; --=20 2.26.2