From nobody Wed Dec 17 05:50:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1765868423; cv=none; d=zohomail.com; s=zohoarc; b=UvwdxIwjyZ9w+PS18x/8tXBl9MMtvrL4qmrLpugtzFSBSafSGHNzL4ZUIixngRkNLLbPaRAt5Wrk0Dl9uHNwRBCfZbnTXApB58KdyXA8ifW400nvlSDyg0r0C1SomuKDMW5ER7Z/ar/jNBcoDlwOZZLOCGTYPFLEE0uvUNnFt0I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765868423; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=si6iM5Q08+odV2itqkAkXBPQ8Cjneuo1vXCrpiaPveg=; b=lxGJowZJ1JQ71xOtJDcYeh+udg3fkINzif+X5jrX8FHmJ7LvQ7bKhrFqJj/mykQx6i7FfiW9Iol/DIveYAdSQEPPbrHjRjbE7I/Ww8vQc5sFRjk8+xyA2JUf8G/13Go20LJHbVDfckoA3+LFDBx+L9Po6qrUd55MQymccSD+Lwk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1765868423642119.75007915748927; Mon, 15 Dec 2025 23:00:23 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id D3B5741ACD; Tue, 16 Dec 2025 02:00:22 -0500 (EST) Received: from [172.19.199.80] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 4593441B10; Tue, 16 Dec 2025 01:58:33 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 8E22541A32; Tue, 16 Dec 2025 01:52:29 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 1967441A1D for ; Tue, 16 Dec 2025 01:52:28 -0500 (EST) Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-193-6qliHf4pNK6ExDP3j3bk5Q-1; Tue, 16 Dec 2025 01:52:26 -0500 Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-7b9321b9312so8738178b3a.1 for ; Mon, 15 Dec 2025 22:52:26 -0800 (PST) Received: from armenon-kvm.armenon-thinkpadp16vgen1.bengluru.csb ([49.36.108.104]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7f4c22851besm14513304b3a.11.2025.12.15.22.52.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Dec 2025 22:52:23 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765867947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=si6iM5Q08+odV2itqkAkXBPQ8Cjneuo1vXCrpiaPveg=; b=iGrj99gD7qVO+cWKUYIhldJhwokEzlnQ9RtOIJ43sBZQ0meD8QWmbOcCDDjciu6TVU2uhd vMysVQHrF72yc+eiKiC4EVPygqo0pKqktjUo4lpgi8Xe2P7IFj7s8o7c+/lqOwSXc85XfY kyZ7O1BQKQ7ZmKJN0vbNKkhOgGqESPw= X-MC-Unique: 6qliHf4pNK6ExDP3j3bk5Q-1 X-Mimecast-MFC-AGG-ID: 6qliHf4pNK6ExDP3j3bk5Q_1765867945 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765867945; x=1766472745; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=si6iM5Q08+odV2itqkAkXBPQ8Cjneuo1vXCrpiaPveg=; b=w53ZrOIz5D35V5JWjYCL1daA1XpBkFfUlZgnBIMOlIx97OqL4IPw/DtvID+S80Qr+2 kwyNoF3YXnT+i22KfRDHiWBWZW0QOfJPsA4gzpwyyqB59w0sfynuQ8w1QjWDJPBPZzrQ U2FkmP/Us0tKDwItNRNmcYVFCPyVdXivXGhvqCQOPT5dpcZpcgQnpWNKMVsBZG6ct1XV 8rXajV6pufrK+k53GJPte4115OscRqz9RyhQa5qgJAZSHss2zeoqBoBHI3iToYTiEddj Xn6ISxbzKU+PZz6aV7sm4RV3hzCynigP8Sf2q3P3iiwJHafHYDUig/KetumJlm+F6qc1 lbrg== X-Gm-Message-State: AOJu0YxjHG0iZgCErPMaZuo84czRZFKyIc3HpxvYwqV1A0vhDtuXUztl k7G0TjvbqxFFdv4Qzoj+gf+w3nhLdr8npF1raRzhoTYiRmJR+nrEk/jBiLx11WyKpY9Us+dHfD+ gWDTSNPSdB028KHeaTCSWSKeyCKFRHu3BtYtGNjNidpQlIoDTzfeMOcwomUJYgQKYdzK3Hu3bnu FHuNA0Qh1MnZ1T/vmsr+G5XkwTJgFS1sdk8mpjNy1IKg== X-Gm-Gg: AY/fxX6AEtP2VLVJFjc0MkTAVAfPUJfNoOSPjUN7ajF6yXBXsz9AwLsYDLqVfT6BYkc urGYYiWY4NlcJ3n3m/hZhacT9qFU66W7azk9Dry4W4ccxE5adc80s0w97nvD4jRdW/LZIc42wb9 M++NNWQau+1vX+r0ROa6TePeWyqtWYEIwtECfLInRucwcwNTobl4QM5Zz4BjlypfbUT5Dm1gf4n tF49yO0CXseRzEEODRhm7ScYBFWZotoni5wOvrlhY3KRMOPTupJ3MXHQDFSCVsPH4E514GxHpjM W1IKlEMMCPoFoQIY5QLLaj5jG1FTnm2Tv3SuYla+hKhriHHgz2cR1eYhS6IWYhcany41MkakOp0 aG1dLPC/cueFDzMaTvaLV/DRMkJKyA9KMc/8XYRUErBaIufmGWdmy87I2Bw== X-Received: by 2002:aa7:88d6:0:b0:7f7:2cde:875c with SMTP id d2e1a72fcca58-7f72ceed216mr9068713b3a.16.1765867944963; Mon, 15 Dec 2025 22:52:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbGeYePYPwGDj3/Hacq/IFgHUI96Ifm25OYLI4gJPnZT519WvVk/q5xS0z2KCjqUrYUpJAcA== X-Received: by 2002:aa7:88d6:0:b0:7f7:2cde:875c with SMTP id d2e1a72fcca58-7f72ceed216mr9068692b3a.16.1765867944430; Mon, 15 Dec 2025 22:52:24 -0800 (PST) To: devel@lists.libvirt.org Subject: [PATCH v2 4/5] secret: Rename virSecretObj structure attribute from base64File to secretValueFile Date: Tue, 16 Dec 2025 12:22:09 +0530 Message-ID: <20251216065210.9297-5-armenon@redhat.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251216065210.9297-1-armenon@redhat.com> References: <20251216065210.9297-1-armenon@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: aOELULbc9NomEVUjASj7ynGXF5xtAy4lpPeiAGN_oT4_1765867945 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: YLDGF7J62FQXG3H47HQBJ4SOBERMYRV5 X-Message-ID-Hash: YLDGF7J62FQXG3H47HQBJ4SOBERMYRV5 X-MailFrom: armenon@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Arun Menon X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Arun Menon via Devel Reply-To: Arun Menon X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1765868435974154100 Content-Type: text/plain; charset="utf-8"; x-default="true" Change the attribute name of _virSecretObj because we want it to have a gen= eric name to indicate that secret values can be stored in it in both base64 and encrypted formats. Signed-off-by: Arun Menon --- src/conf/virsecretobj.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c index 66270e2751..a3dd7983bb 100644 --- a/src/conf/virsecretobj.c +++ b/src/conf/virsecretobj.c @@ -39,7 +39,7 @@ VIR_LOG_INIT("conf.virsecretobj"); struct _virSecretObj { virObjectLockable parent; char *configFile; - char *base64File; + char *secretValueFile; virSecretDef *def; unsigned char *value; /* May be NULL */ size_t value_size; @@ -139,7 +139,7 @@ virSecretObjDispose(void *opaque) g_free(obj->value); } g_free(obj->configFile); - g_free(obj->base64File); + g_free(obj->secretValueFile); } =20 =20 @@ -378,11 +378,11 @@ virSecretObjListAdd(virSecretObjList *secrets, if (!(obj =3D virSecretObjNew())) goto cleanup; =20 - /* Generate the possible configFile and base64File strings + /* Generate the possible configFile and secretValueFile strings * using the configDir, uuidstr, and appropriate suffix */ if (!(obj->configFile =3D virFileBuildPath(configDir, uuidstr, ".x= ml")) || - !(obj->base64File =3D virFileBuildPath(configDir, uuidstr, ".b= ase64"))) + !(obj->secretValueFile =3D virFileBuildPath(configDir, uuidstr= , ".base64"))) goto cleanup; =20 if (virHashAddEntry(secrets->objs, uuidstr, obj) < 0) @@ -656,7 +656,7 @@ virSecretObjDeleteData(virSecretObj *obj) { /* The configFile will already be removed, so secret won't be * loaded again if this fails */ - unlink(obj->base64File); + unlink(obj->secretValueFile); } =20 =20 @@ -691,7 +691,7 @@ virSecretObjSaveData(virSecretObj *obj) =20 base64 =3D g_base64_encode(obj->value, obj->value_size); =20 - if (virFileRewriteStr(obj->base64File, S_IRUSR | S_IWUSR, base64) < 0) + if (virFileRewriteStr(obj->secretValueFile, S_IRUSR | S_IWUSR, base64)= < 0) return -1; =20 return 0; @@ -813,26 +813,26 @@ virSecretLoadValue(virSecretObj *obj) struct stat st; g_autofree char *contents =3D NULL; =20 - if ((fd =3D open(obj->base64File, O_RDONLY)) =3D=3D -1) { + if ((fd =3D open(obj->secretValueFile, O_RDONLY)) =3D=3D -1) { if (errno =3D=3D ENOENT) { ret =3D 0; goto cleanup; } virReportSystemError(errno, _("cannot open '%1$s'"), - obj->base64File); + obj->secretValueFile); goto cleanup; } =20 if (fstat(fd, &st) < 0) { virReportSystemError(errno, _("cannot stat '%1$s'"), - obj->base64File); + obj->secretValueFile); goto cleanup; } =20 if ((size_t)st.st_size !=3D st.st_size) { virReportError(VIR_ERR_INTERNAL_ERROR, _("'%1$s' file does not fit in memory"), - obj->base64File); + obj->secretValueFile); goto cleanup; } =20 @@ -845,7 +845,7 @@ virSecretLoadValue(virSecretObj *obj) =20 if (saferead(fd, contents, st.st_size) !=3D st.st_size) { virReportSystemError(errno, _("cannot read '%1$s'"), - obj->base64File); + obj->secretValueFile); goto cleanup; } contents[st.st_size] =3D '\0'; --=20 2.51.1