From owner-svn-src-all@freebsd.org Thu Sep 24 06:54:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B5363EE6EB for ; Thu, 24 Sep 2020 06:54:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) (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 "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bxm4f4ycfz410n for ; Thu, 24 Sep 2020 06:54:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72c.google.com with SMTP id t138so2402193qka.0 for ; Wed, 23 Sep 2020 23:54:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=azBV/P25KOx4sju/Z/2vJrAm1P+RYAjzGxapNzFvvnI=; b=ydd43xKTrDN5UU2v2Coq6MvX9pLYT165l+0ix0iK1x6A/LZrVjxzGW/l7Yo6T7oBwI XTVOVKOjrm+YhqDiQGhhvif6ZuMRWupXiZVGerfz1Ns3BzcgxA9GicJButzG8c6zNfVz sq07JcvF+UMJC/Ta8JNVUmTWYbflx8cZLUZkE+VaPZUuhmweiFsQJ5xcHstZhhxGLTp4 za4j+z65Syithwk7Il+zG7sHBxwlYVGvUE8sRvjFsA/MCqKpZlCPbmiIE5YG84VA5g8q /eH2I2hz5h+HnCdt79eoW4/EpDNRIqf3f9HSQmWknICYzg8JNfj3CyDv7pLZ5OZlq6N/ a1Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=azBV/P25KOx4sju/Z/2vJrAm1P+RYAjzGxapNzFvvnI=; b=ncxpOn5xwntFxk+oMwPnn1mCWRh6fEPZmJIk9weZTBwOS/tO1ch9fHlcqAH6QJJp2E 5QhAhTmBvNBkLGpWVOsU3zF2we5Wiq+BFR9lmkr4ZsIVxv9/itxz232SC1rhgeVa9fE6 UMsjVLXP0iEEcYVHwmRot8QAlSueNh8gijwvnHBah4MknZxyEEwwLTj4BGdPsOETPJfE xwmQ/UyJM7jUb4mY+K2Dh+ne5O6ef0L3idfXGD6BX3uZeXqvHpgF7THd2ihPLlx4ogAN +JsnclQxRSj7VmnvkYjJAgtJ3kHU7BTeGu4XUcFTRmKajbsIyYxooawZj0aQ1XAb2Uyt NN2A== X-Gm-Message-State: AOAM532OlcYFkaR8G0ieB6oR1zigVXgzfmO8zgcY8I5Jio/Qy7mxPW7k zccY3L8Ubdzf9WYSKzOXh8BISSQHr9XJC+kY3G2EoA== X-Google-Smtp-Source: ABdhPJyCmMHi925sCnERJNW1V+v4n6ZSqYt8RwJLpikE0j+6ey2UOf6Mo8AR34zqXlE0CeQC65orGe2fVjfpZfZw5q0= X-Received: by 2002:ae9:ee06:: with SMTP id i6mr3460893qkg.380.1600930481721; Wed, 23 Sep 2020 23:54:41 -0700 (PDT) MIME-Version: 1.0 References: <202009231656.08NGujEs042900@gndrsh.dnsmgr.net> In-Reply-To: From: Warner Losh Date: Thu, 24 Sep 2020 00:54:30 -0600 Message-ID: Subject: Re: svn commit: r365643 - head/bin/cp To: Stefan Esser Cc: "Rodney W. Grimes" , Kyle Evans , Alan Somers , Mateusz Guzik , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4Bxm4f4ycfz410n X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=ydd43xKT; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::72c) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.21 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.95)[-0.949]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[freebsd.org,gmail.com]; NEURAL_HAM_LONG(-0.96)[-0.960]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.30)[-0.299]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72c:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-all] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2020 06:54:43 -0000 On Thu, Sep 24, 2020 at 12:41 AM Stefan Esser wrote: > Am 23.09.20 um 19:23 schrieb Warner Losh> But for this issue, we're not > mounting devfs early enough. We should > > fix that. Removing /dev/null from the boot process likely is never going > > to happen because we use it all over the place to discard output... > > There's ~200 instances of it in the boot rc scripts, so getting rid of > > it there would also be quite the effort, with the same question. > > Removal of /dev/null from rc.d scripts should be quite simple, > since most cases could just use ">-" (close file descriptor) > instead. Other usage could be substituted with ":>" followed > by chown. > So closing fd1 and fd2 doesn't cause them to be available for these programs to get as an fd on open, causing other issues? But >- isn't documented in sh(1) as doing the close thing. On a whim I did the following: $ echo fred >- $ ls -last ./- 4 -rw-r--r-- 1 imp imp 5 Sep 24 00:50 ./- $ cat ./- fred $ which suggests maybe you now have a lot of files named - instead... > I'd be willing to generate patches for review, if there is any > chance such a change might be accepted into -CURRENT. > > I could not find any use of /dev/zero, Yea, I'd thought we used it in libc, but I can't find any evidence of that with grep now that I've gone looking for it. For get that specific one :) > but e.g. rc.d/syscons > uses ${kbddev} (i.e. /dev/ttyv0) and rc.d/zvol performs swapon > on /dev/zvol/${name}, rc.d/random uses /dev/random and so on. > So those interactions should be disaled by rc variables... Or we should be failing the operation... > But those further references to /dev nodes will in general be > NOPs if /dev is not available (some test for existence of the > node they rely on, other just fail trying to access them, but > without negative effect on going multi-user). > Yea, that's more minor, but if /dev/ isn't there, they likely should fail, or shouldn't proceed... But in a way that allows the rest of the rc scripts to continue... Warner