From nobody Mon May 6 04:40:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1496368705104557.8549682854534; Thu, 1 Jun 2017 18:58:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9BC8780C0E; Fri, 2 Jun 2017 01:58:22 +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 618697E5B2; Fri, 2 Jun 2017 01:58:22 +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 0B6FB180BAF5; Fri, 2 Jun 2017 01:58:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v521wLKO031289 for ; Thu, 1 Jun 2017 21:58:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 51B9818E50; Fri, 2 Jun 2017 01:58:21 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4BABD5DC18 for ; Fri, 2 Jun 2017 01:58:19 +0000 (UTC) Received: from mail-qk0-f169.google.com (mail-qk0-f169.google.com [209.85.220.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8740CC04B317 for ; Fri, 2 Jun 2017 01:58:18 +0000 (UTC) Received: by mail-qk0-f169.google.com with SMTP id d14so50373232qkb.1 for ; Thu, 01 Jun 2017 18:58:18 -0700 (PDT) Received: from localhost.localdomain ([186.223.3.196]) by smtp.googlemail.com with ESMTPSA id r10sm14054778qtb.15.2017.06.01.18.58.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Jun 2017 18:58:17 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9BC8780C0E Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9BC8780C0E Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BBRhzp00" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8740CC04B317 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jcfaracco@gmail.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8740CC04B317 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=egBq8sdw6Iz4bqtbz+5j2ZTh3ROeeZ2eTCejpiw9tX8=; b=BBRhzp00ddAfIuIj4Bs9UFh4g8WbVDme6F4zibc1qpvfeVyUzVrPXqmmUyw3mp2jbh DKA9vTAz8Zc0tezGGhak3I92jEkAti3xgwj515lQF2Vp9mxNgNCOvOK67ELwAD4pr3qb uBevGqqDvpv3qoxWXh66NPI7/I99YBZ7p8sIwwiaVqQhy2izg6342wHvXXWVNb2HXHR5 UKNP2P0JzbCab1rgmxecyjATMN3TiM12VOcfazMkM751YwsY1Wrv+lj2kxaO003Aphyr TJMCjxhySNOTpd9+FpARHzeJwQBttxmSxBHhuRH/6JmaDd4j+XTlu/vxGyrpp6udGLzV mM5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=egBq8sdw6Iz4bqtbz+5j2ZTh3ROeeZ2eTCejpiw9tX8=; b=V7z66mkojrEJU0lhYl3Q19unrW9WmfawzDr77P6kU0g1NPh5n5qtbNGVyM9YOmVpE3 BTlLBcyJg9lbjnzZYKrjTfOZixoNDbFEstt4tDiY6rgrSzEn2sRz/Ay3v8Dbs8mu0fD6 kbB9t5FXmquZfBVEh0lkEhgjzx7slqIL85VQDvew/F2MvbBFxT8wPy51V3v0I6eo5p/8 bx3YbvBifhAg7kDj6tnfug5j55yviQYKGqoTmfFmT1KDt1QcSmYRq5O0oOl53A6MZD9h eB+SLaPj+4f6cfr3v5dGPWE/pQicfUf/IrB6VAUEyqy69rkl8/5bBS30Q8XgiADsOT0L WRkg== X-Gm-Message-State: AKS2vOznylo6DMCw1jGq/XEgtc4BEMEMSAVluxa4Elz/YpLXusUe2udi VPXO8/ltNnFe4mKh X-Received: by 10.55.3.2 with SMTP id 2mr5255804qkd.65.1496368697548; Thu, 01 Jun 2017 18:58:17 -0700 (PDT) From: Julio Faracco To: libvir-list@redhat.com Date: Thu, 1 Jun 2017 22:58:06 -0300 Message-Id: <1496368686-15087-1-git-send-email-jcfaracco@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 02 Jun 2017 01:58:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 02 Jun 2017 01:58:18 +0000 (UTC) for IP:'209.85.220.169' DOMAIN:'mail-qk0-f169.google.com' HELO:'mail-qk0-f169.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.77 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.220.169 mail-qk0-f169.google.com 209.85.220.169 mail-qk0-f169.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] util: fixing wrong comparison inside virStoragePermsCopy(). 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 02 Jun 2017 01:58:23 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" VIR_STRDUP returns -1 if the string copy was not successful. So, the current comparison/logic is throwing an error when VIR_STRDUP() returns 1. Only when source is NULL, it is considering as a success which is not right. Signed-off-by: Julio Faracco --- src/util/virstoragefile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 6d8ada9..e82a7fb 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -1974,7 +1974,7 @@ virStoragePermsCopy(const virStoragePerms *src) ret->uid =3D src->uid; ret->gid =3D src->gid; =20 - if (VIR_STRDUP(ret->label, src->label)) + if (VIR_STRDUP(ret->label, src->label) < 0) goto error; =20 return ret; --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list