From nobody Wed Feb 11 01:26:07 2026 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=1770711591; cv=none; d=zohomail.com; s=zohoarc; b=Xhv+G6qU0Mw4/6wrf0B4J2zAILqbTFq05B9CZj7gCtwpkh+PiVUrCO1OBxkDfwkLpNDlOrITmC83zrkjJiTghDycNUftyo+czbwxMXalkqFsmhhK+h1G/WOaMs9ipQ2D6iG19bU77BBYW247td4TePzp7yWl3DWwJLjvUZOvtxU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770711591; 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=miFwiCEtlhixFjsvUp2hfKJpehcqvoGC+A4QLZpl4mE=; b=Oez6y2XyHtglUVZYpwVKI8umyUkN9TU6c8x9EMY3xmb4V3SkUYgX5uuXFYhEa3yMk0KYrv17T9erXfVCZSOeyX7TlvjyUBzqi2S04C8MZ1WXNzBFOdfSHY/WF13gCgGgc5n4jrw8ZhPaNT1DTWQXDmJh9MnhiOmxdw6PW8+9hU0= 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 1770711590985854.4174617543518; Tue, 10 Feb 2026 00:19:50 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 8554D44154; Tue, 10 Feb 2026 03:19:49 -0500 (EST) Received: from [172.19.199.6] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 9FB9844167; Tue, 10 Feb 2026 03:18:34 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 6F1983F287; Tue, 10 Feb 2026 03:00:29 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 174393F2B4 for ; Tue, 10 Feb 2026 03:00:27 -0500 (EST) Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-520-oIQKqSwqOYGIVRcTSuRLVg-1; Tue, 10 Feb 2026 03:00:25 -0500 Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2a7b7f04a11so15823325ad.3 for ; Tue, 10 Feb 2026 00:00:25 -0800 (PST) Received: from armenon-kvm.armenon-thinkpadp16vgen1.bengluru.csb ([49.36.106.198]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2aadc397d8dsm98273835ad.1.2026.02.10.00.00.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Feb 2026 00:00: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=1770710426; 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=miFwiCEtlhixFjsvUp2hfKJpehcqvoGC+A4QLZpl4mE=; b=E3YXKAMK7qVUOcDzEI8yotBIt9G4EfeQJxrAQxoHFMBy6EEJFce8FzG8FbieADP3V/hdds o9vPaFKEYsAm/V+jGqasbEF40QUTutGAE2zvJmaOx4QzQAfpJNdNjqxIj69RiVHtz+piRR WNEzCJZBslg8cOTHc5aZJhvEkjlWmAg= X-MC-Unique: oIQKqSwqOYGIVRcTSuRLVg-1 X-Mimecast-MFC-AGG-ID: oIQKqSwqOYGIVRcTSuRLVg_1770710424 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770710424; x=1771315224; 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=miFwiCEtlhixFjsvUp2hfKJpehcqvoGC+A4QLZpl4mE=; b=kcpIOU07jT39ANzT2SMhrrLW14y+JQv0ioIB6xzm24jRu0qW635o4p5/34k1k6udyU g8DVRIfvbP7sGfbIJXcQ7TFHcVbLOHY5zRwUtEJi23uB21oI3/ocXcA7Oaos4PZaeVuv /O01QRxHzIdKX8TcvcnZwj6UVipBxm9/O3hUp9kHdnt9hIbjHFtmKun/Npl0LAs9Mg+G 2nLyHQO69n6/DqowFTfWvEo8VTu1lte3CYwSF09EfUl7fUhWpdo9HqDPushDzHLaYHYR SOYM6y+6stL7oVw8ZZOqF5vorSWYPCOE1jHLypQIC4ItumN6YoE/D3GZbAlRwl3I6h6g rl0w== X-Gm-Message-State: AOJu0YydJ2/xHtpCTc78b4KB1DHZJRpAsca0/BoDB3bVHGsuZb7SRsVV fTa1XWgxno9HJX/cKxsR4+nw2kbOjIrLHFxedY6jVb3ioE8x5Vekoif5f4ac8/msTKPh32ex5V7 HlNyTYTlEbrFijsFwMIPUusoauAbL5wl30aBB9ULLE0kBF1fQJwJQLgJoNWv3rB9wK4UI0vSdSy K+c2mw7Y0a+dTCcNwTxm79HrBvi2fW5AjommvO9FcF+A== X-Gm-Gg: AZuq6aJMKZCYejvnGy1Q0XSBLGsbptzF0IjiYWfm0IsGecOfva9oV+c4i5wE33x+joj eOJr+lc0TcW0YNK0YDZDFvHOZV1JlsHVRY6n7sFRwtvgM3Y2TW6CMhjWRwnuLZ4Qj02wj4Xy1PV OF51N/xQ9qb2m1vmle96u6wUb/RA6xmXeNCnWEky2fvzFpuJD0StyAceK2fRn4PkwMGPYhXIqY3 m5RWcx3x61Kclp5KrO+2D2Jp0Dfqf2j5a20cgaUMr9sPdKr2iy0aVE50/7a67TqJwwudV/to/AP kLT6Tk3b3I3qTLIuBrG5elWxpqmDITHRlVjGmuLowzsbzektbPM417Ev0WMhvrl4/1xuSvbsYTq oERy735DSuD+Z1Sz3y/GC3aXvYG/71Sk6oLdleBAS1TzFH52N4tXD2arxXEdMlPYCYBGDNw== X-Received: by 2002:a17:903:2984:b0:2a0:c84f:4124 with SMTP id d9443c01a7336-2a9519bcc43mr134877385ad.52.1770710424114; Tue, 10 Feb 2026 00:00:24 -0800 (PST) X-Received: by 2002:a17:903:2984:b0:2a0:c84f:4124 with SMTP id d9443c01a7336-2a9519bcc43mr134876855ad.52.1770710423520; Tue, 10 Feb 2026 00:00:23 -0800 (PST) To: devel@lists.libvirt.org Subject: [PATCH v5 4/6] secret: Rename virSecretObj structure attribute from base64File to secretValueFile Date: Tue, 10 Feb 2026 13:30:10 +0530 Message-ID: <20260210080012.17753-5-armenon@redhat.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20260210080012.17753-1-armenon@redhat.com> References: <20260210080012.17753-1-armenon@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: yjvmcj3kh7r0il4IPD1rN2I7uVbBCyIYre-CmzgvgZ8_1770710424 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4QHKSNNJO6BU6FMP43XBXNSICIEV5FDQ X-Message-ID-Hash: 4QHKSNNJO6BU6FMP43XBXNSICIEV5FDQ 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: 1770711602364154100 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 Reviewed-by: Peter Krempa --- 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