From nobody Thu May 2 17:14:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1573728200; cv=none; d=zoho.com; s=zohoarc; b=PLSjZGnbfAisRKXI6faHV/wijvm6RYcFC/6Dymd4UmOyrahcvHpy3oVF0X3FV3MX3hjyC/nO9t5aMrR0D/fp0bgaY/DtSpUKuseh2ghVgeylH1LxwthYwn24XUVRcQjbtVWlr0CuGrxcFgYajQyroTwgfuJ8FsjJRJlZRxdish4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573728200; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cKRGgI5s0MMsTQrcsQHmOh/xc5M5wR7t3GX7Bvz+Cxk=; b=OzUANl00qRI5lCqYqk8ooQS/h9K/ZkKh2Y0GzpwBCNCv40M6DrzU7gziZttvWuqED+1/5XJ5p0KpVUF/4eYBRxwccJWsTygijeiUTPkad5s2INfado4NlynACGCBMyN+Y+/Q9ZHHgDPknVGXWooYMYBUjGVZx/UNflFQ+mbHn8o= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1573728200233242.30898260585502; Thu, 14 Nov 2019 02:43:20 -0800 (PST) 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-411-k85RAQU6Pf-BilmUm_oPUQ-1; Thu, 14 Nov 2019 05:43:17 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id CDE391005513; Thu, 14 Nov 2019 10:43:10 +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 9EFC751C3F; Thu, 14 Nov 2019 10:43:10 +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 57D3118089CF; Thu, 14 Nov 2019 10:43:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAEAgand005407 for ; Thu, 14 Nov 2019 05:42:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 40A2060303; Thu, 14 Nov 2019 10:42:36 +0000 (UTC) Received: from antique-laptop.redhat.com (ovpn-200-40.brq.redhat.com [10.40.200.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71E6A601B8 for ; Thu, 14 Nov 2019 10:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573728199; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=cKRGgI5s0MMsTQrcsQHmOh/xc5M5wR7t3GX7Bvz+Cxk=; b=S8dCZV6tI5dqpeaC4Uxhd9ZqOQlTGig+WeY2SItqTo4E6K3RekLqQBDjMqPxMj1paogVmz GWdEDPitqptHR8WUSm4/ZrH58lib7v1IkTO1wQgjNterMDFfZX0Dky5aNNlR+A03nZQ46v +1qUlK3vmjae+07XACfQy5xSeTPTWho= From: Pavel Hrdina To: libvir-list@redhat.com Date: Thu, 14 Nov 2019 11:42:27 +0100 Message-Id: <9559e0eb4416fa73fa4f156a0679d3b2ffd19a75.1573726952.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] replace use of gnulib setenv by g_setenv 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.79 on 10.5.11.12 X-MC-Unique: k85RAQU6Pf-BilmUm_oPUQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina Reviewed-by: Cole Robinson --- src/security/virt-aa-helper.c | 4 ++-- src/vbox/vbox_XPCOMCGlue.c | 2 +- tests/libxlxml2domconfigtest.c | 4 ++-- tests/lxcxml2xmltest.c | 2 +- tests/qemudomaincheckpointxml2xmltest.c | 2 +- tests/qemudomainsnapshotxml2xmltest.c | 2 +- tests/qemufirmwaretest.c | 2 +- tests/qemuhotplugtest.c | 2 +- tests/qemumemlocktest.c | 2 +- tests/qemusecuritytest.c | 2 +- tests/qemuvhostusertest.c | 2 +- tests/qemuxml2argvtest.c | 14 +++++++------- tests/qemuxml2xmltest.c | 4 ++-- tests/securityselinuxhelper.c | 4 ++-- tests/testutils.c | 6 +++--- tests/testutils.h | 4 ++-- tests/testutilsqemu.c | 2 +- tests/vircgrouptest.c | 8 ++++---- tests/virfiletest.c | 2 +- tests/virhostdevtest.c | 2 +- tests/virnettlscontexttest.c | 2 +- tests/virnettlssessiontest.c | 2 +- tests/virpcitest.c | 2 +- tests/virportallocatortest.c | 2 +- tests/virsystemdtest.c | 18 +++++++++--------- tests/virtimetest.c | 4 ++-- tools/virt-login-shell-helper.c | 12 ++++++------ 27 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 5ac9a9eeb8..12edc9c73f 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -1408,11 +1408,11 @@ main(int argc, char **argv) =20 /* clear the environment */ environ =3D NULL; - if (setenv("PATH", "/sbin:/usr/sbin", 1) !=3D 0) + if (g_setenv("PATH", "/sbin:/usr/sbin", 1) !=3D 0) vah_error(ctl, 1, _("could not set PATH")); =20 /* ensure the traditional IFS setting */ - if (setenv("IFS", " \t\n", 1) !=3D 0) + if (g_setenv("IFS", " \t\n", 1) !=3D 0) vah_error(ctl, 1, _("could not set IFS")); =20 if (!(progname =3D strrchr(argv[0], '/'))) diff --git a/src/vbox/vbox_XPCOMCGlue.c b/src/vbox/vbox_XPCOMCGlue.c index f48a78a923..9cd39df0d8 100644 --- a/src/vbox/vbox_XPCOMCGlue.c +++ b/src/vbox/vbox_XPCOMCGlue.c @@ -104,7 +104,7 @@ tryLoadOne(const char *dir, bool setAppHome, bool ignor= eMissing, */ if (setAppHome) { if (dir !=3D NULL) { - setenv("VBOX_APP_HOME", dir, 1 /* always override */); + g_setenv("VBOX_APP_HOME", dir, 1 /* always override */); } else { unsetenv("VBOX_APP_HOME"); } diff --git a/tests/libxlxml2domconfigtest.c b/tests/libxlxml2domconfigtest.c index 5bda6db360..43584477a9 100644 --- a/tests/libxlxml2domconfigtest.c +++ b/tests/libxlxml2domconfigtest.c @@ -172,8 +172,8 @@ mymain(void) * results. In order to detect things that just work by a blind * chance, we need to set an virtual timezone that no libvirt * developer resides in. */ - if (setenv("TZ", "VIR00:30", 1) < 0) { - perror("setenv"); + if (g_setenv("TZ", "VIR00:30", 1) < 0) { + perror("g_setenv"); return EXIT_FAILURE; } =20 diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c index 6a720503a9..f79d683c8d 100644 --- a/tests/lxcxml2xmltest.c +++ b/tests/lxcxml2xmltest.c @@ -79,7 +79,7 @@ mymain(void) /* Unset or set all envvars here that are copied in lxcdBuildCommandLi= ne * using ADD_ENV_COPY, otherwise these tests may fail due to unexpected * values for these envvars */ - setenv("PATH", "/bin", 1); + g_setenv("PATH", "/bin", 1); =20 DO_TEST("systemd"); DO_TEST("hostdev"); diff --git a/tests/qemudomaincheckpointxml2xmltest.c b/tests/qemudomainchec= kpointxml2xmltest.c index 49e8cddeb3..c2e5db7e94 100644 --- a/tests/qemudomaincheckpointxml2xmltest.c +++ b/tests/qemudomaincheckpointxml2xmltest.c @@ -175,7 +175,7 @@ mymain(void) /* Unset or set all envvars here that are copied in qemudBuildCommandL= ine * using ADD_ENV_COPY, otherwise these tests may fail due to unexpected * values for these envvars */ - setenv("PATH", "/bin", 1); + g_setenv("PATH", "/bin", 1); =20 /* Test a normal user redefine */ DO_TEST_OUT("redefine", 0); diff --git a/tests/qemudomainsnapshotxml2xmltest.c b/tests/qemudomainsnapsh= otxml2xmltest.c index fd3bb04e26..04b67111c4 100644 --- a/tests/qemudomainsnapshotxml2xmltest.c +++ b/tests/qemudomainsnapshotxml2xmltest.c @@ -160,7 +160,7 @@ mymain(void) /* Unset or set all envvars here that are copied in qemudBuildCommandL= ine * using ADD_ENV_COPY, otherwise these tests may fail due to unexpected * values for these envvars */ - setenv("PATH", "/bin", 1); + g_setenv("PATH", "/bin", 1); =20 DO_TEST_OUT("all_parameters", "9d37b878-a7cc-9f9a-b78f-49b3abad25a8", TEST_INTERNAL); diff --git a/tests/qemufirmwaretest.c b/tests/qemufirmwaretest.c index 906d594ace..dffe47c386 100644 --- a/tests/qemufirmwaretest.c +++ b/tests/qemufirmwaretest.c @@ -70,7 +70,7 @@ testFWPrecedence(const void *opaque G_GNUC_UNUSED) =20 fakehome =3D g_strdup(abs_srcdir "/qemufirmwaredata/home/user/.config"= ); =20 - setenv("XDG_CONFIG_HOME", fakehome, 1); + g_setenv("XDG_CONFIG_HOME", fakehome, 1); =20 if (qemuFirmwareFetchConfigs(&fwList, false) < 0) return -1; diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index a0a579f29a..0c013d138b 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -598,7 +598,7 @@ mymain(void) abort(); } =20 - setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); + g_setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); =20 #if !WITH_YAJL fputs("libvirt not compiled with JSON support, skipping this test\n", = stderr); diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c index d5a4fb1268..50e25ee80f 100644 --- a/tests/qemumemlocktest.c +++ b/tests/qemumemlocktest.c @@ -67,7 +67,7 @@ mymain(void) abort(); } =20 - setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); + g_setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); =20 if (qemuTestDriverInit(&driver) < 0) { VIR_FREE(fakerootdir); diff --git a/tests/qemusecuritytest.c b/tests/qemusecuritytest.c index 685ac4dca2..71719241c3 100644 --- a/tests/qemusecuritytest.c +++ b/tests/qemusecuritytest.c @@ -112,7 +112,7 @@ testDomain(const void *opaque) =20 /* Mocking is enabled only when this env variable is set. * See mock code for explanation. */ - if (setenv(ENVVAR, "1", 0) < 0) + if (g_setenv(ENVVAR, "1", 0) < 0) return -1; =20 if (qemuSecuritySetAllLabel(data->driver, vm, NULL, false) < 0) diff --git a/tests/qemuvhostusertest.c b/tests/qemuvhostusertest.c index cc1e523841..6ff7923099 100644 --- a/tests/qemuvhostusertest.c +++ b/tests/qemuvhostusertest.c @@ -68,7 +68,7 @@ testVUPrecedence(const void *opaque G_GNUC_UNUSED) =20 fakehome =3D g_strdup(abs_srcdir "/qemuvhostuserdata/home/user/.config= "); =20 - setenv("XDG_CONFIG_HOME", fakehome, 1); + g_setenv("XDG_CONFIG_HOME", fakehome, 1); =20 if (qemuVhostUserFetchConfigs(&vuList, false) < 0) return -1; diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f0405866e1..62fd95b97d 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -614,15 +614,15 @@ mymain(void) abort(); } =20 - setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); + g_setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); =20 /* Set the timezone because we are mocking the time() function. * If we don't do that, then localtime() may return unpredictable * results. In order to detect things that just work by a blind * chance, we need to set an virtual timezone that no libvirt * developer resides in. */ - if (setenv("TZ", "VIR00:30", 1) < 0) { - perror("setenv"); + if (g_setenv("TZ", "VIR00:30", 1) < 0) { + perror("g_setenv"); return EXIT_FAILURE; } =20 @@ -793,10 +793,10 @@ mymain(void) /* Unset or set all envvars here that are copied in qemudBuildCommandL= ine * using ADD_ENV_COPY, otherwise these tests may fail due to unexpected * values for these envvars */ - setenv("PATH", "/bin", 1); - setenv("USER", "test", 1); - setenv("LOGNAME", "test", 1); - setenv("HOME", "/home/test", 1); + g_setenv("PATH", "/bin", 1); + g_setenv("USER", "test", 1); + g_setenv("LOGNAME", "test", 1); + g_setenv("HOME", "/home/test", 1); unsetenv("TMPDIR"); unsetenv("LD_PRELOAD"); unsetenv("LD_LIBRARY_PATH"); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 8b256b9b19..047e1d2b91 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -147,7 +147,7 @@ mymain(void) abort(); } =20 - setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); + g_setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); =20 /* Required for tpm-emulator tests */ @@ -234,7 +234,7 @@ mymain(void) /* Unset or set all envvars here that are copied in qemudBuildCommandL= ine * using ADD_ENV_COPY, otherwise these tests may fail due to unexpected * values for these envvars */ - setenv("PATH", "/bin", 1); + g_setenv("PATH", "/bin", 1); =20 DO_TEST("minimal", NONE); DO_TEST_CAPS_LATEST("genid"); diff --git a/tests/securityselinuxhelper.c b/tests/securityselinuxhelper.c index 8b90ddada9..50d4f40dc5 100644 --- a/tests/securityselinuxhelper.c +++ b/tests/securityselinuxhelper.c @@ -145,7 +145,7 @@ int setcon_raw(const char *context) errno =3D EINVAL; return -1; } - return setenv("FAKE_SELINUX_CONTEXT", context, 1); + return g_setenv("FAKE_SELINUX_CONTEXT", context, 1); } =20 int setcon(const char *context) @@ -224,7 +224,7 @@ int security_disable(void) return -1; } =20 - return setenv("FAKE_SELINUX_DISABLED", "1", 1); + return g_setenv("FAKE_SELINUX_DISABLED", "1", 1); } =20 int security_getenforce(void) diff --git a/tests/testutils.c b/tests/testutils.c index a3bedd0fef..3c786b3e29 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -96,7 +96,7 @@ virTestRun(const char *title, /* Some test are fragile about environ settings. If that's * the case, don't poison it. */ if (getenv("VIR_TEST_MOCK_PROGNAME")) - setenv("VIR_TEST_MOCK_TESTNAME", title, 1); + g_setenv("VIR_TEST_MOCK_TESTNAME", title, 1); =20 if (testCounter =3D=3D 0 && !virTestGetVerbose()) fprintf(stderr, " "); @@ -813,7 +813,7 @@ virTestSetEnvPath(void) } =20 if (new_path && - setenv("PATH", new_path, 1) < 0) + g_setenv("PATH", new_path, 1) < 0) goto cleanup; =20 ret =3D 0; @@ -847,7 +847,7 @@ int virTestMain(int argc, if (STRPREFIX(progname, "lt-")) progname +=3D 3; =20 - setenv("VIR_TEST_MOCK_PROGNAME", progname, 1); + g_setenv("VIR_TEST_MOCK_PROGNAME", progname, 1); =20 virFileActivateDirOverrideForProg(argv[0]); =20 diff --git a/tests/testutils.h b/tests/testutils.h index 0088251dca..c9ee11855f 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -118,7 +118,7 @@ int virTestMain(int argc, #ifdef __APPLE__ # define PRELOAD_VAR "DYLD_INSERT_LIBRARIES" # define FORCE_FLAT_NAMESPACE \ - setenv("DYLD_FORCE_FLAT_NAMESPACE", "1", 1); + g_setenv("DYLD_FORCE_FLAT_NAMESPACE", "1", 1); # define MOCK_EXT ".dylib" #else # define PRELOAD_VAR "LD_PRELOAD" @@ -140,7 +140,7 @@ int virTestMain(int argc, } else { \ newenv =3D g_strdup_printf("%s:%s", lib, preload); \ } \ - setenv(PRELOAD_VAR, newenv, 1); \ + g_setenv(PRELOAD_VAR, newenv, 1); \ FORCE_FLAT_NAMESPACE \ execv(argv[0], argv); \ } \ diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 6fe385e545..081ed331fa 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -603,7 +603,7 @@ qemuTestSetHostCPU(virCapsPtr caps, if (cpu) { caps->host.arch =3D cpu->arch; if (cpu->model) - setenv("VIR_TEST_MOCK_FAKE_HOST_CPU", cpu->model, 1); + g_setenv("VIR_TEST_MOCK_FAKE_HOST_CPU", cpu->model, 1); } caps->host.cpu =3D cpu; } diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index e1770426d7..dfedb0b91c 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@ -187,7 +187,7 @@ testCgroupDetectMounts(const void *args) virBuffer buf =3D VIR_BUFFER_INITIALIZER; size_t i; =20 - setenv("VIR_CGROUP_MOCK_FILENAME", data->file, 1); + g_setenv("VIR_CGROUP_MOCK_FILENAME", data->file, 1); =20 parsed =3D g_strdup_printf("%s/vircgroupdata/%s.parsed", abs_srcdir, d= ata->file); =20 @@ -994,13 +994,13 @@ initFakeFS(const char *mode, abort(); } =20 - setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); + g_setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); =20 if (mode) - setenv("VIR_CGROUP_MOCK_MODE", mode, 1); + g_setenv("VIR_CGROUP_MOCK_MODE", mode, 1); =20 if (filename) - setenv("VIR_CGROUP_MOCK_FILENAME", filename, 1); + g_setenv("VIR_CGROUP_MOCK_FILENAME", filename, 1); =20 return fakerootdir; } diff --git a/tests/virfiletest.c b/tests/virfiletest.c index c7d5f6abeb..70ad4ab92c 100644 --- a/tests/virfiletest.c +++ b/tests/virfiletest.c @@ -327,7 +327,7 @@ testFileIsSharedFSType(const void *opaque G_GNUC_UNUSED) =20 mtabFile =3D g_strdup_printf(abs_srcdir "/virfiledata/%s", data->mtabF= ile); =20 - if (setenv("LIBVIRT_MTAB", mtabFile, 1) < 0) { + if (g_setenv("LIBVIRT_MTAB", mtabFile, 1) < 0) { fprintf(stderr, "Unable to set env variable\n"); goto cleanup; } diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index 1f3f730433..05e1933b9e 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -507,7 +507,7 @@ mymain(void) abort(); } =20 - setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); + g_setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); =20 # define DO_TEST(fnc) \ do { \ diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c index 6c01336420..2210c8cc91 100644 --- a/tests/virnettlscontexttest.c +++ b/tests/virnettlscontexttest.c @@ -111,7 +111,7 @@ mymain(void) { int ret =3D 0; =20 - setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); + g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); =20 testTLSInit(KEYFILE); =20 diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c index 997cf5a372..59924c7037 100644 --- a/tests/virnettlssessiontest.c +++ b/tests/virnettlssessiontest.c @@ -239,7 +239,7 @@ mymain(void) { int ret =3D 0; =20 - setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); + g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); =20 testTLSInit(KEYFILE); =20 diff --git a/tests/virpcitest.c b/tests/virpcitest.c index d6dbe8c1ef..d99f53beaf 100644 --- a/tests/virpcitest.c +++ b/tests/virpcitest.c @@ -335,7 +335,7 @@ mymain(void) abort(); } =20 - setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); + g_setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); =20 # define DO_TEST(fnc) \ do { \ diff --git a/tests/virportallocatortest.c b/tests/virportallocatortest.c index 8e62fc4519..4e50cd74b3 100644 --- a/tests/virportallocatortest.c +++ b/tests/virportallocatortest.c @@ -171,7 +171,7 @@ mymain(void) if (virTestRun("Test alloc reuse", testAllocReuse, NULL) < 0) ret =3D -1; =20 - setenv("LIBVIRT_TEST_IPV4ONLY", "really", 1); + g_setenv("LIBVIRT_TEST_IPV4ONLY", "really", 1); =20 if (virTestRun("Test IPv4-only alloc all", testAllocAll, NULL) < 0) ret =3D -1; diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c index b85259f61f..3564eea50d 100644 --- a/tests/virsystemdtest.c +++ b/tests/virsystemdtest.c @@ -236,7 +236,7 @@ static int testCreateNoSystemd(const void *opaque G_GNU= C_UNUSED) }; int rv; =20 - setenv("FAIL_NO_SERVICE", "1", 1); + g_setenv("FAIL_NO_SERVICE", "1", 1); =20 if ((rv =3D virSystemdCreateMachine("demo", "qemu", @@ -270,7 +270,7 @@ static int testCreateSystemdNotRunning(const void *opaq= ue G_GNUC_UNUSED) }; int rv; =20 - setenv("FAIL_NOT_REGISTERED", "1", 1); + g_setenv("FAIL_NOT_REGISTERED", "1", 1); =20 if ((rv =3D virSystemdCreateMachine("demo", "qemu", @@ -304,7 +304,7 @@ static int testCreateBadSystemd(const void *opaque G_GN= UC_UNUSED) }; int rv; =20 - setenv("FAIL_BAD_SERVICE", "1", 1); + g_setenv("FAIL_BAD_SERVICE", "1", 1); =20 if ((rv =3D virSystemdCreateMachine("demo", "qemu", @@ -445,7 +445,7 @@ static int testPMSupportHelper(const void *opaque) const struct testPMSupportData *data =3D opaque; =20 for (i =3D 0; i < 4; i++) { - setenv("RESULT_SUPPORT", results[i], 1); + g_setenv("RESULT_SUPPORT", results[i], 1); if ((rv =3D data->tested(&result)) < 0) { fprintf(stderr, "%s", "Unexpected canSuspend error\n"); return -1; @@ -470,7 +470,7 @@ static int testPMSupportHelperNoSystemd(const void *opa= que) bool result; const struct testPMSupportData *data =3D opaque; =20 - setenv("FAIL_NO_SERVICE", "1", 1); + g_setenv("FAIL_NO_SERVICE", "1", 1); =20 if ((rv =3D data->tested(&result)) =3D=3D 0) { unsetenv("FAIL_NO_SERVICE"); @@ -493,7 +493,7 @@ static int testPMSupportSystemdNotRunning(const void *o= paque) bool result; const struct testPMSupportData *data =3D opaque; =20 - setenv("FAIL_NOT_REGISTERED", "1", 1); + g_setenv("FAIL_NOT_REGISTERED", "1", 1); =20 if ((rv =3D data->tested(&result)) =3D=3D 0) { unsetenv("FAIL_NOT_REGISTERED"); @@ -567,11 +567,11 @@ testActivation(bool useNames) snprintf(nfdstr, sizeof(nfdstr), "%zu", 1 + nsockIP); snprintf(pidstr, sizeof(pidstr), "%lld", (long long)getpid()); =20 - setenv("LISTEN_FDS", nfdstr, 1); - setenv("LISTEN_PID", pidstr, 1); + g_setenv("LISTEN_FDS", nfdstr, 1); + g_setenv("LISTEN_PID", pidstr, 1); =20 if (useNames) - setenv("LISTEN_FDNAMES", virBufferCurrentContent(&names), 1); + g_setenv("LISTEN_FDNAMES", virBufferCurrentContent(&names), 1); else unsetenv("LISTEN_FDNAMES"); =20 diff --git a/tests/virtimetest.c b/tests/virtimetest.c index 1eb321858b..0a5542ee34 100644 --- a/tests/virtimetest.c +++ b/tests/virtimetest.c @@ -79,8 +79,8 @@ testTimeLocalOffset(const void *args) const testTimeLocalOffsetData *data =3D args; long actual; =20 - if (setenv("TZ", data->zone, 1) < 0) { - perror("setenv"); + if (g_setenv("TZ", data->zone, 1) < 0) { + perror("g_setenv"); return -1; } tzset(); diff --git a/tools/virt-login-shell-helper.c b/tools/virt-login-shell-helpe= r.c index ace8733968..87735833d9 100644 --- a/tools/virt-login-shell-helper.c +++ b/tools/virt-login-shell-helper.c @@ -382,13 +382,13 @@ main(int argc, char **argv) } =20 clearenv(); - setenv("PATH", "/bin:/usr/bin", 1); - setenv("SHELL", shcmd, 1); - setenv("USER", name, 1); - setenv("LOGNAME", name, 1); - setenv("HOME", homedir, 1); + g_setenv("PATH", "/bin:/usr/bin", 1); + g_setenv("SHELL", shcmd, 1); + g_setenv("USER", name, 1); + g_setenv("LOGNAME", name, 1); + g_setenv("HOME", homedir, 1); if (term) - setenv("TERM", term, 1); + g_setenv("TERM", term, 1); =20 if (execv(shcmd, (char *const*) shargv) < 0) { virReportSystemError(errno, _("Unable to exec shell %s"), --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 17:14:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1573728188; cv=none; d=zoho.com; s=zohoarc; b=Fg4xEb6srmn59IW6JZ5YCV2psElNeFOeWCpCVdIZbDI6akLJQbQKpat9nfBY+k+uFdLKe6+0KBLxat7iDuHJB7rOX9eA7Sxg9fTOjQ+PJzDhtv4IHV99w9yFQZQKaJb5JlheHTGWeNTK2M9/TGj0xjKP19G7s9+LkjbT2Td4qqc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573728188; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EoN3jSAeyHwwYfhZVN5fSp+QHuYteoY7HPFxy9cnlC4=; b=AU3JHg+tGqsMEaKYHoxwrUCvWdIAEXsJMEwGmInX7/D1POomXmTX0k/utEalfr7CMt3IWyRTmF5diG5LDXuUFG6JfZIJ5kL6805z22t1tfx5eGpHQbqF6F+7E4642ZecnLanDTVWgX731ll0hRN2/1x5o87IrA0sPL/l8Fy/Ljw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1573728188048808.3288491320047; Thu, 14 Nov 2019 02:43:08 -0800 (PST) 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-321-r6IcMw9HOJGeW6p7sF3tDA-1; Thu, 14 Nov 2019 05:43:04 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 56ACF1802CE7; Thu, 14 Nov 2019 10:42:57 +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 D3DE45C219; Thu, 14 Nov 2019 10:42:56 +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 0364C18089CF; Thu, 14 Nov 2019 10:42:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAEAgbFm005413 for ; Thu, 14 Nov 2019 05:42:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 37500601B8; Thu, 14 Nov 2019 10:42:37 +0000 (UTC) Received: from antique-laptop.redhat.com (ovpn-200-40.brq.redhat.com [10.40.200.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0B0F60303 for ; Thu, 14 Nov 2019 10:42:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573728186; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=EoN3jSAeyHwwYfhZVN5fSp+QHuYteoY7HPFxy9cnlC4=; b=T1JoUIr2VFBolypBmMF2aRiIQUITEbYQZLefsDz65pVyF4vwK2nyQDC7VSRrvzRl3BVVKh 1lgM2T250X585ZQwANu6+QY+4q6U6YmyOKRXG79j4DVY/7BRjFWz11344DgaRWvy5Jx6x4 QYM9SXMjxmVeSDKQOM5IjTZlN4MN87w= From: Pavel Hrdina To: libvir-list@redhat.com Date: Thu, 14 Nov 2019 11:42:28 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] replace use of gnulib unsetenv by g_unsetenv 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.79 on 10.5.11.16 X-MC-Unique: r6IcMw9HOJGeW6p7sF3tDA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- src/util/virsystemd.c | 4 ++-- src/vbox/vbox_XPCOMCGlue.c | 2 +- tests/qemusecuritytest.c | 2 +- tests/qemuxml2argvtest.c | 10 +++++----- tests/testutils.c | 2 +- tests/testutilsqemu.c | 2 +- tests/vircgrouptest.c | 8 ++++---- tests/virfiletest.c | 2 +- tests/virsystemdtest.c | 28 ++++++++++++++-------------- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 1f9eddf70b..cfa499e5c4 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -854,8 +854,8 @@ virSystemdGetListenFDs(void) return 0; } =20 - unsetenv("LISTEN_PID"); - unsetenv("LISTEN_FDS"); + g_unsetenv("LISTEN_PID"); + g_unsetenv("LISTEN_FDS"); =20 VIR_DEBUG("Got %u file descriptors", nfds); =20 diff --git a/src/vbox/vbox_XPCOMCGlue.c b/src/vbox/vbox_XPCOMCGlue.c index 9cd39df0d8..4151d20909 100644 --- a/src/vbox/vbox_XPCOMCGlue.c +++ b/src/vbox/vbox_XPCOMCGlue.c @@ -106,7 +106,7 @@ tryLoadOne(const char *dir, bool setAppHome, bool ignor= eMissing, if (dir !=3D NULL) { g_setenv("VBOX_APP_HOME", dir, 1 /* always override */); } else { - unsetenv("VBOX_APP_HOME"); + g_unsetenv("VBOX_APP_HOME"); } } =20 diff --git a/tests/qemusecuritytest.c b/tests/qemusecuritytest.c index 71719241c3..e9af92ee23 100644 --- a/tests/qemusecuritytest.c +++ b/tests/qemusecuritytest.c @@ -125,7 +125,7 @@ testDomain(const void *opaque) =20 ret =3D 0; cleanup: - unsetenv(ENVVAR); + g_unsetenv(ENVVAR); freePaths(); return ret; } diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 62fd95b97d..19e8842f84 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -797,11 +797,11 @@ mymain(void) g_setenv("USER", "test", 1); g_setenv("LOGNAME", "test", 1); g_setenv("HOME", "/home/test", 1); - unsetenv("TMPDIR"); - unsetenv("LD_PRELOAD"); - unsetenv("LD_LIBRARY_PATH"); - unsetenv("QEMU_AUDIO_DRV"); - unsetenv("SDL_AUDIODRIVER"); + g_unsetenv("TMPDIR"); + g_unsetenv("LD_PRELOAD"); + g_unsetenv("LD_LIBRARY_PATH"); + g_unsetenv("QEMU_AUDIO_DRV"); + g_unsetenv("SDL_AUDIODRIVER"); =20 DO_TEST("minimal", NONE); DO_TEST("minimal-sandbox", diff --git a/tests/testutils.c b/tests/testutils.c index 3c786b3e29..cc951f6b29 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -148,7 +148,7 @@ virTestRun(const char *title, fprintf(stderr, "!"); } =20 - unsetenv("VIR_TEST_MOCK_TESTNAME"); + g_unsetenv("VIR_TEST_MOCK_TESTNAME"); return ret; } =20 diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 081ed331fa..3799a8e5b9 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -599,7 +599,7 @@ qemuTestSetHostCPU(virCapsPtr caps, cpu =3D cpuPower8; } =20 - unsetenv("VIR_TEST_MOCK_FAKE_HOST_CPU"); + g_unsetenv("VIR_TEST_MOCK_FAKE_HOST_CPU"); if (cpu) { caps->host.arch =3D cpu->arch; if (cpu->model) diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index dfedb0b91c..67785ae954 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@ -215,7 +215,7 @@ testCgroupDetectMounts(const void *args) result =3D 0; =20 cleanup: - unsetenv("VIR_CGROUP_MOCK_FILENAME"); + g_unsetenv("VIR_CGROUP_MOCK_FILENAME"); VIR_FREE(parsed); virCgroupFree(&group); virBufferFreeAndReset(&buf); @@ -1012,9 +1012,9 @@ cleanupFakeFS(char *fakerootdir) virFileDeleteTree(fakerootdir); =20 VIR_FREE(fakerootdir); - unsetenv("LIBVIRT_FAKE_ROOT_DIR"); - unsetenv("VIR_CGROUP_MOCK_MODE"); - unsetenv("VIR_CGROUP_MOCK_FILENAME"); + g_unsetenv("LIBVIRT_FAKE_ROOT_DIR"); + g_unsetenv("VIR_CGROUP_MOCK_MODE"); + g_unsetenv("VIR_CGROUP_MOCK_FILENAME"); } =20 static int diff --git a/tests/virfiletest.c b/tests/virfiletest.c index 70ad4ab92c..6c25674453 100644 --- a/tests/virfiletest.c +++ b/tests/virfiletest.c @@ -343,7 +343,7 @@ testFileIsSharedFSType(const void *opaque G_GNUC_UNUSED) ret =3D 0; cleanup: VIR_FREE(mtabFile); - unsetenv("LIBVIRT_MTAB"); + g_unsetenv("LIBVIRT_MTAB"); return ret; #endif } diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c index 3564eea50d..f3a8524914 100644 --- a/tests/virsystemdtest.c +++ b/tests/virsystemdtest.c @@ -246,11 +246,11 @@ static int testCreateNoSystemd(const void *opaque G_G= NUC_UNUSED) false, 0, NULL, NULL, 0)) =3D=3D 0) { - unsetenv("FAIL_NO_SERVICE"); + g_unsetenv("FAIL_NO_SERVICE"); fprintf(stderr, "%s", "Unexpected create machine success\n"); return -1; } - unsetenv("FAIL_NO_SERVICE"); + g_unsetenv("FAIL_NO_SERVICE"); =20 if (rv !=3D -2) { fprintf(stderr, "%s", "Unexpected create machine error\n"); @@ -280,11 +280,11 @@ static int testCreateSystemdNotRunning(const void *op= aque G_GNUC_UNUSED) false, 0, NULL, NULL, 0)) =3D=3D 0) { - unsetenv("FAIL_NOT_REGISTERED"); + g_unsetenv("FAIL_NOT_REGISTERED"); fprintf(stderr, "%s", "Unexpected create machine success\n"); return -1; } - unsetenv("FAIL_NOT_REGISTERED"); + g_unsetenv("FAIL_NOT_REGISTERED"); =20 if (rv !=3D -2) { fprintf(stderr, "%s", "Unexpected create machine error\n"); @@ -314,11 +314,11 @@ static int testCreateBadSystemd(const void *opaque G_= GNUC_UNUSED) false, 0, NULL, NULL, 0)) =3D=3D 0) { - unsetenv("FAIL_BAD_SERVICE"); + g_unsetenv("FAIL_BAD_SERVICE"); fprintf(stderr, "%s", "Unexpected create machine success\n"); return -1; } - unsetenv("FAIL_BAD_SERVICE"); + g_unsetenv("FAIL_BAD_SERVICE"); =20 if (rv !=3D -1) { fprintf(stderr, "%s", "Unexpected create machine error\n"); @@ -455,12 +455,12 @@ static int testPMSupportHelper(const void *opaque) fprintf(stderr, "Unexpected result for answer '%s'\n", results= [i]); goto error; } - unsetenv("RESULT_SUPPORT"); + g_unsetenv("RESULT_SUPPORT"); } =20 return 0; error: - unsetenv("RESULT_SUPPORT"); + g_unsetenv("RESULT_SUPPORT"); return -1; } =20 @@ -473,11 +473,11 @@ static int testPMSupportHelperNoSystemd(const void *o= paque) g_setenv("FAIL_NO_SERVICE", "1", 1); =20 if ((rv =3D data->tested(&result)) =3D=3D 0) { - unsetenv("FAIL_NO_SERVICE"); + g_unsetenv("FAIL_NO_SERVICE"); fprintf(stderr, "%s", "Unexpected canSuspend success\n"); return -1; } - unsetenv("FAIL_NO_SERVICE"); + g_unsetenv("FAIL_NO_SERVICE"); =20 if (rv !=3D -2) { fprintf(stderr, "%s", "Unexpected canSuspend error\n"); @@ -496,11 +496,11 @@ static int testPMSupportSystemdNotRunning(const void = *opaque) g_setenv("FAIL_NOT_REGISTERED", "1", 1); =20 if ((rv =3D data->tested(&result)) =3D=3D 0) { - unsetenv("FAIL_NOT_REGISTERED"); + g_unsetenv("FAIL_NOT_REGISTERED"); fprintf(stderr, "%s", "Unexpected canSuspend success\n"); return -1; } - unsetenv("FAIL_NOT_REGISTERED"); + g_unsetenv("FAIL_NOT_REGISTERED"); =20 if (rv !=3D -2) { fprintf(stderr, "%s", "Unexpected canSuspend error\n"); @@ -573,7 +573,7 @@ testActivation(bool useNames) if (useNames) g_setenv("LISTEN_FDNAMES", virBufferCurrentContent(&names), 1); else - unsetenv("LISTEN_FDNAMES"); + g_unsetenv("LISTEN_FDNAMES"); =20 map[0].name =3D "demo-unix.socket"; map[0].family =3D AF_UNIX; @@ -640,7 +640,7 @@ testActivationEmpty(const void *opaque G_GNUC_UNUSED) { virSystemdActivationPtr act; =20 - unsetenv("LISTEN_FDS"); + g_unsetenv("LISTEN_FDS"); =20 if (virSystemdGetActivation(NULL, 0, &act) < 0) return -1; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 17:14:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1573728204; cv=none; d=zoho.com; s=zohoarc; b=DL7W+FZFBYdwmm28m5HfTR8e5Yh3Coxd022u6P9DfMvZtp0f84LW6R1U6I765em4ywPCYtkAa4MFzDkMMxd6e8ds6Le7Wy/1oWkfQBf9a3K9JQ1TwVWBoov1jYZkD9xsw2n/LaMqkrzg6biXzSz8xNnc+JiDp+NN25mEmQqHU/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573728204; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kumqJEA4BQ/Q3U/WY+hi0QPR479u202WxKgo9ZIbxtk=; b=XHqSFxIwd3qLFIsTONHvyzY1zJPs66VoR/L3q9Wty5Zbop2dgntuVaVH6M8Mir5tiUR4nn4cIvIb/eBDUt1Dt7lYi7oP6doSpnic2yR1TwHPkFcRDFu+BoTvxAgc6btNJV4vZIBHK4chuo2Y9yMc8fcW7Od97qhoSV13cAKFALU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1573728204128474.5153908913694; Thu, 14 Nov 2019 02:43:24 -0800 (PST) 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-132-RwD42GAeMou6jUZN0pcB8A-1; Thu, 14 Nov 2019 05:43:21 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BAEAD8C5EE0; Thu, 14 Nov 2019 10:43:16 +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 944615C548; Thu, 14 Nov 2019 10:43:16 +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 3AD8D18089D5; Thu, 14 Nov 2019 10:43:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAEAgcU8005425 for ; Thu, 14 Nov 2019 05:42:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3A03660303; Thu, 14 Nov 2019 10:42:38 +0000 (UTC) Received: from antique-laptop.redhat.com (ovpn-200-40.brq.redhat.com [10.40.200.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BC2A601B8 for ; Thu, 14 Nov 2019 10:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573728203; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=kumqJEA4BQ/Q3U/WY+hi0QPR479u202WxKgo9ZIbxtk=; b=b8PVGso+5XS2P+CDljJnBdt7ROOfgBBcZwItrLQKKrEm/BceimFOB39yrrwFX4e7Gvrxx1 EDDj1QbMMoPc49QhoNNYeuKMY3dGXHpk6CzByUrlupnlrpdjdyhgwqF4IfdrsVtvWJhvji f7J39V+18zAjKAVC8vFoHPAmOdi28dw= From: Pavel Hrdina To: libvir-list@redhat.com Date: Thu, 14 Nov 2019 11:42:29 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] syntax-check: forbid usage of setenv and unsetenv 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.79 on 10.5.11.16 X-MC-Unique: RwD42GAeMou6jUZN0pcB8A-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" --- build-aux/syntax-check.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 1c46928ac7..710ac1c949 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1169,6 +1169,14 @@ sc_prohibit_dirent_d_type: halt=3D'do not use the d_type field in "struct dirent"' \ $(_sc_search_regexp) =20 +sc_prohibit_setenv: + @prohibit=3D'\' \ + halt=3D'use g_setenv instead of setenv' \ + $(_sc_search_regexp) + @prohibit=3D'\' \ + halt=3D'use g_unsetenv instead of unsetenv' \ + $(_sc_search_regexp) + =20 # _sc_search_regexp # @@ -2341,6 +2349,9 @@ exclude_file_name_regexp--sc_prohibit_cross_inclusion= =3D \ exclude_file_name_regexp--sc_prohibit_dirent_d_type =3D \ ^(src/util/vircgroup.c)$ =20 +exclude_file_name_regexp--sc_prohibit_setenv =3D \ + ^(build-aux/syntax-check\.mk|bootstrap\.conf)$$ + exclude_file_name_regexp--sc_prohibit_strcmp =3D \ ^(tools/nss/libvirt_nss.*\.c|tools/virt-login-shell\.c) =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 17:14:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1573728198; cv=none; d=zoho.com; s=zohoarc; b=FpztEgv011jCNwT1XpcsMiXH3MqogboaZU/jzKRdKF/0+RtlySlNsU+Jp3/9TNdUpbpPo3XkuYeOpCZdNsP6inx3IDWJDFxJpCUgFPqfsqVI9hGO19rOnnj1MkvkzP/ZiXX3QVBs5Dnnn6vdeI4+weqlnNjA9mzF1eJdvDUmRc8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573728198; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UwyiJyL8IdXzb81mGD804SVpQ6OtvWolk+brSypR6k0=; b=B7IHleDxAnxajc5I/U8pPVNpFWxWtsxcMeiWyvkodRrppw4IUpcUmxmYQqWYUfdCSDDRf9sUyj9UhQ/UoSzOxBcSPWAX3ps7ffzloH9lw8VyTUykwN1/kUQYajk0KyRXBBH7jtxbdsC2L0MY3DkSE7uPltFTmSoJFtvhfFQJ2O4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1573728198622934.1975009831286; Thu, 14 Nov 2019 02:43:18 -0800 (PST) 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-60-vtzk06n6PdmMF_7PC7bz3A-1; Thu, 14 Nov 2019 05:43:15 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9D0041005511; Thu, 14 Nov 2019 10:43:10 +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 709FE691B7; Thu, 14 Nov 2019 10:43:10 +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 2CC024A460; Thu, 14 Nov 2019 10:43:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAEAgdQg005431 for ; Thu, 14 Nov 2019 05:42:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 76E2C601B8; Thu, 14 Nov 2019 10:42:39 +0000 (UTC) Received: from antique-laptop.redhat.com (ovpn-200-40.brq.redhat.com [10.40.200.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E57260303 for ; Thu, 14 Nov 2019 10:42:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573728197; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UwyiJyL8IdXzb81mGD804SVpQ6OtvWolk+brSypR6k0=; b=ia0GesfNt9tqI0V5VJ3UR5sJvtfohRs39PPdKeU79rS53oIQP6GDvjc8gGBoaJln006/fZ mB7wqV+0ZwGCyjU3ep10hHxwnuMu7TO3OVTqKDoAtl5vuFjnGFBeJ9Oviv++uuoOP/gbIc TP3xc9BfqmsNHuhCoTuzEVrxkbk05f0= From: Pavel Hrdina To: libvir-list@redhat.com Date: Thu, 14 Nov 2019 11:42:30 +0100 Message-Id: <660923f10532d7e8d2caf37e5ef3b6a0af1ecde7.1573726952.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] bootstrap.conf: remove usage of setenv and unsetenv gnulib modules 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.79 on 10.5.11.13 X-MC-Unique: vtzk06n6PdmMF_7PC7bz3A-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- bootstrap.conf | 2 -- build-aux/syntax-check.mk | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 4c784487e2..0f75600a2e 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -70,7 +70,6 @@ pthread_sigmask recv regex send -setenv setsockopt sigaction sigpipe @@ -88,7 +87,6 @@ time_r timegm ttyname_r uname -unsetenv verify vsnprintf waitpid diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 710ac1c949..5a3d796e45 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -2350,7 +2350,7 @@ exclude_file_name_regexp--sc_prohibit_dirent_d_type = =3D \ ^(src/util/vircgroup.c)$ =20 exclude_file_name_regexp--sc_prohibit_setenv =3D \ - ^(build-aux/syntax-check\.mk|bootstrap\.conf)$$ + ^(build-aux/syntax-check\.mk)$$ =20 exclude_file_name_regexp--sc_prohibit_strcmp =3D \ ^(tools/nss/libvirt_nss.*\.c|tools/virt-login-shell\.c) --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list