From nobody Wed May 15 14:57:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1618236300; cv=none; d=zohomail.com; s=zohoarc; b=lrZTD8WMWeYgueTQjFJM4SGLaG4dHyvlvS9ZABkvWYr4sIt6yBB5h9PCEh/o1wz4z+0bYZyQ3NJnF/lAVSTi+NXgDXPppVd5j1RhotprP7Q6sm8JgKMdlzrP0Fzpk53d6Ez44flFVoDXb5mGsITUtGnEfKN5HxjEEw0Agc9idGQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618236300; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=JABmjkEPfofDEtZLLINgQadVRZqbCrUOCeJHw/vegXw=; b=dtjlW6UqBMWy+XQHT1UQjR8yDel2QAtGnt4ezJve+F9CAOHQ6Xwbhg7rrfTX+UMekdvyv0JoOB4tgtMftN/BZq0Wt2K9J2laT8jBCMsi5uDRhWMaNmHgQgZXq5CvnIQf4HSFRt5gd2Sp8NYpNJIXbmGov4XZ8vQN/RsIAHpD+Io= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1618236300641617.930197263281; Mon, 12 Apr 2021 07:05:00 -0700 (PDT) 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-107-ByriUYAiPX2o0gSXqNHoWg-1; Mon, 12 Apr 2021 10:04:56 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id AA99B1883530; Mon, 12 Apr 2021 14:04:49 +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 4C73B100164A; Mon, 12 Apr 2021 14:04:46 +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 72D7444A5B; Mon, 12 Apr 2021 14:04:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13CE4gs5022669 for ; Mon, 12 Apr 2021 10:04:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 21DCE209F756; Mon, 12 Apr 2021 14:04:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1AEFD209F757 for ; Mon, 12 Apr 2021 14:04:40 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DEC4680A1D5 for ; Mon, 12 Apr 2021 14:04:39 +0000 (UTC) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-493-8UdQ5Sd2NNeH7Y6C_Wch8w-1; Mon, 12 Apr 2021 10:04:37 -0400 Received: by mail-pl1-f178.google.com with SMTP id e2so2108473plh.8 for ; Mon, 12 Apr 2021 07:04:37 -0700 (PDT) Received: from localhost ([103.142.141.204]) by smtp.gmail.com with ESMTPSA id d5sm11053064pjo.12.2021.04.12.07.04.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 07:04:35 -0700 (PDT) X-MC-Unique: ByriUYAiPX2o0gSXqNHoWg-1 X-MC-Unique: 8UdQ5Sd2NNeH7Y6C_Wch8w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JABmjkEPfofDEtZLLINgQadVRZqbCrUOCeJHw/vegXw=; b=T+jvFM/4OanU3HhOJu+keuvBfaSOqfIL8dxpSces5DY6bDEsxzO3NqK77HDvvEBBFi 1MsG0LeYvpXQUxcCnC7k4umlGuFbW/k5gXKCrYVzzyuT6uKhAO7e/FQYUw1Xj59wn3cY b+E6bDMMA4jAag7mbThWQT7ExkPy3sT7TNVGewtCe4k6ZPvpGcHaohcvPx6F5wgvdIA/ 91J+97f+Xqnbpjk2UXML2A+cg3SoUMOFUCSR3MtlRT5fOCJYsaqH/omaXfCG5/MgHMJ0 yW3+O4oiBYR8b4ihtuLvdqA/SDpL12fyEimJrxeihZXfN+cAJcvWh5HxCu8wACFBMddq pn2A== X-Gm-Message-State: AOAM530RKLIXfh09nLMP9zJ3dzU8MSBxKPpvDl+GnUk/92y8r7RrwGCe JmDcVYL1pU+tNIRBWzVkjbUUJFJ8lvWSsRIc9Es= X-Google-Smtp-Source: ABdhPJzphBFxQFpb43gKGp2CVxeZqF03egBYaxDQAC2tLhyzrD9y+8SXfUpHfED0V4qyB5Ji20flzw== X-Received: by 2002:a17:90b:4a4e:: with SMTP id lb14mr1885330pjb.155.1618236276255; Mon, 12 Apr 2021 07:04:36 -0700 (PDT) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH resend] virfile: Replace AbsPath judgement method with g_path_is_absolute() Date: Mon, 12 Apr 2021 22:04:27 +0800 Message-Id: <20210412140427.647931-1-lukedyue@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Luke Yue 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.84 on 10.5.11.22 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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The g_path_is_absolute() considers more situations than just a simply "path[0] =3D=3D '/'". Related issue: https://gitlab.com/libvirt/libvirt/-/issues/12 Signed-off-by: Luke Yue Reviewed-by: Michal Privoznik --- src/util/virfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 93fac200cc..3311eaff3d 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -3153,7 +3153,7 @@ virFileOpenTty(int *ttyprimary G_GNUC_UNUSED, int virFileAbsPath(const char *path, char **abspath) { - if (path[0] =3D=3D '/') { + if (g_path_is_absolute(path)) { *abspath =3D g_strdup(path); } else { g_autofree char *buf =3D g_get_current_dir(); --=20 2.31.1