From nobody Sun May 5 13:45:12 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547827246576786.075773998814; Fri, 18 Jan 2019 08:00:46 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6BDEDC3C4F; Fri, 18 Jan 2019 16:00:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 962AA10FCFF1; Fri, 18 Jan 2019 16:00: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 682633F7D0; Fri, 18 Jan 2019 16:00: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 x0IG0bFF009211 for ; Fri, 18 Jan 2019 11:00:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8980660BEE; Fri, 18 Jan 2019 16:00:37 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B3205F7C1 for ; Fri, 18 Jan 2019 16:00:13 +0000 (UTC) Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) (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 A9EF6C056794 for ; Fri, 18 Jan 2019 16:00:10 +0000 (UTC) Received: by mail-qk1-f194.google.com with SMTP id d15so8352303qkj.0 for ; Fri, 18 Jan 2019 08:00:10 -0800 (PST) Received: from localhost.localdomain ([2804:431:b705:b9f4:e0c8:af50:1c3e:1464]) by smtp.gmail.com with ESMTPSA id e49sm55948710qta.0.2019.01.18.08.00.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 08:00:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=+b7Ixue0TP21eXm9pcCbNRyR+BrwscxXMseViFS/i9E=; b=PZD0KpZ1gwvphr4BdUseo3xCwdYJtPnTJnsL4+xRqquqzqN766ZhYZaGssBKC0sCt3 fyubfXmZ2//EAq4fkMVBBkGVbhy7hYiqRh/mDczIl8KTpm3nCCMJNmkwj6t4kdyGcB3j OjSaLsqLu3FQLgM84rcn70etrDLYipdgK2Dxze6ykKjXGTrnepib4ZAGo2jm3cc2m+Yq ZyIAG6tdUGT/aTu6HdD/LSZ+GiCQKXHKeuJ3naHzXHgd1WuqA4MPUyUTfpDGhSXwbU38 3YuRPUutIEqTtvyIw2+9ikTRi3q7HNtgWNCyBZYtjxRStxVitJQJEIROK8Y44HsfLqfG QGAQ== 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:mime-version :content-transfer-encoding; bh=+b7Ixue0TP21eXm9pcCbNRyR+BrwscxXMseViFS/i9E=; b=bvohH4DeQ+4FUlzpNtvmWdWPlgrqUW/Q8lspfbmW+nKT23RdWHuwrrsKMttZ+MMh+j HRUSikZZJvuqsXF3vj+oSkUuRWxo2IDI8XB2YQeXxsObWhTW1BndNzQvFbEGuLlf1vU0 zAC4TgRElH3kryU/fq94g9ndYAleJ6crx/cSG4xmcKG7blZYEDkydPQpQzEF54n43/fd PcHzwn+VKZsXGi7wk7Xh5V3VO2KPOh3QjG4yoMnq2HK3L1ceTm3mTTC4qwcp4L2Lxp+o rWSnFEyqvQhG5vUDOQXyarvtyApaIXxruNfzctrSY6ItwOPIdcUY5UvmzWYmdp3l871F 83PA== X-Gm-Message-State: AJcUukcz+i2XApLS0ahPpW2p/jeD1vixssz3yblv374QNAWorp5zpVlR bSJysNqF20Mom6iv9UuLE2uKcjVN0NY= X-Google-Smtp-Source: ALg8bN4eNJcCN+E5sYfR0OC3fc/tSvtHRUtwi++1ww0Z2etv+Ccy57wICKcpOJPoeQJb26NRclSRCg== X-Received: by 2002:a37:5257:: with SMTP id g84mr15553860qkb.76.1547827209667; Fri, 18 Jan 2019 08:00:09 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Fri, 18 Jan 2019 14:00:03 -0200 Message-Id: <20190118160003.7995-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 18 Jan 2019 16:00:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 18 Jan 2019 16:00:10 +0000 (UTC) for IP:'209.85.222.194' DOMAIN:'mail-qk1-f194.google.com' HELO:'mail-qk1-f194.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.222.194 mail-qk1-f194.google.com 209.85.222.194 mail-qk1-f194.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] storage: fix volume perms when it is not specified. 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 18 Jan 2019 16:00:43 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This commit adds permissions inheritance to volume from main pool when it is not explicitly added by command or XML definition. It permissions are defined into XML, they should be respected. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D677242 Signed-off-by: Julio Faracco --- src/storage/storage_driver.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 4a13e90481..5961d35f26 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -1850,6 +1850,16 @@ storageVolCreateXML(virStoragePoolPtr pool, goto cleanup; } =20 + /* Inherit perms and mode from pool when they are not defined. */ + if (voldef->target.perms->uid =3D=3D (uid_t)-1) + voldef->target.perms->uid =3D def->target.perms.uid; + + if (voldef->target.perms->gid =3D=3D (gid_t)-1) + voldef->target.perms->gid =3D def->target.perms.gid; + + if (voldef->target.perms->mode =3D=3D (mode_t)-1) + voldef->target.perms->mode =3D def->target.perms.mode; + if (virStorageVolCreateXMLEnsureACL(pool->conn, def, voldef) < 0) goto cleanup; =20 --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list