From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, NICE_REPLY_A,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21364 invoked from network); 25 May 2022 19:05:38 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 25 May 2022 19:05:38 -0000 Received: from mail.posixcafe.org ([45.76.19.58]) by 9front; Wed May 25 15:03:39 -0400 2022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posixcafe.org; s=20200506; t=1653505415; 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=kXbswv3FT/HWk4vuv9UXqKTGJC/SFVTq2xZnfX6EF+o=; b=ar9wdj3sc0nSFetDZnwZDXYHyhu4QJUcO7bJHMqoVDpFymlLDA8H6Rw0x1riQRb6fJMduS 2HcXAE+6Byos7toivSf01kFaoroMQRsMYFy+++FdqIZ09ayBeOydUoWU7UcPYi4m8cOwIn yv6yxUNHsZVUcDrStXzoCSiEUs69dMw= Received: from [192.168.168.200] (161-97-228-135.lpcnextlight.net [161.97.228.135]) by mail.posixcafe.org (OpenSMTPD) with ESMTPSA id c6e6f813 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <9front@9front.org>; Wed, 25 May 2022 14:03:35 -0500 (CDT) Message-ID: <236719d3-a3de-fed1-bb31-8cae0ce16ea0@posixcafe.org> Date: Wed, 25 May 2022 13:03:21 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Content-Language: en-US To: 9front@9front.org References: <360D31817B067471414B1C6D6DF6DF92@felloff.net> From: Jacob Moody In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: abstract session database SOAP over ORM deep-learning software Subject: Re: [9front] [PATCH] Unmount to remove sharp devices. Reply-To: 9front@9front.org Precedence: bulk On 5/23/22 11:37, Jacob Moody wrote: > There was some followup discussion for this on irc that I want to > make sure is captured here: > > The command written to /dev/drivers will change to be one of: > chdev DEVS > chdev -DEVS I am having some second thoughts about this. While this syntax does replicate chmod, I am not entirely convinced that is what we want. When being added to /sys/src/libauth/newns:/^nsop/ you have to special case around the ARGBEGIN block. Combine that with the fact that this decision would lock chdev(1) from ever accepting it's own flags, it felt like this was introducing special case cruft. Another consideration was what the syntax would be for removing all drivers, currently it would just be chdev '' or something similar. Which is fine but fat fingering that would be an annoying way to kill your current namespace. These caveats may be entirely acceptable, but I was bothered enough to attempt to find another way. Instead, I thought perhaps a rune prefix might be best. So you end up with: chdev ∅ for removing all drivers. chdev ∉DEVS For removing just the specified drivers. chdev ∈DEVS For removing access to all but the specified drivers. If a prefix is not given, ∈ is assumed. I did implement this idea, to field it for quirks, but wanted to get some feedback before redoing man page changes. The downsides I see here are: 1. Deviation from chmod 2. This steals three runes that could have otherwise been used for drivers 3. ∉ is a bit more involved to type then '-' With that said, I do much prefer this interface. Another option may be to use rune prefixes, but also provide flag synonyms to the prefixes in chdev(1). There is also an unrelated quirk I stumbled across when reviewing changes. As is currently, devshr checks for if the noattach has been set before allowing a process to post a fd. I have changed this to check for access to devmnt/'#M', which is what replicates the 'can mount' knob that RFNOMNT tweaks. This seems fine to me, but should we also replicate this check over in to devsrv for consistency? Thanks, moody