Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Dec 2012 14:07:38 -0800
From:      Xin Li <delphij@delphij.net>
To:        Garrett Cooper <yanegomi@gmail.com>
Cc:        Ian Lepore <freebsd@damnhippie.dyndns.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, Xin LI <delphij@freebsd.org>, svn-src-head@freebsd.org, Andrey Zonov <zont@freebsd.org>, Chris Rees <utisoft@gmail.com>
Subject:   Re: svn commit: r244198 - in head: etc/rc.d sbin/sysctl
Message-ID:  <50D23AAA.9070804@delphij.net>
In-Reply-To: <CAGH67wRzpQO_gBHNVF2LVfue7uf5KYRTDo3J0Y1d5ebw0TFyDg@mail.gmail.com>
References:  <201212132332.qBDNWmK4037503@svn.freebsd.org> <50D1D720.80206@FreeBSD.org> <1355931456.1198.203.camel@revolution.hippie.lan> <CAGH67wRfd0CcHZA5kwmdnyyTvinXyXubqVuX_FLwJ1RuMH=ZnA@mail.gmail.com> <CADLo839wcmrXXUD5FXGYJw3s5qW0%2BurYWOdUaCpdCkjFYxVTHA@mail.gmail.com> <CAGH67wRzpQO_gBHNVF2LVfue7uf5KYRTDo3J0Y1d5ebw0TFyDg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 12/19/12 13:08, Garrett Cooper wrote:
> On Wed, Dec 19, 2012 at 12:14 PM, Chris Rees <utisoft@gmail.com>
> wrote:
>> 
>> On 19 Dec 2012 19:37, "Garrett Cooper" <yanegomi@gmail.com>
>> wrote:
>>> 
>>> On Wed, Dec 19, 2012 at 7:37 AM, Ian Lepore 
>>> <freebsd@damnhippie.dyndns.org> wrote:
>>> 
>>> ...
>>> 
>>>> Instead of running sysctl a bunch of times, how about
>>>> something conceptually similar to
>>>> 
>>>> cat /etc/sysctl.d/* /etc/sysctl.conf | sysctl -f -
>>>> 
>>>> Along with this (untested) patch to make sysctl understand
>>>> "-f -".
>>>> 
>>>> Hmmm, is /dev/stdin available as early as sysctl.conf runs?
>>>> If not, the attached patch isn't going to work.
>>> 
>>> Why not just make sysctl understand multiple -f options?
>>> You're probably going to run into more problems parsing from
>>> /dev/stdin and it's going to obfuscate things a lot dealing
>>> with which file came last, feeding back diagnostic info, etc. 
>>> Please don't "linuxise" this tool.
>> 
>> I seem to recall cpio being around a lot before Linux... Our sh
>> also accepts piped scripts.  It's useful.
> 
> Yes, but it just compresses data and doesn't have to necessarily 
> backtrack in order to do so.
> 
>> ssh host cat file | sysctl -f -
> 
> I prefer:
> 
> ssh host cat file > foo sysctl -f foo
> 
> ... and my bikesheds navy blue.

Vulnerable to temporary file attacks (which is relatively easy to
mitigate with mkstemp, though) and poor error handling.

Cheers,
- -- 
Xin LI <delphij@delphij.net>    https://www.delphij.net/
FreeBSD - The Power to Serve!           Live free or die
-----BEGIN PGP SIGNATURE-----

iQEcBAEBCAAGBQJQ0jqqAAoJEG80Jeu8UPuzBiMH/3EF1cDUcjpa9+k7OAPmJx89
PGQhy64QH5CZiztTFMpHsywaAJSr/5LeR/28SdP4YRB67P4IeSLFgRsB+6XqmCJz
cwtuYmZKiorjUhZ9jojwuYG+tab/dRFit46oqk5FujVE8FPhvvBcDpwVyX5vXfsX
HHUyks49pjx/pTFGldb6BxZ9Gp9OZyNXgAM5/RLAW/NLYMEksSp2z4YUquYIZYeh
8ZWsdpQKLFRXv3XG1pnpNYinoKjJ5Khxi6J10yrrOnBdUE1d0VBbMb5BdrBui65I
bQVBTNPnoIQEYP2HtLybL5nnpwvX23ujLDQOxOA6/HtEUz6+206s9JHjRTTWOnc=
=+9Qv
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50D23AAA.9070804>