From owner-freebsd-audit Mon May 6 1:12:13 2002 Delivered-To: freebsd-audit@freebsd.org Received: from turbine.trit.org (turbine.trit.org [63.198.170.141]) by hub.freebsd.org (Postfix) with ESMTP id CAA6E37B404 for ; Mon, 6 May 2002 01:12:06 -0700 (PDT) Received: from turbine.trit.org (localhost [127.0.0.1]) by turbine.trit.org (Postfix) with ESMTP id 4E1DB3E5C for ; Mon, 6 May 2002 08:12:05 +0000 (UTC) To: audit@freebsd.org Subject: sysctl -> sysctl -w Date: Mon, 06 May 2002 08:12:05 +0000 From: Dima Dorfman Message-Id: <20020506081205.4E1DB3E5C@turbine.trit.org> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Since the sysctl -w option was deprecated, we've occasionally seen commits that remove its usage from various parts of the tree. Instead of seeing this go on in piecemeal, I'd like to fix most of them in one commit. The following patch fixes this everywhere except contrib/, some of the KAME stuff (it should stay there, since KAME supports other BSDs, which still require -w), and some stuff that's still on a vendor branch (share/doc/smm and some stuff in picobsd; I didn't think it was worth taking it off for something like this). If anyone knows why I shouldn't commit this, please speak up. Thanks. Index: UPDATING =================================================================== RCS file: /ref/cvsf/src/UPDATING,v retrieving revision 1.203 diff -u -r1.203 UPDATING --- UPDATING 25 Apr 2002 14:41:39 -0000 1.203 +++ UPDATING 6 May 2002 07:57:59 -0000 @@ -861,7 +861,7 @@ If you have really bad/marginal IDE drives, you may find they don't work well. Use pio mode instead. The easiest way to cope if you have a problem combination is to add: - /sbin/sysctl -w hw.atamodes=pio,pio,pio,pio + /sbin/sysctl hw.atamodes=pio,pio,pio,pio to the start of /etc/rc.conf. 20000319: Index: release/picobsd/dial/floppy.tree/etc/mfs.rc =================================================================== RCS file: /ref/cvsf/src/release/picobsd/dial/floppy.tree/etc/mfs.rc,v retrieving revision 1.3 diff -u -r1.3 mfs.rc --- release/picobsd/dial/floppy.tree/etc/mfs.rc 25 Apr 2000 18:59:56 -0000 1.3 +++ release/picobsd/dial/floppy.tree/etc/mfs.rc 6 May 2002 08:03:02 -0000 @@ -13,7 +13,7 @@ trap "echo 'Reboot interrupted'; exit 1" 3 -sysctl -w vm.defer_swapspace_pageouts=1 vm.disable_swapspace_pageouts=1 2>&1 >/dev/null +sysctl vm.defer_swapspace_pageouts=1 vm.disable_swapspace_pageouts=1 2>&1 >/dev/null echo "" echo "-------------------------------------------" Index: release/picobsd/mfs_tree/etc/rc.network =================================================================== RCS file: /ref/cvsf/src/release/picobsd/mfs_tree/etc/rc.network,v retrieving revision 1.4 diff -u -r1.4 rc.network --- release/picobsd/mfs_tree/etc/rc.network 8 Mar 2002 12:33:48 -0000 1.4 +++ release/picobsd/mfs_tree/etc/rc.network 6 May 2002 08:02:13 -0000 @@ -59,16 +59,16 @@ echo -n 'Additional routing options:' if [ -n "$tcp_extensions" -a "x$tcp_extensions" != "xYES" ] ; then echo -n ' tcp_extensions=NO' - sysctl -w net.inet.tcp.rfc1323=0 >/dev/null 2>&1 - sysctl -w net.inet.tcp.rfc1644=0 >/dev/null 2>&1 + sysctl net.inet.tcp.rfc1323=0 >/dev/null 2>&1 + sysctl net.inet.tcp.rfc1644=0 >/dev/null 2>&1 fi if [ "X$gateway_enable" = X"YES" ]; then echo -n ' IP_gateway=YES' - sysctl -w net.inet.ip.forwarding=1 >/dev/null 2>&1 + sysctl net.inet.ip.forwarding=1 >/dev/null 2>&1 fi if [ "X$arpproxy_all" = X"YES" ]; then echo -n ' turning on ARP_PROXY_ALL: ' - sysctl -w net.link.ether.inet.proxyall=1 2>&1 + sysctl net.link.ether.inet.proxyall=1 2>&1 fi echo '.' network_pass1_done=YES # Let future generations know we made it. Index: release/picobsd/net/floppy.tree/etc/rc.network =================================================================== RCS file: /ref/cvsf/src/release/picobsd/net/floppy.tree/etc/rc.network,v retrieving revision 1.6 diff -u -r1.6 rc.network --- release/picobsd/net/floppy.tree/etc/rc.network 28 Aug 1999 01:33:41 -0000 1.6 +++ release/picobsd/net/floppy.tree/etc/rc.network 6 May 2002 08:01:55 -0000 @@ -55,16 +55,16 @@ echo -n 'Additional routing options:' if [ -n "$tcp_extensions" -a "x$tcp_extensions" != "xYES" ] ; then echo -n ' tcp_extensions=NO' - sysctl -w net.inet.tcp.rfc1323=0 >/dev/null 2>&1 - sysctl -w net.inet.tcp.rfc1644=0 >/dev/null 2>&1 + sysctl net.inet.tcp.rfc1323=0 >/dev/null 2>&1 + sysctl net.inet.tcp.rfc1644=0 >/dev/null 2>&1 fi if [ "X$gateway_enable" = X"YES" ]; then echo -n ' IP_gateway=YES' - sysctl -w net.inet.ip.forwarding=1 >/dev/null 2>&1 + sysctl net.inet.ip.forwarding=1 >/dev/null 2>&1 fi if [ "X$arpproxy_all" = X"YES" ]; then echo -n ' turning on ARP_PROXY_ALL: ' - sysctl -w net.link.ether.inet.proxyall=1 2>&1 + sysctl net.link.ether.inet.proxyall=1 2>&1 fi echo '.' network_pass1_done=YES # Let future generations know we made it. Index: release/picobsd/router/floppy.tree/etc/mfs.rc =================================================================== RCS file: /ref/cvsf/src/release/picobsd/router/floppy.tree/etc/mfs.rc,v retrieving revision 1.2 diff -u -r1.2 mfs.rc --- release/picobsd/router/floppy.tree/etc/mfs.rc 28 Aug 1999 01:33:49 -0000 1.2 +++ release/picobsd/router/floppy.tree/etc/mfs.rc 6 May 2002 08:01:32 -0000 @@ -6,7 +6,7 @@ set HOME=/ set PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin -sysctl -w vm.defer_swapspace_pageouts=1 vm.disable_swapspace_pageouts=1 +sysctl vm.defer_swapspace_pageouts=1 vm.disable_swapspace_pageouts=1 ### Special setup for one floppy PICOBSD ### echo Index: share/examples/isdn/FAQ =================================================================== RCS file: /ref/cvsf/src/share/examples/isdn/FAQ,v retrieving revision 1.10 diff -u -r1.10 FAQ --- share/examples/isdn/FAQ 1 May 2001 09:14:56 -0000 1.10 +++ share/examples/isdn/FAQ 6 May 2002 08:00:05 -0000 @@ -634,7 +634,7 @@ This can easily be checked by doing ``sysctl net.inet.tcp.rfc1323''. If the result is 1, then the RFC1323 support is turned on. -Turn this off by doing ``sysctl -w net.inet.tcp.rfc1323=0'' (This is +Turn this off by doing ``sysctl net.inet.tcp.rfc1323=0'' (This is called "net.inet.tcp.do_rfc1323" under BSD/OS). For FreeBSD make sure that tcp_extension="NO" is in your /etc/rc.conf Index: sys/compat/linux/linux_mib.c =================================================================== RCS file: /ref/cvsf/src/sys/compat/linux/linux_mib.c,v retrieving revision 1.15 diff -u -r1.15 linux_mib.c --- sys/compat/linux/linux_mib.c 3 Dec 2001 16:12:25 -0000 1.15 +++ sys/compat/linux/linux_mib.c 6 May 2002 07:59:50 -0000 @@ -316,9 +316,9 @@ } /* - * Usage: sysctl -w linux.debug=.<0/1> + * Usage: sysctl linux.debug=.<0/1> * - * E.g.: sysctl -w linux.debug=21.0 + * E.g.: sysctl linux.debug=21.0 * * As a special case, syscall "all" will apply to all syscalls globally. */ Index: sys/conf/kern.post.mk =================================================================== RCS file: /ref/cvsf/src/sys/conf/kern.post.mk,v retrieving revision 1.17 diff -u -r1.17 kern.post.mk --- sys/conf/kern.post.mk 1 May 2002 03:28:14 -0000 1.17 +++ sys/conf/kern.post.mk 6 May 2002 07:59:24 -0000 @@ -150,7 +150,7 @@ fi ; \ mv ${DESTDIR}${KODIR} ${DESTDIR}${KODIR}.old ; \ if [ "$$thiskernel" = ${DESTDIR}${KODIR}/${KERNEL_KO} ] ; then \ - sysctl -w kern.bootfile=${DESTDIR}${KODIR}.old/${KERNEL_KO} ; \ + sysctl kern.bootfile=${DESTDIR}${KODIR}.old/${KERNEL_KO} ; \ fi; \ fi .endif Index: sys/dev/bktr/bktr_card.h =================================================================== RCS file: /ref/cvsf/src/sys/dev/bktr/bktr_card.h,v retrieving revision 1.4 diff -u -r1.4 bktr_card.h --- sys/dev/bktr/bktr_card.h 26 Jun 2000 09:41:31 -0000 1.4 +++ sys/dev/bktr/bktr_card.h 6 May 2002 07:58:46 -0000 @@ -54,7 +54,7 @@ * eg options BKTR_OVERRIDE CARD=1 * * or using the sysclt hw.bt848.card - * eg sysctl -w hw.bt848.card=1 + * eg sysctl hw.bt848.card=1 * * where is one of the following card defines. */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon May 6 2: 4:20 2002 Delivered-To: freebsd-audit@freebsd.org Received: from cheer.mahoroba.org (flets19-004.kamome.or.jp [218.45.19.4]) by hub.freebsd.org (Postfix) with ESMTP id 1689A37B40B for ; Mon, 6 May 2002 02:04:17 -0700 (PDT) Received: from mille.mahoroba.org (IDENT:8tsdBDcGf2CLI3jIRJ8yPFgY8nzlmJvPd8/+Q4hB94tZ6uM3iyW4FEoUR1of6pvT@mille.mahoroba.org [IPv6:2001:200:301:0:202:2dff:fe0a:6bee]) (user=ume mech=CRAM-MD5 bits=0) by cheer.mahoroba.org (8.12.3/8.12.3) with ESMTP/inet6 id g4694DLR091011 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 6 May 2002 18:04:17 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Mon, 06 May 2002 18:03:58 +0900 Message-ID: From: Hajimu UMEMOTO To: Dima Dorfman Cc: audit@FreeBSD.ORG Subject: Re: sysctl -> sysctl -w In-Reply-To: <20020506081205.4E1DB3E5C@turbine.trit.org> References: <20020506081205.4E1DB3E5C@turbine.trit.org> User-Agent: xcite1.38> Wanderlust/2.8.1 (Something) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-4?Q?Unebigory=F2mae?=) APEL/10.3 Emacs/21.2 (i386--freebsd) MULE/5.0 (=?ISO-2022-JP?B?GyRCOC1MWhsoQg==?=) X-Operating-System: FreeBSD 4.6-PRERELEASE MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS-perl11-milter (http://amavis.org/) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, >>>>> On Mon, 06 May 2002 08:12:05 +0000 >>>>> Dima Dorfman said: dima> commit. The following patch fixes this everywhere except contrib/, dima> some of the KAME stuff (it should stay there, since KAME supports dima> other BSDs, which still require -w), and some stuff that's still on a Do you mean share/example/IPv6/USAGE? If so, I believe it should be okay. Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@bisd.hitachi.co.jp ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon May 6 7:23:53 2002 Delivered-To: freebsd-audit@freebsd.org Received: from green.bikeshed.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D6D4937B401; Mon, 6 May 2002 07:23:49 -0700 (PDT) Received: from localhost (green@localhost) by green.bikeshed.org (8.11.6/8.11.6) with ESMTP id g46ENmU18421; Mon, 6 May 2002 10:23:49 -0400 (EDT) (envelope-from green@green.bikeshed.org) Message-Id: <200205061423.g46ENmU18421@green.bikeshed.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Dima Dorfman Cc: audit@freebsd.org Subject: Re: sysctl -> sysctl -w In-Reply-To: Your message of "Mon, 06 May 2002 08:12:05 -0000." <20020506081205.4E1DB3E5C@turbine.trit.org> From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 06 May 2002 10:23:48 -0400 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dima Dorfman wrote: > Since the sysctl -w option was deprecated, we've occasionally seen > commits that remove its usage from various parts of the tree. Instead > of seeing this go on in piecemeal, I'd like to fix most of them in one > commit. The following patch fixes this everywhere except contrib/, > some of the KAME stuff (it should stay there, since KAME supports > other BSDs, which still require -w), and some stuff that's still on a > vendor branch (share/doc/smm and some stuff in picobsd; I didn't think > it was worth taking it off for something like this). > > If anyone knows why I shouldn't commit this, please speak up. > > Thanks. > > Index: UPDATING > =================================================================== > RCS file: /ref/cvsf/src/UPDATING,v > retrieving revision 1.203 > diff -u -r1.203 UPDATING > --- UPDATING 25 Apr 2002 14:41:39 -0000 1.203 > +++ UPDATING 6 May 2002 07:57:59 -0000 > @@ -861,7 +861,7 @@ > If you have really bad/marginal IDE drives, you may find they > don't work well. Use pio mode instead. The easiest way to > cope if you have a problem combination is to add: > - /sbin/sysctl -w hw.atamodes=pio,pio,pio,pio > + /sbin/sysctl hw.atamodes=pio,pio,pio,pio > to the start of /etc/rc.conf. > > 20000319: I don't think you should commit that part. It's for the past, anyway. Heck, the sysctl doesn't even exist anymore ;-) -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org <> bfeldman@tislabs.com \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed May 8 12: 2:20 2002 Delivered-To: freebsd-audit@freebsd.org Received: from dhcp117.mvista.com (gateway-1237.mvista.com [12.44.186.158]) by hub.freebsd.org (Postfix) with ESMTP id 2F77B37B404; Wed, 8 May 2002 12:02:12 -0700 (PDT) Received: (from nbliss@localhost) by dhcp117.mvista.com (8.11.6/8.11.6) id g48Ixu732700; Wed, 8 May 2002 11:59:56 -0700 Date: Wed, 8 May 2002 11:59:56 -0700 From: Neil Bliss To: freebsd-gnats-submit@freebsd.org Cc: neil@darlow.co.uk, audit@freebsd.org, nbliss@mvista.com Subject: Re: conf/30441: Can't set interface arguments for dhcp configured interfaces Message-ID: <20020508115956.I12891@dhcp117.mvista.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hey folks, I just ran into this problem, and here's my proposed fix for it. Feel free to incorporate it, or not. =) Index: rc.network =================================================================== RCS file: /home/ncvs/src/etc/rc.network,v retrieving revision 1.134 diff -c -r1.134 rc.network *** rc.network 2002/04/11 22:06:27 1.134 --- rc.network 2002/05/08 19:01:20 *************** *** 211,219 **** case ${ifconfig_args} in '') ;; ! [Dd][Hh][Cc][Pp]) # DHCP inits are done all in one go below dhcp_interfaces="$dhcp_interfaces $ifn" eval showstat_$ifn=1 ;; *) --- 211,225 ---- case ${ifconfig_args} in '') ;; ! [Dd][Hh][Cc][Pp]) # DHCP inits are done all in one go below dhcp_interfaces="$dhcp_interfaces $ifn" eval showstat_$ifn=1 ;; *) --- 211,225 ---- case ${ifconfig_args} in '') ;; ! *[Dd][Hh][Cc][Pp]*) # DHCP inits are done all in one go below dhcp_interfaces="$dhcp_interfaces $ifn" + # eat the DHCP token, and apply any other args. + ifconfig_args=`echo $ifconfig_args \ + | sed s/[Dd][Hh][Cc][Pp]//` + if [ -n "${ifconfig_args}" ]; then + ifconfig ${ifn} ${ifconfig_args} + fi eval showstat_$ifn=1 ;; *) later, Neil -- Neil Bliss - Monta Vista Technical Support Yow!-Zippy-says: I once decorated my apartment entirely in ten foot salad forks!! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu May 9 10:15:26 2002 Delivered-To: freebsd-audit@freebsd.org Received: from hand.dotat.at (host217-34-79-171.in-addr.btopenworld.com [217.34.79.171]) by hub.freebsd.org (Postfix) with ESMTP id EC89C37B404 for ; Thu, 9 May 2002 10:15:20 -0700 (PDT) Received: from fanf by hand.dotat.at with local (Exim 3.35 #1) id 175rVd-000JbC-00 for freebsd-audit@freebsd.org; Thu, 09 May 2002 17:15:17 +0000 From: Tony Finch To: freebsd-audit@freebsd.org Subject: correct error handling in reboot(8) Message-Id: Date: Thu, 09 May 2002 17:15:17 +0000 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I just noticed when looking at reboot(8) following the killall rant in the recent RISKS that there a number of cases after SIGSTOPping init in which it may abort calling err() but fail to restart init. This patch uses atexit() to ensure that init is restarted if things go wrong. The same problem and fix apply to -STABLE. Index: reboot.c =================================================================== RCS file: /home/ncvs/src/sbin/reboot/reboot.c,v retrieving revision 1.15 diff -u -r1.15 reboot.c --- reboot.c 26 Apr 2002 22:32:15 -0000 1.15 +++ reboot.c 9 May 2002 17:03:58 -0000 @@ -60,8 +60,9 @@ #include #include -void usage(void); u_int get_pageins(void); +void restart_init(void); +void usage(void); int dohalt; @@ -69,7 +70,7 @@ main(int argc, char *argv[]) { struct passwd *pw; - int ch, howto, i, fd, kflag, lflag, nflag, qflag, pflag, sverrno; + int ch, howto, i, fd, kflag, lflag, nflag, qflag, pflag; u_int pageins; char *kernel, *p; const char *user; @@ -156,6 +157,8 @@ sync(); /* Just stop init -- if we fail, we'll restart it. */ + if (atexit(restart_init) == -1) + err(1, "atexit"); if (kill(1, SIGTSTP) == -1) err(1, "SIGTSTP init"); @@ -187,24 +190,28 @@ if (kill(-1, SIGKILL) == -1) { if (errno == ESRCH) break; - goto restart; + err(1, "killall"); } if (i > 5) { - (void)fprintf(stderr, - "WARNING: some process(es) wouldn't die\n"); + warnx("WARNING: some process(es) wouldn't die"); break; } (void)sleep(2 * i); } + /* + * If the reboot() succeeds then we never get control back, + * otherwise we exit via some error reporting and restart_init(). + */ reboot(howto); - /* FALLTHROUGH */ + err(1, "reboot failed"); +} -restart: - sverrno = errno; - errx(1, "%s%s", kill(1, SIGHUP) == -1 ? "(can't restart init): " : "", - strerror(sverrno)); - /* NOTREACHED */ +void +restart_init() +{ + if (kill(1, SIGHUP) == -1) + warn("can't restart init"); } void Tony. -- f.a.n.finch http://dotat.at/ CROMARTY FORTH TYNE DOGGER: NORTHEASTERLY 3 OR 4, OCCASIONALLY 5. PATCHY RAIN AT FIRST. MODERATE OR GOOD WITH FOG PATCHES. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message