From nobody Mon Jun 3 08:10:51 2024 X-Original-To: freebsd-hackers@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 4Vt5yN07QCz5M4Lk; Mon, 03 Jun 2024 08:10:52 +0000 (UTC) (envelope-from salvadore@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vt5yM5M4Rz47xb; Mon, 3 Jun 2024 08:10:51 +0000 (UTC) (envelope-from salvadore@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717402251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=Zo/nxmY3NMGzs/HocIrbPCQuSo5fsPZ9J+VRhg7pgRI=; b=pRDASE4brHkNHqNW9wa/DxO/fPvhSWd2ockx15l+8e4MKlUGT+rTau1lzhsRed1O07qPaD xYRRq4MOaEakHqM6Ia8J1zF2vSLYo3n0idDRkBzsFtbL09El3AZHcKKZUbLf0cqNo6tSy3 Lq1p2cue495JaUln91LNbfRGsrDYm0yIFQ+kF0BTG4/se+O9m5U979+qahC3jc0ZmgduoL 221xXDHcx350B94/mvXgkW+yTWNtzIZsgYCw2Zcoh0hZ8sfE59Hys+eJGwI3Lu24K24/4D z0FCwOa5uwUeLnGlrG1t1gsNZSKuoC+5Cay9AMe3gextHy/JK4sZ6yn4fEdOKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717402251; a=rsa-sha256; cv=none; b=SB/CIKiKTI2SB4FgHxi8dj+pndBwqiluHzxaaXQF/fUytBth4WeUl+k25j7irpxqddjFTY C4W8QYDQ4nzHaLuBk9HsIGKpU5ZbZ5FShNntLT9cLt9cXuwnSD97uXY0s4wLYqS55OkWgv JtqR6T+pB4kyJOs3H40QbEUbGRHTayabmJQ6NIzzkxe5zQf+yZ3K+AtLBoGwB3wHko/WaM Hr9CzmBzMXsOZeZOnQlamLwfOhDcmGYb1oGt0CUNkQY7zsg+I6LoD0iszTFuTJ4Q9Vheyb 0aGveDn7oVHQ7S0QD8g7wkLldEajQl4abHydOY+Mya4XI/H6JyZzRuj/1ClaNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717402251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=Zo/nxmY3NMGzs/HocIrbPCQuSo5fsPZ9J+VRhg7pgRI=; b=WLlwf0bh8sut2L2VkP+L2hxUGBdfSDWi0vHCLWH+jOXNhUAKG2WUh5enZkcYyNHelctwMe gSWRW31v7pTJdpmB0AQxf/zSyL541gb13LhsHd/Nv+WKOKjAlxKFv6k5c6GYo6t/wtAsph ahIV1vJNcU0fRqg41qKXK+rFNtGuQP9+aD8ohxeuS2I8h70AtV4XjyjDDTfJTbv/CsCRzW 3+vnhI8rI9docPupW6K+RmNUBhraKs4v06izEHWFxwfc9E0ddwl488Jgcr6xrDdcoyxsrM hAS+K5rEJjWk63HEZje9ccqfeKO7oTXw9/b/wGFepo6HlGxm8Py06MbU/1ty2Q== Received: by freefall.freebsd.org (Postfix, from userid 1472) id B2318CECF; Mon, 03 Jun 2024 08:10:51 +0000 (UTC) To: freebsd-status-calls@FreeBSD.org Subject: Call for 2024Q2 status reports Cc: freebsd-current@FreeBSD.org,freebsd-hackers@FreeBSD.org,devsummit@FreeBSD.org,info@bsdcan.org,soc-students@FreeBSD.org,soc-mentors@FreeBSD.org Message-Id: <20240603081051.B2318CECF@freefall.freebsd.org> Date: Mon, 03 Jun 2024 08:10:51 +0000 (UTC) From: Lorenzo Salvadore List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org Dear FreeBSD Community, The deadline for the next FreeBSD Status Report update is June, 30th 2024 for work done since the last round of quarterly reports: April 2024 - June 2024. I would like to remind you that reports are published on a quarterly basis and are usually collected during the last month of each quarter, You are also welcome to submit them even earlier if you want, and the earlier you submit them, the more time we have for reviewing. Status report submissions do not need to be very long. They may be about anything happening in the FreeBSD project and community, and they provide a great way to inform FreeBSD users and developers about work that is underway or has been completed. Report submissions are not limited to committers; anyone doing anything interesting and FreeBSD related can -- and should -- write one! The following methods are available to submit your reports: * submit a review on Phabricator and add the group "status" to the reviewers list. You should put your reports in the directory doc/website/content/en/status/report-2024-04-2024-06/ (create it if it is missing); * submit a pull request at . You should put your reports in the directory doc/website/content/en/status/report-2024-04-2024-06/ (create it if it is missing); * send an email to status-submissions@FreeBSD.org including your report. An AsciiDoc template is available at . We look forward to seeing your 2024Q2 reports! Thanks, Lorenzo Salvadore (on behalf of status@) From nobody Tue Jun 4 14:47:50 2024 X-Original-To: freebsd-hackers@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 4Vttk81kCGz5LZpW for ; Tue, 04 Jun 2024 14:48:00 +0000 (UTC) (envelope-from Nicolas.MASSE@stormshield.eu) Received: from mail.stormshield.eu (mail.stormshield.eu [91.212.116.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.stormshield.eu", Issuer "Sectigo RSA Organization Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vttk71QWqz4pt9 for ; Tue, 4 Jun 2024 14:47:59 +0000 (UTC) (envelope-from Nicolas.MASSE@stormshield.eu) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=stormshield.eu header.s=signer2 header.b="tAwXNXR "; dmarc=pass (policy=quarantine) header.from=stormshield.eu; spf=pass (mx1.freebsd.org: domain of Nicolas.MASSE@stormshield.eu designates 91.212.116.25 as permitted sender) smtp.mailfrom=Nicolas.MASSE@stormshield.eu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stormshield.eu; s=signer2; t=1717512471; h=From:Subject:Date:Message-ID:To:MIME-Version :Content-Type; bh=gTkbIH7yViqX2e40Fj2kcsEb1ldRvZp+PHty1WSXfTo=; b=tAwXNXR f4+61udrTGUvI+HN9ZxTm7q4+fPWbQqIhKmVOx3EaRmBvkxhs/Ve9Ivtf7K+5XFF2pnN6Oyn6 8M7eSXKvx230Bd0kWwEF4II2pfkgp/JjWTqmKy/sHXtTOhK0U5j+j2o4C7w4fzMQWW9hDKEnp tSeRrg14VJRoTJK6chKMdC8jj5N5TXI6D+4Z/p2+MpaR2JGfELbKUB9lBX09XDe+p5+eejxXo 6Jrvfi1j1Xx2yVLtGS9hNHELr+FtwMPQ60yjzi50DyakWs6pk7uKN7RK91m9ka4bhQ6p6tBCB AuOfyr8NoXemrgBEQzhXaq5sLVlKMvcWuMeHuGi3Uzg==; From: Nicolas MASSE To: "freebsd-hackers@FreeBSD.org" Subject: Generic module for managing access through the mac framework Thread-Topic: Generic module for managing access through the mac framework Thread-Index: AQHato4sXY0Llptvmkq9qQOERuejSg== Date: Tue, 4 Jun 2024 14:47:50 +0000 Message-ID: <3b62d55d66101bebd504a65f9b2706ab40edb712.camel@stormshield.eu> Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: multipart/alternative; boundary="_000_3b62d55d66101bebd504a65f9b2706ab40edb712camelstormshiel_" List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 X-DKIM-Signer: DkimX (v3.60.360) X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.85 / 15.00]; MIME_BASE64_TEXT_BOGUS(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.95)[-0.947]; DMARC_POLICY_ALLOW(-0.50)[stormshield.eu,quarantine]; R_SPF_ALLOW(-0.20)[+ip4:91.212.116.25/32]; R_DKIM_ALLOW(-0.20)[stormshield.eu:s=signer2]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MIME_BASE64_TEXT(0.10)[]; RCPT_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:49068, ipnet:91.212.116.0/24, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; TO_DN_EQ_ADDR_ALL(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@FreeBSD.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[stormshield.eu:+] X-Rspamd-Queue-Id: 4Vttk71QWqz4pt9 --_000_3b62d55d66101bebd504a65f9b2706ab40edb712camelstormshiel_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 SGVsbG8sDQoNCg0KQXQgbXkgY29tcGFueSwgd2UgYXJlIHdvcmtpbmcgb24gYSBnZW5lcmljIG1h YyBtb2R1bGUuIEl0cyBwdXJwb3NlIGlzIHRvIGdyYW50IHNvbWUgdXNlcnMgYSBzZXQgb2YgcHJp dmlsZWdlcyBpbiBvcmRlciB0byBydW4gdGhlaXIgc2VydmljZXMuDQoNCkZvciBleGFtcGxlLCBp dCBjYW4gYmUgY29uZmlndXJlZCBpbiBvcmRlciB0byBhbGxvdyB0aGUgbnRwIHVzZXIgdG8gc2V0 IHRoZSBzeXN0ZW0gY2xvY2sgKFBSSVZfQ0xPQ0tfU0VUVElNRSksIG9yIGFsbG93IGEgcHJvY2Vz cyB0byBjaGFuZ2UgaXRzIHVzZXIgb3IgZ3JvdXBzIChQUklWX0NSRURfU0VUW1VJRHxHSUR8R1JP VVBTKSwgcmVzdHJpY3RpbmcgdGhlbSB0byBzb21lIGFsbG93ZWQgdmFsdWVzLg0KDQpBZnRlciBy ZWFkaW5nIHRoZSBkaXNjdXNzaW9ucyBhcm91bmQgdGhlIG1hY19kbyBtb2R1bGUsIEkgd2FzIHdv bmRlcmluZyBpZiBvdGhlciBwZW9wbGUgY291bGQgYmUgaW50ZXJlc3RlZCBpbiBzdWNoIGEgbW9y ZSBnZW5lcmljIG1vZHVsZS4NCg0KRXZlbiB0aG91Z2ggaXQgZG9lc24ndCBkbyB0aGUgZXhhY3Qg c2FtZSB0aGluZywgaXQgc3RpbGwgaGFzIGEgbG90IGluIGNvbW1vbiB3aXRoIG1hY19kbyB3aGls ZSBleHRlbmRpbmcgaXRzIGNhcGFiaWxpdGllcy4NCg0KDQpTbyBmYXIsIGl0IGlzIHN0aWxsIGEg d29yayBpbiBwcm9ncmVzcyBzbyB3ZSBkb24ndCBoYXZlIGNvZGUgdG8gc2hhcmUgeWV0LiBUaG91 Z2ggSSB0aGluayBpdCdkIGJlIGludGVyZXN0aW5nIHRvIHNwZWFrIGFib3V0IHRoZSBpZGVhLg0K DQpJIGNhbiBleHBsYWluIGZ1cnRoZXIgaG93IHdlIHBsYW4gdG8gZG8gdGhpcyBpZiBhbnkgb2Yg eW91IGlzIGludGVyZXN0ZWQuDQoNCg0KUmVnYXJkcywNCk5pY29sYXMgTWFzc2UNCg== --_000_3b62d55d66101bebd504a65f9b2706ab40edb712camelstormshiel_ Content-Type: text/html; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 PGh0bWwgZGlyPSJsdHIiPg0KPGhlYWQ+DQo8bWV0YSBodHRwLWVxdWl2PSJDb250ZW50LVR5cGUi IGNvbnRlbnQ9InRleHQvaHRtbDsgY2hhcnNldD11dGYtOCI+DQo8L2hlYWQ+DQo8Ym9keSBzdHls ZT0idGV4dC1hbGlnbjpsZWZ0OyBkaXJlY3Rpb246bHRyOyI+DQo8cHJlIGNsYXNzPSJtYWluIj5I ZWxsbyw8L3ByZT4NCjxwcmUgY2xhc3M9Im1haW4iPjxicj48L3ByZT4NCjxwcmUgY2xhc3M9Im1h aW4iPkF0IG15IGNvbXBhbnksIHdlIGFyZSB3b3JraW5nIG9uIGEgZ2VuZXJpYyBtYWMgbW9kdWxl LiBJdHMgcHVycG9zZSBpcyB0byBncmFudCBzb21lIHVzZXJzIGEgc2V0IG9mIHByaXZpbGVnZXMg aW4gb3JkZXIgdG8gcnVuIHRoZWlyIHNlcnZpY2VzLjwvcHJlPg0KPHByZSBjbGFzcz0ibWFpbiI+ Rm9yIGV4YW1wbGUsIGl0IGNhbiBiZSBjb25maWd1cmVkIGluIG9yZGVyIHRvIGFsbG93IHRoZSBu dHAgdXNlciB0byBzZXQgdGhlIHN5c3RlbSBjbG9jayAoUFJJVl9DTE9DS19TRVRUSU1FKSwgb3Ig YWxsb3cgYSBwcm9jZXNzIHRvIGNoYW5nZSBpdHMgdXNlciBvciBncm91cHMgKFBSSVZfQ1JFRF9T RVRbVUlEfEdJRHxHUk9VUFMpLCByZXN0cmljdGluZyB0aGVtIHRvIHNvbWUgYWxsb3dlZCB2YWx1 ZXMuPC9wcmU+DQo8cHJlIGNsYXNzPSJtYWluIj5BZnRlciByZWFkaW5nIHRoZSBkaXNjdXNzaW9u cyBhcm91bmQgdGhlIG1hY19kbyBtb2R1bGUsIEkgd2FzIHdvbmRlcmluZyBpZiBvdGhlciBwZW9w bGUgY291bGQgYmUgaW50ZXJlc3RlZCBpbiBzdWNoIGEgbW9yZSBnZW5lcmljIG1vZHVsZS48L3By ZT4NCjxwcmUgY2xhc3M9Im1haW4iPkV2ZW4gdGhvdWdoIGl0IGRvZXNuJ3QgZG8gdGhlIGV4YWN0 IHNhbWUgdGhpbmcsIGl0IHN0aWxsIGhhcyBhIGxvdCBpbiBjb21tb24gd2l0aCBtYWNfZG8gd2hp bGUgZXh0ZW5kaW5nIGl0cyBjYXBhYmlsaXRpZXMuPC9wcmU+DQo8cHJlIGNsYXNzPSJtYWluIj48 YnI+PC9wcmU+DQo8cHJlIGNsYXNzPSJtYWluIj5TbyBmYXIsIGl0IGlzIHN0aWxsIGEgd29yayBp biBwcm9ncmVzcyBzbyB3ZSBkb24ndCBoYXZlIGNvZGUgdG8gc2hhcmUgeWV0LiBUaG91Z2ggSSB0 aGluayBpdCdkIGJlIGludGVyZXN0aW5nIHRvIHNwZWFrIGFib3V0IHRoZSBpZGVhLjwvcHJlPg0K PHByZSBjbGFzcz0ibWFpbiI+SSBjYW4gZXhwbGFpbiBmdXJ0aGVyIGhvdyB3ZSBwbGFuIHRvIGRv IHRoaXMgaWYgYW55IG9mIHlvdSBpcyBpbnRlcmVzdGVkLjwvcHJlPg0KPHByZSBjbGFzcz0ibWFp biI+PGJyPjwvcHJlPg0KPHByZSBjbGFzcz0ibWFpbiI+UmVnYXJkcywNCk5pY29sYXMgTWFzc2U8 L3ByZT4NCjwvYm9keT4NCjwvaHRtbD4NCg== --_000_3b62d55d66101bebd504a65f9b2706ab40edb712camelstormshiel_-- From nobody Wed Jun 5 07:07:26 2024 X-Original-To: freebsd-hackers@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 4VvJTl4HFgz5M9gy for ; Wed, 05 Jun 2024 07:08:43 +0000 (UTC) (envelope-from Alexander@Leidinger.net) Received: from mailgate.Leidinger.net (bastille.leidinger.net [89.238.82.207]) (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 ECDSA (P-256) client-digest SHA256) (Client CN "mailgate.leidinger.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VvJTk6r55z43d5 for ; Wed, 5 Jun 2024 07:08:42 +0000 (UTC) (envelope-from Alexander@Leidinger.net) Authentication-Results: mx1.freebsd.org; none List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leidinger.net; s=outgoing-alex; t=1717571308; 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: in-reply-to:in-reply-to:references:references; bh=iuKxPSnRvNX1oqNnC/01Ks9ee09JPr1FoUX8Am1oyIY=; b=yyhAHzyljKP+DlvqCoX4Djh0UNZ/rv5gruKUWhgA42wprtf/I53TXUi58uAfw1PlDraZ+8 BELTL2C9NkiJjpRkOThV5jp5dsnD1XJDPFY3MwSkXuqRZnT7mC4WI0nNnDnQwASpboha3M UCVbhI+fY8xBksBVhm7dLI6QWS2bjoGsVMkpqovRAk0qjaJRZMU7Rq2eBNNqFAjdk0Hn7k 8mLln5YaIZKutQyzrEgair0AvccBK1bSYtJ3AbwAXReLgf6pku8d4jgTFeRkWqGfQg10ro o4HC9QzDtCbgJ0aI4yk9P/1Z0ONmmYL7hQH8ceuOaCBM9K7Z36BrwjUvDO2REw== Date: Wed, 05 Jun 2024 09:07:26 +0200 From: Alexander Leidinger To: Nicolas MASSE Cc: "freebsd-hackers@FreeBSD.org" Subject: Re: Generic module for managing access through the mac framework In-Reply-To: <3b62d55d66101bebd504a65f9b2706ab40edb712.camel@stormshield.eu> References: <3b62d55d66101bebd504a65f9b2706ab40edb712.camel@stormshield.eu> Message-ID: Organization: No organization, this is a private message. Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=_8943a02cfb2f99594f37a66a5ec51401"; micalg=pgp-sha256 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:34240, ipnet:89.238.64.0/18, country:DE] X-Rspamd-Queue-Id: 4VvJTk6r55z43d5 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --=_8943a02cfb2f99594f37a66a5ec51401 Content-Type: multipart/alternative; boundary="=_966ae685291f49a44a6c924e22d5600e" --=_966ae685291f49a44a6c924e22d5600e Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Am 2024-06-04 16:47, schrieb Nicolas MASSE: > Hello, > > At my company, we are working on a generic mac module. Its purpose is > to grant some users a set of privileges in order to run their services. > > For example, it can be configured in order to allow the ntp user to set > the system clock (PRIV_CLOCK_SETTIME), or allow a process to change its > user or groups (PRIV_CRED_SET[UID|GID|GROUPS), restricting them to some > allowed values. > > After reading the discussions around the mac_do module, I was wondering > if other people could be interested in such a more generic module. > > Even though it doesn't do the exact same thing, it still has a lot in > common with mac_do while extending its capabilities. > > So far, it is still a work in progress so we don't have code to share > yet. Though I think it'd be interesting to speak about the idea. > > I can explain further how we plan to do this if any of you is > interested. This sounds a bit like the Solaris RBAC/privileges. https://docs.oracle.com/cd/E23824_01/html/821-1456/prbac-1.html#scrolltoc IMO it would be worth to include, as it allows a more fine grained access to privileged stuff without the need to handout full root permissions to some applications. Bye, Alexander. -- http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_966ae685291f49a44a6c924e22d5600e Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8

Am 2024-06-04 16:47, schrieb Nicolas MASSE:

Hello,
 
At my company, we are working on a generic mac module=
=2E Its purpose is to grant some users a set of privileges in order to run =
their services.
For example, it can be configured in order to allow t=
he ntp user to set the system clock (PRIV_CLOCK_SETTIME), or allow a proces=
s to change its user or groups (PRIV_CRED_SET[UID|GID|GROUPS), restricting =
them to some allowed values.
After reading the discussions around the mac_do modul=
e, I was wondering if other people could be interested in such a more gener=
ic module.
Even though it doesn't do the exact same thing, it st=
ill has a lot in common with mac_do while extending its capabilities.
 
So far, it is still a work in progress so we don't ha=
ve code to share yet. Though I think it'd be interesting to speak about the=
 idea.
I can explain further how we plan to do this if any o=
f you is interested.

This sounds a bit like the Solaris RBAC/privileges.

  https://docs.oracle.com/cd/E23824_01/html/821-1456/prb= ac-1.html#scrolltoc

IMO it would be worth to include, as it allows a more fine grained acces= s to privileged stuff without the need to handout full root permissions to = some applications.

Bye,
Alexander.

--
--=_966ae685291f49a44a6c924e22d5600e-- --=_8943a02cfb2f99594f37a66a5ec51401 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc; size=833 Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIyBAEBCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmZgDr0ACgkQEg2wmwP4 2IbD9w/4zCLzPwmKUwCS6rV+jda6quZx1k6vRIz8Bl1QQ+ej25HSka5NaGPgs01z Mg1+bVa/ODz9VFONfJSUw1cMx0FuqRC5V6nAcbkmWaHmKKXsrwsmmJHnwtZJ8Kwo Y3xyBLEhhtxkUes+VjxK6OtA3KiG+YDIwZZILLZdS8zPanwozp56lTneate7TBZi 4Oc9y7ACK4PNVTE+DN3br6bPBGo5J+/OvPzn9NPOx3Wgm0O0RcHrL8UxFyuQIl1e XWQtMAarR+FBfKQ/L7YIQiNtwUHmMn5OOt27eBRMnWd3cRCVoK+u1qdSDiN6clcu 8UNtjbbASN3pcsml6LMJSUEP2JR5cQu2kMei1Yru1xs+5scGD1Djq8rIzmCC+Qrb E5DFgiQBwLpBpCobLkJ6hAGPJRKBt6EKyCbVL96vwUjgWNuyAMZV5warq54WZtJE NesPlYXyCFFUnNwlsNuREpkU4ukHPMzDqC7YylCKqdIPHTtXg2SYjH54W88upimx rjXRqIEqYZNgIOqSctXTC47nUI6/QhHr3uCVtySbkRgcYTBMYTuItImQICsfBGe+ W8+7fclxtPolnTcMplJvX4m0BTkX22Oz99XEwdX4WOjD/SotZdCL5Z4OFMsPk+qg FwfXsRzO9Ri0GVvtCkjOrBZIDhd59b2sjujtrg8KTaKyO+WixA== =V8tI -----END PGP SIGNATURE----- --=_8943a02cfb2f99594f37a66a5ec51401-- From nobody Fri Jun 7 06:59:38 2024 X-Original-To: freebsd-hackers@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 4VwXqL2yKNz5MynW for ; Fri, 07 Jun 2024 07:28:14 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4VwXqK3qsfz4sh5 for ; Fri, 7 Jun 2024 07:28:13 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=freebsd.org (policy=none); spf=softfail (mx1.freebsd.org: 198.144.192.42 is neither permitted nor denied by domain of yuri@FreeBSD.org) smtp.mailfrom=yuri@FreeBSD.org Received: from [192.168.5.3] (c-98-42-44-116.hsd1.ca.comcast.net [98.42.44.116]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id 4576xdWX085126 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 6 Jun 2024 23:59:39 -0700 (PDT) (envelope-from yuri@FreeBSD.org) X-Authentication-Warning: shell1.rawbw.com: Host c-98-42-44-116.hsd1.ca.comcast.net [98.42.44.116] claimed to be [192.168.5.3] Content-Type: multipart/alternative; boundary="------------dsFBllPHem7f1o2xk7OONCOK" Message-ID: <2bcfb025-b639-4696-82e6-bfeb1a291294@FreeBSD.org> Date: Thu, 6 Jun 2024 23:59:38 -0700 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Freebsd hackers list From: Yuri Subject: What are equivalents of Linux ioctl functions FICLONE and FICLONERANGE ? X-Spamd-Bar: + X-Spamd-Result: default: False [1.71 / 15.00]; VIOLATED_DIRECT_SPF(3.50)[]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.997]; ONCE_RECEIVED(0.10)[]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : No valid SPF, No valid DKIM,none]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_NO_TLS_LAST(0.10)[]; XM_UA_NO_VERSION(0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; TO_DN_ALL(0.00)[]; ARC_NA(0.00)[]; GREYLIST(0.00)[pass,body]; RCPT_COUNT_ONE(0.00)[1]; FREEFALL_USER(0.00)[yuri]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_SPF_SOFTFAIL(0.00)[~all]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:7961, ipnet:198.144.192.0/23, country:US]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@FreeBSD.org]; TO_DOM_EQ_FROM_DOM(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; HAS_XAW(0.00)[] X-Rspamd-Queue-Id: 4VwXqK3qsfz4sh5 This is a multi-part message in MIME format. --------------dsFBllPHem7f1o2xk7OONCOK Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On Linux files can be copied with: ioctl(destFd, FICLONE, srcFd) What would be the equivalent of this on FreeBSD? Thanks, Yuri --------------dsFBllPHem7f1o2xk7OONCOK Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit On Linux files can be copied with:
ioctl(destFd, FICLONE, srcFd)


What would be the equivalent of this on FreeBSD?




Thanks,
Yuri


--------------dsFBllPHem7f1o2xk7OONCOK-- From nobody Fri Jun 7 09:48:47 2024 X-Original-To: freebsd-hackers@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 4Vwbxc115Nz5NBR5 for ; Fri, 07 Jun 2024 09:48:52 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vwbxb6xNjz49D8; Fri, 7 Jun 2024 09:48:51 +0000 (UTC) (envelope-from se@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717753732; 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=ePcgGNR4j8Kds6Dkwu7QJ8BfZRLetw5yfxAhJe/42u0=; b=Se0uG9LOyAibD9Iis/5cXLBDWN5oOeGMRXZOaTu+B/ZBC9aznrfCVbCd7p+TXOGt1UO7sR GnmJ2ptIP84JdY5VIpyqVamZwyy0GHfrX6O2oczk/5TUEa4hAuYuv+kVUK89ZlwPdWLtK8 OanGho5+1aMexNOWhCLyzwX/Kam13s0OV4CtDf6yxVP89701R+DMrM3TvXgCmUJu2deTyJ btFafycN2N6g40xl6/DapI+iusQAjL6eHRVGfRXBpQn2OQdXtCqqNYZWL1pPnFaiDmYD3P KrkiINZ5EEH7kHqof+uCCOFIlsx/bc9QsDhT6Z4frESAl24NTqJ1JDTFIrvcgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717753732; a=rsa-sha256; cv=none; b=uX0iElNBzXl52EGv1fnMfA4D/06M/VM2uxsQ23a2m8OAbjyh1OF0zwW9L64l/0W01FxPF5 AUVwxUwpZ6MjqyclTr7wz4eT1vqQGIiB5EWaiDVfkOl75rw+NhsqOI/4RJjq1BzzItOr87 /jAZBfENiJeiFcT5aFPpeUw6/6aqzgl6Ipjm9VlWzaC+oWH6QeA3L/08rtuep3eEDF2hQm 7EjGiotDktBfxnzcYMIZIGFqViZH+aE2OT86PPcDQhlcWzLO8cOy6Lj9DLEyzWU9t9Z8A3 g0dzuG8oUKuSIgIiIsPnSxZRfh9NzgF9z/sK/frbebuqaRLKXurwOXgFrJgpZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717753732; 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=ePcgGNR4j8Kds6Dkwu7QJ8BfZRLetw5yfxAhJe/42u0=; b=Iqrm5prv+U2JjWlGT49Eb66H6EyXnACMq+m+8L6C+mJNVIYJvXbHjks6FlmT2C2NMAzLAk RswtYg7WgaU9pmnE5IczxlKIH+3r/FYdSUSxpAqhrbqKqiHR9I0Qx30cDSCMPv5XQKlx9d Ugh14QQ+uW5przDZ7lHHClM0upTO1UDIxQeS/CtJoDCP6LZMwm4nV1s/DZWoZjolMjSzAM 7LMlOa0mHCYLRLbHpRvxQydBazkBT8ehl68fuwg1AZJbNQ64C8C35m+W+Ka8s1hAgBnKs0 IeJtApJcbhWoX5Fr6991rsSABUhwNB5Aq41U0LiHtkMu1NI0a+9ULk64SfScMQ== Received: from [192.168.119.168] (p5dc83c4c.dip0.t-ipconnect.de [93.200.60.76]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vwbxb2kzRzLJt; Fri, 7 Jun 2024 09:48:51 +0000 (UTC) (envelope-from se@FreeBSD.org) Message-ID: <1406f7e7-63a9-4f9a-a2e6-2de71bac65cb@FreeBSD.org> Date: Fri, 7 Jun 2024 11:48:47 +0200 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Stefan Esser Subject: Re: What are equivalents of Linux ioctl functions FICLONE and FICLONERANGE ? To: Yuri Victorovich References: <2bcfb025-b639-4696-82e6-bfeb1a291294@FreeBSD.org> Content-Language: de-DE, en-US Cc: freebsd-hackers@freebsd.org In-Reply-To: <2bcfb025-b639-4696-82e6-bfeb1a291294@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Am 07.06.24 um 08:59 schrieb Yuri: > On Linux files can be copied with: > ioctl(destFd, FICLONE, srcFd) > > > What would be the equivalent of this on FreeBSD? That would be copy_file_range(), but as on Linux, it does only offer any benefit on filesystems that support copy-on-write or potentially on network attached storage. NFSv4 has recently gained support for server-side copies if copy_file_range is used, for example. But UFS will fall back to a normal copy operation. ZFS should do this via block cloning, but that has not been enabled by default, since it has a history of corrupted files (and it is not clear, whether all border cases are covered in the latest version). Regards, STefan From nobody Sat Jun 8 05:36:45 2024 X-Original-To: freebsd-hackers@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 4Vx6JH1jQ1z5NPyg for ; Sat, 08 Jun 2024 05:36:47 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vx6JH0b4cz4LGJ; Sat, 8 Jun 2024 05:36:47 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717825007; 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=htArBxmRrkC0W/QYAqYG0J6WqUKpVX9j8b5QtEAPV7M=; b=ZVXp3FdhJBIcvqIgYzjRhgItsFWMASP/b8q+Gy32cwISjIsa5gQbV0hR2v5KSJhhl3QjPR SwTpDXVvqfuFyobLnLnj24Cfim7C7KqujHt2VBsx+6Lgkhucaau1zoA/UAiMyqJrsvqeMF mXSLjqAzm6J4lQIW0XhSckSIxy6NpqR/91m5EZf46ON6fls21Mp+h8Ron/Lji9Yx09SpRU u33W/cN8Exmd/nxk/vTg0v4K08t17u1xKEf7Aa+7MBAb3XPLvj0m1zukIS1d/1y+0U62zC KjDZ9Wyw8SgsHj/PxlzFTs3d1IlCb8h/dsSk06Lrf3fJtye4qbxyBTXaLGWDkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717825007; a=rsa-sha256; cv=none; b=hrci9V+9dqoa/tJ4q73IWfcQmWlEZwnQAoD+Unkrybp5H008NXbmy4C5uqByzXHzrn9RTm ISVyncn6hrA0pX/4rdqWIWFB7AqqWWqx/ej/ftzAPWJbRk1GiWeQDrb2R0AJYKzsi1Dp/T XFWNryxi/K2ywR4wxYMSsNh2bpsFQsTfrUwpnC+9VQvb7359ZCjFXWtxSrjkia+sP1f09O 7yt4vyYBiwN106561zb63UTS2SyolYytyMn0XM/lmHv0Any5yNGZ904FsXfSPTU4G7gSb6 tdrJOgkQE+skQ+3+tgoe28d/IGMpDV/MwuZAf1rwrns3zXvd4YPWdIJXUaeJYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717825007; 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=htArBxmRrkC0W/QYAqYG0J6WqUKpVX9j8b5QtEAPV7M=; b=a+RyxYRByTxETsOE+wNrV1iVOTMAAEoQiO9M2Tyro+I/EMyLHgEBa7KtECihaKl29cbx2F plUHBqQObEwakNBUCrpj5f26oNkNKqPcUBaBE2Mb0AvX4BYuqXpGl+fABgPQ/ZvgSiONou YZj/b1o8Qm87tI/VHoFfVw7iQbrg0PI37LObRBMCJSfcOnmUaCIMvH515t/b7bC516oKRy o8KNH8bb8WpZFEgj/sJCtoCYWrn8kP7zQpD6tNqApJAu5HGIIJA4m8GEmbBN94ehPeeeq8 D5ZV9ugcNeBUk6NzZGaV6i+RooqGUkILozkeUgeIjg1bTcddbDCmyvWB2pqMFw== Received: from ltc.des.dev (unknown [IPv6:2a01:e0a:386:9c20:922e:16ff:fef1:acef]) (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) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vx6JG6ZVCz11Rs; Sat, 8 Jun 2024 05:36:46 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id DE7C13630B; Sat, 08 Jun 2024 07:36:45 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Stefan Esser Cc: Yuri Victorovich , freebsd-hackers@freebsd.org Subject: Re: What are equivalents of Linux ioctl functions FICLONE and FICLONERANGE ? In-Reply-To: <1406f7e7-63a9-4f9a-a2e6-2de71bac65cb@FreeBSD.org> (Stefan Esser's message of "Fri, 7 Jun 2024 11:48:47 +0200") References: <2bcfb025-b639-4696-82e6-bfeb1a291294@FreeBSD.org> <1406f7e7-63a9-4f9a-a2e6-2de71bac65cb@FreeBSD.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sat, 08 Jun 2024 07:36:45 +0200 Message-ID: <86o78c2dxu.fsf@ltc.des.dev> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Stefan Esser writes: > Yuri Victorovich writes: > > On Linux files can be copied with: > > ioctl(destFd, FICLONE, srcFd) > > What would be the equivalent of this on FreeBSD? > That would be copy_file_range(), but as on Linux, it does only > offer any benefit on filesystems that support copy-on-write or > potentially on network attached storage. Even without filesystem support, it still avoids copying the contents of the file out to user space, so it's faster than a regular copy. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Sat Jun 8 08:01:52 2024 X-Original-To: freebsd-hackers@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 4Vx9Ww5jSDz5NdX5 for ; Sat, 08 Jun 2024 08:02:04 +0000 (UTC) (envelope-from theraven@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vx9Ww5BH9z4bK7; Sat, 8 Jun 2024 08:02:04 +0000 (UTC) (envelope-from theraven@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717833724; 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=Vyu1ubttwD+UMj/EHk4kbzrLsadVmh6VmJyD00oQ9cA=; b=b3UliyZcXARr0TDJ1HOE8glK8HLu/z7ZWJ5irlMGD56w8IGY+o4iU3sy+Dqfr9Rg4E+jaa 3BsZmj6OXon2gSCWUAG7zM9YbR1d9kWsCxfP/XJfwCxrELjuwiQs3I9WGUgMHuZvBB0ctA 1Sl1xzzvrjEvQQnWbzZjZmn3bROxfCld2r+WfUR2a0Qyoflpu2D+Wo/Em7eVYBY3qlgn/R TNIgtfCaF7h1wLOdtvitO4nOXgM74sA/HXxb20Qu7P3mCBrikSxs3C0BwkmakatNiLb7Mo jNamRePXL1svPacAbXwc01xBRn/EkUr/4bdkdcvMnmhF12JeTVDXnolSMIy1TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717833724; a=rsa-sha256; cv=none; b=ke1SQjzYJ/7Xw9LmMnnjsj56aGnsqFbv1b5HqmmmXuTthnyIn6/9r2ohWEjH+AIlQ02je7 pDY7CpJp4iZZR2iTnocGanKY3EuADWUyfymDdRpHrtUc+T81obVU2RCDH3QKE3ifkM5sbq ZbzBxebtNalYk8Jw34yXr5t/8TDSfH8nU3BBf8nbEyfjMqzhsa5yn4uOgOOmpfwINO3oLl pbMWKGutv2Dv3Ku8Y9nlRMzQmEK4A8eReGPh9z33SAFZyzAqy89V0qlhyoqM8d0j6JgXtL PdDqGaK0Ze26Wo9UaR9FFaR8KKnAi+//QJDggq5UauUacyOTavj68gOT6m25NQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717833724; 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=Vyu1ubttwD+UMj/EHk4kbzrLsadVmh6VmJyD00oQ9cA=; b=BCQ/Ad4FJprUqR9iDmaHVN/qUrTk3BpGbW9WztupmiVI9fHWMVb2O4LS9GJQ1LuObSTqMn up0KPJWUiV9oJW0fjYjJ5jPlQ0GAM3z5fwo5/14sadPZHKSMuh4b3x5x+ocCwMoBlEmweI o4qw3etDR/REokwkPvMQ4sLCg3tJgGJ2SxG90vxvTJyPaW5/bgfEoyod/v8bqRTU1UZSrF fKDq2sDc/7+scCqU1+AJzNAt39H8WwyayOHi8Gh93nOxF4NckQapBUfzXo+Lw2O5MxwM9C Mm1Wb3MTcXEVejkZss0K3rQOhsVXJDaruZzyf4SWHT6SnDBbFEw0Y8B2nsfxWg== Received: from smtp.theravensnest.org (smtp.theravensnest.org [45.77.103.195]) (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) (Authenticated sender: theraven) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vx9Ww4mBhz134n; Sat, 8 Jun 2024 08:02:04 +0000 (UTC) (envelope-from theraven@freebsd.org) Received: from smtpclient.apple (host81-131-179-19.range81-131.btcentralplus.com [81.131.179.19]) by smtp.theravensnest.org (Postfix) with ESMTPSA id D647DB500; Sat, 8 Jun 2024 09:02:03 +0100 (BST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: David Chisnall List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org Mime-Version: 1.0 (1.0) Subject: Re: What are equivalents of Linux ioctl functions FICLONE and FICLONERANGE ? Date: Sat, 8 Jun 2024 09:01:52 +0100 Message-Id: References: <86o78c2dxu.fsf@ltc.des.dev> Cc: Stefan Esser , Yuri Victorovich , freebsd-hackers@freebsd.org In-Reply-To: <86o78c2dxu.fsf@ltc.des.dev> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: iPad Mail (21F90) On 8 Jun 2024, at 06:36, Dag-Erling Sm=C3=B8rgrav wrote: >=20 > =EF=BB=BFStefan Esser writes: >> Yuri Victorovich writes: >>> On Linux files can be copied with: >>> ioctl(destFd, FICLONE, srcFd) >>> What would be the equivalent of this on FreeBSD? >> That would be copy_file_range(), but as on Linux, it does only >> offer any benefit on filesystems that support copy-on-write or >> potentially on network attached storage. >=20 > Even without filesystem support, it still avoids copying the contents of > the file out to user space, so it's faster than a regular copy. Note that there is no in-kernel fallback path for if the file descriptor typ= e does not support it. This means that you cannot use it, for example, for c= opies from an anonymous shared memory object to a regular file. David= From nobody Sun Jun 9 16:25:37 2024 X-Original-To: freebsd-hackers@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 4Vy0dt0sYnz5Mvyq for ; Sun, 09 Jun 2024 16:25:06 +0000 (UTC) (envelope-from justsomelessons@gmail.com) Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vy0ds1HkFz4WGL for ; Sun, 9 Jun 2024 16:25:05 +0000 (UTC) (envelope-from justsomelessons@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=dzK0p7qf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of justsomelessons@gmail.com designates 2607:f8b0:4864:20::112e as permitted sender) smtp.mailfrom=justsomelessons@gmail.com Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-62ceb6a4e97so13114877b3.1 for ; Sun, 09 Jun 2024 09:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717950302; x=1718555102; darn=freebsd.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=cebjttlEQ3LuEhdxH0F9OKXXXvnUmOKSihrz+UM+Gq0=; b=dzK0p7qflKimHMYN90GJyF5YR5w61/bR6d3BEhr2EeYMTzMBJcFPlSfCgb8JNVuj5e GfQS57pD2QdiaK9IUZX1T/G0EVn+C86fc0nZn1BQcqV8j3SvgWizM6N/cMPcYgSW072j g9QFJMhiFr7mkLZtK20sd+8Nx2hItSIWzjinTQnT/Y3SS/vqLvl5je2iqQhddjbXNQbM 9sw50/moal7yHIdHGdGoXr0x6325t1UlkZW42ZeT8JbUwjQ10ZgMboiIE8syPtFMeAst zc6QEHJyDOQcGBEqJMCLprPMEda8RQvhIoZ4YPHAh9ZZRXoqRpBjFJXthSaha/cf/Jtf 1nzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717950302; x=1718555102; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cebjttlEQ3LuEhdxH0F9OKXXXvnUmOKSihrz+UM+Gq0=; b=TMYsR3Mz1j684Kf08I1Gvog4pK9aNpgIKVAnxzXayLMYflbfFlQoaNfJ24+nVi2Hck /waTemrwn93jerPx3xG/g+/kDPr1KC5cc6r7Y6x5ZxZUsL5ffTvx8oO8bF1VqitUQDgQ ZA1sXTOVNIZKoRrbGf8b8/G8+DjXK1CjLeq4CuEFSG8ZAVnzyTgl1Ay8eHT1+0y2jsWT jIas+RuHNJakyI3v3B/ifxhgqsyiAZd6svqfi6qY9e9ALWFoMv3a8Wa9FGLgL5b+LnYr /QszXvPtqNStkTeoh15hfD9NrruEMAlINGUO9v4WCtoGaReJAGP5V/qA5wEZuR0J4Ssu 8N3Q== X-Gm-Message-State: AOJu0Yx+ODaZV8mnPkLTNScBJQ6ZdvzN8U5W4rG4AUZSd7TBJyj2Xe9n 361Lsj5BFhvGp0iMDttD7zoGYFroF/XGPBr4kt2UzALjX0/rhKjEw9b0KsC7bbbO0a1UKfHiYOV o2/J39bm1KzGPN3CNJ/LE0gSniOMtU9vJ X-Google-Smtp-Source: AGHT+IHMUIJ2iiWLLgO9kNi07aZf2T/8zBz4XsfrOpleqgsVjhbiamtrU2qcFsaFWKkIoZF8Afq7ohZYQS1Tc18JJW0= X-Received: by 2002:a81:7155:0:b0:61b:33c8:7bce with SMTP id 00721157ae682-62cd55fd77emr71082597b3.31.1717950302405; Sun, 09 Jun 2024 09:25:02 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 From: justsomelessons Date: Sun, 9 Jun 2024 19:25:37 +0300 Message-ID: Subject: Start week from Monday in cal(1) To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.21 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_SPAM_SHORT(0.79)[0.789]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_ONE(0.00)[1]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEMAIL_FROM(0.00)[gmail.com]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::112e:from] X-Rspamd-Queue-Id: 4Vy0ds1HkFz4WGL Hello! As you can find, FreeBSD cal(1) man page says that "It is not possible to display Monday as the first day of the week with cal". But daily it is more comfortable if weeks start from Monday. I know that there is ncal (vertical) mode which always starts from Monday, but any other calendar in the world (software or that on the wall) is horizontal, so ncal is uncomfortable too. So I've made a simple patch that adds -M option to cal(1) to start week from Monday: https://codeberg.org/vall/stuff/src/branch/main/ncalfixed By the way, Debian also has set of patches that adds such option: https://salsa.debian.org/meskes/bsdmainutils/-/tree/master/debian/patches Can I ask if such an option can be added to the FreeBSD base? It's highly appreciative if my tiny patches with or without modifications can be helpful. Or are there historical or some other reasons for nonpossibility to start weeks from Monday? Thank you! ----- Best regards, Valentine Astakhov. From nobody Sun Jun 9 18:00:17 2024 X-Original-To: freebsd-hackers@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 4Vy3N00w7jz5N6V9 for ; Sun, 09 Jun 2024 18:28:16 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4Vy3Mz1hrwz4jHc for ; Sun, 9 Jun 2024 18:28:15 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=freebsd.org (policy=none); spf=softfail (mx1.freebsd.org: 198.144.192.42 is neither permitted nor denied by domain of yuri@FreeBSD.org) smtp.mailfrom=yuri@FreeBSD.org Received: from [192.168.5.3] (c-98-42-44-116.hsd1.ca.comcast.net [98.42.44.116]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id 459I0IID020072 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 9 Jun 2024 11:00:18 -0700 (PDT) (envelope-from yuri@FreeBSD.org) X-Authentication-Warning: shell1.rawbw.com: Host c-98-42-44-116.hsd1.ca.comcast.net [98.42.44.116] claimed to be [192.168.5.3] Content-Type: multipart/alternative; boundary="------------i9ZqUmmk0jwTY0iF0HrX18r8" Message-ID: <1e288f98-564a-488d-a98d-b7f45afac2c1@FreeBSD.org> Date: Sun, 9 Jun 2024 11:00:17 -0700 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Freebsd hackers list From: Yuri Subject: Can stdout/stderr of a running process be dynamically redirected in FreeBSD ? X-Spamd-Bar: + X-Spamd-Result: default: False [1.73 / 15.00]; VIOLATED_DIRECT_SPF(3.50)[]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.979]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ONCE_RECEIVED(0.10)[]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : No valid SPF, No valid DKIM,none]; RCVD_NO_TLS_LAST(0.10)[]; XM_UA_NO_VERSION(0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; TO_DN_ALL(0.00)[]; ARC_NA(0.00)[]; GREYLIST(0.00)[pass,body]; RCPT_COUNT_ONE(0.00)[1]; FREEFALL_USER(0.00)[yuri]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_SPF_SOFTFAIL(0.00)[~all]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:7961, ipnet:198.144.192.0/23, country:US]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@FreeBSD.org]; TO_DOM_EQ_FROM_DOM(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; HAS_XAW(0.00)[] X-Rspamd-Queue-Id: 4Vy3Mz1hrwz4jHc This is a multi-part message in MIME format. --------------i9ZqUmmk0jwTY0iF0HrX18r8 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Imagine the situation when there is a process that is running in the terminal and periodically printing something related to its progress. At some point this terminal output should be replaced by a TUI in the same terminal that would capture the original process' output and show it in its TUI sub-window, and would also show some other info. There is the project for Linux called "redirect" that does such stdout/stderr redirection: https://github.com/jerome-pouiller/reredirect/ However, it uses ptrace functions that are missing in FreeBSD, like PTRACE_POKEUSER. Is it possible to perform the action like is described in the first paragraph in some other way, given that ptrace doesn't have required functions? This function is useful in many business contexts, when users run some long-running tools, and there is a variety of ways how results of these tools can be displayed to the user. Thanks, Yuri --------------i9ZqUmmk0jwTY0iF0HrX18r8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Imagine the situation when there is a process that is running in the terminal and periodically printing something related to its progress.

At some point this terminal output should be replaced by a TUI in the same terminal that would capture the original process' output and show it in its TUI sub-window, and would also show some other info.


There is the project for Linux called "redirect" that does such stdout/stderr redirection: https://github.com/jerome-pouiller/reredirect/

However, it uses ptrace functions that are missing in FreeBSD, like PTRACE_POKEUSER.


Is it possible to perform the action like is described in the first paragraph in some other way, given that ptrace doesn't have required functions?


This function is useful in many business contexts, when users run some long-running tools, and there is a variety of ways how results of these tools can be displayed to the user.



Thanks,

Yuri


--------------i9ZqUmmk0jwTY0iF0HrX18r8-- From nobody Sun Jun 9 18:35:25 2024 X-Original-To: freebsd-hackers@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 4Vy3XV4KgJz5N7Xm for ; Sun, 09 Jun 2024 18:35:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vy3XV2HVfz4kT9 for ; Sun, 9 Jun 2024 18:35:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2bfff08fc29so3102740a91.1 for ; Sun, 09 Jun 2024 11:35:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1717958137; x=1718562937; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=n0bHVG+JW1l0MJZpjQ9mMrsc5rTON0DGK07NY4iPYTo=; b=PutCr+Ags7Neent1BMPcCn/bho9JhO3p1SX++lUnuz1kH/RUeu0c1stEgfcel2ZJkz lVPGIP4uGNNloa7uJlEK3pfxsfVVGPA9JRwOd9lYs1qdhrCiTugAaor+Cuvd8xh+5TuB pV1OqSDHn1wEzyDOQ+4HOW7Di9dJ4RbajOep8hdQY0ccV012Hq5EhO9Uc0CedPeGhu5u lfbifN9D5nlieACNsKiEPgr1Eh8Av4qJrfTJ7gHjcg+0VNxUNDtkdeIvLwO9S9YkkJiA n+ioj8igJqBCfo+U2gzHW2+KI/9PKWvdNMU+CWoCPISxhgpsVQ2j7DMTiELTyF9laQV/ A3UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717958137; x=1718562937; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=n0bHVG+JW1l0MJZpjQ9mMrsc5rTON0DGK07NY4iPYTo=; b=wTclHLlDc//JnW4lmONpnzqeTTOW80CKxIu+ZH8UIwM5pCURej7wh3VwOtP64WIBln qQD1XXDE8kMTzMI0GiqpIX79YP7gkHqBQS8GAKcM0WvNT30WtZqnY6GWFDvencRq4XBT SHTsCSeyj9ZOvCOzqmgCxhFgRZeFc5fXQwl/agGbkNFU2eIp4riq19yWpIFoo1KG9xCk IkJYSVJ/L/+UMSwJJdedzD3hOvFUHMyFQe5osIZR5eKeoKn3tVCJQj1h7wqqa30Y9A0W WARgZ3/HjxK4cCio8ybKpaQcCVXdShuep078UN94TxSQusjuwhgdP7TgaT3pDG7FeOum 0D7Q== X-Gm-Message-State: AOJu0YxxOTqD3Nzh4/jSa8yWgC5FtXCcWkuR2i/R359c01ho60AST8Bj hMALQ9T4vpjwJiQidzcyDf5phmYrkgfMatz3bbrbrTzahLDbSvt3kPLra+X0RTfwy4eL61/EQTa oYq3uzMmniIDJTP+i2nch245O+OjUt0ay1mMziYQZjPoeMKDiTDA= X-Google-Smtp-Source: AGHT+IFa64MDmuS75kmxHazhPvnkZVtdNA3+PNP8MXbWqEYcpaEnYx+LtiwQ6eT4CSs2iBk54HBLFUa1euNvWG9tp6o= X-Received: by 2002:a17:90a:f986:b0:2c2:d8d7:bf65 with SMTP id 98e67ed59e1d1-2c2d8d7c050mr3815449a91.7.1717958136597; Sun, 09 Jun 2024 11:35:36 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: <1e288f98-564a-488d-a98d-b7f45afac2c1@FreeBSD.org> In-Reply-To: <1e288f98-564a-488d-a98d-b7f45afac2c1@FreeBSD.org> From: Warner Losh Date: Sun, 9 Jun 2024 12:35:25 -0600 Message-ID: Subject: Re: Can stdout/stderr of a running process be dynamically redirected in FreeBSD ? To: Yuri Cc: Freebsd hackers list Content-Type: multipart/alternative; boundary="00000000000078ad23061a794c17" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Vy3XV2HVfz4kT9 --00000000000078ad23061a794c17 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jun 9, 2024, 12:28=E2=80=AFPM Yuri wrote: > Imagine the situation when there is a process that is running in the > terminal and periodically printing something related to its progress. > > At some point this terminal output should be replaced by a TUI in the sam= e > terminal that would capture the original process' output and show it in i= ts > TUI sub-window, and would also show some other info. > > > There is the project for Linux called "redirect" that does such > stdout/stderr redirection: https://github.com/jerome-pouiller/reredirect/ > > However, it uses ptrace functions that are missing in FreeBSD, like > PTRACE_POKEUSER. > > > Is it possible to perform the action like is described in the first > paragraph in some other way, given that ptrace doesn't have required > functions? > > > This function is useful in many business contexts, when users run some > long-running tools, and there is a variety of ways how results of these > tools can be displayed to the user. > Look at the snp device and watch. They are close if a tty is involved. Warner > Thanks, > > Yuri > > > --00000000000078ad23061a794c17 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sun, Jun 9, 2024, 12:28=E2=80=AFPM Yuri <yuri@free= bsd.org> wrote:
=20 =20 =20

Imagine the situation when there is a process that is running in the terminal and periodically printing something related to its progress.

At some point this terminal output should be replaced by a TUI in the same terminal that would capture the original process' output and show it in its TUI sub-window, and would also show some other info.


There is the project for Linux called "redirect" that does such stdout/stderr redirection: https://github.com/jerome-pouiller/= reredirect/

However, it uses ptrace functions that are missing in FreeBSD, like PTRACE_POKEUSER.


Is it possible to perform the action like is described in the first paragraph in some other way, given that ptrace doesn't have required functions?


This function is useful in many business contexts, when users run some long-running tools, and there is a variety of ways how results of these tools can be displayed to the user.


Look at the snp device and watch. They are cl= ose if a tty is involved.

Warner

Thanks,

Yuri


--00000000000078ad23061a794c17-- From nobody Sun Jun 9 19:45:55 2024 X-Original-To: freebsd-hackers@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 4Vy55w4pjXz5NK0K for ; Sun, 09 Jun 2024 19:46:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4Vy55w1N2Zz4vS7; Sun, 9 Jun 2024 19:46:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 459Jjt6i091733; Sun, 9 Jun 2024 22:45:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 459Jjt6i091733 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 459JjtHY091732; Sun, 9 Jun 2024 22:45:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 9 Jun 2024 22:45:55 +0300 From: Konstantin Belousov To: Warner Losh Cc: Yuri , Freebsd hackers list Subject: Re: Can stdout/stderr of a running process be dynamically redirected in FreeBSD ? Message-ID: References: <1e288f98-564a-488d-a98d-b7f45afac2c1@FreeBSD.org> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4Vy55w1N2Zz4vS7 On Sun, Jun 09, 2024 at 12:35:25PM -0600, Warner Losh wrote: > On Sun, Jun 9, 2024, 12:28 PM Yuri wrote: > > > Imagine the situation when there is a process that is running in the > > terminal and periodically printing something related to its progress. > > > > At some point this terminal output should be replaced by a TUI in the same > > terminal that would capture the original process' output and show it in its > > TUI sub-window, and would also show some other info. > > > > > > There is the project for Linux called "redirect" that does such > > stdout/stderr redirection: https://github.com/jerome-pouiller/reredirect/ > > > > However, it uses ptrace functions that are missing in FreeBSD, like > > PTRACE_POKEUSER. > > > > > > Is it possible to perform the action like is described in the first > > paragraph in some other way, given that ptrace doesn't have required > > functions? > > > > > > This function is useful in many business contexts, when users run some > > long-running tools, and there is a variety of ways how results of these > > tools can be displayed to the user. > > > > Look at the snp device and watch. They are close if a tty is involved. snp watches, it does not redirect. I suspect that an example almost identical by its main idea is reptyr. AFAIR the program does the same hacking on the target process, by attaching to it, and injecting the code to execute. See ports sysutils/reptyr, I believe that the FreeBSD port was done by kevans.