svn commit: r326563 - in head/contrib/ofed: infiniband-diags/build libibnetdisc opensm/complib opensm/libopensm opensm/libvendor opensm/opensm

2017-12-05 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Dec  5 08:25:17 2017
New Revision: 326563
URL: https://svnweb.freebsd.org/changeset/base/326563

Log:
  Correctly prefix the infiniband include directory for buildworld. This fixes
  the OFED buildworld target, WITH_OFED=YES, when the include files are not
  already installed locally, but only in the temporary object directory.
  
  Found by: kib
  Sponsored by: Mellanox Technologies

Modified:
  head/contrib/ofed/infiniband-diags/build/Makefile.inc
  head/contrib/ofed/libibnetdisc/Makefile
  head/contrib/ofed/opensm/complib/Makefile
  head/contrib/ofed/opensm/libopensm/Makefile
  head/contrib/ofed/opensm/libvendor/Makefile
  head/contrib/ofed/opensm/opensm/Makefile

Modified: head/contrib/ofed/infiniband-diags/build/Makefile.inc
==
--- head/contrib/ofed/infiniband-diags/build/Makefile.inc   Tue Dec  5 
07:21:47 2017(r326562)
+++ head/contrib/ofed/infiniband-diags/build/Makefile.inc   Tue Dec  5 
08:25:17 2017(r326563)
@@ -4,7 +4,7 @@
 
 BINDIR?= /usr/bin
 SRCS+= ibdiag_common.c ibdiag_sa.c
-CFLAGS+= -I${INCLUDEDIR}/infiniband
+CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband
 CFLAGS+= -DHAVE_CONFIG_H=1
 CFLAGS+= -I${.CURDIR}/../../
 CFLAGS+= -I${.CURDIR}/../../src

Modified: head/contrib/ofed/libibnetdisc/Makefile
==
--- head/contrib/ofed/libibnetdisc/Makefile Tue Dec  5 07:21:47 2017
(r326562)
+++ head/contrib/ofed/libibnetdisc/Makefile Tue Dec  5 08:25:17 2017
(r326563)
@@ -27,7 +27,7 @@ ibnd_show_progress.3
 LIBADD=osmcomp ibmad ibumad
 CFLAGS+=   -DHAVE_CONFIG_H=1
 CFLAGS+=   -I${.CURDIR}
-CFLAGS+=   -I${INCLUDEDIR}/infiniband
+CFLAGS+=   -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband
 VERSION_MAP=   ${.CURDIR}/libibnetdisc.map
 
 .include 

Modified: head/contrib/ofed/opensm/complib/Makefile
==
--- head/contrib/ofed/opensm/complib/Makefile   Tue Dec  5 07:21:47 2017
(r326562)
+++ head/contrib/ofed/opensm/complib/Makefile   Tue Dec  5 08:25:17 2017
(r326563)
@@ -27,7 +27,7 @@ cl_vector.c \
 ib_statustext.c
 
 CFLAGS+=   -I${.CURDIR}/.. -DHAVE_CONFIG_H=1
-CFLAGS+=   -I${INCLUDEDIR}/infiniband
+CFLAGS+=   -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband
 LIBADD=pthread
 VERSION_MAP=   ${.CURDIR}/libosmcomp.map
 

Modified: head/contrib/ofed/opensm/libopensm/Makefile
==
--- head/contrib/ofed/opensm/libopensm/Makefile Tue Dec  5 07:21:47 2017
(r326562)
+++ head/contrib/ofed/opensm/libopensm/Makefile Tue Dec  5 08:25:17 2017
(r326563)
@@ -14,7 +14,7 @@ osm_helper.c
 
 LIBADD=pthread
 CFLAGS+=   -I${.CURDIR}/.. -DHAVE_CONFIG_H=1
-CFLAGS+=   -I${INCLUDEDIR}/infiniband
+CFLAGS+=   -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband
 VERSION_MAP=   ${.CURDIR}/../opensm/libopensm.map
 
 .include 

Modified: head/contrib/ofed/opensm/libvendor/Makefile
==
--- head/contrib/ofed/opensm/libvendor/Makefile Tue Dec  5 07:21:47 2017
(r326562)
+++ head/contrib/ofed/opensm/libvendor/Makefile Tue Dec  5 08:25:17 2017
(r326563)
@@ -13,7 +13,7 @@ osm_vendor_ibumad_sa.c
 
 LIBADD=ibumad pthread
 CFLAGS+=   -I${.CURDIR}/.. -DHAVE_CONFIG_H=1
-CFLAGS+=   -I${INCLUDEDIR}/infiniband
+CFLAGS+=   -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband
 VERSION_MAP=   ${.CURDIR}/libosmvendor.map
 
 .include 

Modified: head/contrib/ofed/opensm/opensm/Makefile
==
--- head/contrib/ofed/opensm/opensm/MakefileTue Dec  5 07:21:47 2017
(r326562)
+++ head/contrib/ofed/opensm/opensm/MakefileTue Dec  5 08:25:17 2017
(r326563)
@@ -95,7 +95,7 @@ st.c
 
 MAN=   opensm.8
 CFLAGS+=   -I${.CURDIR}/.. -DHAVE_CONFIG_H=1
-CFLAGS+=   -I${INCLUDEDIR}/infiniband
+CFLAGS+=   -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband
 LIBADD=opensm osmvendor osmcomp wrap pthread
 
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Konstantin Belousov
On Tue, Dec 05, 2017 at 03:55:10AM +, Eitan Adler wrote:
> Author: eadler
> Date: Tue Dec  5 03:55:10 2017
> New Revision: 326554
> URL: https://svnweb.freebsd.org/changeset/base/326554
> 
> Log:
>   sponge(1): initial commit
>   
>   sponge(1) is a utility that reads input until
>   complete, then opens the output file, then
>   writes to it. This makes it useful in pipelines
>   that read and write to the same file.
>   
>   Reviewed by:wblock, jilles, imp, cem, danfe (all: various 
> iterations)
>   Inspired by:https://joeyh.name/code/moreutils/
> 
> Added:
>   head/usr.bin/sponge/
>   head/usr.bin/sponge/Makefile   (contents, props changed)
>   head/usr.bin/sponge/sponge.1   (contents, props changed)
>   head/usr.bin/sponge/sponge.c   (contents, props changed)
>   head/usr.bin/sponge/tests/
>   head/usr.bin/sponge/tests/Makefile   (contents, props changed)
>   head/usr.bin/sponge/tests/Makefile.depend   (contents, props changed)
>   head/usr.bin/sponge/tests/sponge_test.sh   (contents, props changed)
> Modified:
>   head/.arclint
>   head/usr.bin/tee/tee.1
> 
> Modified: head/.arclint
> ==
> --- head/.arclint Tue Dec  5 02:23:36 2017(r326553)
> +++ head/.arclint Tue Dec  5 03:55:10 2017(r326554)
> @@ -9,7 +9,8 @@
>"type": "spelling"
>  },
>  "chmod": {
> -  "type": "chmod"
> +  "type": "chmod",
> +  "exclude": "(/tests/)"
>  },
>  "merge-conflict": {
>"type": "merge-conflict"
> 
> Added: head/usr.bin/sponge/Makefile
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/usr.bin/sponge/Makefile  Tue Dec  5 03:55:10 2017
> (r326554)
> @@ -0,0 +1,8 @@
> +# $FreeBSD$
> +
> +PROG=sponge
> +
> +HAS_TESTS=
> +SUBDIR.${MK_TESTS}+= tests
> +
> +.include 
> 
> Added: head/usr.bin/sponge/sponge.1
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/usr.bin/sponge/sponge.1  Tue Dec  5 03:55:10 2017
> (r326554)
> @@ -0,0 +1,75 @@
> +.\"  Eitan Adler.  All rights reserved.
> +.\"
> +.\" Redistribution and use in source and binary forms, with or without
> +.\" modification, are permitted provided that the following conditions
> +.\" are met:
> +.\" 1. Redistributions of source code must retain the above copyright
> +.\"notice, this list of conditions and the following disclaimer.
> +.\" 2. Redistributions in binary form must reproduce the above copyright
> +.\"notice, this list of conditions and the following disclaimer in the
> +.\"documentation and/or other materials provided with the distribution.
> +.\"
> +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
> +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
> PURPOSE
> +.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
> +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
> CONSEQUENTIAL
> +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
> STRICT
> +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> +.\" SUCH DAMAGE.
> +.\"
> +.\" $FreeBSD$
> +.\"
> +.Dd November 1, 2017
> +.Dt SPONGE 1
> +.Os
> +.Sh NAME
> +.Nm sponge
> +.Nd buffer stdin and write to stdout
> +.Sh SYNOPSIS
> +.Nm
> +.Op Fl a
> +.Ar filename
> +.Sh DESCRIPTION
> +The
> +.Nm
> +utility reads standard in until complete, then opens
> +the output file and writes to it.
> +This makes it useful in pipelines that read a file and then write to it.
> +These options are available:
> +.Bl -tag -width indent
> +.It Fl a
> +Open
> +.Ar filename
> +in append mode.
> +.El
> +.Pp
> +If an attempt to allocate memory fails,
> +.Nm
> +fails without output.
> +The file is written even if earlier components
> +of the pipeline failed.
> +.Sh SEE ALSO
> +.Xr builtin 1 ,
> +.Xr csh 1 ,
> +.Xr getrusage 2 ,
> +.Xr tee 1 ,
> +.Xr wait 2
> +.Sh EXIT STATUS
> +.Ex -std
> +.Sh EXAMPLES
> +A
> +.Pa file
> +can be be sorted "in place" by executing
> +.Cm sort file | sponge file
> +.Sh HISTORY
> +The
> +.Nm
> +utility was written by
> +.An Eitan Adler Aq Mt ead...@freebsd.org
> +and first appeared
> +in
> +.Fx 12.0 .
> 
> Added: head/usr.bin/sponge/sponge.c
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/usr.bin/sponge/sponge.c  Tue Dec  5 03:55:10 2017

svn commit: r326564 - head/release/tools

2017-12-05 Thread Colin Percival
Author: cperciva
Date: Tue Dec  5 09:08:48 2017
New Revision: 326564
URL: https://svnweb.freebsd.org/changeset/base/326564

Log:
  Resurrect r321659: Turn off ChallengeResponseAuthentication for EC2 AMIs.
  
  EC2 instances are normally launched with an SSH public key specified,
  which is then used for logging in (by default, as 'ec2-user').  Having
  ChallengeResponseAuthentication enabled (as FreeBSD's default sshd_config
  does) has no functional effect in a new EC2 instance, since you can't log
  in using a password until a password has been set -- but having this
  enabled results in alerts from automated scanning tools which can detect
  that sshd advertises support for keyboard-interactive logins (since they
  can't detect that accounts have no password set).
  
  EC2 users who want to use passwords to log in to their instances will need
  to set 'ChallengeResponseAuthentication yes' in FreeBSD 12.0 and later.
  
  Discussed with:   gjb, gtetlow, emaste, des
  Requested by: Amazon
  X-MFC:No
  Relnotes: ChallengeResponseAuthentication is turned off by default in
Amazon EC2 AMIs.

Modified:
  head/release/tools/ec2.conf

Modified: head/release/tools/ec2.conf
==
--- head/release/tools/ec2.conf Tue Dec  5 08:25:17 2017(r326563)
+++ head/release/tools/ec2.conf Tue Dec  5 09:08:48 2017(r326564)
@@ -81,6 +81,12 @@ vm_extra_pre_umount() {
# Load the kernel module for the Amazon "Elastic Network Adapter"
echo 'if_ena_load="YES"' >> ${DESTDIR}/boot/loader.conf
 
+   # Disable ChallengeResponseAuthentication according to EC2
+   # requirements.
+   sed -i '' -e \
+   's/^#ChallengeResponseAuthentication 
yes/ChallengeResponseAuthentication no/' \
+   ${DESTDIR}/etc/ssh/sshd_config
+
# The first time the AMI boots, the installed "first boot" scripts
# should be allowed to run:
# * ec2_configinit (download and process EC2 user-data)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326565 - head/release/tools

2017-12-05 Thread Colin Percival
Author: cperciva
Date: Tue Dec  5 09:22:14 2017
New Revision: 326565
URL: https://svnweb.freebsd.org/changeset/base/326565

Log:
  Make EC2 instances use Amazon's NTP service for time synchronization.
  
  Since Amazon provides NTP servers within their network, this should
  be far superior to using the default NTP pools; and since the service
  is provided by Amazon there's very little risk in enabling it by
  default.  (If someone is able to compromise Amazon's NTP servers and
  exploit them to attack EC2 instances, they would almost certainly be
  able to compromise EC2 instances even without ntpd running...)
  
  MFC after:1 week
  Relnotes: EC2 instances now keep their clocks synchronized using
the Amazon Time Sync Service (aka. NTP).

Modified:
  head/release/tools/ec2.conf

Modified: head/release/tools/ec2.conf
==
--- head/release/tools/ec2.conf Tue Dec  5 09:08:48 2017(r326564)
+++ head/release/tools/ec2.conf Tue Dec  5 09:22:14 2017(r326565)
@@ -9,7 +9,7 @@
 export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs 
dual-dhclient amazon-ssm-agent"
 
 # Set to a list of third-party software to enable in rc.conf(5).
-export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_ephemeralswap 
ec2_loghostkey firstboot_freebsd_update firstboot_pkgs"
+export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_ephemeralswap 
ec2_loghostkey firstboot_freebsd_update firstboot_pkgs ntpd"
 
 # Build with a 3 GB UFS partition; the growfs rc.d script will expand
 # the partition to fill the root disk after the EC2 instance is launched.
@@ -86,6 +86,11 @@ vm_extra_pre_umount() {
sed -i '' -e \
's/^#ChallengeResponseAuthentication 
yes/ChallengeResponseAuthentication no/' \
${DESTDIR}/etc/ssh/sshd_config
+
+   # Use the NTP service provided by Amazon
+   sed -i '' -e 's/^pool/#pool/' \
+   -e 's/^#server.*/server 169.254.169.123 iburst/' \
+   ${DESTDIR}/etc/ntp.conf
 
# The first time the AMI boots, the installed "first boot" scripts
# should be allowed to run:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326558 - in head: . usr.sbin/fdformat

2017-12-05 Thread Ed Schouten
2017-12-05 6:02 GMT+01:00 Cy Schubert :
> +OLD_FILES+=usr/share/man/man8/fdformat.1.gz

s/man8/man1/, right? :-)

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Li-Wen Hsu
On Tue, Dec 05, 2017 at 10:43:45 +0200, Konstantin Belousov wrote:
> On Tue, Dec 05, 2017 at 03:55:10AM +, Eitan Adler wrote:
> > Author: eadler
> > Date: Tue Dec  5 03:55:10 2017
> > New Revision: 326554
> > URL: https://svnweb.freebsd.org/changeset/base/326554

[...]

> > Added: head/usr.bin/sponge/sponge.c
> > ==
> > --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> > +++ head/usr.bin/sponge/sponge.cTue Dec  5 03:55:10 2017
> > (r326554)

[...]

> > +   while (bufremain > 0) {
> > +   whichbuf = (bufremain < maxiovec) ? bufremain : maxiovec;
> > +   bufremain -= whichbuf;
> > +
> > +   i = writev(fd, iov, whichbuf);
> > +   if (i < 0) {
> > +   err(1, "failed to write");
> > +   }
> > +   }
> This loop is nonsensical.

Also breaks build:

/usr/src/usr.bin/sponge/sponge.c:175:25: error: comparison of integers of 
different signs: 'size_t' (aka 'unsigned long') and 'long' 
[-Werror,-Wsign-compare]
whichbuf = (bufremain < maxiovec) ? bufremain : maxiovec;
~ ^ 
1 error generated.

Ref: https://ci.freebsd.org/job/FreeBSD-head-amd64-build/6187/console

Please check this.

Thanks,
Li-Wen

-- 
Li-Wen Hsu 
https://lwhsu.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Mon, Dec 4, 2017 at 7:55 PM, Eitan Adler  wrote:
> > Author: eadler
> > Date: Tue Dec  5 03:55:10 2017
> > New Revision: 326554
> > URL: https://svnweb.freebsd.org/changeset/base/326554
> >
> > Log:
> >   sponge(1): initial commit
> >
> >   sponge(1) is a utility that reads input until
> >   complete, then opens the output file, then
> >   writes to it. This makes it useful in pipelines
> >   that read and write to the same file.
> >
> >   Reviewed by:  wblock, jilles, imp, cem, danfe (all: various iterations)
> 
> I don't recall reviewing this in any iteration, but I could be mistaken.

I do not see any of these names with checks in the reviewed by box,
providing feedback in a review != reviewed by unless they have
accepted it.

Further more, why does freebsd need this in base?

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Hans Petter Selasky

On 12/05/17 13:58, Rodney W. Grimes wrote:

Further more, why does freebsd need this in base?


Hi,

I think this is useful. It could replace the "-i " (intermediate) option 
for "sed" for example. It avoids creating temporary files when filtering 
files, right?


--HPS
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: eadler
> Date: Tue Dec  5 03:55:10 2017
> New Revision: 326554
> URL: https://svnweb.freebsd.org/changeset/base/326554
> 
> Log:
>   sponge(1): initial commit
>   
>   sponge(1) is a utility that reads input until
>   complete, then opens the output file, then
>   writes to it. This makes it useful in pipelines
>   that read and write to the same file.
>   
>   Reviewed by:wblock, jilles, imp, cem, danfe (all: various 
> iterations)
>   Inspired by:https://joeyh.name/code/moreutils/
> 
> Added:
>   head/usr.bin/sponge/
>   head/usr.bin/sponge/Makefile   (contents, props changed)
>   head/usr.bin/sponge/sponge.1   (contents, props changed)
>   head/usr.bin/sponge/sponge.c   (contents, props changed)
>   head/usr.bin/sponge/tests/
>   head/usr.bin/sponge/tests/Makefile   (contents, props changed)
>   head/usr.bin/sponge/tests/Makefile.depend   (contents, props changed)
>   head/usr.bin/sponge/tests/sponge_test.sh   (contents, props changed)
> Modified:
>   head/.arclint
>   head/usr.bin/tee/tee.1
> 
> Modified: head/.arclint
> ==
> --- head/.arclint Tue Dec  5 02:23:36 2017(r326553)
> +++ head/.arclint Tue Dec  5 03:55:10 2017(r326554)
> @@ -9,7 +9,8 @@
>"type": "spelling"
>  },
>  "chmod": {
> -  "type": "chmod"
> +  "type": "chmod",
> +  "exclude": "(/tests/)"

WHAT?


>  },
>  "merge-conflict": {
>"type": "merge-conflict"
> 
> Added: head/usr.bin/sponge/Makefile
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/usr.bin/sponge/Makefile  Tue Dec  5 03:55:10 2017
> (r326554)
> @@ -0,0 +1,8 @@
> +# $FreeBSD$
> +
> +PROG=sponge
> +
> +HAS_TESTS=
> +SUBDIR.${MK_TESTS}+= tests
> +
> +.include 
> 
> Added: head/usr.bin/sponge/sponge.1
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/usr.bin/sponge/sponge.1  Tue Dec  5 03:55:10 2017
> (r326554)
> @@ -0,0 +1,75 @@
> +.\"  Eitan Adler.  All rights reserved.

This is not a proper form of copyright, it is missing the legal requirement
of the word "copyright" and the required date.



> +.\"
> +.\" $FreeBSD$
> +.\"
> +.Dd November 1, 2017
> +.Dt SPONGE 1
> +.Os
> +.Sh NAME
> +.Nm sponge
> +.Nd buffer stdin and write to stdout
> +.Sh SYNOPSIS
> +.Nm
> +.Op Fl a
> +.Ar filename
> +.Sh DESCRIPTION
> +The
> +.Nm
> +utility reads standard in until complete, then opens
Best way to format manual pages is to break lines at each
clause of a sentance, this should of been broken at the ,

> +the output file and writes to it.
> +This makes it useful in pipelines that read a file and then write to it.

Break at and

> +These options are available:
> +.Bl -tag -width indent
> +.It Fl a
> +Open
> +.Ar filename
> +in append mode.
> +.El
> +.Pp
> +If an attempt to allocate memory fails,
> +.Nm
> +fails without output.
> +The file is written even if earlier components
> +of the pipeline failed.
> +.Sh SEE ALSO
> +.Xr builtin 1 ,
> +.Xr csh 1 ,
> +.Xr getrusage 2 ,
> +.Xr tee 1 ,
> +.Xr wait 2
> +.Sh EXIT STATUS
> +.Ex -std
> +.Sh EXAMPLES
> +A
> +.Pa file
> +can be be sorted "in place" by executing
> +.Cm sort file | sponge file
> +.Sh HISTORY
> +The
> +.Nm
> +utility was written by
> +.An Eitan Adler Aq Mt ead...@freebsd.org
> +and first appeared
> +in
> +.Fx 12.0 .
> 
> Added: head/usr.bin/sponge/sponge.c
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/usr.bin/sponge/sponge.c  Tue Dec  5 03:55:10 2017
> (r326554)
> @@ -0,0 +1,189 @@
> +/*-
> + * SPDX-License-Identifier: BSD-2-Clause
> + *
> + * Copyright (c) 2017 Eitan Adler

Now thats how a copyright should look.

> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in the
> + *documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> + * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> + * DAM

svn commit: r326566 - head

2017-12-05 Thread Cy Schubert
Author: cy
Date: Tue Dec  5 13:41:21 2017
New Revision: 326566
URL: https://svnweb.freebsd.org/changeset/base/326566

Log:
  Fix cut & paste error from r326558.
  
  Reported by:  ed
  MFC after:1 week
  X-MFC with:   r326558
  Pointy hat to:cy

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Dec  5 09:22:14 2017(r326565)
+++ head/ObsoleteFiles.inc  Tue Dec  5 13:41:21 2017(r326566)
@@ -39,7 +39,7 @@
 # done
 
 # 20171204: Move fdformat man page from volume 1 to volume 8.
-OLD_FILES+=usr/share/man/man8/fdformat.1.gz
+OLD_FILES+=usr/share/man/man1/fdformat.1.gz
 # 20171203: libproc version bump
 OLD_LIBS+=usr/lib/libproc.so.4
 OLD_LIBS+=usr/lib32/libproc.so.4
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326558 - in head: . usr.sbin/fdformat

2017-12-05 Thread Cy Schubert
In message 
, Ed Schouten writes:
> 2017-12-05 6:02 GMT+01:00 Cy Schubert :
> > +OLD_FILES+=usr/share/man/man8/fdformat.1.gz
>
> s/man8/man1/, right? :-)

Thank you for pointing this out Ed. Fixed in 326566.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Konstantin Belousov
On Tue, Dec 05, 2017 at 02:00:00PM +0100, Hans Petter Selasky wrote:
> On 12/05/17 13:58, Rodney W. Grimes wrote:
> > Further more, why does freebsd need this in base?
> 
> Hi,
> 
> I think this is useful. It could replace the "-i " (intermediate) option 
> for "sed" for example. It avoids creating temporary files when filtering 
> files, right?

No, if process fails during the operation, user data is destroyed
irretrievable.The usual trick of creating temporary file and renaming
ensure that old file is around until all data for new file is written
into buffer cache. With some existing filesystem support, it also
guarantees that the old file is around in case of the system crash.

All this assuming the tool' code matches its description, which is not.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326567 - head/sys/ddb

2017-12-05 Thread Andriy Gapon
Author: avg
Date: Tue Dec  5 14:22:08 2017
New Revision: 326567
URL: https://svnweb.freebsd.org/changeset/base/326567

Log:
  ddb: fix validation of cpu id in 'set db_cpu=x'
  
  MFC after:1 week

Modified:
  head/sys/ddb/db_sym.c

Modified: head/sys/ddb/db_sym.c
==
--- head/sys/ddb/db_sym.c   Tue Dec  5 13:41:21 2017(r326566)
+++ head/sys/ddb/db_sym.c   Tue Dec  5 14:22:08 2017(r326567)
@@ -85,8 +85,8 @@ db_var_db_cpu(struct db_variable *vp, db_expr_t *value
return (1);
 
case DB_VAR_SET:
-   if (*(int *)valuep < -1 && *(int *)valuep > mp_maxid) {
-   db_printf("Invalid value: %d", *(int*)valuep);
+   if (*(int *)valuep < -1 || *(int *)valuep > mp_maxid) {
+   db_printf("Invalid value: %d\n", *(int*)valuep);
return (0);
}
db_cpu = *(int *)valuep;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Cy Schubert
In message <201712051258.vb5cwjqn051...@pdx.rh.cn85.dnsmgr.net>, "Rodney W. 
Gri
mes" writes:
> [ Charset UTF-8 unsupported, converting... ]
> > On Mon, Dec 4, 2017 at 7:55 PM, Eitan Adler  wrote:
> > > Author: eadler
> > > Date: Tue Dec  5 03:55:10 2017
> > > New Revision: 326554
> > > URL: https://svnweb.freebsd.org/changeset/base/326554
> > >
> > > Log:
> > >   sponge(1): initial commit
> > >
> > >   sponge(1) is a utility that reads input until
> > >   complete, then opens the output file, then
> > >   writes to it. This makes it useful in pipelines
> > >   that read and write to the same file.
> > >
> > >   Reviewed by:  wblock, jilles, imp, cem, danfe (all: various iterations)
> > 
> > I don't recall reviewing this in any iteration, but I could be mistaken.
>
> I do not see any of these names with checks in the reviewed by box,
> providing feedback in a review != reviewed by unless they have
> accepted it.
>
> Further more, why does freebsd need this in base?

When I saw this commit in the inbox on my phone I asked the same question. 
Why is this in base? Especially with tools which are in the same class as 
this already in ports, should this not be a port?


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Hans Petter Selasky

On 12/05/17 14:44, Konstantin Belousov wrote:

On Tue, Dec 05, 2017 at 02:00:00PM +0100, Hans Petter Selasky wrote:

On 12/05/17 13:58, Rodney W. Grimes wrote:

Further more, why does freebsd need this in base?

Hi,

I think this is useful. It could replace the "-i " (intermediate) option
for "sed" for example. It avoids creating temporary files when filtering
files, right?


Hi,


No, if process fails during the operation, user data is destroyed
irretrievable.


It depends what you are doing. If the compiler crashes while outputting 
an object file and the atexit() hooks fail to remove the object file and 
you re-run the build, bad things can still happen and nobody will notice.


From what I can see users must be aware of the limitations of any 
command they use in a script. Should probably be noted in the sponge 
manual page.


sponge could also have an atexit() hook to remove the processed file 
upon failure. Typically when patching files in packages, it is a waste 
of system resources to have a three step procedure, mv-process-mv, 
because when the build is complete the files will be deleted anyway 


>The usual trick of creating temporary file and renaming

ensure that old file is around until all data for new file is written
into buffer cache. With some existing filesystem support, it also
guarantees that the old file is around in case of the system crash.


This process could also be automated with sponge. If some option XXX is 
set, backup the file first in a safe way, before writing it new. Further 
because sponge is a single utility, it can lock the files in question 
through the whole procedure to make the operation atomic w.r.t. the file 
system. Can you lock files from scripts? And what about performance and 
complexity?




All this assuming the tool' code matches its description, which is not.


--HPS
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Cy Schubert
In message <201712050355.vb53tapl074...@repo.freebsd.org>, Eitan Adler 
writes:
> Author: eadler
> Date: Tue Dec  5 03:55:10 2017
> New Revision: 326554
> URL: https://svnweb.freebsd.org/changeset/base/326554
>
> Log:
>   sponge(1): initial commit
>   
>   sponge(1) is a utility that reads input until
>   complete, then opens the output file, then
>   writes to it. This makes it useful in pipelines
>   that read and write to the same file.
>   
>   Reviewed by:wblock, jilles, imp, cem, danfe (all: various iteration
> s)
>   Inspired by:https://joeyh.name/code/moreutils/
>
> Added:
>   head/usr.bin/sponge/
>   head/usr.bin/sponge/Makefile   (contents, props changed)
>   head/usr.bin/sponge/sponge.1   (contents, props changed)
>   head/usr.bin/sponge/sponge.c   (contents, props changed)
>   head/usr.bin/sponge/tests/
>   head/usr.bin/sponge/tests/Makefile   (contents, props changed)
>   head/usr.bin/sponge/tests/Makefile.depend   (contents, props changed)
>   head/usr.bin/sponge/tests/sponge_test.sh   (contents, props changed)
> Modified:
>   head/.arclint
>   head/usr.bin/tee/tee.1
>
> Modified: head/.arclint
> =
> =
> --- head/.arclint Tue Dec  5 02:23:36 2017(r326553)
> +++ head/.arclint Tue Dec  5 03:55:10 2017(r326554)
> @@ -9,7 +9,8 @@
>"type": "spelling"
>  },
>  "chmod": {
> -  "type": "chmod"
> +  "type": "chmod",
> +  "exclude": "(/tests/)"
>  },
>  "merge-conflict": {
>"type": "merge-conflict"
>
> Added: head/usr.bin/sponge/Makefile
> =
> =
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/usr.bin/sponge/Makefile  Tue Dec  5 03:55:10 2017(r32655
> 4)
> @@ -0,0 +1,8 @@
> +# $FreeBSD$
> +
> +PROG=sponge
> +
> +HAS_TESTS=
> +SUBDIR.${MK_TESTS}+= tests
> +
> +.include 
>
> Added: head/usr.bin/sponge/sponge.1
> =
> =
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/usr.bin/sponge/sponge.1  Tue Dec  5 03:55:10 2017(r32655
> 4)
> @@ -0,0 +1,75 @@
> +.\"  Eitan Adler.  All rights reserved.
> +.\"
> +.\" Redistribution and use in source and binary forms, with or without
> +.\" modification, are permitted provided that the following conditions
> +.\" are met:
> +.\" 1. Redistributions of source code must retain the above copyright
> +.\"notice, this list of conditions and the following disclaimer.
> +.\" 2. Redistributions in binary form must reproduce the above copyright
> +.\"notice, this list of conditions and the following disclaimer in the
> +.\"documentation and/or other materials provided with the distribution.
> +.\"
> +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
> +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPO
> SE
> +.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
> +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTI
> AL
> +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI
> CT
> +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WA
> Y
> +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> +.\" SUCH DAMAGE.
> +.\"
> +.\" $FreeBSD$
> +.\"
> +.Dd November 1, 2017
> +.Dt SPONGE 1
> +.Os
> +.Sh NAME
> +.Nm sponge
> +.Nd buffer stdin and write to stdout
> +.Sh SYNOPSIS
> +.Nm
> +.Op Fl a
> +.Ar filename
> +.Sh DESCRIPTION
> +The
> +.Nm
> +utility reads standard in until complete, then opens
> +the output file and writes to it.
> +This makes it useful in pipelines that read a file and then write to it.
> +These options are available:
> +.Bl -tag -width indent
> +.It Fl a
> +Open
> +.Ar filename
> +in append mode.
> +.El
> +.Pp
> +If an attempt to allocate memory fails,
> +.Nm
> +fails without output.
> +The file is written even if earlier components
> +of the pipeline failed.
> +.Sh SEE ALSO
> +.Xr builtin 1 ,
> +.Xr csh 1 ,
> +.Xr getrusage 2 ,
> +.Xr tee 1 ,
> +.Xr wait 2
> +.Sh EXIT STATUS
> +.Ex -std
> +.Sh EXAMPLES
> +A
> +.Pa file
> +can be be sorted "in place" by executing
> +.Cm sort file | sponge file
> +.Sh HISTORY
> +The
> +.Nm
> +utility was written by
> +.An Eitan Adler Aq Mt ead...@freebsd.org
> +and first appeared
> +in
> +.Fx 12.0 .
>
> Added: head/usr.bin/sponge/sponge.c
> =
> =
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/usr.bin/sponge/sponge.c  

Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Devin Teske

> On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
> 
>> On 12/05/17 13:58, Rodney W. Grimes wrote:
>> Further more, why does freebsd need this in base?
> 
> Hi,
> 
> I think this is useful. It could replace the "-i " (intermediate) option for 
> "sed" for example. It avoids creating temporary files when filtering files, 
> right?
> 
> --HPS
> 

Wth is wrong with:

data=$( sed -e '...' somefile ) &&
echo "$data" > somefile

or

set -e
data=...
echo "$data" > ...

or

exec 3< ... <&3

or

(I digress)

Infinite variations, but the gist is that sponge looks to be trying to help 
sh(1)/similar when help is unneeded.

Why buffer data into memory via fork-exec-pipe to sponge when you can buffer to 
native namespace without pipe to sponge?

Am I missing something? Why do we need sponge(1)?
-- 
Devin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Devin Teske

> On Dec 4, 2017, at 8:40 PM, Conrad Meyer  wrote:
> 
>> On Mon, Dec 4, 2017 at 8:30 PM, Conrad Meyer  wrote:
>>> On Mon, Dec 4, 2017 at 7:55 PM, Eitan Adler  wrote:
>>> Author: eadler
>>> Date: Tue Dec  5 03:55:10 2017
>>> New Revision: 326554
>>> URL: https://svnweb.freebsd.org/changeset/base/326554
>>> 
>>> Log:
>>>  sponge(1): initial commit
>>> 
>>>  sponge(1) is a utility that reads input until
>>>  complete, then opens the output file, then
>>>  writes to it. This makes it useful in pipelines
>>>  that read and write to the same file.
>>> 
>>>  Reviewed by:  wblock, jilles, imp, cem, danfe (all: various iterations)
>> 
>> I don't recall reviewing this in any iteration, but I could be mistaken.
>> 
>> Best,
>> Conrad
> 
> In fact I don't think any of the listed reviewers approved the change,
> at least in phabricator.  The "Reviewed by" line signifies not just
> giving feedback, but approval of the final (or near-final) change.
> 
> Best,
> Conrad
> 

If true, upsetting. You have people like myself that are ultra patient and wait 
for the approvals. For example, https://reviews.freebsd.org/D10006 which has 
been in review for 8 months now and I have been working on it for a total of 5 
years now.

It is more than a little hurtful to put in such effort and then see someone 
else run roughshod past the group.
-- 
Devin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Matt Joras
On Dec 5, 2017 7:35 AM, "Devin Teske"  wrote:


> On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
>
>> On 12/05/17 13:58, Rodney W. Grimes wrote:
>> Further more, why does freebsd need this in base?
>
> Hi,
>
> I think this is useful. It could replace the "-i " (intermediate) option
for "sed" for example. It avoids creating temporary files when filtering
files, right?
>
> --HPS
>

Wth is wrong with:

data=$( sed -e '...' somefile ) &&
echo "$data" > somefile

or

set -e
data=...
echo "$data" > ...

or

exec 3< ... <&3

or

(I digress)

Infinite variations, but the gist is that sponge looks to be trying to help
sh(1)/similar when help is unneeded.

Why buffer data into memory via fork-exec-pipe to sponge when you can
buffer to native namespace without pipe to sponge?

Am I missing something? Why do we need sponge(1)?
--
Devin

I do believe you are sort of missing the point. It is a utility that is
explicitly useful in shell pipelines, so when you want to do things as
one-liners. I like the utility and use the one from ports and my own
version in various things here and there. It is a common utility installed
in Linux distros and the top answer on Google for questions such as
"redirect shell output to same file". I think the outrage about adding a
tiny utility that's common elsewhere is a bit silly.

As for the implementation, I have my own version of sponge (hobby program
written in rust so not base-worthy), and it uses explicit temporary files
for larger outputs.

Matt
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Devin Teske

> On Dec 5, 2017, at 7:53 AM, Matt Joras  wrote:
> 
> 
> 
> On Dec 5, 2017 7:35 AM, "Devin Teske"  wrote:
> 
> > On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
> >
> >> On 12/05/17 13:58, Rodney W. Grimes wrote:
> >> Further more, why does freebsd need this in base?
> >
> > Hi,
> >
> > I think this is useful. It could replace the "-i " (intermediate) option 
> > for "sed" for example. It avoids creating temporary files when filtering 
> > files, right?
> >
> > --HPS
> >
> 
> Wth is wrong with:
> 
> data=$( sed -e '...' somefile ) &&
> echo "$data" > somefile
> 
> or
> 
> set -e
> data=...
> echo "$data" > ...
> 
> or
> 
> exec 3< $( ... )
> EOF
> cat > ... <&3
> 
> or
> 
> (I digress)
> 
> Infinite variations, but the gist is that sponge looks to be trying to help 
> sh(1)/similar when help is unneeded.
> 
> Why buffer data into memory via fork-exec-pipe to sponge when you can buffer 
> to native namespace without pipe to sponge?
> 
> Am I missing something? Why do we need sponge(1)?
> --
> Devin
> 
> I do believe you are sort of missing the point. It is a utility that is 
> explicitly useful in shell pipelines, so when you want to do things as 
> one-liners. I like the utility and use the one from ports and my own version 
> in various things here and there. It is a common utility installed in Linux 
> distros and the top answer on Google for questions such as "redirect shell 
> output to same file". I think the outrage about adding a tiny utility that's 
> common elsewhere is a bit silly.
> 
> As for the implementation, I have my own version of sponge (hobby program 
> written in rust so not base-worthy), and it uses explicit temporary files for 
> larger outputs. 
> 
> Matt

The problems I have are:

1. Should be in ports

Not pre-installed on Linux, why should we have it in base?

If in base, people will target it thinking it solves a need that can't 
otherwise be solved and thus end up creating a script that is less portable 
because it is encumbered with dependencies specific to our base.

2. Teaches bad practice

sed ... somefile | sponge somefile

Ignores if there is a sed error and indiscriminately zeroes somefile.

3. Solution in search of a problem
-- 
Devin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


RE: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Cy Schubert
Why not update sed to create the backup file only if the suffix is given to -i, 
like gnu sed does.

---
Sent using a tiny phone keyboard.
Apologies for any typos and autocorrect.
This old phone only supports top post. Apologies.

Cy Schubert
 or 
The need of the many outweighs the greed of the few.
---

-Original Message-
From: Devin Teske
Sent: 05/12/2017 07:35
To: Hans Petter Selasky
Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers; 
svn-src-...@freebsd.org; svn-src-head@freebsd.org
Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge 
usr.bin/sponge/tests usr.bin/tee


> On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
> 
>> On 12/05/17 13:58, Rodney W. Grimes wrote:
>> Further more, why does freebsd need this in base?
> 
> Hi,
> 
> I think this is useful. It could replace the "-i " (intermediate) option for 
> "sed" for example. It avoids creating temporary files when filtering files, 
> right?
> 
> --HPS
> 

Wth is wrong with:

data=$( sed -e '...' somefile ) &&
echo "$data" > somefile

or

set -e
data=...
echo "$data" > ...

or

exec 3< ... <&3

or

(I digress)

Infinite variations, but the gist is that sponge looks to be trying to help 
sh(1)/similar when help is unneeded.

Why buffer data into memory via fork-exec-pipe to sponge when you can buffer to 
native namespace without pipe to sponge?

Am I missing something? Why do we need sponge(1)?
-- 
Devin

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Matt Joras
On Tue, Dec 5, 2017 at 8:06 AM, Devin Teske  wrote:
>
>
> The problems I have are:
>
> 1. Should be in ports
>
> Not pre-installed on Linux, why should we have it in base?
"Pre-installed on Linux" is meaningless. The closest analog to our
base is arguably GNU coreutils. It is indeed not part of GNU coreutils
but then again there are several things in our base that are not in
coreutils, and vice versa. Why should we have anything in base? If
people find it useful and it doens't have a high cost of
maintainership then why not have it?

> If in base, people will target it thinking it solves a need that can't
> otherwise be solved and thus end up creating a script that is less portable
> because it is encumbered with dependencies specific to our base.
It's not even a homegrown idea though... As we've already covered this
is a tool that exists in the broader OSS ecosystem. As long as it is
compatible with the more common implementation I don't see the issue.
Anything one writes using it is just "encumbered" with a dependency on
sponge.

> 2. Teaches bad practice
>
> sed ... somefile | sponge somefile
>
> Ignores if there is a sed error and indiscriminately zeroes somefile.

Calling this unequivocally bad practice is silly. There are plenty
uses of sponge that aren't bad practice. I have a git commit hook that
utilizes sponge to do the same "auto-culling" that our svn patches do.
I like the sponge version better than creating temporary files myself:

sed '/^$/d' $(git config commit.message) | awk 'NR==FNR{a[$0];next}
!($0 in a)' /dev/fd/0 "$1" | sponge "$1"

> 3. Solution in search of a problem
Again, stating this unequivocally is silly. I discovered sponge years
ago when I was searching how best to handle something where I wanted
to write output back to the same file in a shell pipeline. I was
literally someone with a problem in search of a solution, and that
solution was and still is sponge. Since then I have seen it
recommended numerous times in passing.

Matt
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


RE: svn commit: r326554 - in head: . usr.bin/spongeusr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Cy Schubert
I'll post a phab review at openhack tonight.

---
Sent using a tiny phone keyboard.
Apologies for any typos and autocorrect.
This old phone only supports top post. Apologies.

Cy Schubert
 or 
The need of the many outweighs the greed of the few.
---

-Original Message-
From: Cy Schubert
Sent: 05/12/2017 08:30
To: Devin Teske; Hans Petter Selasky
Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers; 
svn-src-...@freebsd.org; svn-src-head@freebsd.org
Subject: RE: svn commit: r326554 - in head: . 
usr.bin/spongeusr.bin/sponge/tests usr.bin/tee


Why not update sed to create the backup file only if the suffix is given to -i, 
like gnu sed does.

---
Sent using a tiny phone keyboard.
Apologies for any typos and autocorrect.
This old phone only supports top post. Apologies.

Cy Schubert
 or 
The need of the many outweighs the greed of the few.
---



From: Devin Teske
Sent: 05/12/2017 07:35
To: Hans Petter Selasky
Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers; 
svn-src-...@freebsd.org; svn-src-head@freebsd.org
Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge 
usr.bin/sponge/tests usr.bin/tee


> On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
> 
>> On 12/05/17 13:58, Rodney W. Grimes wrote:
>> Further more, why does freebsd need this in base?
> 
> Hi,
> 
> I think this is useful. It could replace the "-i " (intermediate) option for 
> "sed" for example. It avoids creating temporary files when filtering files, 
> right?
> 
> --HPS
> 

Wth is wrong with:

data=$( sed -e '...' somefile ) &&
echo "$data" > somefile

or

set -e
data=...
echo "$data" > ...

or

exec 3< ... <&3

or

(I digress)

Infinite variations, but the gist is that sponge looks to be trying to help 
sh(1)/similar when help is unneeded.

Why buffer data into memory via fork-exec-pipe to sponge when you can buffer to 
native namespace without pipe to sponge?

Am I missing something? Why do we need sponge(1)?
-- 
Devin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Pedro Giffuni


On 05/12/2017 11:29, Cy Schubert wrote:
Why not update sed to create the backup file only if the suffix is 
given to -i, like gnu sed does.




No, no .. there have been several failed attempts at that that cause 
nasty side effects.

It is also a rather non-standardish thing to do.

Pedro.


---
Sent using a tiny phone keyboard.
Apologies for any typos and autocorrect.
This old phone only supports top post. Apologies.

Cy Schubert
 or 
The need of the many outweighs the greed of the few.
---

From: Devin Teske
Sent: 05/12/2017 07:35
To: Hans Petter Selasky
Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers; 
svn-src-...@freebsd.org; svn-src-head@freebsd.org
Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge 
usr.bin/sponge/tests usr.bin/tee



> On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
>
>> On 12/05/17 13:58, Rodney W. Grimes wrote:
>> Further more, why does freebsd need this in base?
>
> Hi,
>
> I think this is useful. It could replace the "-i " (intermediate) 
option for "sed" for example. It avoids creating temporary files when 
filtering files, right?

>
> --HPS
>

Wth is wrong with:

data=$( sed -e '...' somefile ) &&
������� echo "$data" > somefile

or

set -e
data=...
echo "$data" > ...

or

exec 3< ... <&3

or

(I digress)

Infinite variations, but the gist is that sponge looks to be trying to 
help sh(1)/similar when help is unneeded.


Why buffer data into memory via fork-exec-pipe to sponge when you can 
buffer to native namespace without pipe to sponge?


Am I missing something? Why do we need sponge(1)?
--
Devin



___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Rodney W. Grimes
[ Charset windows-1252 unsupported, converting... ]
> 
> On 05/12/2017 11:29, Cy Schubert wrote:
> > Why not update sed to create the backup file only if the suffix is 
> > given to -i, like gnu sed does.
> >
> 
> No, no .. there have been several failed attempts at that that cause 
> nasty side effects.
> It is also a rather non-standardish thing to do.

Yet we are okay with having sponge(1) and its nasty side effects?

Someone please just ask for revision on this, and also make sure
the top level .arclint file that got a bogus add of /test/ during
the commit?

The argument that Linux does this, and that this is a top answer
in google do not hold water for me.  Linux does lots of things,
many are novieces solving novice problems cause they are not
skilled.   sponge(1), imho, as Devin points out is just not
needed to solve this problem and has its own set of issues.

The COST so far of this small amount of code on developers, again,
IMHO, already far out weights any benifit of having it in base.



> Pedro.
> 
> > ---
> > Sent using a tiny phone keyboard.
> > Apologies for any typos and autocorrect.
> > This old phone only supports top post. Apologies.
> >
> > Cy Schubert
> >  or 
> > The need of the many outweighs the greed of the few.
> > ---
> > 
> > From: Devin Teske
> > Sent: 05/12/2017 07:35
> > To: Hans Petter Selasky
> > Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers; 
> > svn-src-...@freebsd.org; svn-src-head@freebsd.org
> > Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge 
> > usr.bin/sponge/tests usr.bin/tee
> >
> >
> > > On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
> > >
> > >> On 12/05/17 13:58, Rodney W. Grimes wrote:
> > >> Further more, why does freebsd need this in base?
> > >
> > > Hi,
> > >
> > > I think this is useful. It could replace the "-i " (intermediate) 
> > option for "sed" for example. It avoids creating temporary files when 
> > filtering files, right?
> > >
> > > --HPS
> > >
> >
> > Wth is wrong with:
> >
> > data=$( sed -e '...' somefile ) &&
> > ? echo "$data" > somefile
> >
> > or
> >
> > set -e
> > data=...
> > echo "$data" > ...
> >
> > or
> >
> > exec 3< > $( ... )
> > EOF
> > cat > ... <&3
> >
> > or
> >
> > (I digress)
> >
> > Infinite variations, but the gist is that sponge looks to be trying to 
> > help sh(1)/similar when help is unneeded.
> >
> > Why buffer data into memory via fork-exec-pipe to sponge when you can 
> > buffer to native namespace without pipe to sponge?
> >
> > Am I missing something? Why do we need sponge(1)?
> > -- 
> > Devin
> >
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


RE: svn commit: r326554 - in head: . usr.bin/spongeusr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Cy Schubert
What side effects? Can you give one or two examples, please?

---
Sent using a tiny phone keyboard.
Apologies for any typos and autocorrect.
This old phone only supports top post. Apologies.

Cy Schubert
 or 
The need of the many outweighs the greed of the few.
---

-Original Message-
From: Pedro Giffuni
Sent: 05/12/2017 08:40
To: Cy Schubert; Devin Teske; Hans Petter Selasky
Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers; 
svn-src-...@freebsd.org; svn-src-head@freebsd.org
Subject: Re: svn commit: r326554 - in head: . 
usr.bin/spongeusr.bin/sponge/tests usr.bin/tee




On 05/12/2017 11:29, Cy Schubert wrote:




Why not update sed to create the backup file only if the suffix is given to -i, 
like gnu sed does.



 No, no .. there have been several failed attempts at that that cause nasty 
side effects.
 It is also a rather non-standardish thing to do.

 Pedro.




---
Sent using a tiny phone keyboard.
 Apologies for any typos and autocorrect.
 This old phone only supports top post. Apologies.

 Cy Schubert
 or 
 The need of the many outweighs the greed of the few.
---



From: Devin Teske
Sent: 05/12/2017 07:35
To: Hans Petter Selasky
Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers; 
svn-src-...@freebsd.org; svn-src-head@freebsd.org
Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge 
usr.bin/sponge/tests usr.bin/tee


 > On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
 > 
>> On 12/05/17 13:58, Rodney W. Grimes wrote:
 >> Further more, why does freebsd need this in base?
 > 
> Hi,
 > 
> I think this is useful. It could replace the "-i " (intermediate) option for 
> "sed" for example. It avoids creating temporary files when filtering files, 
> right?
 > 
> --HPS
 > 

Wth is wrong with:

 data=$( sed -e '...' somefile ) &&
 ������� echo "$data" > somefile

 or

 set -e
 data=...
 echo "$data" > ...

 or

 exec 3< ... <&3

 or

 (I digress)

 Infinite variations, but the gist is that sponge looks to be trying to help 
sh(1)/similar when help is unneeded.

 Why buffer data into memory via fork-exec-pipe to sponge when you can buffer 
to native namespace without pipe to sponge?

 Am I missing something? Why do we need sponge(1)?
-- 
Devin


 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Devin Teske


>> On Dec 5, 2017, at 8:29 AM, Matt Joras  wrote:
>> 
>> On Tue, Dec 5, 2017 at 8:06 AM, Devin Teske  wrote:
>> 
>> 
>> The problems I have are:
>> 
>> 1. Should be in ports
>> 
>> Not pre-installed on Linux, why should we have it in base?
> "Pre-installed on Linux" is meaningless. The closest analog to our
> base is arguably GNU coreutils. It is indeed not part of GNU coreutils
> but then again there are several things in our base that are not in
> coreutils, and vice versa. Why should we have anything in base? If
> people find it useful and it doens't have a high cost of
> maintainership then why not have it?

Hand-waving and baseless conjecture is not going to change the fact that I have 
administered tens-of-thousands of Linux machines and:

1. None have ever had moreutils installed
2. Before today I have never heard of sponge or moreutils

You point to Linux not having a "base" as it were, but this is patently false.

In the kickstart scripts for anaconda, you can specify ^@minimal or @base or 
@whatever to get a classification of packages that have been glommed together. 
When installing Linux (be it CentOS, RedHat, Ubuntu, or whatever) there are 
package collections.

No collection that I have ever installef anywhere has ever installed moreutils. 
Ever.

Contrast that with the facts that:

All linux distros regardless of what package collection you choose gives you 
awk, sed, tr, etc.

So while you point to the notion that "Linux has no base" and "everything is a 
package anyway" (my paraphrasing), this is not the case.

It is not arguing "slippery slope" to not want sponge in base, but rather that 
it literally does not get installed with any package collection in Linux and 
therefore no Linux base has it (the "base" in Linux is based on the package 
collection you choose, and thus since you cannot choose a package collection 
that contains it, you cannot build a Linux system that has sponge on first-boot 
unless you explicitly mention sponge as a package in the packages section of a 
kickstart/preseed or manually select during install).

> 
>> If in base, people will target it thinking it solves a need that can't
>> otherwise be solved and thus end up creating a script that is less portable
>> because it is encumbered with dependencies specific to our base.
> It's not even a homegrown idea though... As we've already covered this
> is a tool that exists in the broader OSS ecosystem.

Tens of thousands of machines across multiple companies tells me otherwise.

> As long as it is
> compatible with the more common implementation I don't see the issue.
> Anything one writes using it is just "encumbered" with a dependency on
> sponge.

>> 2. Teaches bad practice
>> 
>> sed ... somefile | sponge somefile
>> 
>> Ignores if there is a sed error and indiscriminately zeroes somefile.
> 
> Calling this unequivocally bad practice is silly.

sh(1) manually calls it bad practice


> There are plenty
> uses of sponge that aren't bad practice. I have a git commit hook that
> utilizes sponge to do the same "auto-culling" that our svn patches do.

Ignoring errors in a pipeline as was pointed out.

> I like the sponge version better than creating temporary files myself:

You.
Do not.
Need.
Temporary files.

> sed '/^$/d' $(git config commit.message) | awk 'NR==FNR{a[$0];next}
> !($0 in a)' /dev/fd/0 "$1" | sponge "$1"

No temp files AND proper error checking.

set -e # All errors fatal
data=$( sed '/^$/d' $(git config commit.message) )
uncommon_lines=$( echo "$data" | awk 'NR==FNR{a[$0];next} !($0 in a)' /dev/fd/0 
"$1" )
echo "$uncommon_lines" > "$1"

If you don't want the "set -e" just throw "|| exit" at the end of the first two 
lines. The important bit is:

1. If the path produced by $( git config commit.message ) makes sed throw an 
error (e.g., ENOENT) resulting in error status, you don't blindly go on to 
overwrite "$1"

2. If awk is unable to open and read "$1" on the second line, you do not 
blindly forge ahead and overwrtie "$1"

3. Only if you successfully ran sed, successfully ran awk, should "$1" be 
updated.

The sponge approach is just plain bad practice because:

A. An error on the commit message results in "$1" being truncated to zero bytes

B. An error on /dev/fd/0 results in "$1" being truncated to zero bytes

C. An error by awk on "$1" results in "$1" being truncated to zero bytes (e.g., 
a flaky NFS connection wherein an awk read() fails but the sponge write() 
succeeds).

> 
>> 3. Solution in search of a problem
> Again, stating this unequivocally is silly. I discovered sponge years
> ago when I was searching how best to handle something where I wanted
> to write output back to the same file in a shell pipeline.

Something that is explicitly warned against in sh(1).

> I was
> literally someone with a problem in search of a solution, and that
> solution was and still is sponge.

Sure, if you fly in the face of warnings abound.

> Since then I have seen it
> recommended numerous times in passin

Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Devin Teske

> On Dec 5, 2017, at 8:29 AM, Cy Schubert  wrote:
> 
> Why not update sed to create the backup file only if the suffix is given to 
> -i, like gnu sed does.
> 

I suspect that would break countless scripts that test uname to determine how 
to use the -i flag of sed.
-- 
Devin


> ---
> Sent using a tiny phone keyboard.
> Apologies for any typos and autocorrect.
> This old phone only supports top post. Apologies.
> 
> Cy Schubert
>  or 
> The need of the many outweighs the greed of the few.
> ---
> From: Devin Teske
> Sent: 05/12/2017 07:35
> To: Hans Petter Selasky
> Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers; 
> svn-src-...@freebsd.org; svn-src-head@freebsd.org
> Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge 
> usr.bin/sponge/tests usr.bin/tee
> 
> 
> > On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
> > 
> >> On 12/05/17 13:58, Rodney W. Grimes wrote:
> >> Further more, why does freebsd need this in base?
> > 
> > Hi,
> > 
> > I think this is useful. It could replace the "-i " (intermediate) option 
> > for "sed" for example. It avoids creating temporary files when filtering 
> > files, right?
> > 
> > --HPS
> > 
> 
> Wth is wrong with:
> 
> data=$( sed -e '...' somefile ) &&
> echo "$data" > somefile
> 
> or
> 
> set -e
> data=...
> echo "$data" > ...
> 
> or
> 
> exec 3< $( ... )
> EOF
> cat > ... <&3
> 
> or
> 
> (I digress)
> 
> Infinite variations, but the gist is that sponge looks to be trying to help 
> sh(1)/similar when help is unneeded.
> 
> Why buffer data into memory via fork-exec-pipe to sponge when you can buffer 
> to native namespace without pipe to sponge?
> 
> Am I missing something? Why do we need sponge(1)?
> -- 
> Devin
> 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Conrad Meyer
Please revert this change, along with r326555 and r326557.

I am not opposed to the idea of a version of this utility in base.

I am opposed to breaking the build, and functionally broken programs.

Thanks,
Conrad

On Mon, Dec 4, 2017 at 7:55 PM, Eitan Adler  wrote:
> Author: eadler
> Date: Tue Dec  5 03:55:10 2017
> New Revision: 326554
> URL: https://svnweb.freebsd.org/changeset/base/326554
>
> Log:
>   sponge(1): initial commit
>
>   sponge(1) is a utility that reads input until
>   complete, then opens the output file, then
>   writes to it. This makes it useful in pipelines
>   that read and write to the same file.
>
>   Reviewed by:  wblock, jilles, imp, cem, danfe (all: various iterations)
>   Inspired by:  https://joeyh.name/code/moreutils/
>
> Added:
>   head/usr.bin/sponge/
>   head/usr.bin/sponge/Makefile   (contents, props changed)
>   head/usr.bin/sponge/sponge.1   (contents, props changed)
>   head/usr.bin/sponge/sponge.c   (contents, props changed)
>   head/usr.bin/sponge/tests/
>   head/usr.bin/sponge/tests/Makefile   (contents, props changed)
>   head/usr.bin/sponge/tests/Makefile.depend   (contents, props changed)
>   head/usr.bin/sponge/tests/sponge_test.sh   (contents, props changed)
> Modified:
>   head/.arclint
>   head/usr.bin/tee/tee.1
>
> Modified: head/.arclint
> ==
> --- head/.arclint   Tue Dec  5 02:23:36 2017(r326553)
> +++ head/.arclint   Tue Dec  5 03:55:10 2017(r326554)
> @@ -9,7 +9,8 @@
>"type": "spelling"
>  },
>  "chmod": {
> -  "type": "chmod"
> +  "type": "chmod",
> +  "exclude": "(/tests/)"
>  },
>  "merge-conflict": {
>"type": "merge-conflict"
>
> Added: head/usr.bin/sponge/Makefile
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/usr.bin/sponge/MakefileTue Dec  5 03:55:10 2017
> (r326554)
> @@ -0,0 +1,8 @@
> +# $FreeBSD$
> +
> +PROG=  sponge
> +
> +HAS_TESTS=
> +SUBDIR.${MK_TESTS}+= tests
> +
> +.include 
>
> Added: head/usr.bin/sponge/sponge.1
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/usr.bin/sponge/sponge.1Tue Dec  5 03:55:10 2017
> (r326554)
> @@ -0,0 +1,75 @@
> +.\"Eitan Adler.  All rights reserved.
> +.\"
> +.\" Redistribution and use in source and binary forms, with or without
> +.\" modification, are permitted provided that the following conditions
> +.\" are met:
> +.\" 1. Redistributions of source code must retain the above copyright
> +.\"notice, this list of conditions and the following disclaimer.
> +.\" 2. Redistributions in binary form must reproduce the above copyright
> +.\"notice, this list of conditions and the following disclaimer in the
> +.\"documentation and/or other materials provided with the distribution.
> +.\"
> +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
> +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
> PURPOSE
> +.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
> +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
> CONSEQUENTIAL
> +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
> STRICT
> +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> +.\" SUCH DAMAGE.
> +.\"
> +.\" $FreeBSD$
> +.\"
> +.Dd November 1, 2017
> +.Dt SPONGE 1
> +.Os
> +.Sh NAME
> +.Nm sponge
> +.Nd buffer stdin and write to stdout
> +.Sh SYNOPSIS
> +.Nm
> +.Op Fl a
> +.Ar filename
> +.Sh DESCRIPTION
> +The
> +.Nm
> +utility reads standard in until complete, then opens
> +the output file and writes to it.
> +This makes it useful in pipelines that read a file and then write to it.
> +These options are available:
> +.Bl -tag -width indent
> +.It Fl a
> +Open
> +.Ar filename
> +in append mode.
> +.El
> +.Pp
> +If an attempt to allocate memory fails,
> +.Nm
> +fails without output.
> +The file is written even if earlier components
> +of the pipeline failed.
> +.Sh SEE ALSO
> +.Xr builtin 1 ,
> +.Xr csh 1 ,
> +.Xr getrusage 2 ,
> +.Xr tee 1 ,
> +.Xr wait 2
> +.Sh EXIT STATUS
> +.Ex -std
> +.Sh EXAMPLES
> +A
> +.Pa file
> +can be be sorted "in place" by executing
> +.Cm sort file | sponge file
> +.Sh HISTORY
> +The
> +.Nm
> +utility was written by
> +.An Eitan Adler Aq Mt ead...@freebsd.org
> +and first appeared
> +in
> +.Fx 12.0 .
>
> Added: head/usr.bin/sponge/sponge.c
> =

svn commit: r326569 - head/sys/modules/vmm

2017-12-05 Thread Bryan Drewery
Author: bdrewery
Date: Tue Dec  5 17:23:33 2017
New Revision: 326569
URL: https://svnweb.freebsd.org/changeset/base/326569

Log:
  Fix cyclic dependency after r326552.
  
  The OBJS_DEPEND_GUESS mechanism was making vmx_genassym.o depend
  on all headers along with vmx_assym.h, though vmx_assym.h depends
  on having vmx_genassym.o present to generate.  Moving the headers
  to DPSRCS is enough to resolve the issue as they will no longer
  be implicit dependencies for all objects.  Because of this we
  need explicit OBJS_DEPEND_GUESS entries to ensure the headers
  are generated when needed for the *_support.o files that need
  them.
  
  X-MFC-With:   r326552
  MFC after:2 weeks
  Sponsored by: Dell EMC

Modified:
  head/sys/modules/vmm/Makefile

Modified: head/sys/modules/vmm/Makefile
==
--- head/sys/modules/vmm/Makefile   Tue Dec  5 14:46:12 2017
(r326568)
+++ head/sys/modules/vmm/Makefile   Tue Dec  5 17:23:33 2017
(r326569)
@@ -3,8 +3,8 @@
 KMOD=  vmm
 
 SRCS=  opt_acpi.h opt_ddb.h device_if.h bus_if.h pci_if.h pcib_if.h acpi_if.h
-SRCS+= vmx_assym.h svm_assym.h
-DPSRCS=vmx_genassym.c svm_genassym.c
+DPSRCS+=   vmx_assym.h svm_assym.h
+DPSRCS+=   vmx_genassym.c svm_genassym.c
 
 CFLAGS+= -DVMM_KEEP_STATS -DSMP
 CFLAGS+= -I${SRCTOP}/sys/amd64/vmm
@@ -56,6 +56,9 @@ SRCS+=vmcb.c  \
svm_msr.c
 
 CLEANFILES=vmx_assym.h vmx_genassym.o svm_assym.h svm_genassym.o
+
+OBJS_DEPEND_GUESS.vmx_support.o+= vmx_assym.h
+OBJS_DEPEND_GUESS.svm_support.o+= svm_assym.h
 
 vmx_assym.h:vmx_genassym.o
sh ${SYSDIR}/kern/genassym.sh vmx_genassym.o > ${.TARGET}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


RE: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Cy Schubert
Our sed already creates backup files "optionally" just as gsed does. Only the 
syntax is different. No need to sponge sed, just sed -i '' (whereas gsed is -i 
without the argument).

---
Sent using a tiny phone keyboard.
Apologies for any typos and autocorrect.
This old phone only supports top post. Apologies.

Cy Schubert
 or 
The need of the many outweighs the greed of the few.
---

-Original Message-
From: Devin Teske
Sent: 05/12/2017 09:23
To: Cy Schubert
Cc: Hans Petter Selasky; rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; 
src-committers; svn-src-...@freebsd.org; svn-src-head@freebsd.org
Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge 
usr.bin/sponge/tests usr.bin/tee




On Dec 5, 2017, at 8:29 AM, Cy Schubert  wrote:






Why not update sed to create the backup file only if the suffix is given to -i, 
like gnu sed does.






I suspect that would break countless scripts that test uname to determine how 
to use the -i flag of sed.

-- 

Devin








---
Sent using a tiny phone keyboard.
Apologies for any typos and autocorrect.
This old phone only supports top post. Apologies.

Cy Schubert
 or 
The need of the many outweighs the greed of the few.
---



From: Devin Teske
Sent: 05/12/2017 07:35
To: Hans Petter Selasky
Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers; 
svn-src-...@freebsd.org; svn-src-head@freebsd.org
Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge 
usr.bin/sponge/tests usr.bin/tee


> On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
> 
>> On 12/05/17 13:58, Rodney W. Grimes wrote:
>> Further more, why does freebsd need this in base?
> 
> Hi,
> 
> I think this is useful. It could replace the "-i " (intermediate) option for 
> "sed" for example. It avoids creating temporary files when filtering files, 
> right?
> 
> --HPS
> 

Wth is wrong with:

data=$( sed -e '...' somefile ) &&
echo "$data" > somefile

or

set -e
data=...
echo "$data" > ...

or

exec 3< ... <&3

or

(I digress)

Infinite variations, but the gist is that sponge looks to be trying to help 
sh(1)/similar when help is unneeded.

Why buffer data into memory via fork-exec-pipe to sponge when you can buffer to 
native namespace without pipe to sponge?

Am I missing something? Why do we need sponge(1)?
-- 
Devin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Eric Joyner
I got told by a co-worker that this broke buildworld. Can this commit get
reverted/have the cast fixed?

- Eric (erj)

On Tue, Dec 5, 2017 at 9:50 AM Cy Schubert  wrote:

> Our sed already creates backup files "optionally" just as gsed does. Only
> the syntax is different. No need to sponge sed, just sed -i '' (whereas
> gsed is -i without the argument).
>
>
> ---
> Sent using a tiny phone keyboard.
> Apologies for any typos and autocorrect.
> This old phone only supports top post. Apologies.
>
> Cy Schubert
>  or 
> The need of the many outweighs the greed of the few.
> ---
> --
> From: Devin Teske
> Sent: 05/12/2017 09:23
> To: Cy Schubert
> Cc: Hans Petter Selasky; rgri...@freebsd.org; c...@freebsd.org; Eitan
> Adler; src-committers; svn-src-...@freebsd.org; svn-src-head@freebsd.org
>
> Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge
> usr.bin/sponge/tests usr.bin/tee
>
>
> On Dec 5, 2017, at 8:29 AM, Cy Schubert  wrote:
>
> Why not update sed to create the backup file only if the suffix is given
> to -i, like gnu sed does.
>
>
> I suspect that would break countless scripts that test uname to determine
> how to use the -i flag of sed.
> --
> Devin
>
>
> ---
> Sent using a tiny phone keyboard.
> Apologies for any typos and autocorrect.
> This old phone only supports top post. Apologies.
>
> Cy Schubert
>  or 
> The need of the many outweighs the greed of the few.
> ---
> --
> From: Devin Teske
> Sent: 05/12/2017 07:35
> To: Hans Petter Selasky
> Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers;
> svn-src-...@freebsd.org; svn-src-head@freebsd.org
> Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge
> usr.bin/sponge/tests usr.bin/tee
>
>
> > On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
> >
> >> On 12/05/17 13:58, Rodney W. Grimes wrote:
> >> Further more, why does freebsd need this in base?
> >
> > Hi,
> >
> > I think this is useful. It could replace the "-i " (intermediate) option
> for "sed" for example. It avoids creating temporary files when filtering
> files, right?
> >
> > --HPS
> >
>
> Wth is wrong with:
>
> data=$( sed -e '...' somefile ) &&
> echo "$data" > somefile
>
> or
>
> set -e
> data=...
> echo "$data" > ...
>
> or
>
> exec 3< $( ... )
> EOF
> cat > ... <&3
>
> or
>
> (I digress)
>
> Infinite variations, but the gist is that sponge looks to be trying to
> help sh(1)/similar when help is unneeded.
>
> Why buffer data into memory via fork-exec-pipe to sponge when you can
> buffer to native namespace without pipe to sponge?
>
> Am I missing something? Why do we need sponge(1)?
> --
> Devin
>
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326570 - head/usr.bin

2017-12-05 Thread Dimitry Andric
Author: dim
Date: Tue Dec  5 18:26:34 2017
New Revision: 326570
URL: https://svnweb.freebsd.org/changeset/base/326570

Log:
  For now, disconnect usr.bin/sponge from the build, to unbreak world
  after r326557.
  
  Noticed by:   many
  Pointy hat to:eadler

Modified:
  head/usr.bin/Makefile

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Tue Dec  5 17:23:33 2017(r326569)
+++ head/usr.bin/Makefile   Tue Dec  5 18:26:34 2017(r326570)
@@ -148,7 +148,6 @@ SUBDIR= alias \
soelim \
sort \
split \
-   sponge \
stat \
stdbuf \
strings \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Eitan Adler
I'm not near my commit box right now so someone will have to revert
it. What's funny is that I ran a complete 'make buildworld
buildkernel' last night with this patch.

Will respond to the rest of the thread later

On 5 December 2017 at 10:08, Eric Joyner  wrote:
> I got told by a co-worker that this broke buildworld. Can this commit get
> reverted/have the cast fixed?
>
> - Eric (erj)
>
>
> On Tue, Dec 5, 2017 at 9:50 AM Cy Schubert  wrote:
>>
>> Our sed already creates backup files "optionally" just as gsed does. Only
>> the syntax is different. No need to sponge sed, just sed -i '' (whereas gsed
>> is -i without the argument).
>>
>>
>> ---
>> Sent using a tiny phone keyboard.
>> Apologies for any typos and autocorrect.
>> This old phone only supports top post. Apologies.
>>
>> Cy Schubert
>>  or 
>> The need of the many outweighs the greed of the few.
>> ---
>> 
>> From: Devin Teske
>> Sent: 05/12/2017 09:23
>> To: Cy Schubert
>> Cc: Hans Petter Selasky; rgri...@freebsd.org; c...@freebsd.org; Eitan
>> Adler; src-committers; svn-src-...@freebsd.org; svn-src-head@freebsd.org
>>
>> Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge
>> usr.bin/sponge/tests usr.bin/tee
>>
>>
>> On Dec 5, 2017, at 8:29 AM, Cy Schubert  wrote:
>>
>> Why not update sed to create the backup file only if the suffix is given
>> to -i, like gnu sed does.
>>
>>
>> I suspect that would break countless scripts that test uname to determine
>> how to use the -i flag of sed.
>> --
>> Devin
>>
>>
>> ---
>> Sent using a tiny phone keyboard.
>> Apologies for any typos and autocorrect.
>> This old phone only supports top post. Apologies.
>>
>> Cy Schubert
>>  or 
>> The need of the many outweighs the greed of the few.
>> ---
>> 
>> From: Devin Teske
>> Sent: 05/12/2017 07:35
>> To: Hans Petter Selasky
>> Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers;
>> svn-src-...@freebsd.org; svn-src-head@freebsd.org
>> Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge
>> usr.bin/sponge/tests usr.bin/tee
>>
>>
>> > On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
>> >
>> >> On 12/05/17 13:58, Rodney W. Grimes wrote:
>> >> Further more, why does freebsd need this in base?
>> >
>> > Hi,
>> >
>> > I think this is useful. It could replace the "-i " (intermediate) option
>> > for "sed" for example. It avoids creating temporary files when filtering
>> > files, right?
>> >
>> > --HPS
>> >
>>
>> Wth is wrong with:
>>
>> data=$( sed -e '...' somefile ) &&
>> echo "$data" > somefile
>>
>> or
>>
>> set -e
>> data=...
>> echo "$data" > ...
>>
>> or
>>
>> exec 3<> $( ... )
>> EOF
>> cat > ... <&3
>>
>> or
>>
>> (I digress)
>>
>> Infinite variations, but the gist is that sponge looks to be trying to
>> help sh(1)/similar when help is unneeded.
>>
>> Why buffer data into memory via fork-exec-pipe to sponge when you can
>> buffer to native namespace without pipe to sponge?
>>
>> Am I missing something? Why do we need sponge(1)?
>> --
>> Devin
>>
>



-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326571 - in head: sbin/ifconfig sys/net

2017-12-05 Thread Eric Joyner
Author: erj
Date: Tue Dec  5 18:42:07 2017
New Revision: 326571
URL: https://svnweb.freebsd.org/changeset/base/326571

Log:
  ifconfig(8): Display extended compliance code string for SFP transceivers
  
  - Updates tables in affected files with new entries from newer spec
  revisions of SFF-8472, SFF-8024, and SFF-8636
  
  - Change ifconfig to read and display the extended compliance code for
  SFP media if the extended compliance code is not 0. This was being displayed
  for QSFP transceivers only, but SFP28 media uses this to report 25G
  capability.
  
  Reviewed by:  melifaro, sbruno
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D13286

Modified:
  head/sbin/ifconfig/sfp.c
  head/sys/net/sff8472.h

Modified: head/sbin/ifconfig/sfp.c
==
--- head/sbin/ifconfig/sfp.cTue Dec  5 18:26:34 2017(r326570)
+++ head/sbin/ifconfig/sfp.cTue Dec  5 18:42:07 2017(r326571)
@@ -69,7 +69,7 @@ struct _nv {
 const char *find_value(struct _nv *x, int value);
 const char *find_zero_bit(struct _nv *x, int value, int sz);
 
-/* SFF-8472 Rev. 11.4 table 3.4: Connector values */
+/* SFF-8024 Rev. 4.1 Table 4-3: Connector Types */
 static struct _nv conn[] = {
{ 0x00, "Unknown" },
{ 0x01, "SC" },
@@ -87,7 +87,8 @@ static struct _nv conn[] = {
{ 0x20, "HSSDC II" },
{ 0x21, "Copper pigtail" },
{ 0x22, "RJ45" },
-   { 0x23, "No separate connector" }, /* SFF-8436 */
+   { 0x23, "No separable connector" },
+   { 0x24, "MXC 2x16" },
{ 0, NULL }
 };
 
@@ -183,10 +184,17 @@ static struct _nv eth_1040g[] = {
 };
 #defineSFF_8636_EXT_COMPLIANCE 0x80
 
-/* SFF-8024 Rev. 3.4 table 4.4: Extended Specification Compliance */
+/* SFF-8024 Rev. 4.2 table 4-4: Extended Specification Compliance */
 static struct _nv eth_extended_comp[] = {
{ 0xFF, "Reserved" },
-   { 0x1A, "2 lambda DWDM 100G" },
+   { 0x21, "100G PAM4 BiDi" },
+   { 0x20, "100G SWDM4" },
+   { 0x1F, "40G SWDM4" },
+   { 0x1E, "2.5GBASE-T" },
+   { 0x1D, "5GBASE-T" },
+   { 0x1C, "10GBASE-T Short Reach" },
+   { 0x1B, "100G 1550nm WDM" },
+   { 0x1A, "100GE-DWDM2" },
{ 0x19, "100G ACC or 25GAUI C2M ACC" },
{ 0x18, "100G AOC or 25GAUI C2M AOC" },
{ 0x17, "100G CLR4" },
@@ -198,23 +206,24 @@ static struct _nv eth_extended_comp[] = {
{ 0x11, "4 x 10GBASE-SR" },
{ 0x10, "40GBASE-ER4" },
{ 0x0F, "Reserved" },
+   { 0x0E, "Reserved" },
{ 0x0D, "25GBASE-CR CA-N" },
{ 0x0C, "25GBASE-CR CA-S" },
{ 0x0B, "100GBASE-CR4 or 25GBASE-CR CA-L" },
{ 0x0A, "Reserved" },
-   { 0x09, "100G CWDM4 MSA without FEC" },
-   { 0x08, "100G ACC (Active Copper Cable)" },
+   { 0x09, "Obsolete" },
+   { 0x08, "100G ACC (Active Copper Cable) or 25GAUI C2M ACC" },
{ 0x07, "100G PSM4 Parallel SMF" },
-   { 0x06, "100G CWDM4 MSA with FEC" },
+   { 0x06, "100G CWDM4" },
{ 0x05, "100GBASE-SR10" },
-   { 0x04, "100GBASE-ER4" },
-   { 0x03, "100GBASE-LR4" },
-   { 0x02, "100GBASE-SR4" },
-   { 0x01, "100G AOC (Active Optical Cable) or 25GAUI C2M ACC" },
+   { 0x04, "100GBASE-ER4 or 25GBASE-ER" },
+   { 0x03, "100GBASE-LR4 or 25GBASE-LR" },
+   { 0x02, "100GBASE-SR4 or 25GBASE-SR" },
+   { 0x01, "100G AOC (Active Optical Cable) or 25GAUI C2M AOC" },
{ 0x00, "Unspecified" }
 };
 
-/* SFF-8636 Rev. 2.5 table 6.3: Revision compliance */
+/* SFF-8636 Rev. 2.9 table 6.3: Revision compliance */
 static struct _nv rev_compl[] = {
{ 0x1, "SFF-8436 rev <=4.8" },
{ 0x2, "SFF-8436 rev <=4.8" },
@@ -222,7 +231,8 @@ static struct _nv rev_compl[] = {
{ 0x4, "SFF-8636 rev <=1.4" },
{ 0x5, "SFF-8636 rev <=1.5" },
{ 0x6, "SFF-8636 rev <=2.0" },
-   { 0x7, "SFF-8636 rev <=2.5" },
+   { 0x7, "SFF-8636 rev <=2.7" },
+   { 0x8, "SFF-8636 rev >=2.8" },
{ 0x0, "Unspecified" }
 };
 
@@ -378,17 +388,20 @@ get_sfp_transceiver_class(struct i2c_info *ii, char *b
const char *tech_class;
uint8_t code;
 
-   unsigned char qbuf[8];
-   read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 8, (uint8_t *)qbuf);
-
-   /* Check 10G Ethernet/IB first */
-   read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 1, &code);
-   tech_class = find_zero_bit(eth_10g, code, 1);
-   if (tech_class == NULL) {
-   /* No match. Try Ethernet 1G */
-   read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START + 3,
-   1, (caddr_t)&code);
-   tech_class = find_zero_bit(eth_compat, code, 1);
+   /* Use extended compliance code if it's valid */
+   read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS, 1, &code);
+   if (code != 0)
+   tech_class = find_value(eth_extended_comp, code);
+   else {
+ 

svn commit: r326572 - head/sys/dev/ioat

2017-12-05 Thread Conrad Meyer
Author: cem
Date: Tue Dec  5 18:48:58 2017
New Revision: 326572
URL: https://svnweb.freebsd.org/changeset/base/326572

Log:
  ioat(4): Add Skylake Xeon PCI-ID
  
  SKX IOAT is just another 3.2 version of the CBDMA engine.
  
  Submitted by: Deepak Veliath 
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/dev/ioat/ioat.c

Modified: head/sys/dev/ioat/ioat.c
==
--- head/sys/dev/ioat/ioat.cTue Dec  5 18:42:07 2017(r326571)
+++ head/sys/dev/ioat/ioat.cTue Dec  5 18:48:58 2017(r326572)
@@ -236,6 +236,8 @@ static struct _pcsid
{ 0x6f278086, "BDX IOAT Ch7" },
{ 0x6f2e8086, "BDX IOAT Ch0 (RAID)" },
{ 0x6f2f8086, "BDX IOAT Ch1 (RAID)" },
+
+   { 0x20218086, "SKX IOAT" },
 };
 
 MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ioat, pci_ids,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


RE: svn commit: r326554 - in head: . usr.bin/spongeusr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Cy Schubert
Looks like it was disconnected from buildworld. I have a patch on my laptop but 
I won't have internet connectivity for another hour.

---
Sent using a tiny phone keyboard.
Apologies for any typos and autocorrect.
This old phone only supports top post. Apologies.

Cy Schubert
 or 
The need of the many outweighs the greed of the few.
---

-Original Message-
From: Eitan Adler
Sent: 05/12/2017 10:40
To: Eric Joyner
Cc: Cy Schubert; Devin Teske; Hans Petter Selasky; rgri...@freebsd.org; 
c...@freebsd.org; src-committers; svn-src-...@freebsd.org; 
svn-src-head@freebsd.org
Subject: Re: svn commit: r326554 - in head: . 
usr.bin/spongeusr.bin/sponge/tests usr.bin/tee

I'm not near my commit box right now so someone will have to revert
it. What's funny is that I ran a complete 'make buildworld
buildkernel' last night with this patch.

Will respond to the rest of the thread later

On 5 December 2017 at 10:08, Eric Joyner  wrote:
> I got told by a co-worker that this broke buildworld. Can this commit get
> reverted/have the cast fixed?
>
> - Eric (erj)
>
>
> On Tue, Dec 5, 2017 at 9:50 AM Cy Schubert  wrote:
>>
>> Our sed already creates backup files "optionally" just as gsed does. Only
>> the syntax is different. No need to sponge sed, just sed -i '' (whereas gsed
>> is -i without the argument).
>>
>>
>> ---
>> Sent using a tiny phone keyboard.
>> Apologies for any typos and autocorrect.
>> This old phone only supports top post. Apologies.
>>
>> Cy Schubert
>>  or 
>> The need of the many outweighs the greed of the few.
>> ---
>> 
>> From: Devin Teske
>> Sent: 05/12/2017 09:23
>> To: Cy Schubert
>> Cc: Hans Petter Selasky; rgri...@freebsd.org; c...@freebsd.org; Eitan
>> Adler; src-committers; svn-src-...@freebsd.org; svn-src-head@freebsd.org
>>
>> Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge
>> usr.bin/sponge/tests usr.bin/tee
>>
>>
>> On Dec 5, 2017, at 8:29 AM, Cy Schubert  wrote:
>>
>> Why not update sed to create the backup file only if the suffix is given
>> to -i, like gnu sed does.
>>
>>
>> I suspect that would break countless scripts that test uname to determine
>> how to use the -i flag of sed.
>> --
>> Devin
>>
>>
>> ---
>> Sent using a tiny phone keyboard.
>> Apologies for any typos and autocorrect.
>> This old phone only supports top post. Apologies.
>>
>> Cy Schubert
>>  or 
>> The need of the many outweighs the greed of the few.
>> ---
>> 
>> From: Devin Teske
>> Sent: 05/12/2017 07:35
>> To: Hans Petter Selasky
>> Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers;
>> svn-src-...@freebsd.org; svn-src-head@freebsd.org
>> Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge
>> usr.bin/sponge/tests usr.bin/tee
>>
>>
>> > On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
>> >
>> >> On 12/05/17 13:58, Rodney W. Grimes wrote:
>> >> Further more, why does freebsd need this in base?
>> >
>> > Hi,
>> >
>> > I think this is useful. It could replace the "-i " (intermediate) option
>> > for "sed" for example. It avoids creating temporary files when filtering
>> > files, right?
>> >
>> > --HPS
>> >
>>
>> Wth is wrong with:
>>
>> data=$( sed -e '...' somefile ) &&
>> echo "$data" > somefile
>>
>> or
>>
>> set -e
>> data=...
>> echo "$data" > ...
>>
>> or
>>
>> exec 3<> $( ... )
>> EOF
>> cat > ... <&3
>>
>> or
>>
>> (I digress)
>>
>> Infinite variations, but the gist is that sponge looks to be trying to
>> help sh(1)/similar when help is unneeded.
>>
>> Why buffer data into memory via fork-exec-pipe to sponge when you can
>> buffer to native namespace without pipe to sponge?
>>
>> Am I missing something? Why do we need sponge(1)?
>> --
>> Devin
>>
>



-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326573 - head/usr.sbin/syslogd

2017-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Tue Dec  5 19:54:55 2017
New Revision: 326573
URL: https://svnweb.freebsd.org/changeset/base/326573

Log:
  When parsing remote messages, require them to have standard timestamp
  field, and support properly parse out the hostname as described by RFC3164,
  which wasn't done before.  However, don't discard message if it doesn't
  have hostname, for compatibility.
  
  Enable logging of the message supplied hostname instead of real hostname
  with -H switch.
  
  PR:   200933
  Reported by:  Konstantin Pavlov 
  MFC after:2 months

Modified:
  head/usr.sbin/syslogd/syslogd.8
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/syslogd.8
==
--- head/usr.sbin/syslogd/syslogd.8 Tue Dec  5 18:48:58 2017
(r326572)
+++ head/usr.sbin/syslogd/syslogd.8 Tue Dec  5 19:54:55 2017
(r326573)
@@ -28,7 +28,7 @@
 .\" @(#)syslogd.8  8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd March 3, 2017
+.Dd November 28, 2017
 .Dt SYSLOGD 8
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 .Nd log systems messages
 .Sh SYNOPSIS
 .Nm
-.Op Fl 468ACcdFkNnosTuv
+.Op Fl 468ACcdFHkNnosTuv
 .Op Fl a Ar allowed_peer
 .Op Fl b Ar bind_address
 .Op Fl f Ar config_file
@@ -229,6 +229,9 @@ and
 to run
 .Nm ,
 and wants to monitor when and how it exits.
+.It Fl H
+When logging remote messages use hostname from the message (if supplied)
+instead of using address from which the message was received.
 .It Fl k
 Disable the translation of
 messages received with facility

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Tue Dec  5 18:48:58 2017
(r326572)
+++ head/usr.sbin/syslogd/syslogd.c Tue Dec  5 19:54:55 2017
(r326573)
@@ -173,7 +173,6 @@ static STAILQ_HEAD(, socklist) shead = STAILQ_HEAD_INI
 
 #defineIGN_CONS0x001   /* don't print on console */
 #defineSYNC_FILE   0x002   /* do fsync on file after printing */
-#defineADDDATE 0x004   /* add a date to the message */
 #defineMARK0x008   /* this message is a mark */
 #defineISKERNEL0x010   /* kernel generated message */
 
@@ -324,6 +323,7 @@ static int  logflags = O_WRONLY|O_APPEND; /* flags used
 static charbootfile[MAXLINE+1]; /* booted kernel file */
 
 static int RemoteAddDate;  /* Always set the date on remote messages */
+static int RemoteHostname; /* Log remote hostname from the message */
 
 static int UniquePriority; /* Only log specified priority? */
 static int LogFacPri;  /* Put facility and priority in log message: */
@@ -352,7 +352,7 @@ static void domark(int);
 static voidfprintlog(struct filed *, int, const char *);
 static voidinit(int);
 static voidlogerror(const char *);
-static voidlogmsg(int, const char *, const char *, int);
+static voidlogmsg(int, const char *, const char *, const char *, int);
 static voidlog_deadchild(pid_t, int, const char *);
 static voidmarkit(void);
 static int socksetup(struct peer *);
@@ -361,7 +361,7 @@ static int  socklist_recv_sock(struct socklist *);
 static int socklist_recv_signal(struct socklist *);
 static voidsighandler(int);
 static int skip_message(const char *, const char *, int);
-static voidprintline(const char *, char *, int);
+static voidparsemsg(const char *, char *);
 static voidprintsys(char *);
 static int p_open(const char *, pid_t *);
 static voidreapchild(int);
@@ -454,7 +454,7 @@ main(int argc, char *argv[])
if (madvise(NULL, 0, MADV_PROTECT) != 0)
dprintf("madvise() failed: %s\n", strerror(errno));
 
-   while ((ch = getopt(argc, argv, "468Aa:b:cCdf:Fkl:m:nNop:P:sS:Tuv"))
+   while ((ch = getopt(argc, argv, "468Aa:b:cCdf:FHkl:m:nNop:P:sS:Tuv"))
!= -1)
switch (ch) {
 #ifdef INET
@@ -518,6 +518,9 @@ main(int argc, char *argv[])
case 'F':   /* run in foreground instead of daemon 
*/
Foreground++;
break;
+   case 'H':
+   RemoteHostname = 1;
+   break;
case 'k':   /* keep remote kern fac */
KeepKernFac = 1;
break;
@@ -772,7 +775,7 @@ socklist_recv_sock(struct socklist *sl)
socklen_t sslen;
const char *hname;
char line[MAXLINE + 1];
-   int date, len;
+   int len;
 
sslen = sizeof(ss);
len = recvfrom(sl->sl_socket, line, sizeof(line) - 1, 0, sa, &sslen);
@@ -786,19 +789,17 @@ socklist_recv_sock(struct socklist *sl)
}
/* Received valid data. */
line[len] = '\0';
-   if (sl->sl_ss.ss_family == AF_LOCAL) {
+   if (sl->sl_ss.ss_family == AF_LOCAL)
hname =

svn commit: r326574 - head/usr.bin/logger

2017-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Tue Dec  5 19:55:53 2017
New Revision: 326574
URL: https://svnweb.freebsd.org/changeset/base/326574

Log:
  Generate fully RFC3164 compliant messages, with timestamp and hostname.
  Allow to set hostname to any string with -H.
  
  MFC after:2 months

Modified:
  head/usr.bin/logger/logger.1
  head/usr.bin/logger/logger.c

Modified: head/usr.bin/logger/logger.1
==
--- head/usr.bin/logger/logger.1Tue Dec  5 19:54:55 2017
(r326573)
+++ head/usr.bin/logger/logger.1Tue Dec  5 19:55:53 2017
(r326574)
@@ -28,7 +28,7 @@
 .\"@(#)logger.18.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd December 23, 2016
+.Dd December 5, 2017
 .Dt LOGGER 1
 .Os
 .Sh NAME
@@ -38,6 +38,7 @@
 .Nm
 .Op Fl 46Ais
 .Op Fl f Ar file
+.Op Fl H Ar hostname
 .Op Fl h Ar host
 .Op Fl P Ar port
 .Op Fl p Ar pri
@@ -77,6 +78,11 @@ Log the message to standard error, as well as the syst
 .It Fl f Ar file
 Read the contents of the specified file into syslog.
 This option is ignored when a message is also specified.
+.It Fl H Ar hostname
+Set the hostname in the header of the message to specified value.
+If not specified, host part of
+.Xr gethostname 3
+will be used.
 .It Fl h Ar host
 Send the message to the remote system
 .Ar host

Modified: head/usr.bin/logger/logger.c
==
--- head/usr.bin/logger/logger.cTue Dec  5 19:54:55 2017
(r326573)
+++ head/usr.bin/logger/logger.cTue Dec  5 19:55:53 2017
(r326574)
@@ -44,7 +44,7 @@ static char sccsid[] = "@(#)logger.c  8.1 (Berkeley) 6/
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
+#include 
 #include 
 #include 
 
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #defineSYSLOG_NAMES
@@ -71,8 +72,8 @@ static intdecode(char *, const CODE *);
 static int pencode(char *);
 static ssize_t socksetup(const char *, const char *, const char *,
struct socks **);
-static voidlogmessage(int, const char *, struct socks *, ssize_t,
-  const char *);
+static voidlogmessage(int, const char *, const char *, const char *,
+   struct socks *, ssize_t, const char *);
 static voidusage(void);
 
 #ifdef INET6
@@ -93,19 +94,22 @@ main(int argc, char *argv[])
 {
struct socks *socks;
ssize_t nsock;
+   time_t now;
int ch, logflags, pri;
-   char *tag, *host, buf[1024];
+   char *tag, *host, buf[1024], *timestamp, tbuf[26],
+   *hostname, hbuf[MAXHOSTNAMELEN];
const char *svcname, *src;
 
tag = NULL;
host = NULL;
+   hostname = NULL;
svcname = "syslog";
src = NULL;
socks = NULL;
pri = LOG_USER | LOG_NOTICE;
logflags = 0;
unsetenv("TZ");
-   while ((ch = getopt(argc, argv, "46Af:h:iP:p:S:st:")) != -1)
+   while ((ch = getopt(argc, argv, "46Af:H:h:iP:p:S:st:")) != -1)
switch((char)ch) {
case '4':
family = PF_INET;
@@ -123,6 +127,9 @@ main(int argc, char *argv[])
err(1, "%s", optarg);
setvbuf(stdin, 0, _IONBF, 0);
break;
+   case 'H':   /* hostname to set in message header */
+   hostname = optarg;
+   break;
case 'h':   /* hostname to deliver to */
host = optarg;
break;
@@ -168,6 +175,17 @@ main(int argc, char *argv[])
openlog(tag, logflags, 0);
(void) fclose(stdout);
 
+   (void )time(&now);
+   (void )ctime_r(&now, tbuf);
+   tbuf[19] = '\0';
+   timestamp = tbuf + 4;
+
+   if (hostname == NULL) {
+   hostname = hbuf;
+   (void )gethostname(hbuf, MAXHOSTNAMELEN);
+   *strchr(hostname, '.') = '\0';
+   }
+
/* log input line if appropriate */
if (argc > 0) {
char *p, *endp;
@@ -176,11 +194,13 @@ main(int argc, char *argv[])
for (p = buf, endp = buf + sizeof(buf) - 2; *argv;) {
len = strlen(*argv);
if (p + len > endp && p > buf) {
-   logmessage(pri, tag, socks, nsock, buf);
+   logmessage(pri, timestamp, hostname, tag,
+   socks, nsock, buf);
p = buf;
}
if (len > sizeof(buf) - 1)
-   logmessage(pri, tag, socks, nsock, *argv++);
+   logmessage(pri, timestamp, hostname, tag,
+   socks, nsock, *argv++);
else 

svn commit: r326575 - in head/usr.bin: . sponge

2017-12-05 Thread Cy Schubert
Author: cy
Date: Tue Dec  5 20:06:53 2017
New Revision: 326575
URL: https://svnweb.freebsd.org/changeset/base/326575

Log:
  Fix build after r326554; reconnect sponge to build again.

Modified:
  head/usr.bin/Makefile
  head/usr.bin/sponge/sponge.c

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Tue Dec  5 19:55:53 2017(r326574)
+++ head/usr.bin/Makefile   Tue Dec  5 20:06:53 2017(r326575)
@@ -148,6 +148,7 @@ SUBDIR= alias \
soelim \
sort \
split \
+   sponge \
stat \
stdbuf \
strings \

Modified: head/usr.bin/sponge/sponge.c
==
--- head/usr.bin/sponge/sponge.cTue Dec  5 19:55:53 2017
(r326574)
+++ head/usr.bin/sponge/sponge.cTue Dec  5 20:06:53 2017
(r326575)
@@ -172,7 +172,8 @@ main(int argc, char* argv[])
bufremain = bufcnt;
 
while (bufremain > 0) {
-   whichbuf = (bufremain < maxiovec) ? bufremain : maxiovec;
+   whichbuf = bufremain < (unsigned long) maxiovec
+   ? bufremain : maxiovec;
bufremain -= whichbuf;
 
i = writev(fd, iov, whichbuf);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326576 - in head: lib/libc/sys sys/sys

2017-12-05 Thread Ed Maste
Author: emaste
Date: Tue Dec  5 20:19:13 2017
New Revision: 326576
URL: https://svnweb.freebsd.org/changeset/base/326576

Log:
  use @@@ instead of @@ in __sym_default
  
  Using
  .symver foo,foo@@VER
  causes foo and foo@@VER to be output to the .o file. This requires foo
  to be weak since the linker handles foo@@VER as foo.
  
  Using
  .symver foo,foo@@@VER
  causes just foo@@ver to be output and avoid the need for making foo
  weak. It also reduces the constraint on how exactly a linker has to
  handle foo and foo@@VER being present.
  
  Submitted by: Rafael Espíndola
  Reviewed by:  dim, kib
  Differential Revision:https://reviews.freebsd.org/D11653

Modified:
  head/lib/libc/sys/openat.c
  head/lib/libc/sys/setcontext.c
  head/lib/libc/sys/swapcontext.c
  head/sys/sys/cdefs.h

Modified: head/lib/libc/sys/openat.c
==
--- head/lib/libc/sys/openat.c  Tue Dec  5 20:06:53 2017(r326575)
+++ head/lib/libc/sys/openat.c  Tue Dec  5 20:19:13 2017(r326576)
@@ -43,7 +43,6 @@ __sym_compat(openat, __impl_openat, FBSD_1.1);
 __weak_reference(openat, __impl_openat);
 __sym_default(openat, openat, FBSD_1.2);
 
-#pragma weak openat
 int
 openat(int fd, const char *path, int flags, ...)
 {

Modified: head/lib/libc/sys/setcontext.c
==
--- head/lib/libc/sys/setcontext.c  Tue Dec  5 20:06:53 2017
(r326575)
+++ head/lib/libc/sys/setcontext.c  Tue Dec  5 20:19:13 2017
(r326576)
@@ -42,7 +42,6 @@ __sym_compat(setcontext, __impl_setcontext, FBSD_1.0);
 __weak_reference(setcontext, __impl_setcontext);
 __sym_default(setcontext, setcontext, FBSD_1.2);
 
-#pragma weak setcontext
 int
 setcontext(const ucontext_t *uc)
 {

Modified: head/lib/libc/sys/swapcontext.c
==
--- head/lib/libc/sys/swapcontext.c Tue Dec  5 20:06:53 2017
(r326575)
+++ head/lib/libc/sys/swapcontext.c Tue Dec  5 20:19:13 2017
(r326576)
@@ -43,7 +43,6 @@ __sym_compat(swapcontext, __impl_swapcontext, FBSD_1.0
 __weak_reference(swapcontext, __impl_swapcontext);
 __sym_default(swapcontext, swapcontext, FBSD_1.2);
 
-#pragma weak swapcontext
 int
 swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
 {

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hTue Dec  5 20:06:53 2017(r326575)
+++ head/sys/sys/cdefs.hTue Dec  5 20:19:13 2017(r326576)
@@ -551,7 +551,7 @@
 #define__sym_compat(sym,impl,verid)\
__asm__(".symver " #impl ", " #sym "@" #verid)
 #define__sym_default(sym,impl,verid)   \
-   __asm__(".symver " #impl ", " #sym "@@" #verid)
+   __asm__(".symver " #impl ", " #sym "@@@" #verid)
 #else
 #define__weak_reference(sym,alias) \
__asm__(".weak alias"); \
@@ -563,7 +563,7 @@
 #define__sym_compat(sym,impl,verid)\
__asm__(".symver impl, sym@verid")
 #define__sym_default(impl,sym,verid)   \
-   __asm__(".symver impl, sym@@verid")
+   __asm__(".symver impl, sym@@@verid")
 #endif /* __STDC__ */
 #endif /* __GNUC__ || __INTEL_COMPILER */
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326577 - head/sys/net

2017-12-05 Thread Stephen Hurd
Author: shurd
Date: Tue Dec  5 20:43:24 2017
New Revision: 326577
URL: https://svnweb.freebsd.org/changeset/base/326577

Log:
  Avoid calling CURVNET_[SET|RESTORE] for each packet
  
  The LRO possible test was calling CURVNET_SET once for IPv4 or IPv6 for
  each packet in a chain. Only call it once per chain instead.
  
  Submitted by: Matthew Macy 
  Reviewed by:  cem, ae
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D13368

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Dec  5 20:19:13 2017(r326576)
+++ head/sys/net/iflib.cTue Dec  5 20:43:24 2017(r326577)
@@ -2467,13 +2467,26 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t ri)
 }
 
 #if defined(INET6) || defined(INET)
+static void
+iflib_get_ip_forwarding(struct lro_ctrl *lc, bool *v4, bool *v6)
+{
+   CURVNET_SET(lc->ifp->if_vnet);
+#if defined(INET6)
+   *v6 = VNET(ip6_forwarding);
+#endif
+#if defined(INET)
+   *v4 = VNET(ipforwarding);
+#endif
+   CURVNET_RESTORE();
+}
+
 /*
  * Returns true if it's possible this packet could be LROed.
  * if it returns false, it is guaranteed that tcp_lro_rx()
  * would not return zero.
  */
 static bool
-iflib_check_lro_possible(struct lro_ctrl *lc, struct mbuf *m)
+iflib_check_lro_possible(struct mbuf *m, bool v4_forwarding, bool 
v6_forwarding)
 {
struct ether_header *eh;
uint16_t eh_type;
@@ -2483,32 +2496,21 @@ iflib_check_lro_possible(struct lro_ctrl *lc, struct m
switch (eh_type) {
 #if defined(INET6)
case ETHERTYPE_IPV6:
-   {
-   CURVNET_SET(lc->ifp->if_vnet);
-   if (VNET(ip6_forwarding) == 0) {
-   CURVNET_RESTORE();
-   return true;
-   }
-   CURVNET_RESTORE();
-   break;
-   }
+   return !v6_forwarding;
 #endif
 #if defined (INET)
case ETHERTYPE_IP:
-   {
-   CURVNET_SET(lc->ifp->if_vnet);
-   if (VNET(ipforwarding) == 0) {
-   CURVNET_RESTORE();
-   return true;
-   }
-   CURVNET_RESTORE();
-   break;
-   }
+   return !v4_forwarding;
 #endif
}
 
return false;
 }
+#else
+static void
+iflib_get_ip_forwarding(struct lro_ctrl *lc __unused, bool *v4 __unused, bool 
*v6 __unused)
+{
+}
 #endif
 
 static bool
@@ -2525,6 +2527,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget)
struct ifnet *ifp;
int lro_enabled;
bool lro_possible = false;
+   bool v4_forwarding, v6_forwarding;
 
/*
 * XXX early demux data packets so that if_input processing only handles
@@ -2601,6 +2604,8 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget)
__iflib_fl_refill_lt(ctx, fl, budget + 8);
 
lro_enabled = (if_getcapenable(ifp) & IFCAP_LRO);
+   if (lro_enabled)
+   iflib_get_ip_forwarding(&rxq->ifr_lc, &v4_forwarding, 
&v6_forwarding);
mt = mf = NULL;
while (mh != NULL) {
m = mh;
@@ -2615,7 +2620,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget)
 #if defined(INET6) || defined(INET)
if (lro_enabled) {
if (!lro_possible) {
-   lro_possible = 
iflib_check_lro_possible(&rxq->ifr_lc, m);
+   lro_possible = iflib_check_lro_possible(m, 
v4_forwarding, v6_forwarding);
if (lro_possible && mf != NULL) {
ifp->if_input(ifp, mf);
DBG_COUNTER_INC(rx_if_input);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Cy Schubert
In message 
, Eitan Adler writes:
> I'm not near my commit box right now so someone will have to revert
> it. What's funny is that I ran a complete 'make buildworld
> buildkernel' last night with this patch.
>
> Will respond to the rest of the thread later

No problem. r326575 addresses the issue.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


>
> On 5 December 2017 at 10:08, Eric Joyner  wrote:
> > I got told by a co-worker that this broke buildworld. Can this commit get
> > reverted/have the cast fixed?
> >
> > - Eric (erj)
> >
> >
> > On Tue, Dec 5, 2017 at 9:50 AM Cy Schubert  wrote
> :
> >>
> >> Our sed already creates backup files "optionally" just as gsed does. Only
> >> the syntax is different. No need to sponge sed, just sed -i '' (whereas gs
> ed
> >> is -i without the argument).
> >>
> >>
> >> ---
> >> Sent using a tiny phone keyboard.
> >> Apologies for any typos and autocorrect.
> >> This old phone only supports top post. Apologies.
> >>
> >> Cy Schubert
> >>  or 
> >> The need of the many outweighs the greed of the few.
> >> ---
> >> 
> >> From: Devin Teske
> >> Sent: 05/12/2017 09:23
> >> To: Cy Schubert
> >> Cc: Hans Petter Selasky; rgri...@freebsd.org; c...@freebsd.org; Eitan
> >> Adler; src-committers; svn-src-...@freebsd.org; svn-src-head@freebsd.org
> >>
> >> Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge
> >> usr.bin/sponge/tests usr.bin/tee
> >>
> >>
> >> On Dec 5, 2017, at 8:29 AM, Cy Schubert  wrote:
> >>
> >> Why not update sed to create the backup file only if the suffix is given
> >> to -i, like gnu sed does.
> >>
> >>
> >> I suspect that would break countless scripts that test uname to determine
> >> how to use the -i flag of sed.
> >> --
> >> Devin
> >>
> >>
> >> ---
> >> Sent using a tiny phone keyboard.
> >> Apologies for any typos and autocorrect.
> >> This old phone only supports top post. Apologies.
> >>
> >> Cy Schubert
> >>  or 
> >> The need of the many outweighs the greed of the few.
> >> ---
> >> 
> >> From: Devin Teske
> >> Sent: 05/12/2017 07:35
> >> To: Hans Petter Selasky
> >> Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers;
> >> svn-src-...@freebsd.org; svn-src-head@freebsd.org
> >> Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge
> >> usr.bin/sponge/tests usr.bin/tee
> >>
> >>
> >> > On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  wrote:
> >> >
> >> >> On 12/05/17 13:58, Rodney W. Grimes wrote:
> >> >> Further more, why does freebsd need this in base?
> >> >
> >> > Hi,
> >> >
> >> > I think this is useful. It could replace the "-i " (intermediate) option
> >> > for "sed" for example. It avoids creating temporary files when filtering
> >> > files, right?
> >> >
> >> > --HPS
> >> >
> >>
> >> Wth is wrong with:
> >>
> >> data=$( sed -e '...' somefile ) &&
> >> echo "$data" > somefile
> >>
> >> or
> >>
> >> set -e
> >> data=...
> >> echo "$data" > ...
> >>
> >> or
> >>
> >> exec 3< >> $( ... )
> >> EOF
> >> cat > ... <&3
> >>
> >> or
> >>
> >> (I digress)
> >>
> >> Infinite variations, but the gist is that sponge looks to be trying to
> >> help sh(1)/similar when help is unneeded.
> >>
> >> Why buffer data into memory via fork-exec-pipe to sponge when you can
> >> buffer to native namespace without pipe to sponge?
> >>
> >> Am I missing something? Why do we need sponge(1)?
> >> --
> >> Devin
> >>
> >
>
>
>
> -- 
> Eitan Adler
> Source, Ports, Doc committer
> Bugmeister, Ports Security teams
>


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326578 - in head/sys: dev/bnxt net

2017-12-05 Thread Stephen Hurd
Author: shurd
Date: Tue Dec  5 21:00:31 2017
New Revision: 326578
URL: https://svnweb.freebsd.org/changeset/base/326578

Log:
  iflib: Support to padding Ethernet frames to a min size
  
  Some bnxt devices do not correctly send frames smaller than
  52 bytes (without CRC), so add a quirk that will pad frames to an
  arbitrary size before passing off to the encap routine.
  
  Reported by:  Bhargava Chenna Marreddy 
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D13269

Modified:
  head/sys/dev/bnxt/bnxt.h
  head/sys/dev/bnxt/if_bnxt.c
  head/sys/net/iflib.c
  head/sys/net/iflib.h

Modified: head/sys/dev/bnxt/bnxt.h
==
--- head/sys/dev/bnxt/bnxt.hTue Dec  5 20:43:24 2017(r326577)
+++ head/sys/dev/bnxt/bnxt.hTue Dec  5 21:00:31 2017(r326578)
@@ -236,6 +236,8 @@ __FBSDID("$FreeBSD$");
ifmedia_add(softc->media, IFM_ETHER | (ifm_speed), 0, NULL);
\
 } while(0)
 
+#define BNXT_MIN_FRAME_SIZE52  /* Frames must be padded to this size 
for some A0 chips */
+
 /* NVRAM access */
 enum bnxt_nvm_directory_type {
BNX_DIR_TYPE_UNUSED = 0,

Modified: head/sys/dev/bnxt/if_bnxt.c
==
--- head/sys/dev/bnxt/if_bnxt.c Tue Dec  5 20:43:24 2017(r326577)
+++ head/sys/dev/bnxt/if_bnxt.c Tue Dec  5 21:00:31 2017(r326578)
@@ -298,7 +298,7 @@ static struct if_shared_ctx bnxt_sctx_init = {
.isc_magic = IFLIB_MAGIC,
.isc_driver = &bnxt_iflib_driver,
.isc_nfl = 2,   // Number of Free Lists
-   .isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ,
+   .isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ | IFLIB_NEED_ETHER_PAD,
.isc_q_align = PAGE_SIZE,
.isc_tx_maxsize = BNXT_TSO_SIZE,
.isc_tx_maxsegsize = BNXT_TSO_SIZE,
@@ -793,6 +793,7 @@ bnxt_attach_pre(if_ctx_t ctx)
scctx->isc_tx_tso_size_max = BNXT_TSO_SIZE;
scctx->isc_tx_tso_segsize_max = BNXT_TSO_SIZE;
scctx->isc_vectors = softc->func.max_cp_rings;
+   scctx->isc_min_frame_size = BNXT_MIN_FRAME_SIZE;
scctx->isc_txrx = &bnxt_txrx;
 
if (scctx->isc_nrxd[0] <

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Dec  5 20:43:24 2017(r326577)
+++ head/sys/net/iflib.cTue Dec  5 21:00:31 2017(r326578)
@@ -627,11 +627,14 @@ SYSCTL_INT(_net_iflib, OID_AUTO, txq_drain_encapfail, 
 
 
 static int iflib_encap_load_mbuf_fail;
+static int iflib_encap_pad_mbuf_fail;
 static int iflib_encap_txq_avail_fail;
 static int iflib_encap_txd_encap_fail;
 
 SYSCTL_INT(_net_iflib, OID_AUTO, encap_load_mbuf_fail, CTLFLAG_RD,
   &iflib_encap_load_mbuf_fail, 0, "# busdma load failures");
+SYSCTL_INT(_net_iflib, OID_AUTO, encap_pad_mbuf_fail, CTLFLAG_RD,
+  &iflib_encap_pad_mbuf_fail, 0, "# runt frame pad failures");
 SYSCTL_INT(_net_iflib, OID_AUTO, encap_txq_avail_fail, CTLFLAG_RD,
   &iflib_encap_txq_avail_fail, 0, "# txq avail failures");
 SYSCTL_INT(_net_iflib, OID_AUTO, encap_txd_encap_fail, CTLFLAG_RD,
@@ -684,9 +687,10 @@ iflib_debug_reset(void)
iflib_fl_refills = iflib_fl_refills_large = iflib_tx_frees =
iflib_txq_drain_flushing = iflib_txq_drain_oactive =
iflib_txq_drain_notready = iflib_txq_drain_encapfail =
-   iflib_encap_load_mbuf_fail = iflib_encap_txq_avail_fail =
-   iflib_encap_txd_encap_fail = iflib_task_fn_rxs = 
iflib_rx_intr_enables =
-   iflib_fast_intrs = iflib_intr_link = iflib_intr_msix = 
iflib_rx_unavail =
+   iflib_encap_load_mbuf_fail = iflib_encap_pad_mbuf_fail =
+   iflib_encap_txq_avail_fail = iflib_encap_txd_encap_fail =
+   iflib_task_fn_rxs = iflib_rx_intr_enables = iflib_fast_intrs =
+   iflib_intr_link = iflib_intr_msix = iflib_rx_unavail =
iflib_rx_ctx_inactive = iflib_rx_zero_len = iflib_rx_if_input =
iflib_rx_mbuf_null = iflib_rxd_flush = 0;
 }
@@ -3103,6 +3107,35 @@ calc_next_txd(iflib_txq_t txq, int cidx, uint8_t qid)
return (next < end ? next : start);
 }
 
+/*
+ * Pad an mbuf to ensure a minimum ethernet frame size.
+ * min_frame_size is the frame size (less CRC) to pad the mbuf to
+ */
+static __noinline int
+iflib_ether_pad(device_t dev, struct mbuf *m_head, uint16_t min_frame_size)
+{
+   /*
+* 18 is enough bytes to pad an ARP packet to 46 bytes, and
+* and ARP message is the smallest common payload I can think of
+*/
+   static char pad[18];/* just zeros */
+   int n;
+
+   for (n = min_frame_size - m_head->m_pkthdr.len;
+n > 0; n -= sizeof(pad))
+   if (!m_append(m_head, min(n, sizeof(p

Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Conrad Meyer
On Tue, Dec 5, 2017 at 12:16 PM, Cy Schubert  wrote:
> In message  om>
> , Eitan Adler writes:
>> I'm not near my commit box right now so someone will have to revert
>> it. What's funny is that I ran a complete 'make buildworld
>> buildkernel' last night with this patch.
>>
>> Will respond to the rest of the thread later
>
> No problem. r326575 addresses the issue.

Not fully — it doesn't address that the code is functionally broken or
that the change touched things it didn't need to.  I think a revert is
still called for, when you can reach a machine with commit access.

Conrad
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326579 - in head/sys: arm/allwinner arm/allwinner/clkng arm/allwinner/h3 conf

2017-12-05 Thread Emmanuel Vadot
Author: manu
Date: Tue Dec  5 21:21:23 2017
New Revision: 326579
URL: https://svnweb.freebsd.org/changeset/base/326579

Log:
  Allwinner H5: Enhance support
  
  Add proper gpio and clock support

Modified:
  head/sys/arm/allwinner/a10_gpio.c
  head/sys/arm/allwinner/clkng/ccu_h3.c
  head/sys/arm/allwinner/clkng/ccu_sun8i_r.c
  head/sys/arm/allwinner/h3/h3_padconf.c
  head/sys/arm/allwinner/h3/h3_r_padconf.c
  head/sys/conf/files.arm64

Modified: head/sys/arm/allwinner/a10_gpio.c
==
--- head/sys/arm/allwinner/a10_gpio.c   Tue Dec  5 21:00:31 2017
(r326578)
+++ head/sys/arm/allwinner/a10_gpio.c   Tue Dec  5 21:21:23 2017
(r326579)
@@ -113,7 +113,7 @@ extern const struct allwinner_padconf a33_padconf;
 #endif
 
 /* Defined in h3_padconf.c */
-#ifdef SOC_ALLWINNER_H3
+#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5)
 extern const struct allwinner_padconf h3_padconf;
 extern const struct allwinner_padconf h3_r_padconf;
 #endif
@@ -156,8 +156,9 @@ static struct ofw_compat_data compat_data[] = {
{"allwinner,sun8i-a83t-pinctrl",(uintptr_t)&a83t_padconf},
{"allwinner,sun8i-a83t-r-pinctrl",  (uintptr_t)&a83t_r_padconf},
 #endif
-#ifdef SOC_ALLWINNER_H3
+#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5)
{"allwinner,sun8i-h3-pinctrl",  (uintptr_t)&h3_padconf},
+   {"allwinner,sun50i-h5-pinctrl", (uintptr_t)&h3_padconf},
{"allwinner,sun8i-h3-r-pinctrl",(uintptr_t)&h3_r_padconf},
 #endif
 #ifdef SOC_ALLWINNER_A64

Modified: head/sys/arm/allwinner/clkng/ccu_h3.c
==
--- head/sys/arm/allwinner/clkng/ccu_h3.c   Tue Dec  5 21:00:31 2017
(r326578)
+++ head/sys/arm/allwinner/clkng/ccu_h3.c   Tue Dec  5 21:21:23 2017
(r326579)
@@ -37,6 +37,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#if defined(__aarch64__)
+#include "opt_soc.h"
+#endif
+
 #include 
 #include 
 #include 

Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c
==
--- head/sys/arm/allwinner/clkng/ccu_sun8i_r.c  Tue Dec  5 21:00:31 2017
(r326578)
+++ head/sys/arm/allwinner/clkng/ccu_sun8i_r.c  Tue Dec  5 21:21:23 2017
(r326579)
@@ -33,6 +33,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#if defined(__aarch64__)
+#include "opt_soc.h"
+#endif
+
 #include 
 #include 
 #include 

Modified: head/sys/arm/allwinner/h3/h3_padconf.c
==
--- head/sys/arm/allwinner/h3/h3_padconf.c  Tue Dec  5 21:00:31 2017
(r326578)
+++ head/sys/arm/allwinner/h3/h3_padconf.c  Tue Dec  5 21:21:23 2017
(r326579)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2016 Emmanuel Vadot 
+ * Copyright (c) 2016-2017 Emmanuel Vadot 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -33,9 +33,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#if defined(__aarch64__)
+#include "opt_soc.h"
+#endif
+
 #include 
 
-#ifdef SOC_ALLWINNER_H3
+#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5)
 
 const static struct allwinner_pins h3_pins[] = {
{"PA0",  0, 0,  {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, 
"pa_eint0", NULL}, 6, 0},

Modified: head/sys/arm/allwinner/h3/h3_r_padconf.c
==
--- head/sys/arm/allwinner/h3/h3_r_padconf.cTue Dec  5 21:00:31 2017
(r326578)
+++ head/sys/arm/allwinner/h3/h3_r_padconf.cTue Dec  5 21:21:23 2017
(r326579)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2016 Emmanuel Vadot 
+ * Copyright (c) 2016-2017 Emmanuel Vadot 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -33,9 +33,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#if defined(__aarch64__)
+#include "opt_soc.h"
+#endif
+
 #include 
 
-#ifdef SOC_ALLWINNER_H3
+#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5)
 
 const static struct allwinner_pins h3_r_pins[] = {
{"PL0",  0, 0,  {"gpio_in", "gpio_out", "s_twi", NULL, NULL, NULL, 
"pl_eint0", NULL}, 6, 0},

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Tue Dec  5 21:00:31 2017(r326578)
+++ head/sys/conf/files.arm64   Tue Dec  5 21:21:23 2017(r326579)
@@ -28,6 +28,8 @@ arm/allwinner/a10_gpio.c  optionalgpio aw_gpio fdt
 arm/allwinner/a10_mmc.coptionalmmc aw_mmc fdt
 arm/allwinner/a64/a64_padconf.coptionalsoc_allwinner_a64 fdt
 arm/allwinner/a64/a64_r_padconf.c optional soc_allwinner_a64 fdt
+arm/allwinner/h3/h3_padconf.c  optionalsoc_allwinner_h5 fdt
+arm/allwinner/h3/h3_r_padconf.c

Re: svn commit: r282485 - head/lib/libc/gen

2017-12-05 Thread Alan Somers
On Tue, May 5, 2015 at 8:52 AM, Julian Elischer  wrote:

> Author: julian
> Date: Tue May  5 14:52:33 2015
> New Revision: 282485
> URL: https://svnweb.freebsd.org/changeset/base/282485
>
> Log:
>   Tweak seekdir, telldir and readdir so that when htere are deletes going
> on,
>   as seek to teh last location saved will still work. This is needed for
> Samba
>   to be able to correctly handle delete requests from windows. This does
> not
>   completely fix seekdir when deletes are present but fixes the worst of
> the
>   problems. The real solution must involve some changes to the API for eh
> VFS
>   and getdirentries(2).
>
>   Obtained from:Panzura inc
>   MFC after:1 week
>
> Modified:
>   head/lib/libc/gen/directory.3
>   head/lib/libc/gen/readdir.c
>   head/lib/libc/gen/rewinddir.c
>   head/lib/libc/gen/telldir.c
>   head/lib/libc/gen/telldir.h
>

Do you remember what the exact problem you had was?  I'm trying to write a
regression test for it, but I'm having trouble guessing what the bug was.
And was _fixtelldir() related to the issue with deletes, or was that to fix
a separate bug?

-Alan
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326580 - in head: . share/mk

2017-12-05 Thread Bryan Drewery
Author: bdrewery
Date: Tue Dec  5 21:29:47 2017
New Revision: 326580
URL: https://svnweb.freebsd.org/changeset/base/326580

Log:
  AUTO_OBJ: For all top-level targets enforce using an OBJDIR.
  
  This will cause an error if the wanted OBJDIR is not writable.  Previously it
  would cause the files to generate to the source tree.  This was too obscure 
and
  things like buildworld really expect a proper OBJDIR layout.
  
  Sponsored by: Dell EMC

Modified:
  head/Makefile.sys.inc
  head/share/mk/src.sys.obj.mk

Modified: head/Makefile.sys.inc
==
--- head/Makefile.sys.inc   Tue Dec  5 21:21:23 2017(r326579)
+++ head/Makefile.sys.inc   Tue Dec  5 21:29:47 2017(r326580)
@@ -38,6 +38,10 @@ MK_AUTO_OBJ= no
 # just want to read any existing OBJDIR but we don't care if we can create
 # or write to them.
 .MAKEOVERRIDES+=   MK_AUTO_OBJ
+.else
+# For top-level we always assume the MAKEOBJDIRPREFIX is writable rather than
+# falling back to .CURDIR.
+__objdir_writable= yes
 .endif
 .endif # empty(.MAKEOVERRIDES:MMK_AUTO_OBJ)
 

Modified: head/share/mk/src.sys.obj.mk
==
--- head/share/mk/src.sys.obj.mkTue Dec  5 21:21:23 2017
(r326579)
+++ head/share/mk/src.sys.obj.mkTue Dec  5 21:29:47 2017
(r326580)
@@ -172,7 +172,7 @@ CheckAutoObj() { \
 .if !empty(__objdir)
 .if ${.CURDIR} == ${__objdir}
 __objdir_writable?= yes
-.else
+.elif empty(__objdir_writable)
 __objdir_writable!= \
${CheckAutoObj}; CheckAutoObj "${__objdir}" || echo no
 .endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326582 - head/share/mk

2017-12-05 Thread Bryan Drewery
Author: bdrewery
Date: Tue Dec  5 21:30:22 2017
New Revision: 326582
URL: https://svnweb.freebsd.org/changeset/base/326582

Log:
  Deal with bmake-20170301 no longer resolving -C like it used to.
  
  Several checks assume .CURDIR is resolved, such as for determining RELDIR from
  SRCTOP/.CURDIR.  If -C is used then the path is no longer resolved like it was
  before which is problematic for symlinked source trees.  A similar change was
  also made to ports post bmake-20170301.
  
  This fixes 'make -C  buildworld' using the wrong OBJDIR.
  
  Reported by:  rstone
  Sponsored by: Dell EMC

Modified:
  head/share/mk/src.sys.env.mk

Modified: head/share/mk/src.sys.env.mk
==
--- head/share/mk/src.sys.env.mkTue Dec  5 21:30:17 2017
(r326581)
+++ head/share/mk/src.sys.env.mkTue Dec  5 21:30:22 2017
(r326582)
@@ -2,6 +2,14 @@
 
 # early setup only see also src.sys.mk
 
+# bmake-20170301 started taking '-C' "as is" for some cases, notably absolute
+# paths.  Some later comparisons will assume .CURDIR is resolved and matches
+# what we would get with 'cd'.  So just force resolve it now if it is an
+# absolute path.
+.if ${MAKE_VERSION} >= 20170301 && !empty(.CURDIR:M/*)
+.CURDIR:= ${.CURDIR:tA}
+.endif
+
 # make sure this is defined in a consistent manner
 SRCTOP:= ${.PARSEDIR:tA:H:H}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326581 - head/share/mk

2017-12-05 Thread Bryan Drewery
Author: bdrewery
Date: Tue Dec  5 21:30:17 2017
New Revision: 326581
URL: https://svnweb.freebsd.org/changeset/base/326581

Log:
  Handle writable-but-not-a-directory cases for writable OBJDIR check.
  
  Sponsored by: Dell EMC

Modified:
  head/share/mk/src.sys.obj.mk

Modified: head/share/mk/src.sys.obj.mk
==
--- head/share/mk/src.sys.obj.mkTue Dec  5 21:29:47 2017
(r326580)
+++ head/share/mk/src.sys.obj.mkTue Dec  5 21:30:17 2017
(r326581)
@@ -137,7 +137,10 @@ __objdir:= ${MAKEOBJDIR}
 # If the last component is a symlink then recurse on the new path.
 CheckAutoObj= \
 DirIsCreatable() { \
-   [ -w "$${1}" ] && return 0; \
+   if [ -w "$${1}" ]; then \
+   [ -d "$${1}" ] || return 1; \
+   return 0; \
+   fi; \
d="$${1}"; \
IFS=/; \
set -- $${d}; \
@@ -154,13 +157,16 @@ DirIsCreatable() { \
ret=0; \
DirIsCreatable "$${dir%/}" || ret=$$?; \
return $${ret}; \
+   elif [ -e "/$${dir}$${d}" ]; then \
+   return 1; \
else \
break; \
fi; \
fi; \
dir="$${dir}$${d}/"; \
done; \
-   [ -w "$${dir}" ]; \
+   [ -w "$${dir}" ] && [ -d "$${dir}" ] && return 0; \
+   return 1; \
 }; \
 CheckAutoObj() { \
if DirIsCreatable "$${1}"; then \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326583 - head

2017-12-05 Thread Bryan Drewery
Author: bdrewery
Date: Tue Dec  5 21:36:08 2017
New Revision: 326583
URL: https://svnweb.freebsd.org/changeset/base/326583

Log:
  native-xtools: Ensure GCC files are cleaned up.
  
  Because we force enable MK_GCC when building we need to also force
  enable it for the cleaning phase.  Otherwise the NXB_TARGET files
  are found in the next build's kernel-toolchain phase and cause
  an error.
  
  Reported by:  sbruno
  X-MFC-With:   r325001
  MFC after:1 month
  Sponsored by: Dell EMC

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Dec  5 21:30:22 2017(r326582)
+++ head/Makefile.inc1  Tue Dec  5 21:36:08 2017(r326583)
@@ -2261,7 +2261,7 @@ NXBMAKE+= SUBDIR_OVERRIDE='$${NXBDIRS:M*}'
 # even if the TARGET being built for wants GCC.
 NXBMAKE+=  WANT_COMPILER_TYPE='$${X_COMPILER_TYPE}'
 native-xtools: .PHONY
-   ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _cleanobj
+   ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _cleanobj MK_GCC=yes
# Build the bootstrap/host/cross tools that produce native binaries
# Pass along MK_GCC=yes to ensure GCC-needed build tools are built.
# We don't quite know what the NXB_TARGET wants so just build it.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326584 - head/sys/geom/eli

2017-12-05 Thread Warner Losh
Author: imp
Date: Tue Dec  5 21:37:32 2017
New Revision: 326584
URL: https://svnweb.freebsd.org/changeset/base/326584

Log:
  When building standalone, include stand.h rather than the kernel
  includes or the userland includes.
  
  Sponsored by: Netflix

Modified:
  head/sys/geom/eli/g_eli_hmac.c

Modified: head/sys/geom/eli/g_eli_hmac.c
==
--- head/sys/geom/eli/g_eli_hmac.c  Tue Dec  5 21:36:08 2017
(r326583)
+++ head/sys/geom/eli/g_eli_hmac.c  Tue Dec  5 21:37:32 2017
(r326584)
@@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#elif defined(_STANDALONE)
+#include "stand.h"
 #else
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326586 - head/stand/geli

2017-12-05 Thread Warner Losh
Author: imp
Date: Tue Dec  5 21:37:45 2017
New Revision: 326586
URL: https://svnweb.freebsd.org/changeset/base/326586

Log:
  No need to include the userland md5.h, the kernel one is just fine.
  
  Sponsored by: Netflix

Modified:
  head/stand/geli/geliboot_internal.h

Modified: head/stand/geli/geliboot_internal.h
==
--- head/stand/geli/geliboot_internal.h Tue Dec  5 21:37:41 2017
(r326585)
+++ head/stand/geli/geliboot_internal.h Tue Dec  5 21:37:45 2017
(r326586)
@@ -43,7 +43,7 @@
 #include 
 
 /* Pull in the md5, sha256, and sha512 implementations */
-#include 
+#include 
 #include 
 #include 
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326585 - head/stand/ficl

2017-12-05 Thread Warner Losh
Author: imp
Date: Tue Dec  5 21:37:41 2017
New Revision: 326585
URL: https://svnweb.freebsd.org/changeset/base/326585

Log:
  Include ficl.h before anything else and avoid including anything at
  all if we're not building float.
  
  Sponsored by: Netflix

Modified:
  head/stand/ficl/float.c

Modified: head/stand/ficl/float.c
==
--- head/stand/ficl/float.c Tue Dec  5 21:37:32 2017(r326584)
+++ head/stand/ficl/float.c Tue Dec  5 21:37:41 2017(r326585)
@@ -43,14 +43,14 @@
 
 /* $FreeBSD$ */
 
+#include "ficl.h"
+
+#if FICL_WANT_FLOAT
 #include 
 #include 
 #include 
 #include 
 #include 
-#include "ficl.h"
-
-#if FICL_WANT_FLOAT
 
 /***
 ** Do float addition r1 + r2.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326587 - head/stand/libsa

2017-12-05 Thread Warner Losh
Author: imp
Date: Tue Dec  5 21:37:50 2017
New Revision: 326587
URL: https://svnweb.freebsd.org/changeset/base/326587

Log:
  Use the kernel relative paths, rather than the userland relative paths
  for the iso9660 header files.
  
  Sponsored by: Netflix

Modified:
  head/stand/libsa/cd9660.c

Modified: head/stand/libsa/cd9660.c
==
--- head/stand/libsa/cd9660.c   Tue Dec  5 21:37:45 2017(r326586)
+++ head/stand/libsa/cd9660.c   Tue Dec  5 21:37:50 2017(r326587)
@@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
+#include 
 
 #include "stand.h"
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326590 - in head/stand: common efi/loader

2017-12-05 Thread Warner Losh
Author: imp
Date: Tue Dec  5 21:38:04 2017
New Revision: 326590
URL: https://svnweb.freebsd.org/changeset/base/326590

Log:
  Prefer stdint.h to inttypes.h since the added prototypes form the
  latter aren't used. Prefer sys/link_elf.h to link.h so we're only
  dependent on the kernel tree. The default installation of link.h just
  includes this file, and any benefit from that is outweighed by the
  hassle it causes. This reduces the footprint of files needed from the
  system includes (or sysroot in buildworld).
  
  Sponsored by: Netflix

Modified:
  head/stand/common/load_elf.c
  head/stand/common/load_elf_obj.c
  head/stand/common/reloc_elf.c
  head/stand/efi/loader/main.c

Modified: head/stand/common/load_elf.c
==
--- head/stand/common/load_elf.cTue Dec  5 21:37:59 2017
(r326589)
+++ head/stand/common/load_elf.cTue Dec  5 21:38:04 2017
(r326590)
@@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #define FREEBSD_ELF
-#include 
+#include 
 
 #include "bootstrap.h"
 

Modified: head/stand/common/load_elf_obj.c
==
--- head/stand/common/load_elf_obj.cTue Dec  5 21:37:59 2017
(r326589)
+++ head/stand/common/load_elf_obj.cTue Dec  5 21:38:04 2017
(r326590)
@@ -33,12 +33,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
 #define FREEBSD_ELF
-#include 
+#include 
 
 #include "bootstrap.h"
 

Modified: head/stand/common/reloc_elf.c
==
--- head/stand/common/reloc_elf.c   Tue Dec  5 21:37:59 2017
(r326589)
+++ head/stand/common/reloc_elf.c   Tue Dec  5 21:38:04 2017
(r326590)
@@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #define FREEBSD_ELF
-#include 
+#include 
 
 #include "bootstrap.h"
 

Modified: head/stand/efi/loader/main.c
==
--- head/stand/efi/loader/main.cTue Dec  5 21:37:59 2017
(r326589)
+++ head/stand/efi/loader/main.cTue Dec  5 21:38:04 2017
(r326590)
@@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326588 - in head/stand/i386: gptzfsboot zfsboot

2017-12-05 Thread Warner Losh
Author: imp
Date: Tue Dec  5 21:37:55 2017
New Revision: 326588
URL: https://svnweb.freebsd.org/changeset/base/326588

Log:
  Need to include skein in the include path so we don't get this from
  the "system" headers (though in buildworld, it's from the recently
  built sysroot).
  
  Sponsored by: Netflix

Modified:
  head/stand/i386/gptzfsboot/Makefile
  head/stand/i386/zfsboot/Makefile

Modified: head/stand/i386/gptzfsboot/Makefile
==
--- head/stand/i386/gptzfsboot/Makefile Tue Dec  5 21:37:50 2017
(r326587)
+++ head/stand/i386/gptzfsboot/Makefile Tue Dec  5 21:37:55 2017
(r326588)
@@ -30,6 +30,7 @@ CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \
-I${LDRSRC} \
-I${BOOTSRC}/i386/common \
-I${ZFSSRC} \
+   -I${SYSDIR}/crypto/skein \
-I${SYSDIR}/cddl/boot/zfs \
-I${BOOTSRC}/i386/btx/lib \
-I${BOOTSRC}/i386/boot2 \

Modified: head/stand/i386/zfsboot/Makefile
==
--- head/stand/i386/zfsboot/MakefileTue Dec  5 21:37:50 2017
(r326587)
+++ head/stand/i386/zfsboot/MakefileTue Dec  5 21:37:55 2017
(r326588)
@@ -29,6 +29,7 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \
-I${BOOTSRC}/i386/common \
-I${BOOTSRC}/i386 \
-I${ZFSSRC} \
+   -I${SYSDIR}/crypto/skein \
-I${SYSDIR}/cddl/boot/zfs \
-I${BTXLIB} \
-I${BOOTSRC}/i386/boot2 \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326591 - head/contrib/compiler-rt/lib/builtins

2017-12-05 Thread Warner Losh
Author: imp
Date: Tue Dec  5 21:38:10 2017
New Revision: 326591
URL: https://svnweb.freebsd.org/changeset/base/326591

Log:
  This isn't NetBSD specific code. Include these for any kernel /
  standalone use. Tweak for FreeBSD's quirky limits.h stuff.
  
  Sponsored by: Netflix

Modified:
  head/contrib/compiler-rt/lib/builtins/int_lib.h

Modified: head/contrib/compiler-rt/lib/builtins/int_lib.h
==
--- head/contrib/compiler-rt/lib/builtins/int_lib.h Tue Dec  5 21:38:04 
2017(r326590)
+++ head/contrib/compiler-rt/lib/builtins/int_lib.h Tue Dec  5 21:38:10 
2017(r326591)
@@ -55,12 +55,12 @@
 #define UNUSED __attribute__((unused))
 #endif
 
-#if defined(__NetBSD__) && (defined(_KERNEL) || defined(_STANDALONE))
+#if (defined(_KERNEL) || defined(_STANDALONE))
 /*
  * Kernel and boot environment can't use normal headers,
  * so use the equivalent system headers.
  */
-#  include 
+#  include 
 #  include 
 #  include 
 #else
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326589 - head/stand/efi/boot1

2017-12-05 Thread Warner Losh
Author: imp
Date: Tue Dec  5 21:37:59 2017
New Revision: 326589
URL: https://svnweb.freebsd.org/changeset/base/326589

Log:
  Make sure we include the right path for skein.h, as well only include
  the ZFS flags for zfs_modules.c. This keeps us from pulling from the
  system or sysroot during buildworld.

Modified:
  head/stand/efi/boot1/Makefile

Modified: head/stand/efi/boot1/Makefile
==
--- head/stand/efi/boot1/Makefile   Tue Dec  5 21:37:55 2017
(r326588)
+++ head/stand/efi/boot1/Makefile   Tue Dec  5 21:37:59 2017
(r326589)
@@ -31,9 +31,10 @@ CWARNFLAGS.zfs_module.c += -Wno-unused-function
 SRCS=  boot1.c self_reloc.c start.S ufs_module.c
 .if ${MK_ZFS} != "no"
 SRCS+= zfs_module.c
-CFLAGS+=   -I${ZFSSRC}
-CFLAGS+=   -I${SYSDIR}/cddl/boot/zfs
-CFLAGS+=   -DEFI_ZFS_BOOT
+CFLAGS.zfs_module.c+=  -I${ZFSSRC}
+CFLAGS.zfs_module.c+=  -I${SYSDIR}/cddl/boot/zfs
+CFLAGS.zfs_module.c+=  -I${SYSDIR}/crypto/skein
+CFLAGS.zfs_module.c+=  -DEFI_ZFS_BOOT
 LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a
 .endif
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326594 - head/stand/libsa

2017-12-05 Thread Warner Losh
Author: imp
Date: Tue Dec  5 21:38:24 2017
New Revision: 326594
URL: https://svnweb.freebsd.org/changeset/base/326594

Log:
  Now that we offer a semi-sane standards-ish set of #include files in
  the stand environment that's safe to use (and insulated from whatever
  build env you might normally have), stop hacking the bzlib and zlib
  sources with sed. There's no longer any need.
  
  Sponsored by: Netflix

Modified:
  head/stand/libsa/Makefile

Modified: head/stand/libsa/Makefile
==
--- head/stand/libsa/Makefile   Tue Dec  5 21:38:19 2017(r326593)
+++ head/stand/libsa/Makefile   Tue Dec  5 21:38:24 2017(r326594)
@@ -86,50 +86,15 @@ SRCS+=  _setjmp.S
 # loader(8) with LOADER_BZIP2_SUPPORT defined
 .PATH: ${SRCTOP}/contrib/bzip2
 CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS
-SRCS+= libsa_bzlib_private.h
 
-.for file in bzlib.c crctable.c decompress.c huffman.c randtable.c
-SRCS+= _${file}
-CLEANFILES+=   _${file}
-CFLAGS._${file}+=-I${SRCTOP}/contrib/bzip2
+SRCS+=bzlib.c crctable.c decompress.c huffman.c randtable.c
 
-_${file}: ${file}
-   sed "s|bzlib_private\.h|libsa_bzlib_private.h|" \
-   ${.ALLSRC} > ${.TARGET}
-.endfor
-
-CLEANFILES+= libsa_bzlib_private.h
-libsa_bzlib_private.h: bzlib_private.h
-   sed -e 's||"stand.h"|' \
-   ${.ALLSRC} > ${.TARGET}
-
 # decompression functionality from zlib
 .PATH: ${SRCTOP}/contrib/zlib
 CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/contrib/zlib
-SRCS+= adler32.c crc32.c libsa_zutil.h libsa_gzguts.h
+SRCS+= adler32.c crc32.c
+SRCS+= infback.c inffast.c inflate.c inftrees.c zutil.c
 
-.for file in infback.c inffast.c inflate.c inftrees.c zutil.c
-SRCS+= _${file}
-CLEANFILES+=   _${file}
-
-_${file}: ${file}
-   sed -e "s|zutil\.h|libsa_zutil.h|" \
-   -e "s|gzguts\.h|libsa_gzguts.h|" \
-   ${.ALLSRC} > ${.TARGET}
-.endfor
-
-# depend on stand.h being able to be included multiple times
-.for file in zutil.h gzguts.h
-CLEANFILES+= libsa_${file}
-libsa_${file}: ${file}
-   sed -e 's||"stand.h"|' \
-   -e 's||"stand.h"|' \
-   -e 's||"stand.h"|' \
-   -e 's||"stand.h"|' \
-   -e 's||"stand.h"|' \
-   ${.ALLSRC} > ${.TARGET}
-.endfor
-
 # Create a subset of includes that are safe, as well as adjusting those that 
aren't
 # The lists may drive people nuts, but they are explicitly opt-in
 beforedepend:
@@ -146,7 +111,7 @@ beforedepend:
for i in _time.h _strings.h _string.h; do \
[ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
done; \
-   for i in ctype.h stdio.h stdlib.h; do \
+   for i in ctype.h fcntl.h stdio.h stdlib.h; do \
ln -sf ${SASRC}/stand.h $$i; \
done
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326592 - head/stand/userboot/test

2017-12-05 Thread Warner Losh
Author: imp
Date: Tue Dec  5 21:38:14 2017
New Revision: 326592
URL: https://svnweb.freebsd.org/changeset/base/326592

Log:
  Don't inherit CFLAGS. This a specialized test program, and can be
  built with mostly default flags. Do so in anticipation of the rest of
  stand not building with system headers.
  
  Sponsored by: Netflix

Modified:
  head/stand/userboot/test/Makefile

Modified: head/stand/userboot/test/Makefile
==
--- head/stand/userboot/test/Makefile   Tue Dec  5 21:38:10 2017
(r326591)
+++ head/stand/userboot/test/Makefile   Tue Dec  5 21:38:14 2017
(r326592)
@@ -9,6 +9,6 @@ MK_SSP= no
 PROG=  test
 INTERNALPROG=
 
-CFLAGS+=   -I${BOOTSRC}/userboot -U_STANDALONE
+CFLAGS=-I${BOOTSRC}/userboot
 
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326593 - in head/stand: . libsa

2017-12-05 Thread Warner Losh
Author: imp
Date: Tue Dec  5 21:38:19 2017
New Revision: 326593
URL: https://svnweb.freebsd.org/changeset/base/326593

Log:
  Stop building with the standard system headers.
  
  Building with the standard system headers isn't a perfect match to the
  stand environment. Instead, copy over the files we know are safe to
  use and constrain what else is used. We use -nostdinc to achieve this.
  
  This also fixes issues with building 32-bit libraries on amd64
  sometimes pulling in the wrong cpufunc.h giving an error now that we
  stop on errors. It will also enable an easier transition to lua boot.
  
  Sponsored by: Netflix

Modified:
  head/stand/defs.mk
  head/stand/libsa/Makefile

Modified: head/stand/defs.mk
==
--- head/stand/defs.mk  Tue Dec  5 21:38:14 2017(r326592)
+++ head/stand/defs.mk  Tue Dec  5 21:38:19 2017(r326593)
@@ -41,6 +41,12 @@ LIBSA32= ${BOOTOBJ}/libsa32/libsa32.a
 .endif
 
 # Standard options:
+CFLAGS+=   -nostdinc
+.if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1
+CFLAGS+=   -I${BOOTOBJ}/libsa32
+.else
+CFLAGS+=   -I${BOOTOBJ}/libsa
+.endif
 CFLAGS+=   -I${SASRC} -D_STANDALONE
 CFLAGS+=   -I${SYSDIR}
 

Modified: head/stand/libsa/Makefile
==
--- head/stand/libsa/Makefile   Tue Dec  5 21:38:14 2017(r326592)
+++ head/stand/libsa/Makefile   Tue Dec  5 21:38:19 2017(r326593)
@@ -91,6 +91,7 @@ SRCS+=libsa_bzlib_private.h
 .for file in bzlib.c crctable.c decompress.c huffman.c randtable.c
 SRCS+= _${file}
 CLEANFILES+=   _${file}
+CFLAGS._${file}+=-I${SRCTOP}/contrib/bzip2
 
 _${file}: ${file}
sed "s|bzlib_private\.h|libsa_bzlib_private.h|" \
@@ -129,6 +130,26 @@ libsa_${file}: ${file}
${.ALLSRC} > ${.TARGET}
 .endfor
 
+# Create a subset of includes that are safe, as well as adjusting those that 
aren't
+# The lists may drive people nuts, but they are explicitly opt-in
+beforedepend:
+   echo beforedepend; \
+   mkdir -p xlocale arpa; \
+   for i in a.out.h assert.h elf.h limits.h nlist.h setjmp.h stddef.h 
stdbool.h string.h strings.h time.h unistd.h uuid.h; do \
+   ln -sf ${SRCTOP}/include/$$i $$i; \
+   done; \
+   ln -sf ${SYSDIR}/${MACHINE}/include/stdarg.h stdarg.h; \
+   ln -sf ${SYSDIR}/sys/errno.h errno.h; \
+   ln -sf ${SYSDIR}/sys/stdint.h stdint.h; \
+   ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
+   ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
+   for i in _time.h _strings.h _string.h; do \
+   [ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
+   done; \
+   for i in ctype.h stdio.h stdlib.h; do \
+   ln -sf ${SASRC}/stand.h $$i; \
+   done
+
 # io routines
 SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
fstat.c close.c lseek.c open.c read.c write.c readdir.c
@@ -147,6 +168,8 @@ SRCS+=  pkgfs.c
 .if ${MK_NAND} != "no"
 SRCS+= nandfs.c
 .endif
+
+CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2
 
 # explicit_bzero
 .PATH: ${SYSDIR}/libkern
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326595 - head/sys/arm/allwinner

2017-12-05 Thread Kyle Evans
Author: kevans
Date: Tue Dec  5 21:40:52 2017
New Revision: 326595
URL: https://svnweb.freebsd.org/changeset/base/326595

Log:
  a10_gpio: Don't do read/set dance if pin is already configured for output
  
  This fixes some regulator issues with a83t/BananaPi-M3; the pin value was
  getting clobbered as we reconfigured the pin when initializing the
  regulator.
  
  Discussed with:   ian

Modified:
  head/sys/arm/allwinner/a10_gpio.c

Modified: head/sys/arm/allwinner/a10_gpio.c
==
--- head/sys/arm/allwinner/a10_gpio.c   Tue Dec  5 21:38:24 2017
(r326594)
+++ head/sys/arm/allwinner/a10_gpio.c   Tue Dec  5 21:40:52 2017
(r326595)
@@ -353,7 +353,8 @@ a10_gpio_pin_configure(struct a10_gpio_softc *sc, uint
/* Manage input/output. */
if (flags & GPIO_PIN_INPUT) {
err = a10_gpio_set_function(sc, pin, A10_GPIO_INPUT);
-   } else if (flags & GPIO_PIN_OUTPUT) {
+   } else if ((flags & GPIO_PIN_OUTPUT) &&
+   a10_gpio_get_function(sc, pin) != A10_GPIO_OUTPUT) {
if (flags & GPIO_PIN_PRESET_LOW) {
a10_gpio_pin_set_locked(sc, pin, 0);
} else if (flags & GPIO_PIN_PRESET_HIGH) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326596 - head

2017-12-05 Thread Ed Maste
Author: emaste
Date: Tue Dec  5 21:42:09 2017
New Revision: 326596
URL: https://svnweb.freebsd.org/changeset/base/326596

Log:
  Makefile.inc1: map mips MACHINE_/TARGET_ARCH to triples
  
  This helps Clang MIPS builds.
  
  Reviewed by:  bdrewery, jhb (earlier version)
  Differential Revision:https://reviews.freebsd.org/D12171

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Dec  5 21:40:52 2017(r326595)
+++ head/Makefile.inc1  Tue Dec  5 21:42:09 2017(r326596)
@@ -641,9 +641,9 @@ XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -s
 .elif ${WANT_COMPILER_TYPE} == clang || \
 (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang)
 MACHINE_ABI?=  unknown
-MACHINE_TRIPLE?=${MACHINE_ARCH:C/amd64/x86_64/}-${MACHINE_ABI}-freebsd12.0
+MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${MACHINE_ABI}-freebsd12.0
 TARGET_ABI?=   unknown
-TARGET_TRIPLE?=${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd12.0
+TARGET_TRIPLE?=
${TARGET_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${TARGET_ABI}-freebsd12.0
 XCFLAGS+=  -target ${TARGET_TRIPLE}
 .endif
 XCFLAGS+=  --sysroot=${WORLDTMP}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326597 - head/sys/dev/vnic

2017-12-05 Thread Ed Maste
Author: emaste
Date: Tue Dec  5 22:02:46 2017
New Revision: 326597
URL: https://svnweb.freebsd.org/changeset/base/326597

Log:
  vnic: apply hardware L3 checksum only for IPv4
  
  Previously we set the csum_l3 flag for IPv4 and IPv6, but only IPv4
  should have header checksumming applied.
  
  Prompted by Linux commit fa6d7cb5d76cf0467c61420fc9238045aedfd379.
  
  Reviewed by:  bz
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D13366

Modified:
  head/sys/dev/vnic/nicvf_queues.c

Modified: head/sys/dev/vnic/nicvf_queues.c
==
--- head/sys/dev/vnic/nicvf_queues.cTue Dec  5 21:42:09 2017
(r326596)
+++ head/sys/dev/vnic/nicvf_queues.cTue Dec  5 22:02:46 2017
(r326597)
@@ -1802,6 +1802,8 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qen
if (mbuf == NULL)
return (ENOBUFS);
}
+   if (mbuf->m_pkthdr.csum_flags & CSUM_IP)
+   hdr->csum_l3 = 1; /* Enable IP csum calculation */
 
ip = (struct ip *)(mbuf->m_data + ehdrlen);
iphlen = ip->ip_hl << 2;
@@ -1809,13 +1811,10 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qen
proto = ip->ip_p;
break;
 #endif
-   default:
-   hdr->csum_l3 = 0;
}
 
 #if defined(INET6) || defined(INET)
if (poff > 0 && mbuf->m_pkthdr.csum_flags != 0) {
-   hdr->csum_l3 = 1; /* Enable IP csum calculation */
switch (proto) {
case IPPROTO_TCP:
if ((mbuf->m_pkthdr.csum_flags & CSUM_TCP) == 0)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326598 - head/sys/modules/dtb/allwinner

2017-12-05 Thread Kyle Evans
Author: kevans
Date: Tue Dec  5 22:05:10 2017
New Revision: 326598
URL: https://svnweb.freebsd.org/changeset/base/326598

Log:
  dtb/allwinner: Restore a83t/BananaPi-M3 DTS after r342822
  
  sinovoip-bpi-m3.dts was disconnected from the build in r324822. Since then,
  a CCU driver has been added and several other changes have been made to
  make us compatible with upstream DTS for this board.
  
  Add links for older DTB that might be used: our u-boot port was expecting
  sinovoip-bpi-m3.dtb up until ports r455629, and our u-boot will not be
  switching to the upstream name (sun8i-a83t-bananapi-m3) quite yet.
  
  Discussed with:   manu

Modified:
  head/sys/modules/dtb/allwinner/Makefile

Modified: head/sys/modules/dtb/allwinner/Makefile
==
--- head/sys/modules/dtb/allwinner/Makefile Tue Dec  5 22:02:46 2017
(r326597)
+++ head/sys/modules/dtb/allwinner/Makefile Tue Dec  5 22:05:10 2017
(r326598)
@@ -10,6 +10,7 @@ DTS=  \
sun7i-a20-cubieboard2.dts \
sun7i-a20-olimex-som-evb.dts \
sun7i-a20-pcduino3.dts \
+   sun8i-a83t-bananapi-m3.dts \
sun8i-h2-plus-orangepi-zero.dts \
sun8i-h3-nanopi-m1.dts \
sun8i-h3-nanopi-neo.dts \
@@ -24,5 +25,7 @@ LINKS= \
${DTBDIR}/sun7i-a20-cubieboard2.dtb ${DTBDIR}/cubieboard2.dtb \
${DTBDIR}/sun7i-a20-olimex-som-evb.dtb ${DTBDIR}/olimex-a20-som-evb.dtb 
\
${DTBDIR}/sun7i-a20-pcduino3.dtb ${DTBDIR}/pcduino3.dtb \
+   ${DTBDIR}/sun8i-a83t-bananapi-m3.dtb ${DTBDIR}/sinovoip-bpi-m3.dtb \
+   ${DTBDIR}/sun8i-a83t-bananapi-m3.dtb 
${DTBDIR}/sun8i-a83t-sinovoip-bpi-m3.dtb
 
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326599 - head/sys/dev/vt

2017-12-05 Thread Ed Maste
Author: emaste
Date: Tue Dec  5 22:19:59 2017
New Revision: 326599
URL: https://svnweb.freebsd.org/changeset/base/326599

Log:
  Implement "vidcontrol -h " for vt(4)
  
  PR:   210415
  Submitted by: Siva Mahadevan
  Reviewed by:  ray (earlier)
  MFC after:1 month
  Relnotes: yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D11814

Modified:
  head/sys/dev/vt/vt.h
  head/sys/dev/vt/vt_buf.c
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt.h
==
--- head/sys/dev/vt/vt.hTue Dec  5 22:05:10 2017(r326598)
+++ head/sys/dev/vt/vt.hTue Dec  5 22:19:59 2017(r326599)
@@ -196,8 +196,8 @@ struct vt_buf {
 #defineVBF_SCROLL  0x8 /* scroll locked mode. */
 #defineVBF_HISTORY_FULL 0x10   /* All rows filled. */
unsigned int vb_history_size;
-   int  vb_roffset;/* (b) History rows offset. */
-   int  vb_curroffset; /* (b) Saved rows offset. */
+   unsigned int vb_roffset;/* (b) History rows offset. */
+   unsigned int vb_curroffset; /* (b) Saved rows offset. */
term_pos_t   vb_cursor; /* (u) Cursor position. */
term_pos_t   vb_mark_start; /* (b) Copy region start. */
term_pos_t   vb_mark_end;   /* (b) Copy region end. */
@@ -223,7 +223,7 @@ void vtbuf_cursor_position(struct vt_buf *, const term
 void vtbuf_scroll_mode(struct vt_buf *vb, int yes);
 void vtbuf_dirty(struct vt_buf *vb, const term_rect_t *area);
 void vtbuf_undirty(struct vt_buf *, term_rect_t *);
-void vtbuf_sethistory_size(struct vt_buf *, int);
+void vtbuf_sethistory_size(struct vt_buf *, unsigned int);
 int vtbuf_iscursor(const struct vt_buf *vb, int row, int col);
 void vtbuf_cursor_visibility(struct vt_buf *, int);
 #ifndef SC_NO_CUTPASTE

Modified: head/sys/dev/vt/vt_buf.c
==
--- head/sys/dev/vt/vt_buf.cTue Dec  5 22:05:10 2017(r326598)
+++ head/sys/dev/vt/vt_buf.cTue Dec  5 22:19:59 2017(r326599)
@@ -134,11 +134,10 @@ vthistory_addlines(struct vt_buf *vb, int offset)
 #endif
 
vb->vb_curroffset += offset;
-   if (vb->vb_curroffset < 0)
-   vb->vb_curroffset = 0;
-   if (vb->vb_curroffset + vb->vb_scr_size.tp_row >= vb->vb_history_size)
+   if (vb->vb_curroffset + vb->vb_scr_size.tp_row >= vb->vb_history_size) {
vb->vb_flags |= VBF_HISTORY_FULL;
-   vb->vb_curroffset %= vb->vb_history_size;
+   vb->vb_curroffset %= vb->vb_history_size;
+   }
if ((vb->vb_flags & VBF_SCROLL) == 0) {
vb->vb_roffset = vb->vb_curroffset;
}
@@ -460,7 +459,7 @@ vtbuf_init(struct vt_buf *vb, const term_pos_t *p)
 }
 
 void
-vtbuf_sethistory_size(struct vt_buf *vb, int size)
+vtbuf_sethistory_size(struct vt_buf *vb, unsigned int size)
 {
term_pos_t p;
 
@@ -474,9 +473,9 @@ void
 vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, unsigned int history_size)
 {
term_char_t *old, *new, **rows, **oldrows, **copyrows, *row, *oldrow;
-   int bufsize, rowssize, w, h, c, r, history_was_full;
-   unsigned int old_history_size;
-   term_rect_t rect;
+   unsigned int w, h, c, r, old_history_size;
+   size_t bufsize, rowssize;
+   int history_full;
 
history_size = MAX(history_size, p->tp_row);
 
@@ -495,7 +494,8 @@ vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, uns
w = vb->vb_scr_size.tp_col;
h = vb->vb_scr_size.tp_row;
old_history_size = vb->vb_history_size;
-   history_was_full = vb->vb_flags & VBF_HISTORY_FULL;
+   history_full = vb->vb_flags & VBF_HISTORY_FULL ||
+   vb->vb_curroffset + h >= history_size;
 
vb->vb_history_size = history_size;
vb->vb_buffer = new;
@@ -504,20 +504,16 @@ vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, uns
vb->vb_scr_size = *p;
vtbuf_init_rows(vb);
 
-   /* Copy history and fill extra space if needed. */
+   /*
+* Copy rows to the new buffer. The first row in the history
+* is back to index 0, ie. the new buffer doesn't cycle.
+*/
if (history_size > old_history_size) {
-   /*
-* Copy rows to the new buffer. The first row in the history
-* is back to index 0, ie. the new buffer doesn't cycle.
-*
-* The rest of the new buffer is initialized with blank
-* content.
-*/
for (r = 0; r < old_history_size; r ++) {
row = rows[r];
 
/* Compute the corresponding row in the old buffer. */
-   if (history_was_full)
+   if (his

svn commit: r326600 - head/contrib/compiler-rt/lib/builtins

2017-12-05 Thread Warner Losh
Author: imp
Date: Tue Dec  5 22:24:20 2017
New Revision: 326600
URL: https://svnweb.freebsd.org/changeset/base/326600

Log:
  Since this is contrib code, create an upstreamable version of my
  change. Now on FreeBSD and NetBSD if _STANDALONE is defined, we
  include the kernel version with alloances for the quirky differences
  between the two.
  
  Sponsored by: Netflix

Modified:
  head/contrib/compiler-rt/lib/builtins/int_lib.h

Modified: head/contrib/compiler-rt/lib/builtins/int_lib.h
==
--- head/contrib/compiler-rt/lib/builtins/int_lib.h Tue Dec  5 22:19:59 
2017(r326599)
+++ head/contrib/compiler-rt/lib/builtins/int_lib.h Tue Dec  5 22:24:20 
2017(r326600)
@@ -55,12 +55,16 @@
 #define UNUSED __attribute__((unused))
 #endif
 
-#if (defined(_KERNEL) || defined(_STANDALONE))
+#if (defined(__FreeBSD__) || defined(__NetBSD__)) && (defined(_KERNEL) || 
defined(_STANDALONE))
 /*
  * Kernel and boot environment can't use normal headers,
  * so use the equivalent system headers.
  */
+#ifdef __FreeBSD__
 #  include 
+#else
+#  include 
+#endif
 #  include 
 #  include 
 #else
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326601 - head/contrib/mdocml

2017-12-05 Thread Jilles Tjoelker
Author: jilles
Date: Tue Dec  5 23:00:41 2017
New Revision: 326601
URL: https://svnweb.freebsd.org/changeset/base/326601

Log:
  mdocml: Add IEEE Std 1003.1-2008, 2016 edition
  
  Also document IEEE Std 1003.1-2008, 2013 edition in mdoc(7) (as well as the
  2016 edition).
  
  Submitted by: Yuri Pankov
  Reviewed by:  bjk
  Differential Revision:https://reviews.freebsd.org/D13349

Modified:
  head/contrib/mdocml/mdoc.7
  head/contrib/mdocml/st.in

Modified: head/contrib/mdocml/mdoc.7
==
--- head/contrib/mdocml/mdoc.7  Tue Dec  5 22:24:20 2017(r326600)
+++ head/contrib/mdocml/mdoc.7  Tue Dec  5 23:00:41 2017(r326601)
@@ -2575,6 +2575,17 @@ The second and last Technical Corrigendum.
 .br
 This standard is also called
 X/Open Portability Guide version 7.
+.Pp
+.It \-p1003.1-2013
+.St -p1003.1-2013
+.br
+The 2013 edition incorporates Technical Corrigendum 1.
+.Pp
+.It \-p1003.1-2016
+.St -p1003.1-2016
+.br
+The 2016 edition incorporates Technical Corrigendum 1 and
+Technical Corrigendum 2.
 .El
 .It Other standards
 .Pp

Modified: head/contrib/mdocml/st.in
==
--- head/contrib/mdocml/st.in   Tue Dec  5 22:24:20 2017(r326600)
+++ head/contrib/mdocml/st.in   Tue Dec  5 23:00:41 2017(r326601)
@@ -35,6 +35,7 @@ LINE("-p1003.1-2001", "IEEE Std 1003.1-2001 (\\(LqPOSI
 LINE("-p1003.1-2004",  "IEEE Std 1003.1-2004 (\\(LqPOSIX.1\\(Rq)")
 LINE("-p1003.1-2008",  "IEEE Std 1003.1-2008 (\\(LqPOSIX.1\\(Rq)")
 LINE("-p1003.1-2013",  "IEEE Std 1003.1-2008, 2013 Edition 
(\\(LqPOSIX.1\\(Rq)")
+LINE("-p1003.1-2016",  "IEEE Std 1003.1-2008, 2016 Edition 
(\\(LqPOSIX.1\\(Rq)")
 LINE("-p1003.1",   "IEEE Std 1003.1 (\\(LqPOSIX.1\\(Rq)")
 LINE("-p1003.1b",  "IEEE Std 1003.1b (\\(LqPOSIX.1b\\(Rq)")
 LINE("-p1003.1b-93",   "IEEE Std 1003.1b-1993 (\\(LqPOSIX.1b\\(Rq)")
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326602 - head/sys/cam/scsi

2017-12-05 Thread Warner Losh
Author: imp
Date: Tue Dec  5 23:02:31 2017
New Revision: 326602
URL: https://svnweb.freebsd.org/changeset/base/326602

Log:
  Remove stray cam_periph_async call. It's called twice this way. While
  currently harmless for AC_UNIT_ATTENTION event (cam_periph_async does
  nothing with them), it's still in error because if it were to start in
  the future, it would be done twice.
  
  Sponsored by: Netflix

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Tue Dec  5 23:00:41 2017(r326601)
+++ head/sys/cam/scsi/scsi_da.c Tue Dec  5 23:02:31 2017(r326602)
@@ -1919,7 +1919,6 @@ daasync(void *callback_arg, u_int32_t code,
dareprobe(periph);
}
}
-   cam_periph_async(periph, code, path, arg);
break;
}
case AC_SCSI_AEN:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326603 - head/contrib/mdocml

2017-12-05 Thread Jilles Tjoelker
Author: jilles
Date: Tue Dec  5 23:06:15 2017
New Revision: 326603
URL: https://svnweb.freebsd.org/changeset/base/326603

Log:
  mdoc(7): Update .Dd for previous commit

Modified:
  head/contrib/mdocml/mdoc.7

Modified: head/contrib/mdocml/mdoc.7
==
--- head/contrib/mdocml/mdoc.7  Tue Dec  5 23:02:31 2017(r326602)
+++ head/contrib/mdocml/mdoc.7  Tue Dec  5 23:06:15 2017(r326603)
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd $Mdocdate: July 20 2017 $
+.Dd $Mdocdate: December 5 2017 $
 .Dt MDOC 7
 .Os
 .Sh NAME
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326606 - in head/sys/cam: . ata mmc nvme scsi

2017-12-05 Thread Warner Losh
Author: imp
Date: Wed Dec  6 00:29:50 2017
New Revision: 326606
URL: https://svnweb.freebsd.org/changeset/base/326606

Log:
  Remove unused 4th argument to match the standard error routines.
  
  Sponsored by: Netflix
  Differential Revision: https://reviews.freebsd.org/D13386

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/ata/ata_pmp.c
  head/sys/cam/ata/ata_xpt.c
  head/sys/cam/cam_periph.c
  head/sys/cam/cam_periph.h
  head/sys/cam/mmc/mmc_da.c
  head/sys/cam/nvme/nvme_da.c
  head/sys/cam/scsi/scsi_cd.c
  head/sys/cam/scsi/scsi_ch.c
  head/sys/cam/scsi/scsi_da.c
  head/sys/cam/scsi/scsi_enc.c
  head/sys/cam/scsi/scsi_pass.c
  head/sys/cam/scsi/scsi_pt.c
  head/sys/cam/scsi/scsi_sa.c
  head/sys/cam/scsi/scsi_sg.c
  head/sys/cam/scsi/scsi_xpt.c

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Wed Dec  6 00:29:43 2017(r326605)
+++ head/sys/cam/ata/ata_da.c   Wed Dec  6 00:29:50 2017(r326606)
@@ -3354,7 +3354,7 @@ adaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_
}
 #endif
 
-   return(cam_periph_error(ccb, cam_flags, sense_flags, NULL));
+   return(cam_periph_error(ccb, cam_flags, sense_flags));
 }
 
 static void

Modified: head/sys/cam/ata/ata_pmp.c
==
--- head/sys/cam/ata/ata_pmp.c  Wed Dec  6 00:29:43 2017(r326605)
+++ head/sys/cam/ata/ata_pmp.c  Wed Dec  6 00:29:50 2017(r326606)
@@ -597,7 +597,7 @@ pmpdone(struct cam_periph *periph, union ccb *done_ccb
priority = done_ccb->ccb_h.pinfo.priority;
 
if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
-   if (cam_periph_error(done_ccb, 0, 0, NULL) == ERESTART) {
+   if (cam_periph_error(done_ccb, 0, 0) == ERESTART) {
return;
} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
cam_release_devq(done_ccb->ccb_h.path,

Modified: head/sys/cam/ata/ata_xpt.c
==
--- head/sys/cam/ata/ata_xpt.c  Wed Dec  6 00:29:43 2017(r326605)
+++ head/sys/cam/ata/ata_xpt.c  Wed Dec  6 00:29:50 2017(r326606)
@@ -763,8 +763,8 @@ probedone(struct cam_periph *periph, union ccb *done_c
 
if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
if (cam_periph_error(done_ccb,
-   0, softc->restart ? (SF_NO_RECOVERY | SF_NO_RETRY) : 0,
-   NULL) == ERESTART) {
+   0, softc->restart ? (SF_NO_RECOVERY | SF_NO_RETRY) : 0
+   ) == ERESTART) {
 out:
/* Drop freeze taken due to CAM_DEV_QFREEZE flag set. */
cam_release_devq(path, 0, 0, 0, FALSE);

Modified: head/sys/cam/cam_periph.c
==
--- head/sys/cam/cam_periph.c   Wed Dec  6 00:29:43 2017(r326605)
+++ head/sys/cam/cam_periph.c   Wed Dec  6 00:29:50 2017(r326606)
@@ -1302,7 +1302,7 @@ camperiphdone(struct cam_periph *periph, union ccb *do
}
}
if (cam_periph_error(done_ccb,
-   0, SF_RETRY_UA | SF_NO_PRINT, NULL) == ERESTART)
+   0, SF_RETRY_UA | SF_NO_PRINT) == ERESTART)
goto out;
if (done_ccb->ccb_h.status & CAM_DEV_QFRZN) {
cam_release_devq(done_ccb->ccb_h.path, 0, 0, 0, 0);
@@ -1716,7 +1716,7 @@ sense_error_done:
  */
 int
 cam_periph_error(union ccb *ccb, cam_flags camflags,
-u_int32_t sense_flags, union ccb *save_ccb)
+u_int32_t sense_flags)
 {
struct cam_path *newpath;
union ccb  *orig_ccb, *scan_ccb;

Modified: head/sys/cam/cam_periph.h
==
--- head/sys/cam/cam_periph.h   Wed Dec  6 00:29:43 2017(r326605)
+++ head/sys/cam/cam_periph.h   Wed Dec  6 00:29:50 2017(r326606)
@@ -197,7 +197,7 @@ voidcam_periph_freeze_after_event(struct 
cam_periph 
  struct timeval* event_time,
  u_int duration_ms);
 intcam_periph_error(union ccb *ccb, cam_flags camflags,
-u_int32_t sense_flags, union ccb *save_ccb);
+u_int32_t sense_flags);
 
 static __inline struct mtx *
 cam_periph_mtx(struct cam_periph *periph)

Modified: head/sys/cam/mmc/mmc_da.c
==
--- head/sys/cam/mmc/mmc_da.c   Wed Dec  6 00:29:43 2017(r326605)
+++ head/sys/cam/mmc/mmc_da.c   Wed Dec  6 00:29:50 2017(r326606)
@@ -1425,6 +1425,6 @@ sddadone(struct cam_pe

svn commit: r326605 - head/sys/cam

2017-12-05 Thread Warner Losh
Author: imp
Date: Wed Dec  6 00:29:43 2017
New Revision: 326605
URL: https://svnweb.freebsd.org/changeset/base/326605

Log:
  Add NVME as a known device type for devstat processing.
  
  Also, reduce the amount of cut and pasted code a little since only two
  args are different in the devstat_end_transaction calls.
  
  Sponsored by: Netflix

Modified:
  head/sys/cam/cam_periph.c

Modified: head/sys/cam/cam_periph.c
==
--- head/sys/cam/cam_periph.c   Wed Dec  6 00:00:37 2017(r326604)
+++ head/sys/cam/cam_periph.c   Wed Dec  6 00:29:43 2017(r326605)
@@ -1171,8 +1171,10 @@ cam_periph_runccb(union ccb *ccb,
 * If the user has supplied a stats structure, and if we understand
 * this particular type of ccb, record the transaction start.
 */
-   if ((ds != NULL) && (ccb->ccb_h.func_code == XPT_SCSI_IO ||
-   ccb->ccb_h.func_code == XPT_ATA_IO)) {
+   if (ds != NULL &&
+   (ccb->ccb_h.func_code == XPT_SCSI_IO ||
+   ccb->ccb_h.func_code == XPT_ATA_IO ||
+   ccb->ccb_h.func_code == XPT_NVME_IO)) {
starttime = ccb_h.func_code == XPT_SCSI_IO) {
-   devstat_end_transaction(ds,
-   ccb->csio.dxfer_len - ccb->csio.resid,
-   ccb->csio.tag_action & 0x3,
-   ((ccb->ccb_h.flags & CAM_DIR_MASK) ==
-   CAM_DIR_NONE) ?  DEVSTAT_NO_DATA : 
-   (ccb->ccb_h.flags & CAM_DIR_OUT) ?
-   DEVSTAT_WRITE : 
-   DEVSTAT_READ, NULL, starttime);
+   bytes = ccb->csio.dxfer_len - ccb->csio.resid;
+   tag = (devstat_tag_type)(ccb->csio.tag_action & 0x3);
} else if (ccb->ccb_h.func_code == XPT_ATA_IO) {
-   devstat_end_transaction(ds,
-   ccb->ataio.dxfer_len - ccb->ataio.resid,
-   0, /* Not used in ATA */
-   ((ccb->ccb_h.flags & CAM_DIR_MASK) ==
-   CAM_DIR_NONE) ?  DEVSTAT_NO_DATA : 
-   (ccb->ccb_h.flags & CAM_DIR_OUT) ?
-   DEVSTAT_WRITE : 
-   DEVSTAT_READ, NULL, starttime);
+   bytes = ccb->ataio.dxfer_len - ccb->ataio.resid;
+   tag = (devstat_tag_type)0;
+   } else if (ccb->ccb_h.func_code == XPT_NVME_IO) {
+   bytes = ccb->nvmeio.dxfer_len; /* NB: resid no possible 
*/
+   tag = (devstat_tag_type)0;
+   } else {
+   valid = false;
}
+   if (valid)
+   devstat_end_transaction(ds, bytes, tag,
+   ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) 
?
+   DEVSTAT_NO_DATA : (ccb->ccb_h.flags & CAM_DIR_OUT) ?
+   DEVSTAT_WRITE : DEVSTAT_READ, NULL, starttime);
}
 
return(error);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326607 - head/sys/fs/tmpfs

2017-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Wed Dec  6 00:42:08 2017
New Revision: 326607
URL: https://svnweb.freebsd.org/changeset/base/326607

Log:
  Reduce pollution via tmpfs.h.

Modified:
  head/sys/fs/tmpfs/tmpfs.h
  head/sys/fs/tmpfs/tmpfs_subr.c
  head/sys/fs/tmpfs/tmpfs_vfsops.c
  head/sys/fs/tmpfs/tmpfs_vnops.c

Modified: head/sys/fs/tmpfs/tmpfs.h
==
--- head/sys/fs/tmpfs/tmpfs.h   Wed Dec  6 00:29:50 2017(r326606)
+++ head/sys/fs/tmpfs/tmpfs.h   Wed Dec  6 00:42:08 2017(r326607)
@@ -37,22 +37,13 @@
 #ifndef _FS_TMPFS_TMPFS_H_
 #define _FS_TMPFS_TMPFS_H_
 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
 #include 
-#include 
-#include 
 
+#ifdef _SYS_MALLOC_H_
 MALLOC_DECLARE(M_TMPFSMNT);
 MALLOC_DECLARE(M_TMPFSNAME);
+#endif
 
 /*
  * Internal representation of a tmpfs directory entry.

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==
--- head/sys/fs/tmpfs/tmpfs_subr.c  Wed Dec  6 00:29:50 2017
(r326606)
+++ head/sys/fs/tmpfs/tmpfs_subr.c  Wed Dec  6 00:42:08 2017
(r326607)
@@ -39,8 +39,11 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -59,6 +62,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 

Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c
==
--- head/sys/fs/tmpfs/tmpfs_vfsops.cWed Dec  6 00:29:50 2017
(r326606)
+++ head/sys/fs/tmpfs/tmpfs_vfsops.cWed Dec  6 00:42:08 2017
(r326607)
@@ -46,8 +46,10 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -56,6 +58,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 

Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
==
--- head/sys/fs/tmpfs/tmpfs_vnops.c Wed Dec  6 00:29:50 2017
(r326606)
+++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Dec  6 00:42:08 2017
(r326607)
@@ -39,9 +39,11 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326608 - head/sys/fs/tmpfs

2017-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Wed Dec  6 00:44:49 2017
New Revision: 326608
URL: https://svnweb.freebsd.org/changeset/base/326608

Log:
  Fix file missed in r326607.

Modified:
  head/sys/fs/tmpfs/tmpfs_fifoops.c

Modified: head/sys/fs/tmpfs/tmpfs_fifoops.c
==
--- head/sys/fs/tmpfs/tmpfs_fifoops.c   Wed Dec  6 00:42:08 2017
(r326607)
+++ head/sys/fs/tmpfs/tmpfs_fifoops.c   Wed Dec  6 00:44:49 2017
(r326608)
@@ -39,6 +39,7 @@
  __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/spongeusr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Pedro Giffuni
Hello;

> On Dec 5, 2017, at 12:17, Cy Schubert  wrote:
> 
> What side effects? Can you give one or two examples, please?
> 

Sorry, I forgot the details .. but I am pretty sure there was exp-run and 
breakage in the ports tree.

Pedro.

> ---
> Sent using a tiny phone keyboard.
> Apologies for any typos and autocorrect.
> This old phone only supports top post. Apologies.
> 
> Cy Schubert
>  or 
> The need of the many outweighs the greed of the few.
> ---
> From: Pedro Giffuni
> Sent: 05/12/2017 08:40
> To: Cy Schubert; Devin Teske; Hans Petter Selasky
> Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers; 
> svn-src-...@freebsd.org; svn-src-head@freebsd.org
> Subject: Re: svn commit: r326554 - in head: . 
> usr.bin/spongeusr.bin/sponge/tests usr.bin/tee
> 
> 
> On 05/12/2017 11:29, Cy Schubert wrote:
>> Why not update sed to create the backup file only if the suffix is given to 
>> -i, like gnu sed does.
>> 
> 
> No, no .. there have been several failed attempts at that that cause nasty 
> side effects.
> It is also a rather non-standardish thing to do.
> 
> Pedro.
> 
>> ---
>> Sent using a tiny phone keyboard.
>> Apologies for any typos and autocorrect.
>> This old phone only supports top post. Apologies.
>> 
>> Cy Schubert
>>   or 
>>  
>> The need of the many outweighs the greed of the few.
>> ---
>> From: Devin Teske
>> Sent: 05/12/2017 07:35
>> To: Hans Petter Selasky
>> Cc: rgri...@freebsd.org ; c...@freebsd.org 
>> ; Eitan Adler; src-committers; 
>> svn-src-...@freebsd.org ; 
>> svn-src-head@freebsd.org 
>> Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge 
>> usr.bin/sponge/tests usr.bin/tee
>> 
>> 
>> > On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  
>> >  wrote:
>> > 
>> >> On 12/05/17 13:58, Rodney W. Grimes wrote:
>> >> Further more, why does freebsd need this in base?
>> > 
>> > Hi,
>> > 
>> > I think this is useful. It could replace the "-i " (intermediate) option 
>> > for "sed" for example. It avoids creating temporary files when filtering 
>> > files, right?
>> > 
>> > --HPS
>> > 
>> 
>> Wth is wrong with:
>> 
>> data=$( sed -e '...' somefile ) &&
>> ������� echo "$data" > somefile
>> 
>> or
>> 
>> set -e
>> data=...
>> echo "$data" > ...
>> 
>> or
>> 
>> exec 3<> $( ... )
>> EOF
>> cat > ... <&3
>> 
>> or
>> 
>> (I digress)
>> 
>> Infinite variations, but the gist is that sponge looks to be trying to help 
>> sh(1)/similar when help is unneeded.
>> 
>> Why buffer data into memory via fork-exec-pipe to sponge when you can buffer 
>> to native namespace without pipe to sponge?
>> 
>> Am I missing something? Why do we need sponge(1)?
>> -- 
>> Devin
>> 
> 

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r316980 - head/contrib/zstd/programs

2017-12-05 Thread Conrad Meyer
Ping.  Please revert this change.  If you want zstd to behave this
way, pursue it upstream first.

Thanks,
Conrad

On Wed, Nov 15, 2017 at 7:38 PM, Conrad Meyer  wrote:
> Please revert this change.
>
> First, it introduces the POLA-violating behavior that zstdcat deletes
> its source files.  This is not how zcat/bzcat behaves.
>
> Second, it introduces a needless behavioral difference between FreeBSD
> zstd and the rest of the world's zstd.  The zstd documentation we ship
> continues to claim that zstd preserves source files by default, yet
> this change makes that documentation exactly backwards.  While we can
> change FreeBSD's documentation to accommodate the change, we can't
> change Google results.
>
> Thanks,
> Conrad
>
> On Sat, Apr 15, 2017 at 1:15 PM, Baptiste Daroussin  wrote:
>> Author: bapt
>> Date: Sat Apr 15 20:15:44 2017
>> New Revision: 316980
>> URL: https://svnweb.freebsd.org/changeset/base/316980
>>
>> Log:
>>   Change some default to make zstd a dropin replacement for gzip,bzip etc
>>   in most cases
>>
>>   Changes ares:
>>   - quiet by default
>>   - remove the source files one compression completion by default
>>
>> Modified:
>>   head/contrib/zstd/programs/fileio.c
>>   head/contrib/zstd/programs/zstdcli.c
>>
>> Modified: head/contrib/zstd/programs/fileio.c
>> ==
>> --- head/contrib/zstd/programs/fileio.c Sat Apr 15 20:06:24 2017
>> (r316979)
>> +++ head/contrib/zstd/programs/fileio.c Sat Apr 15 20:15:44 2017
>> (r316980)
>> @@ -138,7 +138,7 @@ static U32 g_dictIDFlag = 1;
>>  void FIO_setDictIDFlag(unsigned dictIDFlag) { g_dictIDFlag = dictIDFlag; }
>>  static U32 g_checksumFlag = 1;
>>  void FIO_setChecksumFlag(unsigned checksumFlag) { g_checksumFlag = 
>> checksumFlag; }
>> -static U32 g_removeSrcFile = 0;
>> +static U32 g_removeSrcFile = 1;
>>  void FIO_setRemoveSrcFile(unsigned flag) { g_removeSrcFile = (flag>0); }
>>  static U32 g_memLimit = 0;
>>  void FIO_setMemLimit(unsigned memLimit) { g_memLimit = memLimit; }
>>
>> Modified: head/contrib/zstd/programs/zstdcli.c
>> ==
>> --- head/contrib/zstd/programs/zstdcli.cSat Apr 15 20:06:24 2017 
>>(r316979)
>> +++ head/contrib/zstd/programs/zstdcli.cSat Apr 15 20:15:44 2017 
>>(r316980)
>> @@ -61,7 +61,7 @@
>>  #define MB *(1 <<20)
>>  #define GB *(1U<<30)
>>
>> -#define DEFAULT_DISPLAY_LEVEL 2
>> +#define DEFAULT_DISPLAY_LEVEL 1
>>
>>  static const char*g_defaultDictName = "dictionary";
>>  static const unsigned g_defaultMaxDictSize = 110 KB;
>>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r316980 - head/contrib/zstd/programs

2017-12-05 Thread Allan Jude
On 2017-12-05 20:17, Conrad Meyer wrote:
> Ping.  Please revert this change.  If you want zstd to behave this
> way, pursue it upstream first.
> 
> Thanks,
> Conrad
> 
> On Wed, Nov 15, 2017 at 7:38 PM, Conrad Meyer  wrote:
>> Please revert this change.
>>
>> First, it introduces the POLA-violating behavior that zstdcat deletes
>> its source files.  This is not how zcat/bzcat behaves.
>>
>> Second, it introduces a needless behavioral difference between FreeBSD
>> zstd and the rest of the world's zstd.  The zstd documentation we ship
>> continues to claim that zstd preserves source files by default, yet
>> this change makes that documentation exactly backwards.  While we can
>> change FreeBSD's documentation to accommodate the change, we can't
>> change Google results.
>>
>> Thanks,
>> Conrad
>>
>> On Sat, Apr 15, 2017 at 1:15 PM, Baptiste Daroussin  wrote:
>>> Author: bapt
>>> Date: Sat Apr 15 20:15:44 2017
>>> New Revision: 316980
>>> URL: https://svnweb.freebsd.org/changeset/base/316980
>>>
>>> Log:
>>>   Change some default to make zstd a dropin replacement for gzip,bzip etc
>>>   in most cases
>>>
>>>   Changes ares:
>>>   - quiet by default
>>>   - remove the source files one compression completion by default
>>>
>>> Modified:
>>>   head/contrib/zstd/programs/fileio.c
>>>   head/contrib/zstd/programs/zstdcli.c
>>>
>>> Modified: head/contrib/zstd/programs/fileio.c
>>> ==
>>> --- head/contrib/zstd/programs/fileio.c Sat Apr 15 20:06:24 2017
>>> (r316979)
>>> +++ head/contrib/zstd/programs/fileio.c Sat Apr 15 20:15:44 2017
>>> (r316980)
>>> @@ -138,7 +138,7 @@ static U32 g_dictIDFlag = 1;
>>>  void FIO_setDictIDFlag(unsigned dictIDFlag) { g_dictIDFlag = dictIDFlag; }
>>>  static U32 g_checksumFlag = 1;
>>>  void FIO_setChecksumFlag(unsigned checksumFlag) { g_checksumFlag = 
>>> checksumFlag; }
>>> -static U32 g_removeSrcFile = 0;
>>> +static U32 g_removeSrcFile = 1;
>>>  void FIO_setRemoveSrcFile(unsigned flag) { g_removeSrcFile = (flag>0); }
>>>  static U32 g_memLimit = 0;
>>>  void FIO_setMemLimit(unsigned memLimit) { g_memLimit = memLimit; }
>>>
>>> Modified: head/contrib/zstd/programs/zstdcli.c
>>> ==
>>> --- head/contrib/zstd/programs/zstdcli.cSat Apr 15 20:06:24 2017
>>> (r316979)
>>> +++ head/contrib/zstd/programs/zstdcli.cSat Apr 15 20:15:44 2017
>>> (r316980)
>>> @@ -61,7 +61,7 @@
>>>  #define MB *(1 <<20)
>>>  #define GB *(1U<<30)
>>>
>>> -#define DEFAULT_DISPLAY_LEVEL 2
>>> +#define DEFAULT_DISPLAY_LEVEL 1
>>>
>>>  static const char*g_defaultDictName = "dictionary";
>>>  static const unsigned g_defaultMaxDictSize = 110 KB;
>>>
> 

Upstream recommends we create an additional hardlink, called 'zz' (like
xz but zstd), to do such compatibility, and keep 'zstd' the same as zstd
on every other distro.

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r326609 - in head: stand/libsa stand/userboot stand/userboot/test stand/userboot/userboot usr.sbin/bhyveload

2017-12-05 Thread Warner Losh
Author: imp
Date: Wed Dec  6 02:00:00 2017
New Revision: 326609
URL: https://svnweb.freebsd.org/changeset/base/326609

Log:
  Make putenv and getenv match the userland definition of these
  functions, tweak man page and one variable that shouldn't be const
  anymore.
  
  Sponsored by: Netflix

Modified:
  head/stand/libsa/environment.c
  head/stand/libsa/libstand.3
  head/stand/libsa/stand.h
  head/stand/userboot/test/test.c
  head/stand/userboot/userboot.h
  head/stand/userboot/userboot/main.c
  head/usr.sbin/bhyveload/bhyveload.c

Modified: head/stand/libsa/environment.c
==
--- head/stand/libsa/environment.c  Wed Dec  6 00:44:49 2017
(r326608)
+++ head/stand/libsa/environment.c  Wed Dec  6 02:00:00 2017
(r326609)
@@ -162,7 +162,7 @@ setenv(const char *name, const char *value, int overwr
 }
 
 int
-putenv(const char *string)
+putenv(char *string)
 {
 char   *value, *copy;
 intresult;

Modified: head/stand/libsa/libstand.3
==
--- head/stand/libsa/libstand.3 Wed Dec  6 00:44:49 2017(r326608)
+++ head/stand/libsa/libstand.3 Wed Dec  6 02:00:00 2017(r326609)
@@ -110,7 +110,7 @@ for set/unset hook functions.
 .Xc
 .It Xo
 .Ft int
-.Fn putenv "const char *string"
+.Fn putenv "char *string"
 .Xc
 .It Xo
 .Ft int

Modified: head/stand/libsa/stand.h
==
--- head/stand/libsa/stand.hWed Dec  6 00:44:49 2017(r326608)
+++ head/stand/libsa/stand.hWed Dec  6 02:00:00 2017(r326609)
@@ -330,7 +330,7 @@ extern int  env_setenv(const char *name, int flags,
 extern char*getenv(const char *name);
 extern int setenv(const char *name, const char *value,
   int overwrite);
-extern int putenv(const char *string);
+extern int putenv(char *string);
 extern int unsetenv(const char *name);
 
 extern ev_sethook_tenv_noset;  /* refuse set operation */

Modified: head/stand/userboot/test/test.c
==
--- head/stand/userboot/test/test.c Wed Dec  6 00:44:49 2017
(r326608)
+++ head/stand/userboot/test/test.c Wed Dec  6 02:00:00 2017
(r326609)
@@ -367,10 +367,10 @@ test_getmem(void *arg, uint64_t *lowmem, uint64_t *hig
 *highmem = 0;
 }
 
-const char *
+char *
 test_getenv(void *arg, int idx)
 {
-   static const char *vars[] = {
+   static char *vars[] = {
"foo=bar",
"bar=barbar",
NULL

Modified: head/stand/userboot/userboot.h
==
--- head/stand/userboot/userboot.h  Wed Dec  6 00:44:49 2017
(r326608)
+++ head/stand/userboot/userboot.h  Wed Dec  6 02:00:00 2017
(r326609)
@@ -202,7 +202,7 @@ struct loader_callbacks {
 * environment variable to return next. It will begin at 0 and
 * each invocation will add 1 to the previous value of 'num'.
 */
-   const char *(*getenv)(void *arg, int num);
+   char *  (*getenv)(void *arg, int num);
 
/*
 * Version 4 additions.

Modified: head/stand/userboot/userboot/main.c
==
--- head/stand/userboot/userboot/main.c Wed Dec  6 00:44:49 2017
(r326608)
+++ head/stand/userboot/userboot/main.c Wed Dec  6 02:00:00 2017
(r326609)
@@ -78,7 +78,7 @@ void
 loader_main(struct loader_callbacks *cb, void *arg, int version, int ndisks)
 {
static char mallocbuf[MALLOCSZ];
-   const char *var;
+   char *var;
int i;
 
if (version < USERBOOT_VERSION)

Modified: head/usr.sbin/bhyveload/bhyveload.c
==
--- head/usr.sbin/bhyveload/bhyveload.c Wed Dec  6 00:44:49 2017
(r326608)
+++ head/usr.sbin/bhyveload/bhyveload.c Wed Dec  6 02:00:00 2017
(r326609)
@@ -529,7 +529,7 @@ addenv(const char *str)
SLIST_INSERT_HEAD(&envhead, env, next);
 }
 
-static const char *
+static char *
 cb_getenv(void *arg, int num)
 {
int i;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326610 - head/stand/libsa

2017-12-05 Thread Warner Losh
Author: imp
Date: Wed Dec  6 02:00:09 2017
New Revision: 326610
URL: https://svnweb.freebsd.org/changeset/base/326610

Log:
  Fix random() prototype to match the system.
  
  Sponsored by: Netflix

Modified:
  head/stand/libsa/stand.h

Modified: head/stand/libsa/stand.h
==
--- head/stand/libsa/stand.hWed Dec  6 02:00:00 2017(r326609)
+++ head/stand/libsa/stand.hWed Dec  6 02:00:09 2017(r326610)
@@ -282,7 +282,7 @@ extern ssize_t  write(int, void *, size_t);
 extern struct  dirent *readdirfd(int);
 
 extern voidsrandom(unsigned int);
-extern u_long  random(void);
+extern longrandom(void);
 
 /* imports from stdlib, locally modified */
 extern longstrtol(const char *, char **, int);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326611 - head/sys/sys

2017-12-05 Thread Justin Hibbits
Author: jhibbits
Date: Wed Dec  6 02:05:21 2017
New Revision: 326611
URL: https://svnweb.freebsd.org/changeset/base/326611

Log:
  Use unsigned intptr_t type for framebuffer addresses
  
  Summary:
  Some architectures (powerpc Book-E) have a vm_paddr_t larger than intptr_t.
  Casting from the intptr_t to vm_paddr_t causes sign extension, leading to a
  potentially invalid address.
  
  This was seen when running X on a PowerPC P1022 machine, which mapped the
  backing framebuffer at 0xc180.  When mmap()d by X, this yielded an invalid
  address of 0xc180, or, as the hardware would see it, 0xfc180.
  
  Reviewed By: ray
  Differential Revision: https://reviews.freebsd.org/D13332

Modified:
  head/sys/sys/fbio.h

Modified: head/sys/sys/fbio.h
==
--- head/sys/sys/fbio.h Wed Dec  6 02:00:09 2017(r326610)
+++ head/sys/sys/fbio.h Wed Dec  6 02:05:21 2017(r326611)
@@ -136,8 +136,8 @@ struct fb_info {
fb_leave_t  *leave;
fb_setblankmode_t *setblankmode;
 
-   intptr_tfb_pbase;   /* For FB mmap. */
-   intptr_tfb_vbase;   /* if NULL, use fb_write/fb_read. */
+   uintptr_t   fb_pbase;   /* For FB mmap. */
+   uintptr_t   fb_vbase;   /* if NULL, use fb_write/fb_read. */
void*fb_priv;   /* First argument for read/write. */
const char  *fb_name;
uint32_tfb_flags;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326612 - head/sys/dev/vt/hw/fb

2017-12-05 Thread Justin Hibbits
Author: jhibbits
Date: Wed Dec  6 02:06:14 2017
New Revision: 326612
URL: https://svnweb.freebsd.org/changeset/base/326612

Log:
  Allow custom overrides of mmap attribute for VT framebuffer
  
  Summary:
  As in /dev/fb, allow the framebuffer driver to override the default memattr 
for
  mmap(2).  This is analogous to the change in 306555.
  
  Reviewed By: ray
  Differential Revision: https://reviews.freebsd.org/D13331

Modified:
  head/sys/dev/vt/hw/fb/vt_fb.c

Modified: head/sys/dev/vt/hw/fb/vt_fb.c
==
--- head/sys/dev/vt/hw/fb/vt_fb.c   Wed Dec  6 02:05:21 2017
(r326611)
+++ head/sys/dev/vt/hw/fb/vt_fb.c   Wed Dec  6 02:06:14 2017
(r326612)
@@ -143,8 +143,11 @@ vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, 
*paddr = vtophys((uint8_t *)info->fb_vbase + offset);
} else {
*paddr = info->fb_pbase + offset;
+   if (info->fb_flags & FB_FLAG_MEMATTR)
+   *memattr = info->fb_memattr;
 #ifdef VM_MEMATTR_WRITE_COMBINING
-   *memattr = VM_MEMATTR_WRITE_COMBINING;
+   else
+   *memattr = VM_MEMATTR_WRITE_COMBINING;
 #endif
}
return (0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326613 - head/contrib/tcpdump

2017-12-05 Thread Ed Maste
Author: emaste
Date: Wed Dec  6 02:21:11 2017
New Revision: 326613
URL: https://svnweb.freebsd.org/changeset/base/326613

Log:
  Update tcpdump to 4.9.2
  
  It contains many fixes, including bounds checking, buffer overflows (in
  SLIP and bittok2str_internal), buffer over-reads, and infinite loops.
  
  One other notable change:
Do not use getprotobynumber() for protocol name resolution.
Do not do any protocol name resolution if -n is specified.
  
  Submitted by: gordon
  Reviewed by:  delphij, emaste, glebius
  MFC after:1 week
  Relnotes: Yes
  Security: CVE-2017-11108, CVE-2017-11541, CVE-2017-11542
  Security: CVE-2017-11543, CVE-2017-12893, CVE-2017-12894
  Security: CVE-2017-12895, CVE-2017-12896, CVE-2017-12897
  Security: CVE-2017-12898, CVE-2017-12899, CVE-2017-12900
  Security: CVE-2017-12901, CVE-2017-12902, CVE-2017-12985
  Security: CVE-2017-12986, CVE-2017-12987, CVE-2017-12988
  Security: CVE-2017-12989, CVE-2017-12990, CVE-2017-12991
  Security: CVE-2017-12992, CVE-2017-12993, CVE-2017-12994
  Security: CVE-2017-12995, CVE-2017-12996, CVE-2017-12997
  Security: CVE-2017-12998, CVE-2017-12999, CVE-2017-13000
  Security: CVE-2017-13001, CVE-2017-13002, CVE-2017-13003
  Security: CVE-2017-13004, CVE-2017-13005, CVE-2017-13006
  Security: CVE-2017-13007, CVE-2017-13008, CVE-2017-13009
  Security: CVE-2017-13010, CVE-2017-13011, CVE-2017-13012
  Security: CVE-2017-13013, CVE-2017-13014, CVE-2017-13015
  Security: CVE-2017-13016, CVE-2017-13017, CVE-2017-13018
  Security: CVE-2017-13019, CVE-2017-13020, CVE-2017-13021
  Security: CVE-2017-13022, CVE-2017-13023, CVE-2017-13024
  Security: CVE-2017-13025, CVE-2017-13026, CVE-2017-13027
  Security: CVE-2017-13028, CVE-2017-13029, CVE-2017-13030
  Security: CVE-2017-13031, CVE-2017-13032, CVE-2017-13033
  Security: CVE-2017-13034, CVE-2017-13035, CVE-2017-13036
  Security: CVE-2017-13037, CVE-2017-13038, CVE-2017-13039
  Security: CVE-2017-13040, CVE-2017-13041, CVE-2017-13042
  Security: CVE-2017-13043, CVE-2017-13044, CVE-2017-13045
  Security: CVE-2017-13046, CVE-2017-13047, CVE-2017-13048
  Security: CVE-2017-13049, CVE-2017-13050, CVE-2017-13051
  Security: CVE-2017-13052, CVE-2017-13053, CVE-2017-13054
  Security: CVE-2017-13055, CVE-2017-13687, CVE-2017-13688
  Security: CVE-2017-13689, CVE-2017-13690, CVE-2017-13725
  Differential Revision:https://reviews.freebsd.org/D12404

Added:
  head/contrib/tcpdump/funcattrs.h
 - copied unchanged from r323696, vendor/tcpdump/dist/funcattrs.h
Modified:
  head/contrib/tcpdump/CHANGES
  head/contrib/tcpdump/CONTRIBUTING
  head/contrib/tcpdump/CREDITS
  head/contrib/tcpdump/INSTALL.txt
  head/contrib/tcpdump/Makefile.in
  head/contrib/tcpdump/PLATFORMS
  head/contrib/tcpdump/README.md
  head/contrib/tcpdump/VERSION
  head/contrib/tcpdump/addrtoname.c
  head/contrib/tcpdump/addrtoname.h
  head/contrib/tcpdump/addrtostr.c
  head/contrib/tcpdump/af.c
  head/contrib/tcpdump/af.h
  head/contrib/tcpdump/checksum.c
  head/contrib/tcpdump/config.h.in
  head/contrib/tcpdump/configure
  head/contrib/tcpdump/configure.in
  head/contrib/tcpdump/extract.h
  head/contrib/tcpdump/gmpls.c
  head/contrib/tcpdump/gmpls.h
  head/contrib/tcpdump/ip6.h
  head/contrib/tcpdump/ipproto.c
  head/contrib/tcpdump/ipproto.h
  head/contrib/tcpdump/l2vpn.c
  head/contrib/tcpdump/l2vpn.h
  head/contrib/tcpdump/netdissect-stdinc.h
  head/contrib/tcpdump/netdissect.h
  head/contrib/tcpdump/nlpid.c
  head/contrib/tcpdump/nlpid.h
  head/contrib/tcpdump/oui.c
  head/contrib/tcpdump/oui.h
  head/contrib/tcpdump/print-802_11.c
  head/contrib/tcpdump/print-802_15_4.c
  head/contrib/tcpdump/print-aodv.c
  head/contrib/tcpdump/print-arp.c
  head/contrib/tcpdump/print-atm.c
  head/contrib/tcpdump/print-beep.c
  head/contrib/tcpdump/print-bfd.c
  head/contrib/tcpdump/print-bgp.c
  head/contrib/tcpdump/print-bootp.c
  head/contrib/tcpdump/print-cfm.c
  head/contrib/tcpdump/print-chdlc.c
  head/contrib/tcpdump/print-cnfp.c
  head/contrib/tcpdump/print-decnet.c
  head/contrib/tcpdump/print-dhcp6.c
  head/contrib/tcpdump/print-domain.c
  head/contrib/tcpdump/print-eap.c
  head/contrib/tcpdump/print-eigrp.c
  head/contrib/tcpdump/print-esp.c
  head/contrib/tcpdump/print-ether.c
  head/contrib/tcpdump/print-fr.c
  head/contrib/tcpdump/print-frag6.c
  head/contrib/tcpdump/print-gre.c
  head/contrib/tcpdump/print-hncp.c
  head/contrib/tcpdump/print-icmp.c
  head/contrib/tcpdump/print-icmp6.c
  head/contrib/tcpdump/print-ip.c
  head/contrib/tcpdump/print-ip6.c
  head/contrib/tcpdump/print-ip6opts.c
  head/contrib/tcpdump/print-isakmp.c
  head/contrib/tcpdump/print-isoclns.c
  head/contrib/tcpdump/print-juniper.c
  head/contrib/tcpdump/print-l2tp.c
  head/contrib/tcpdump/print-ldp.c
  head/contrib/tcpdump/print-llc.c
  head/contrib/tcpdump/print-lldp.c
  head/contrib/tcpdump/print-lmp.c
  head/contrib/tcpdump/p

svn commit: r326614 - in head: etc/mtree usr.bin usr.bin/sponge usr.bin/tee

2017-12-05 Thread Eitan Adler
Author: eadler
Date: Wed Dec  6 02:47:46 2017
New Revision: 326614
URL: https://svnweb.freebsd.org/changeset/base/326614

Log:
  sponge(1): revert
  
  I did a complete buildworld and test... with the program disconnected
  from the tree. Revert the change for now.
  
  (this keeps the change to .arclint which is still correct)
  
  Wearing:  my pointhat

Deleted:
  head/usr.bin/sponge/
Modified:
  head/etc/mtree/BSD.tests.dist
  head/usr.bin/Makefile
  head/usr.bin/tee/tee.1

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Wed Dec  6 02:21:11 2017
(r326613)
+++ head/etc/mtree/BSD.tests.dist   Wed Dec  6 02:47:46 2017
(r326614)
@@ -712,8 +712,6 @@
 ..
 soelim
 ..
-sponge
-..
 stat
 ..
 tail

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Wed Dec  6 02:21:11 2017(r326613)
+++ head/usr.bin/Makefile   Wed Dec  6 02:47:46 2017(r326614)
@@ -148,7 +148,6 @@ SUBDIR= alias \
soelim \
sort \
split \
-   sponge \
stat \
stdbuf \
strings \

Modified: head/usr.bin/tee/tee.1
==
--- head/usr.bin/tee/tee.1  Wed Dec  6 02:21:11 2017(r326613)
+++ head/usr.bin/tee/tee.1  Wed Dec  6 02:47:46 2017(r326614)
@@ -72,8 +72,6 @@ utility takes the default action for all signals,
 except in the event of the
 .Fl i
 option.
-.Sh SEE ALSO
-.Xr sponge 1
 .Sh EXIT STATUS
 .Ex -std
 .Sh STANDARDS
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326614 - in head: etc/mtree usr.bin usr.bin/sponge usr.bin/tee

2017-12-05 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: eadler
> Date: Wed Dec  6 02:47:46 2017
> New Revision: 326614
> URL: https://svnweb.freebsd.org/changeset/base/326614
> 
> Log:
>   sponge(1): revert
>   
>   I did a complete buildworld and test... with the program disconnected
>   from the tree. Revert the change for now.
>   
>   (this keeps the change to .arclint which is still correct)

Commited with no log entry that makes any sense about why it was changed,
please revert .arclint and recommit with a proper log entry for .arclint
as to why all /tests/ dirs should be ignored.

>   Wearing:my pointhat
> 
> Deleted:
>   head/usr.bin/sponge/
> Modified:
>   head/etc/mtree/BSD.tests.dist
>   head/usr.bin/Makefile
>   head/usr.bin/tee/tee.1
> 
> Modified: head/etc/mtree/BSD.tests.dist
> ==
> --- head/etc/mtree/BSD.tests.dist Wed Dec  6 02:21:11 2017
> (r326613)
> +++ head/etc/mtree/BSD.tests.dist Wed Dec  6 02:47:46 2017
> (r326614)
> @@ -712,8 +712,6 @@
>  ..
>  soelim
>  ..
> -sponge
> -..
>  stat
>  ..
>  tail
> 
> Modified: head/usr.bin/Makefile
> ==
> --- head/usr.bin/Makefile Wed Dec  6 02:21:11 2017(r326613)
> +++ head/usr.bin/Makefile Wed Dec  6 02:47:46 2017(r326614)
> @@ -148,7 +148,6 @@ SUBDIR=   alias \
>   soelim \
>   sort \
>   split \
> - sponge \
>   stat \
>   stdbuf \
>   strings \
> 
> Modified: head/usr.bin/tee/tee.1
> ==
> --- head/usr.bin/tee/tee.1Wed Dec  6 02:21:11 2017(r326613)
> +++ head/usr.bin/tee/tee.1Wed Dec  6 02:47:46 2017(r326614)
> @@ -72,8 +72,6 @@ utility takes the default action for all signals,
>  except in the event of the
>  .Fl i
>  option.
> -.Sh SEE ALSO
> -.Xr sponge 1
>  .Sh EXIT STATUS
>  .Ex -std
>  .Sh STANDARDS
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326614 - in head: etc/mtree usr.bin usr.bin/sponge usr.bin/tee

2017-12-05 Thread Conrad Meyer
On Tue, Dec 5, 2017 at 7:10 PM, Rodney W. Grimes
 wrote:
> [ Charset UTF-8 unsupported, converting... ]
>> Author: eadler
>> Date: Wed Dec  6 02:47:46 2017
>> New Revision: 326614
>> URL: https://svnweb.freebsd.org/changeset/base/326614
>>
>> Log:
>>   sponge(1): revert
>>
>>   I did a complete buildworld and test... with the program disconnected
>>   from the tree. Revert the change for now.
>>
>>   (this keeps the change to .arclint which is still correct)
>
> Commited with no log entry that makes any sense about why it was changed,
> please revert .arclint and recommit with a proper log entry for .arclint
> as to why all /tests/ dirs should be ignored.

I have to agree with Rod.  The commit message for the arclint change
is currently "sponge(1): initial commit …" and doesn't say anything
about the arclint change.  Even if the change is correct, the commit
message isn't.

Conrad
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/spongeusr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Cy Schubert
Thanks.

It doesn't matter anyway FreeBSD sed -i '' == gsed -i .


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


In message <4fe900e7-10e6-4909-bb4a-c5e6f83ff...@freebsd.org>, Pedro 
Giffuni wr
ites:
> 
>
> --Apple-Mail=_50E4FA92-D46B-44D0-AA71-CE18C2B93B8C
> Content-Transfer-Encoding: quoted-printable
> Content-Type: text/plain;
>   charset=utf-8
>
> Hello;
>
> > On Dec 5, 2017, at 12:17, Cy Schubert  =
> wrote:
> >=20
> > What side effects? Can you give one or two examples, please?
> >=20
>
> Sorry, I forgot the details .. but I am pretty sure there was exp-run =
> and breakage in the ports tree.
>
> Pedro.
>
> > ---
> > Sent using a tiny phone keyboard.
> > Apologies for any typos and autocorrect.
> > This old phone only supports top post. Apologies.
> >=20
> > Cy Schubert
> >  or 
> > The need of the many outweighs the greed of the few.
> > ---
> > From: Pedro Giffuni
> > Sent: 05/12/2017 08:40
> > To: Cy Schubert; Devin Teske; Hans Petter Selasky
> > Cc: rgri...@freebsd.org; c...@freebsd.org; Eitan Adler; src-committers; =
> svn-src-...@freebsd.org; svn-src-head@freebsd.org
> > Subject: Re: svn commit: r326554 - in head: . =
> usr.bin/spongeusr.bin/sponge/tests usr.bin/tee
> >=20
> >=20
> > On 05/12/2017 11:29, Cy Schubert wrote:
> >> Why not update sed to create the backup file only if the suffix is =
> given to -i, like gnu sed does.
> >>=20
> >=20
> > No, no .. there have been several failed attempts at that that cause =
> nasty side effects.
> > It is also a rather non-standardish thing to do.
> >=20
> > Pedro.
> >=20
> >> ---
> >> Sent using a tiny phone keyboard.
> >> Apologies for any typos and autocorrect.
> >> This old phone only supports top post. Apologies.
> >>=20
> >> Cy Schubert
> >>   or =
>  
> >> The need of the many outweighs the greed of the few.
> >> ---
> >> From: Devin Teske
> >> Sent: 05/12/2017 07:35
> >> To: Hans Petter Selasky
> >> Cc: rgri...@freebsd.org ; c...@freebsd.org =
> ; Eitan Adler; src-committers; =
> svn-src-...@freebsd.org ; =
> svn-src-head@freebsd.org 
> >> Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge =
> usr.bin/sponge/tests usr.bin/tee
> >>=20
> >>=20
> >> > On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky  =
>  wrote:
> >> >=20
> >> >> On 12/05/17 13:58, Rodney W. Grimes wrote:
> >> >> Further more, why does freebsd need this in base?
> >> >=20
> >> > Hi,
> >> >=20
> >> > I think this is useful. It could replace the "-i " (intermediate) =
> option for "sed" for example. It avoids creating temporary files when =
> filtering files, right?
> >> >=20
> >> > --HPS
> >> >=20
> >>=20
> >> Wth is wrong with:
> >>=20
> >> data=3D$( sed -e '...' somefile ) &&
> >> =C3=AF=C2=BF=C2=BD=C3=AF=C2=BF=C2=BD=C3=AF=C2=BF=C2=BD=C3=AF=C2=BF=C2=BD=
> =C3=AF=C2=BF=C2=BD=C3=AF=C2=BF=C2=BD=C3=AF=C2=BF=C2=BD echo "$data" > =
> somefile
> >>=20
> >> or
> >>=20
> >> set -e
> >> data=3D...
> >> echo "$data" > ...
> >>=20
> >> or
> >>=20
> >> exec 3< >> $( ... )
> >> EOF
> >> cat > ... <&3
> >>=20
> >> or
> >>=20
> >> (I digress)
> >>=20
> >> Infinite variations, but the gist is that sponge looks to be trying =
> to help sh(1)/similar when help is unneeded.
> >>=20
> >> Why buffer data into memory via fork-exec-pipe to sponge when you can =
> buffer to native namespace without pipe to sponge?
> >>=20
> >> Am I missing something? Why do we need sponge(1)?
> >> --=20
> >> Devin
> >>=20
> >=20
>
>
> --Apple-Mail=_50E4FA92-D46B-44D0-AA71-CE18C2B93B8C
> Content-Transfer-Encoding: quoted-printable
> Content-Type: text/html;
>   charset=utf-8
>
>  charset=3Dutf-8"> -webkit-nbsp-mode: space; line-break: after-white-space;" =
> class=3D"">Hello; type=3D"cite" class=3D"">On Dec 5, 2017, at 12:17, Cy =
> Schubert  class=3D"">cy.schub...@komquats.com> wrote: class=3D"Apple-interchange-newline">
>charset=3Dwindows-1252" http-equiv=3D"Content-Type" class=3D"">
>  =20
>class=3D""> 11pt;" class=3D"">What side effects? Can you give one or two examples, =
> please? class=3D""> class=3D"">Sorry, I forgot the details .. but I am pretty sure =
> there was exp-run and breakage in the ports tree. class=3D"">Pedro. type=3D"cite" class=3D""> text=3D"#00" class=3D""> Calibri,sans-serif; font-size: 11pt;" class=3D"">---Sent =
> using a tiny phone keyboard.Apologies for any typos and =
> autocorrect.This old phone only supports top post. =
> Apologies.Cy Schubert< href=3D"mailto:cy.schub...@cschubert.com"; =
> class=3D"">cy.schub...@cschubert.com> or < href=3D"mailto:c...@freebsd.org"; class=3D"">c...@freebsd.org> class=3D"">The need of the many outweighs the greed of the few. class=3D"">--- style=3D"font-family: Tahoma,sans-serif; font-size: 10pt; 

Re: svn commit: r326611 - head/sys/sys

2017-12-05 Thread Bruce Evans

On Wed, 6 Dec 2017, Justin Hibbits wrote:


Log:
 Use unsigned intptr_t type for framebuffer addresses

 Summary:
 Some architectures (powerpc Book-E) have a vm_paddr_t larger than intptr_t.
 Casting from the intptr_t to vm_paddr_t causes sign extension, leading to a
 potentially invalid address.


Don't do that then.  It is only valid to cast intptr_t to and from void *
or vm_offset_t.  All of these can only represent virtual addresses, and
converting virtual addresses to physical addresses by casting to vm_paddr_t
gives garbage.

The problem is that fb_pbase is a physical address misrepresented using
[u]intptr_t.  intptr_t for the virtual address fb_vbase is only a problem
if fb_base is misrepresented by a larger unsigned type.


 This was seen when running X on a PowerPC P1022 machine, which mapped the
 backing framebuffer at 0xc180.  When mmap()d by X, this yielded an invalid
 address of 0xc180, or, as the hardware would see it, 0xfc180.


On 32-bit arches, truncation still occurs at 4G (insted of sign extension at
2G).

The sign extension bug would fix exotic arches where device memory is
below 2G or above top_of_memory-2G.  amd64 doesn't seem to be one of these.
It puts the kernel near the top and uses sign extension tricks to reach it,
but that is only virtual.


...
Modified: head/sys/sys/fbio.h
==
--- head/sys/sys/fbio.h Wed Dec  6 02:00:09 2017(r326610)
+++ head/sys/sys/fbio.h Wed Dec  6 02:05:21 2017(r326611)
@@ -136,8 +136,8 @@ struct fb_info {
fb_leave_t  *leave;
fb_setblankmode_t *setblankmode;

-   intptr_tfb_pbase;   /* For FB mmap. */
-   intptr_tfb_vbase;   /* if NULL, use fb_write/fb_read. */
+   uintptr_t   fb_pbase;   /* For FB mmap. */
+   uintptr_t   fb_vbase;   /* if NULL, use fb_write/fb_read. */


This breaks the warning for fb_pbase.  fb_pbase is a physical address, so
it cannot be represented by any intptr_t in general.  Apparently it never
holds a virtual address, since that would be confusing even if it is
converted between virtual and physical correctly.

fb_vbase is apparently a virtual address, so intptr_t was good enough for
it.

The broken code in dev/fb using these struct members is:

X creator_vt.c: sc->fb.fb_pbase = phys;

'phys' has type bus_addr_t, so this assignment blindly truncates addresses
on arches where bus_address_t != [u]intptr_t.  The sign extension even fixes
this on arches where intptr_t == int32_t, bus_addr_t == uint64_t, and
physical addresses are in the lower or upper 2G of the bus space.

Even vm_paddr_t is at least technically wrong for fb_pbase.  Since the buffer
is a frame buffer, its bus space is probably always memory, and bus_addr_t
must be at least as large as vm_addr_t to represent any physical memory
space, but bus_addr_t might be larger and actually use the extra bits to
select a mapping method...  Assignment is only correct if fb_base has type
bus_addr_t and is treated as a cookie, but for mmap() of device memory there
would have to be translation.

X fbd.c:if (info->fb_pbase == 0)
X fbd.c:*paddr = vtophys((uint8_t *)info->fb_vbase + 
offset);
X fbd.c:else
X fbd.c:*paddr = info->fb_pbase + offset;

This is the translation code in fb_mmap().  'offset' is the mmap offset
which has type vm_ooffset_t which is hopefully large enough to represent
any physical address, although of course it isn't (it is too small for
/dev/kmem of 64-bit arches and also for /dev/mem on 64-bit arches if
high physical addresses are used).

The fb_pbase == 0 case partly correct.  fb_vbase gives a virtual address
and 'offset' must be small to give another virtual address, and the result
is converted to a physical address.  No overflow checking is done for
the addition.

fb_pbase != 0 means that fb_pbase gives a raw bus space address.  'offset'
is presumably still small, but fb_pbase is already broken since it can
only represent virtual addresses.  As usual, no overflow checking is done
for the addition.  The assignment is also logically broken.  The RHS should
have type bus_addr_t, but mmap()'s API doesn't support that.  *paddr has
type vm_paddr_t, which might have a different size and representation.

Callers have lots of casts to intptr_t for initializations of fb_vbase.
These were not quite correct.  They are mostly/always to convert from
pointers to integral types to intptr_t, but intptr_t is only guaranteed
to work for converting between void * and intptr_t.  The sloppy casts
works on vaxes because all pointers have the same representation.  Now
these casts have the additional error of a sign mismatch between the
cast and the target type.  This can cause sign extension bugs like the
one fixed (I think intptr_t and uintptr_t can have different sizes.
E.g., uintptr_t might be uint32_t but intptr_t migh

Re: svn commit: r326574 - head/usr.bin/logger

2017-12-05 Thread Cy Schubert
In message <201712051955.vb5jtrwp079...@repo.freebsd.org>, Gleb Smirnoff 
writes
:
> Author: glebius
> Date: Tue Dec  5 19:55:53 2017
> New Revision: 326574
> URL: https://svnweb.freebsd.org/changeset/base/326574
>
> Log:
>   Generate fully RFC3164 compliant messages, with timestamp and hostname.
>   Allow to set hostname to any string with -H.
>   
>   MFC after:  2 months
>
> Modified:
>   head/usr.bin/logger/logger.1
>   head/usr.bin/logger/logger.c
>
> Modified: head/usr.bin/logger/logger.1
> =
> =
> --- head/usr.bin/logger/logger.1  Tue Dec  5 19:54:55 2017(r32657
> 3)
> +++ head/usr.bin/logger/logger.1  Tue Dec  5 19:55:53 2017(r32657
> 4)
> @@ -28,7 +28,7 @@
>  .\"  @(#)logger.18.1 (Berkeley) 6/6/93
>  .\" $FreeBSD$
>  .\"
> -.Dd December 23, 2016
> +.Dd December 5, 2017
>  .Dt LOGGER 1
>  .Os
>  .Sh NAME
> @@ -38,6 +38,7 @@
>  .Nm
>  .Op Fl 46Ais
>  .Op Fl f Ar file
> +.Op Fl H Ar hostname
>  .Op Fl h Ar host
>  .Op Fl P Ar port
>  .Op Fl p Ar pri
> @@ -77,6 +78,11 @@ Log the message to standard error, as well as the syst
>  .It Fl f Ar file
>  Read the contents of the specified file into syslog.
>  This option is ignored when a message is also specified.
> +.It Fl H Ar hostname
> +Set the hostname in the header of the message to specified value.
> +If not specified, host part of
> +.Xr gethostname 3
> +will be used.
>  .It Fl h Ar host
>  Send the message to the remote system
>  .Ar host
>
> Modified: head/usr.bin/logger/logger.c
> =
> =
> --- head/usr.bin/logger/logger.c  Tue Dec  5 19:54:55 2017(r32657
> 3)
> +++ head/usr.bin/logger/logger.c  Tue Dec  5 19:55:53 2017(r32657
> 4)
> @@ -44,7 +44,7 @@ static char sccsid[] = "@(#)logger.c8.1 (Berkeley) 
> 6/
>  #include 
>  __FBSDID("$FreeBSD$");
>  
> -#include 
> +#include 
>  #include 
>  #include 
>  
> @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  #define  SYSLOG_NAMES
> @@ -71,8 +72,8 @@ static int  decode(char *, const CODE *);
>  static int   pencode(char *);
>  static ssize_t   socksetup(const char *, const char *, const char *,
>   struct socks **);
> -static void  logmessage(int, const char *, struct socks *, ssize_t,
> -const char *);
> +static void  logmessage(int, const char *, const char *, const char *,
> + struct socks *, ssize_t, const char *);
>  static void  usage(void);
>  
>  #ifdef INET6
> @@ -93,19 +94,22 @@ main(int argc, char *argv[])
>  {
>   struct socks *socks;
>   ssize_t nsock;
> + time_t now;
>   int ch, logflags, pri;
> - char *tag, *host, buf[1024];
> + char *tag, *host, buf[1024], *timestamp, tbuf[26],
> + *hostname, hbuf[MAXHOSTNAMELEN];
>   const char *svcname, *src;
>  
>   tag = NULL;
>   host = NULL;
> + hostname = NULL;
>   svcname = "syslog";
>   src = NULL;
>   socks = NULL;
>   pri = LOG_USER | LOG_NOTICE;
>   logflags = 0;
>   unsetenv("TZ");
> - while ((ch = getopt(argc, argv, "46Af:h:iP:p:S:st:")) != -1)
> + while ((ch = getopt(argc, argv, "46Af:H:h:iP:p:S:st:")) != -1)
>   switch((char)ch) {
>   case '4':
>   family = PF_INET;
> @@ -123,6 +127,9 @@ main(int argc, char *argv[])
>   err(1, "%s", optarg);
>   setvbuf(stdin, 0, _IONBF, 0);
>   break;
> + case 'H':   /* hostname to set in message header */
> + hostname = optarg;
> + break;
>   case 'h':   /* hostname to deliver to */
>   host = optarg;
>   break;
> @@ -168,6 +175,17 @@ main(int argc, char *argv[])
>   openlog(tag, logflags, 0);
>   (void) fclose(stdout);
>  
> + (void )time(&now);
> + (void )ctime_r(&now, tbuf);
> + tbuf[19] = '\0';
> + timestamp = tbuf + 4;
> +
> + if (hostname == NULL) {
> + hostname = hbuf;
> + (void )gethostname(hbuf, MAXHOSTNAMELEN);
> + *strchr(hostname, '.') = '\0';

Hi Gleb,

I'm getting a segfault here.

[New LWP 101396]
Core was generated by `logger -p daemon.notice -t local-dhclient(lagg0):4629
2 dhclient-script for inter'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00402152 in main (argc=, argv=)
at /opt/src/svn-current/usr.bin/logger/logger.c:186
186 *strchr(hostname, '.') = '\0';
(gdb) bt
#0  0x00402152 in main (argc=, argv=)
at /opt/src/svn-current/usr.bin/logger/logger.c:186
(gdb) 

> + }
> +
>   /* log input line if appropriate */
>   if (argc > 0) {
>   char *p, *endp;
> @@ -176,11 +194,13 @@ mai

Re: svn commit: r326574 - head/usr.bin/logger

2017-12-05 Thread Gleb Smirnoff
  Hi Cy,

On Tue, Dec 05, 2017 at 08:30:07PM -0800, Cy Schubert wrote:
C> Hi Gleb,
C> 
C> I'm getting a segfault here.
C> 
C> [New LWP 101396]
C> Core was generated by `logger -p daemon.notice -t local-dhclient(lagg0):4629
C> 2 dhclient-script for inter'.
C> Program terminated with signal SIGSEGV, Segmentation fault.
C> #0  0x00402152 in main (argc=, argv=)
C> at /opt/src/svn-current/usr.bin/logger/logger.c:186
C> 186  *strchr(hostname, '.') = '\0';
C> (gdb) bt
C> #0  0x00402152 in main (argc=, argv=)
C> at /opt/src/svn-current/usr.bin/logger/logger.c:186
C> (gdb) 

Mea culpa! Can you please test the attached patch?

-- 
Gleb Smirnoff
Index: logger.c
===
--- logger.c	(revision 326614)
+++ logger.c	(working copy)
@@ -183,7 +183,7 @@ main(int argc, char *argv[])
 	if (hostname == NULL) {
 		hostname = hbuf;
 		(void )gethostname(hbuf, MAXHOSTNAMELEN);
-		*strchr(hostname, '.') = '\0';
+		*strchrnul(hostname, '.') = '\0';
 	}
 
 	/* log input line if appropriate */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326574 - head/usr.bin/logger

2017-12-05 Thread Cy Schubert
In message <20171206044051.gf1...@freebsd.org>, Gleb Smirnoff writes:
> 
>
> --/NkBOFFp2J2Af1nK
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
>
>   Hi Cy,
>
> On Tue, Dec 05, 2017 at 08:30:07PM -0800, Cy Schubert wrote:
> C> Hi Gleb,
> C> 
> C> I'm getting a segfault here.
> C> 
> C> [New LWP 101396]
> C> Core was generated by `logger -p daemon.notice -t local-dhclient(lagg0):46
> 29
> C> 2 dhclient-script for inter'.
> C> Program terminated with signal SIGSEGV, Segmentation fault.
> C> #0  0x00402152 in main (argc=, argv=
> )
> C> at /opt/src/svn-current/usr.bin/logger/logger.c:186
> C> 186*strchr(hostname, '.') = '\0';
> C> (gdb) bt
> C> #0  0x00402152 in main (argc=, argv=
> )
> C> at /opt/src/svn-current/usr.bin/logger/logger.c:186
> C> (gdb) 
>
> Mea culpa! Can you please test the attached patch?
>
> -- 
> Gleb Smirnoff
>
> --/NkBOFFp2J2Af1nK
> Content-Type: text/x-diff; charset=us-ascii
> Content-Disposition: attachment; filename="logger.diff"
>
> Index: logger.c
> ===
> --- logger.c  (revision 326614)
> +++ logger.c  (working copy)
> @@ -183,7 +183,7 @@ main(int argc, char *argv[])
>   if (hostname == NULL) {
>   hostname = hbuf;
>   (void )gethostname(hbuf, MAXHOSTNAMELEN);
> - *strchr(hostname, '.') = '\0';
> + *strchrnul(hostname, '.') = '\0';
>   }
>  
>   /* log input line if appropriate */
>
> --/NkBOFFp2J2Af1nK--

Fixed. Thanks!


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326615 - head/usr.sbin/bhyveload

2017-12-05 Thread Warner Losh
Author: imp
Date: Wed Dec  6 05:18:52 2017
New Revision: 326615
URL: https://svnweb.freebsd.org/changeset/base/326615

Log:
  De-const to match changes in userboot.h
  
  Sponsored by: Netflix

Modified:
  head/usr.sbin/bhyveload/bhyveload.c

Modified: head/usr.sbin/bhyveload/bhyveload.c
==
--- head/usr.sbin/bhyveload/bhyveload.c Wed Dec  6 02:47:46 2017
(r326614)
+++ head/usr.sbin/bhyveload/bhyveload.c Wed Dec  6 05:18:52 2017
(r326615)
@@ -513,14 +513,14 @@ cb_getmem(void *arg, uint64_t *ret_lowmem, uint64_t *r
 }
 
 struct env {
-   const char *str;/* name=value */
+   char *str;  /* name=value */
SLIST_ENTRY(env) next;
 };
 
 static SLIST_HEAD(envhead, env) envhead;
 
 static void
-addenv(const char *str)
+addenv(char *str)
 {
struct env *env;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee

2017-12-05 Thread Alexey Dokuchaev
[ Charset UTF-8 unsupported, converting... ]
On Tue, Dec 05, 2017 at 01:06:40PM -0800, Conrad Meyer wrote:
> On Tue, Dec 5, 2017 at 12:16 PM, Cy Schubert wrote:
> > In message [...], Eitan Adler writes:
> >> I'm not near my commit box right now so someone will have to revert
> >> it. What's funny is that I ran a complete 'make buildworld
> >> buildkernel' last night with this patch.
> >>
> >> Will respond to the rest of the thread later[.]
> >
> > No problem. r326575 addresses the issue.
> 
> Not fully -- it doesn't address that the code is functionally broken or
> that the change touched things it didn't need to.  I think a revert is
> still called for, when you can reach a machine with commit access.

While it was already reverted, all the input so far raises a question of
should it be readded even if/when fixed, since it apparently can be done
with existing shell tools, in a better way [1].

I'd like us to have a smaller, orthogonal base, with tools not repeating
themselves.

./danfe

[1] https://lists.freebsd.org/pipermail/svn-src-head/2017-December/107001.html
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326616 - head/stand/libsa

2017-12-05 Thread Toomas Soome
Author: tsoome
Date: Wed Dec  6 06:49:53 2017
New Revision: 326616
URL: https://svnweb.freebsd.org/changeset/base/326616

Log:
  dhcp_try_rfc1048() is not used any more
  
  Remove unused function.
  
  Reviewed by:  imp
  Differential Revision:https://reviews.freebsd.org/D13382

Modified:
  head/stand/libsa/bootp.c
  head/stand/libsa/bootp.h

Modified: head/stand/libsa/bootp.c
==
--- head/stand/libsa/bootp.cWed Dec  6 05:18:52 2017(r326615)
+++ head/stand/libsa/bootp.cWed Dec  6 06:49:53 2017(r326616)
@@ -355,17 +355,6 @@ bad:
return (-1);
 }
 
-int
-dhcp_try_rfc1048(u_char *cp, u_int len)
-{
-
-   expected_dhcpmsgtype = DHCPACK;
-   if (bcmp(vm_rfc1048, cp, sizeof(vm_rfc1048)) == 0) {
-   return (vend_rfc1048(cp, len));
-   }
-   return (-1);
-}
-
 static int
 vend_rfc1048(u_char *cp, u_int len)
 {

Modified: head/stand/libsa/bootp.h
==
--- head/stand/libsa/bootp.hWed Dec  6 05:18:52 2017(r326615)
+++ head/stand/libsa/bootp.hWed Dec  6 06:49:53 2017(r326616)
@@ -146,6 +146,4 @@ struct cmu_vend {
 extern struct bootp *bootp_response;
 extern size_t bootp_response_size;
 
-intdhcp_try_rfc1048(u_char *cp, u_int len);
-
 #endif /* _BOOTP_H_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"