From nobody Thu Feb 9 10:38:25 2023 X-Original-To: ports-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PCCyB0q1dz3nYcV for ; Thu, 9 Feb 2023 10:38:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCCy96V3xz3GYx for ; Thu, 9 Feb 2023 10:38:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675939105; h=from:from: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; bh=qMxcx0kOeC+AKI8PcAc3QPqRUbRPKiUrfrXjfIs9KEg=; b=yPAGaGSUykjvPA/oNCoznFb29koF3hu/XSdd8rUgOvQlfXPONgekPZATtk0pdvyDPAdWPd AuqZ6FeU4Oyilt5bRH9g5qFIOIQA05HG3A4LwKD0sIuIU5jrBlIyOpmwsQBMkN5aCOMmBb h/xsijACR0W6gpDMl2fk86zxST1x3McoK4VqMR/JA+Gr0VtLfrPacR2FvA4JN0OEI9n0rD mc28HTqODExnUBW4orDPyVRUOBu+DvP1n/R7bzoksfOgirXH01GbtHUvEN2rPSplRECQQ5 khQfTZg+jhqNjpYBDGmE1ibjWDhTOQISqkChjY2F58chkAK4ST3f2p1urw2auw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675939105; a=rsa-sha256; cv=none; b=t/7S2HAlDDZjG6SQByQnQCi1hwkSKhE5vr5RkVINulDvZGh1Dg7iUwKT4ErhKiZdZFXMHZ roXPg3fw1odv4vhhXeg607D5bWvrKj250tjzbn5+opdNMipBLUVggm8s3Duq7XpFBGQY7u H1fNtlF5cCTE8q+3TwlDZZaKlK1o7MGBLOoN/EcysUat94Ntm5AqJxvvAEL0awRzmGsAzb mqtIRkv9u+zTecQ7aT6gCWnaBeMqvAR1QfPXCrX6OrIyMuB4rQwPTcmbIqq/nNBaa+4dTm oCWCgaDYgAkfTTvW+Pdgo2y712JThJrgdt2bxGDLdwFrkzv8SKXARqZlCEM9iw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCCy95L4czZ3v for ; Thu, 9 Feb 2023 10:38:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 319AcPKu006059 for ; Thu, 9 Feb 2023 10:38:25 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 319AcPB6006058 for ports-bugs@FreeBSD.org; Thu, 9 Feb 2023 10:38:25 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 269433] ports-mgmt/pkg Segfault on malformed pkg.conf content (pkg_env) Date: Thu, 09 Feb 2023 10:38:25 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: theo.bertin@advens.fr X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: pkg@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269433 Bug ID: 269433 Summary: ports-mgmt/pkg Segfault on malformed pkg.conf content (pkg_env) Product: Ports & Packages Version: Latest Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: pkg@FreeBSD.org Reporter: theo.bertin@advens.fr Assignee: pkg@FreeBSD.org Flags: maintainer-feedback?(pkg@FreeBSD.org) There seems to be a bug in the way pkg handles options in pkg.conf (/usr/local/etc/pkg.conf). Problem was initially detected on an HardenedBSD 13.1-STABLE, but was reproduced on a fresh FreeBSD 13.1-RELEASE downloaded today: - FreeBSD 13.1-RELEASE: uname -aKU =3D FreeBSD freebsd 13.1-RELEASE FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC amd64 1301000 1301000 - pkg -vv: Version : 1.19.0 PKG_DBDIR =3D "/var/db/pkg"; PKG_CACHEDIR =3D "/var/cache/pkg"; PORTSDIR =3D "/usr/ports"; INDEXDIR =3D ""; INDEXFILE =3D "INDEX-13"; HANDLE_RC_SCRIPTS =3D false; DEFAULT_ALWAYS_YES =3D false; ASSUME_ALWAYS_YES =3D false; REPOS_DIR [ "/etc/pkg/", "/usr/local/etc/pkg/repos/", ] PLIST_KEYWORDS_DIR =3D ""; SYSLOG =3D true; ABI =3D "FreeBSD:13:amd64"; ALTABI =3D "freebsd:13:x86:64"; DEVELOPER_MODE =3D false; VULNXML_SITE =3D "http://vuxml.freebsd.org/freebsd/vuln.xml.xz"; FETCH_RETRY =3D 3; PKG_PLUGINS_DIR =3D "/usr/local/lib/pkg/"; PKG_ENABLE_PLUGINS =3D true; PLUGINS [ ] DEBUG_SCRIPTS =3D false; PLUGINS_CONF_DIR =3D "/usr/local/etc/pkg/"; PERMISSIVE =3D false; REPO_AUTOUPDATE =3D true; NAMESERVER =3D ""; HTTP_USER_AGENT =3D "pkg/1.19.0"; EVENT_PIPE =3D ""; FETCH_TIMEOUT =3D 30; UNSET_TIMESTAMP =3D false; SSH_RESTRICT_DIR =3D ""; PKG_ENV { } ABI Repositories: FreeBSD: {=20 url : "pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterl= y", enabled : yes, priority : 0, mirror_type : "SRV", signature_type : "FINGERPRINTS", fingerprints : "/usr/share/keys/pkg" } How to reproduce: - install pkg - install some package (step likely not necessary) - edit /usr/local/etc/pkg.conf and add the following lines (without the "-"= 's): --------------------------------------- pkg_env {} PKG_ENV : { http_proxy: "http://10.0.0.1:3128" https_proxy: "http://10.0.0.1:3128" ftp_proxy: "http://10.0.0.1:3128" } --------------------------------------- - try doing a `pkg info`: root@freebsd:~ # pkg info=20 gettext-runtime-0.21.1 GNU gettext runtime libraries and programs indexinfo-0.3.1 Utility to regenerate the GNU info page index libffi-3.4.4 Foreign Function Interface mpdecimal-2.5.1 C/C++ arbitrary precision decimal floating p= oint libraries pkg-1.19.0 Package manager python39-3.9.16 Interpreted object-oriented programming lang= uage readline-8.2.0 Library for editing command lines as they are typed vim-9.0.0981 Improved version of the vi editor (console flavor) Child process pid=3D1149 terminated abnormally: Segmentation fault root@freebsd:~ #=20 The configuration is obviously wrong, but pkg shouldn't segfault on this. After some testing, it seems that: - pkg doesn't fail if multiple lines with same case are in the file ('pkg_e= nv {}' plus 'pkg_env : {...}') - pkg fails when multiple lines are present, with a different casing ('pkg_= env {}' plus 'PKG_ENV : {...}') I don't know if this bug occurs only for the pkg_env option, or other parameters as well. --=20 You are receiving this mail because: You are the assignee for the bug.=