From nobody Wed Feb 21 14:19:34 2024 X-Original-To: jail@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 4Tfz1L3MsGz5CGX2 for ; Wed, 21 Feb 2024 14:19:34 +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 4Tfz1L2Hm4z4l6R for ; Wed, 21 Feb 2024 14:19:34 +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=1708525174; 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: in-reply-to:in-reply-to:references:references; bh=fW2A/w1hCWwl+5IvPvnVaLFSfOV/Pd0o5p0TaPL8LXA=; b=FH45k7Glku1ilMSXLkh0FfSZwdcIl5lUdZYziv8urJoIsXydnOJULFxue8/UYLdrf7+u9j Zd4QFRIuLl+VSIel5CWCG1M/K96aiVlA5rA/sz20KOdxAp569RyEeVWx2opeu3WkRtaM0A iHxaomrIzVc012mxUVYYyD+zkRKxcilvwMjOdtr3IgpGpiASF8jpy6Cgfd+YgTAcVO30pj y5X0CrXPuqek/tPtYnARc8rNZ4hOzEOYlDDzPCtU8TncP3d/2a7YtkFxxBd+k1IMhhkQHL D3DazbS1kxCEYQnv3gbMI04GHkI758PJXDZZ+VQeYUZa8XtzFp7y+Q2+2c3jag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708525174; a=rsa-sha256; cv=none; b=M+I196XQ7zJTZ1R+E6XBA5DlPXE54JXuBn1CurLFsc5Y9jDuCp5iTgJv08VT7x+cUbatAc v+pt7UJ+T06brkqLQ/6+wCSH1vRdsAv3piLdQWLPZ+2O8L71DymTigkNVyCkJ7yNariCnI NK2wZhg9N/o0wdcWTCjBtDHAyFdYN/CGgLBKhkj+IgvekM7hLN5i9VX3HSI9DKh+noZ+Ld i20AeeUnswauZHNM4e5xda4F7uyybdbQYB3qdZ/S/xD3FK3JvGB/NXBuO7OSIcu36zyPpe tFxCtGHGrxUWOR36OwzsPvfYSDCjiWx+C73vI60XLVxFTnmaws8fxV0MMEr+yQ== 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 4Tfz1L17C3z159k for ; Wed, 21 Feb 2024 14:19:34 +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 41LEJYZn073971 for ; Wed, 21 Feb 2024 14:19:34 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 41LEJYxI073970 for jail@FreeBSD.org; Wed, 21 Feb 2024 14:19:34 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: jail@FreeBSD.org Subject: [Bug 277210] jail(8): exec.clean retrieves PWD from user info (can cause services to crash on jail start-up) Date: Wed, 21 Feb 2024 14:19:34 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: linimon@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: jail@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to Message-ID: In-Reply-To: References: 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: Discussion about FreeBSD jail(8) List-Archive: https://lists.freebsd.org/archives/freebsd-jail List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-jail@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277210 Mark Linimon changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|bugs@FreeBSD.org |jail@FreeBSD.org --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Thu Feb 22 02:12:17 2024 X-Original-To: jail@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 4TgGqk0gnyz5BbBs for ; Thu, 22 Feb 2024 02:12:18 +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 4TgGqj607pz4shd for ; Thu, 22 Feb 2024 02:12:17 +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=1708567937; 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: in-reply-to:in-reply-to:references:references; bh=cw5HBQmYRlmLGEUG++t5OTHuOLKLj1j+mCvRSf46w8Y=; b=YZrEHSuQHQCBFhpArcBKM4FDCr3tuys38TB++YF3fu8RmqOuBhY0NTr3IUTW18ZjQKo6+s gr5De1q659eEnXu2TEeci7u0SlTCblOxyO1Hu8Qm56U1sktbwMuaXyBxpCr+rhSbw77Ecg 3aLtKyzx81YBkxkL1ORiQrHmB/oEVZ+tm+TjL9eeviJjD8i3LQkt0i2EPFxGC+eNEAPyYW HJdOHeM/tX/k5hyCtkfnNmLruSa4dyKis/8cQCvgKi7bYmkE4XMRRhKts/NVfLlUNFwRe4 kLiokBrQHwBk3zVQn7gMADPQHLxqHoU/fCgkd4nfz6eLnHe3vznA2qqN5FjVsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708567937; a=rsa-sha256; cv=none; b=iKGiZsZllBmeQuRPtfNKDv3YNM1uAiZfzrWMKtpPjOUuOihQu+864iTmzSz9ovKTogUXO8 r5lZxAUsYspKlAxw2xRwojEIrOOJ1GNf8xi5ofKsRgnp3k8ibYxTvmhOU4FhJbonmj0g3b ai8x7erkuAxe3zEPVLs5CkmU6MJ1t7UWwymN9FIntcc5gmTyxqmMYwURcv2CGXYqYP9S2A Z8WE9GK0QcH1quuDBp2ocm/Xz4Eif6ECvt2cq2R/t92yH/7l6iMw58KBMTPCYZRWMo5cYt gB0ZLUenRjMYXHxLkJ35e9D0A6bylWpx//+PWLqUzGHQVY5fIhOeCVAOxo7PbQ== 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 4TgGqj52V3z1Rtf for ; Thu, 22 Feb 2024 02:12:17 +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 41M2CH5l035481 for ; Thu, 22 Feb 2024 02:12:17 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 41M2CHUo035477 for jail@FreeBSD.org; Thu, 22 Feb 2024 02:12:17 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: jail@FreeBSD.org Subject: [Bug 277210] jail(8): exec.clean retrieves PWD from user info (can cause services to crash on jail start-up) Date: Thu, 22 Feb 2024 02:12:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: jamie@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: jail@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc bug_status Message-ID: In-Reply-To: References: 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: Discussion about FreeBSD jail(8) List-Archive: https://lists.freebsd.org/archives/freebsd-jail List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-jail@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277210 Jamie Gritton changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jamie@FreeBSD.org Status|New |Open --- Comment #5 from Jamie Gritton --- While it does make sense to root from the jail's root under exec.clean, it unfortunately clashes with a decade of current practice. I'll consider a change, and see what people think, but I can't guarantee it= 'll happen given the long history. It seems reasonable that if a user is speci= fied (even directly like -U root), then it would still chdir to its home, but in= the absence of a user, starting in "/" would in fact be the most expected outco= me. --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Thu Feb 22 07:09:44 2024 X-Original-To: jail@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 4TgPQx0WQZz5C3pm for ; Thu, 22 Feb 2024 07:09:45 +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 4TgPQw5mbPz4NRg for ; Thu, 22 Feb 2024 07:09:44 +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=1708585784; 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: in-reply-to:in-reply-to:references:references; bh=983zoVspZsZG3mDP85ghx+NPMALa9z+u7/YcAPUAm4A=; b=U6XCkRXGjejWNMOKnYkMDm9+OCYMgwCyhual82h6JnxOVmJC9wj5PJNRM8N2mM0ipvyfTC B1c7p4PpLNRVUdBK5ixAG2Nef4K+jgyScFKkWloy/5Fj3T1VOdqlo9kMmxhz+k2qisK09X QNN//UkWXepvFIacBno7zH0oayubeLc3yza5iR6BCKa1iWHD/cAfcOhpH3Aj9uAS7XOXYv tcvfyMTBIAyTkY0RC92JgRseWYvcnHCnX0U0dDsQmFRb0uVbB3SMN0BWsZm32TOk0Sn4Ah P1J+zGp27NSEZE3radem7dQJyPbCeyjIxNMCguJxYFB41umgHUVG4HA2RbT69g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708585784; a=rsa-sha256; cv=none; b=Dh77Zqhm9e3HIMIpeZg1aOgodCulb3pXrIeC5i8rYCo6cWb9+ZtEGDJfzHYSQBWXnN2GER Yl1tguSNoTd9f5RShNigr1zrZWbSLNM0iU02E3WpAtoXrOYH2acruTeUXTxPyxZDdYRTLV YjDG51aaDcie/0StrZoTxVts5OBOUGma4flmoY+duOv4mEiRC1AU9WCLhG5MXMn8K/LaGN SCzFYbmvzlv+rq2J53IfCE4z86ObO43RVv2u2+CTtBwGTmjZdHgRQguqDjg4mbyzZYkrjd VZW4WZU1p8IOrTG2imK8jFStpiriy1mT4sfUCTbf9eW7Rz5fE4Ctx3G2d+OQMg== 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 4TgPQw4knzzM8R for ; Thu, 22 Feb 2024 07:09:44 +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 41M79iaJ069025 for ; Thu, 22 Feb 2024 07:09:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 41M79io0069024 for jail@FreeBSD.org; Thu, 22 Feb 2024 07:09:44 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: jail@FreeBSD.org Subject: [Bug 277210] jail(8): exec.clean retrieves PWD from user info (can cause services to crash on jail start-up) Date: Thu, 22 Feb 2024 07:09:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: johannes.kunde@gmail.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: jail@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: Discussion about FreeBSD jail(8) List-Archive: https://lists.freebsd.org/archives/freebsd-jail List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-jail@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277210 --- Comment #6 from johannes.kunde@gmail.com --- (In reply to Jamie Gritton from comment #5) > While it does make sense to root from the jail's root under exec.clean, i= t unfortunately clashes with a decade of current practice. I get the idea. I believe it runs contrary to what most people expect to be= the outcome, which would be a behavior consistent with the host system. A servi= ce running inside a jail with a user other than root most likely doesn't want = to start at /root. > It seems reasonable that if a user is specified (even directly like -U ro= ot), then it would still chdir to its home, but in the absence of a user, s= tarting in "/" would in fact be the most expected outcome. That sounds reasonable. I think one of the main problems is also the lack of information when the problem occurs unexpectedly in the wild. All I got printed out from an exte= rnal library, which caused the issue in my case, was this line: > Feb 12 20:20:39 myjail myservice[9364]: 2024/02/12 20:20:39 stat .: permi= ssion denied Starting from there, it's almost impossible to have a clue what's going on. I don't know if there is any good chance to generate helpful output at runt= ime, but some hints in the manpage would help as well. --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Thu Feb 22 08:06:45 2024 X-Original-To: jail@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 4TgQhj5L5pz5C8Cc for ; Thu, 22 Feb 2024 08:06:45 +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 4TgQhj3Np3z4RQv for ; Thu, 22 Feb 2024 08:06:45 +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=1708589205; 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: in-reply-to:in-reply-to:references:references; bh=0H/JYILlgTmNnxp7E0sxQIMc4pTCEUCTI9fYowomPl8=; b=Pb+HBFuVWp668c9KlEG92sNG3v+jNQvMjxQuMOtAVFlCS3NzUwH8wtOvqa4XeAM5tRhg8g qg4VDgEBasfaQEJC221+Dcmzo4wVfxdrTd+tgE3Qs3al8vhxvOPPOkW79DT47ZBWRW8l1i zEMmuGqIF5bOCGY1V/TM1ZoO8YJBNTnmxBJBX5J7mWkEMcdnSSJwgFkrUnRfwWvARqFkCM mRAPor/B8rBlPTZTW3PR2ilx6F67CbwaQEdEpm6uviefAaRbrH1uPX1ebs5xERqrCU/8ol /18VjX/dzgIpXylNQ+jt84y47k9WjyaYA0uRGrBKgRNE402+bSwVKb8px4wNsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708589205; a=rsa-sha256; cv=none; b=gbI22Lh5L3geBzU5Jmy3EAQ8f7Drz01VXNwUq6yxtlLXN+V78nNyHcW1WFuCL2pqVFXPYQ 3Gq/0qrN+8LWhkI9s5WuHxTQDCc3vB0Y6w1bsdITsB92I1/tjA4VL/Gled9acA29s3x3Vn +WOdSv6rzf52xHrm7YzHp6BPUFjo9X6gK0y4jXctl6nVp4htxiy2gWUyFeEWbzbt0UOkKj 4c9NwX0r3XxuX+ysfDFO6eoeuMa+MXx2qmGx3Bc7cco6E5QwFuKT/PUGSLivXGcXjE//hJ MqU6MCZqmU3q7yeT8t8sBSaVbxeqU+Ur7CAomjzVFlKqlCsAVyjZjYVKCd/a3g== 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 4TgQhj2MLkzNml for ; Thu, 22 Feb 2024 08:06:45 +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 41M86jnD064002 for ; Thu, 22 Feb 2024 08:06:45 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 41M86jgY064001 for jail@FreeBSD.org; Thu, 22 Feb 2024 08:06:45 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: jail@FreeBSD.org Subject: [Bug 277210] jail(8): exec.clean retrieves PWD from user info (can cause services to crash on jail start-up) Date: Thu, 22 Feb 2024 08:06:45 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: michaelo@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: jail@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: Discussion about FreeBSD jail(8) List-Archive: https://lists.freebsd.org/archives/freebsd-jail List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-jail@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277210 --- Comment #7 from Michael Osipov --- >From jail(8): exec.clean Run commands in a clean environment. The environment is d= is- carded except for HOME, SHELL, TERM and USER. HOME and SH= ELL are set to the target login's default values. USER is set = to the target login. TERM is imported from the current envir= on- ment. The environment variables from the login class capab= il- ity database for the target login are also set. I completely miss the chdir(2) here with PWD. That is the first one to be f= ixed even if it gets reverted because it is not documented. --=20 You are receiving this mail because: You are the assignee for the bug.=