svn commit: r361309 - stable/12/usr.sbin/bsdinstall/scripts

2020-05-20 Thread Devin Teske
Author: dteske
Date: Wed May 20 23:27:01 2020
New Revision: 361309
URL: https://svnweb.freebsd.org/changeset/base/361309

Log:
  MFC r361300: Fix indentation in bsdinstall-created wpa_supplicant.conf
  
  PR:   base/221982
  Reported by:  emaste
  Reviewed by:  emaste, allanjude
  Differential Revision:https://reviews.freebsd.org/D23641

Modified:
  stable/12/usr.sbin/bsdinstall/scripts/wlanconfig
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/bsdinstall/scripts/wlanconfig
==
--- stable/12/usr.sbin/bsdinstall/scripts/wlanconfigWed May 20 23:18:47 
2020(r361308)
+++ stable/12/usr.sbin/bsdinstall/scripts/wlanconfigWed May 20 23:27:01 
2020(r361309)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #-
 # Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013-2016 Devin Teske
+# Copyright (c) 2013-2020 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -60,8 +60,7 @@ country_set()
'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \
"$WLAN_IFACE" "$BSDINSTALL_TMPETC"
if [ "$error_str" ]; then
-   $DIALOG \
-   --title "$msg_error" \
+   $DIALOG --title "$msg_error" \
--backtitle "$DIALOG_BACKTITLE" \
--yes-label Change \
--no-label Ignore \
@@ -70,8 +69,7 @@ country_set()
0 0 || return $SUCCESS # Skip
return $FAILURE # Restart
else
-   awk 'sub(/^\t\t/,"")||1' \
-   > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF
+   cat > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF
create_args_$WLAN_IFACE="$ifconfig_args"
EOF
fi
@@ -101,7 +99,8 @@ dialog_country_select()
sub(/Country codes:/, ""), sub(/Regulatory.*/, "") {
while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) {
country = substr($0, RSTART)
-   sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", 
country)
+   sub(/ [[:upper:]][[:upper:][:digit:]].*/, "",
+   country)
code = substr(country, 1, 2)
desc = substr(country, 4)
sub(/[[:space:]]*$/, "", desc)
@@ -153,7 +152,7 @@ dialog_country_select()
 : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 
-cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF
+cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) || exec "$0" "$@"
-   awk 'sub(/^\t/,"")||1' \
-   >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
+   network={
+   \   ssid="$NETWORK"
+   \   scan_ssid=$SCANSSID
+   \   psk="$PASS"
+   \   priority=5
+   }
+   EOF
 elif echo "$ENCRYPTION" | grep -q EAP; then
USERPASS=$( $DIALOG \
--title "WPA-Enterprise Setup"   \
@@ -300,19 +299,19 @@ elif echo "$ENCRYPTION" | grep -q EAP; then
"Password" 3 0 "" 3 12 25 63 1   \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) || exec "$0" "$@"
-   awk 'sub(/^\t/,"")||1' \
-   >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
+   network={
+   \   ssid="$NETWORK"
+   \   scan_ssid=$SCANSSID
+   \   key_mgmt=WPA-EAP$(
+   echo "$USERPASS" | awk '
+   NR == 1 { printf "\n\tidentity=\"%s\"", $1 }
+   NR == 2 { printf "\n\tpassword=\"%s\"", $1 }
+   ' )
+   \   priority=5
+   }
+   EOF
 elif echo "$ENCRYPTION" | grep -q WEP; then
WEPKEY=$( $DIALOG \
--title "WEP Setup"  \
@@ -324,31 +323,31 @@ elif echo "$ENCRYPTION" | grep -q WEP; then
"WEP Key 0" 2 0 "" 2 12 15 0 1   \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) || exec "$0" "$@"
-   awk 'sub(/^\t

svn commit: r361305 - stable/11/usr.sbin/bsdinstall/scripts

2020-05-20 Thread Devin Teske
Author: dteske
Date: Wed May 20 22:20:53 2020
New Revision: 361305
URL: https://svnweb.freebsd.org/changeset/base/361305

Log:
  MFC r361300: Fix indentation in bsdinstall-created wpa_supplicant.conf
  
  PR:   base/221982
  Reported by:  emaste
  Reviewed by:  emaste, allanjude
  Differential Revision:https://reviews.freebsd.org/D23641

Modified:
  stable/11/usr.sbin/bsdinstall/scripts/wlanconfig
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig
==
--- stable/11/usr.sbin/bsdinstall/scripts/wlanconfigWed May 20 22:19:43 
2020(r361304)
+++ stable/11/usr.sbin/bsdinstall/scripts/wlanconfigWed May 20 22:20:53 
2020(r361305)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #-
 # Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013-2016 Devin Teske
+# Copyright (c) 2013-2020 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -60,8 +60,7 @@ country_set()
'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \
"$WLAN_IFACE" "$BSDINSTALL_TMPETC"
if [ "$error_str" ]; then
-   $DIALOG \
-   --title "$msg_error" \
+   $DIALOG --title "$msg_error" \
--backtitle "$DIALOG_BACKTITLE" \
--yes-label Change \
--no-label Ignore \
@@ -70,8 +69,7 @@ country_set()
0 0 || return $SUCCESS # Skip
return $FAILURE # Restart
else
-   awk 'sub(/^\t\t/,"")||1' \
-   > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF
+   cat > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF
create_args_$WLAN_IFACE="$ifconfig_args"
EOF
fi
@@ -101,7 +99,8 @@ dialog_country_select()
sub(/Country codes:/, ""), sub(/Regulatory.*/, "") {
while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) {
country = substr($0, RSTART)
-   sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", 
country)
+   sub(/ [[:upper:]][[:upper:][:digit:]].*/, "",
+   country)
code = substr(country, 1, 2)
desc = substr(country, 4)
sub(/[[:space:]]*$/, "", desc)
@@ -153,7 +152,7 @@ dialog_country_select()
 : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 
-cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF
+cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) || exec "$0" "$@"
-   awk 'sub(/^\t/,"")||1' \
-   >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
+   network={
+   \   ssid="$NETWORK"
+   \   scan_ssid=$SCANSSID
+   \   psk="$PASS"
+   \   priority=5
+   }
+   EOF
 elif echo "$ENCRYPTION" | grep -q EAP; then
USERPASS=$( $DIALOG \
--title "WPA-Enterprise Setup"   \
@@ -300,19 +299,19 @@ elif echo "$ENCRYPTION" | grep -q EAP; then
"Password" 3 0 "" 3 12 25 63 1   \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) || exec "$0" "$@"
-   awk 'sub(/^\t/,"")||1' \
-   >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
+   network={
+   \   ssid="$NETWORK"
+   \   scan_ssid=$SCANSSID
+   \   key_mgmt=WPA-EAP$(
+   echo "$USERPASS" | awk '
+   NR == 1 { printf "\n\tidentity=\"%s\"", $1 }
+   NR == 2 { printf "\n\tpassword=\"%s\"", $1 }
+   ' )
+   \   priority=5
+   }
+   EOF
 elif echo "$ENCRYPTION" | grep -q WEP; then
WEPKEY=$( $DIALOG \
--title "WEP Setup"  \
@@ -324,31 +323,31 @@ elif echo "$ENCRYPTION" | grep -q WEP; then
"WEP Key 0" 2 0 "" 2 12 15 0 1   \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) || exec "$0" "$@"
-   awk 'sub(/^\t

svn commit: r361300 - head/usr.sbin/bsdinstall/scripts

2020-05-20 Thread Devin Teske
Author: dteske
Date: Wed May 20 21:39:19 2020
New Revision: 361300
URL: https://svnweb.freebsd.org/changeset/base/361300

Log:
  Fix indentation in bsdinstall-created wpa_supplicant.conf
  
  PR:   base/221982
  Reported by:  emaste
  Reviewed by:  emaste, allanjude
  MFC after:0 days
  X-MFC-to: stable/11
  Differential Revision:https://reviews.freebsd.org/D23641

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==
--- head/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 21:22:25 2020
(r361299)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 21:39:19 2020
(r361300)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #-
 # Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013-2016 Devin Teske
+# Copyright (c) 2013-2020 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -60,8 +60,7 @@ country_set()
'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \
"$WLAN_IFACE" "$BSDINSTALL_TMPETC"
if [ "$error_str" ]; then
-   $DIALOG \
-   --title "$msg_error" \
+   $DIALOG --title "$msg_error" \
--backtitle "$DIALOG_BACKTITLE" \
--yes-label Change \
--no-label Ignore \
@@ -70,8 +69,7 @@ country_set()
0 0 || return $SUCCESS # Skip
return $FAILURE # Restart
else
-   awk 'sub(/^\t\t/,"")||1' \
-   > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF
+   cat > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF
create_args_$WLAN_IFACE="$ifconfig_args"
EOF
fi
@@ -101,7 +99,8 @@ dialog_country_select()
sub(/Country codes:/, ""), sub(/Regulatory.*/, "") {
while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) {
country = substr($0, RSTART)
-   sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", 
country)
+   sub(/ [[:upper:]][[:upper:][:digit:]].*/, "",
+   country)
code = substr(country, 1, 2)
desc = substr(country, 4)
sub(/[[:space:]]*$/, "", desc)
@@ -153,7 +152,7 @@ dialog_country_select()
 : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 
-cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF
+cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) || exec "$0" "$@"
-   awk 'sub(/^\t/,"")||1' \
-   >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
+   network={
+   \   ssid="$NETWORK"
+   \   scan_ssid=$SCANSSID
+   \   psk="$PASS"
+   \   priority=5
+   }
+   EOF
 elif echo "$ENCRYPTION" | grep -q EAP; then
USERPASS=$( $DIALOG \
--title "WPA-Enterprise Setup"   \
@@ -300,19 +299,19 @@ elif echo "$ENCRYPTION" | grep -q EAP; then
"Password" 3 0 "" 3 12 25 63 1   \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) || exec "$0" "$@"
-   awk 'sub(/^\t/,"")||1' \
-   >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
+   network={
+   \   ssid="$NETWORK"
+   \   scan_ssid=$SCANSSID
+   \   key_mgmt=WPA-EAP$(
+   echo "$USERPASS" | awk '
+   NR == 1 { printf "\n\tidentity=\"%s\"", $1 }
+   NR == 2 { printf "\n\tpassword=\"%s\"", $1 }
+   ' )
+   \   priority=5
+   }
+   EOF
 elif echo "$ENCRYPTION" | grep -q WEP; then
WEPKEY=$( $DIALOG \
--title "WEP Setup"  \
@@ -324,31 +323,31 @@ elif echo "$ENCRYPTION" | grep -q WEP; then
"WEP Key 0" 2 0 "" 2 12 15 0 1   \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) || exec "$0" "$@"
-   awk 'sub(/^\t/,"")||1' \
-

Re: svn commit: r356758 - in head/usr.sbin/bsdinstall: . scripts

2020-01-16 Thread Devin Teske


> On Jan 16, 2020, at 01:01, Kubilay Kocak  wrote:
> 
> On 16/01/2020 7:27 pm, Colin Percival wrote:
>> On 2020-01-15 21:07, Philip Paeps wrote:
>>> On 2020-01-16 04:57:28 (+1000), Oliver Pinter wrote:
 On Wednesday, January 15, 2020, Ben Woods  wrote:
>   bsdinstall: Change "default" (first) Partitioning method to ZFS
>>> 
 Plus I miss from here the relontes tag.
>>> 
>>> I'm not sure if this merits a release notes entry but ... sure.
>>> 
>>> There is not actually a functional change here.  It's just a defaults 
>>> change.
>> I'd say that a change in defaults is far more deserving of being mentioned
>> in the release notes than, say, adding a new feature.  Nobody will trip over
>> new features by mistake, but there's probably someone out there who is used
>> to holding down the Enter key in the installer and expects to get UFS.
> 
> +1 on changing the default. This doesn't preclude UFS systems or reduce 
> choice (we value choice).
> 
> +0 on tweaking it or setting exceptions if and where necessary, as long as it 
> doesn't result in more than minimal fragmentation between 
> versions/archs/install types: this is also a POLA issue. I don't oin its own 
> consider "4gb systems" as necessary.
> 
> +1 RELNOTES, we value POLA.
> 

-1 on (mentioned somewhere in the thread) dynamic menu items that change based 
on hardware. Muscle memory is not bad.
— 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r355280 - head/usr.sbin/bsdconfig/share

2019-12-01 Thread Devin Teske
Author: dteske
Date: Mon Dec  2 05:24:16 2019
New Revision: 355280
URL: https://svnweb.freebsd.org/changeset/base/355280

Log:
  Fix spurious error from sysrc
  
  When using sysrc to modify a file, the file should be created silently.
  However, with the introduction of SVN r335280, an error of "No such file
  or directory" would appear despite everything else working as-expected.
  
  The nature of this spurious error is that SVN r335280 did not check if
  the file exists first, before trying to fixup the line-endings in the
  file just prior to modification.
  
  PR:   bin/240875
  Reported by:  Jose Luis Duran
  MFC after:3 days

Modified:
  head/usr.sbin/bsdconfig/share/sysrc.subr

Modified: head/usr.sbin/bsdconfig/share/sysrc.subr
==
--- head/usr.sbin/bsdconfig/share/sysrc.subrMon Dec  2 00:39:58 2019
(r355279)
+++ head/usr.sbin/bsdconfig/share/sysrc.subrMon Dec  2 05:24:16 2019
(r355280)
@@ -560,7 +560,7 @@ f_sysrc_set()
#
if [ "$not_found" ]; then
# Add a newline if missing before appending to the file
-   awk 'BEGIN { wc = 0 } NR == 1 {
+   [ ! -e "$file" ] || awk 'BEGIN { wc = 0 } NR == 1 {
(cmd = "wc -l " FILENAME) | getline
close(cmd)
wc = $1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349289 - head/lib/libjail

2019-06-22 Thread Devin Teske
Author: dteske
Date: Sat Jun 22 15:39:34 2019
New Revision: 349289
URL: https://svnweb.freebsd.org/changeset/base/349289

Log:
  `libjail/jail.c' includes both  and 
  
  Latter is undesired when including  according to style(9)
  
  Submitted by: Faraz Vahedi
  Reviewed by:  cem
  Differential Revision:https://reviews.freebsd.org/D20637

Modified:
  head/lib/libjail/jail.c

Modified: head/lib/libjail/jail.c
==
--- head/lib/libjail/jail.c Sat Jun 22 05:35:23 2019(r349288)
+++ head/lib/libjail/jail.c Sat Jun 22 15:39:34 2019(r349289)
@@ -30,7 +30,6 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
 #include 
 #include 
 #include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344243 - head/stand/lua

2019-02-17 Thread Devin Teske


> On 17 Feb 2019, at 9:18 PM, Warner Losh  wrote:
> 
> We did a lot of that traditionally in the FORTH loader too, and weren't 
> always that good about it.

Uh, no. I only clear regions of the screen by positioning the cursor using ANSI 
escape sequences and then drawing spaces. I do not clear the screen “a lot” and 
would like to think I was damned good about it.
— 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r343480 - head/lib/libfigpar

2019-01-27 Thread Devin Teske



> On Jan 26, 2019, at 9:31 PM, Bruce Evans  wrote:
> 
> On Sat, 26 Jan 2019, Stefan Esser wrote:
> 
>> Am 26.01.19 um 22:59 schrieb Colin Percival:
>>> ...
>>> The length of the string was already being recalculated, by strcpy.
>>> 
>>> It seems to me that this could be written as
>>> 
>>> temp = malloc(slen + 1);
>>> if (temp == NULL) /* could not allocate memory */
>>> return (-1);
>>> memcpy(temp, source, slen + 1);
>>> 
>>> which avoids both recalculating the string length and using strcpy?
>> 
>> In principle you are right, there is a small run-time cost by not using
>> the known length for the allocation.
>> 
>> The Clang Scan checks are leading to lots (thousands) of false positives
>> and a I have looked at quite a number and abstained from silencing them
>> in the hope that the scan will be improved.
>> 
>> It should learn that at least the trivial case of an allocation of the
>> value of strlen()+1 followed by a strcpy (and no further strcat or the
>> like) is safe.
> 
> It would be a large bug in coverity for it complain about normal use of
> strcpy().
> 
> However, the the use was not normal.  It has very broken error checking
> for malloc().  This gave undefined behaviour for C99 and usually failure
> of the function and a memory leak for POSIX,
> 
> The broken error checking was to check errno instead of the return
> value of malloc(), without even setting errno to 0 before calling
> malloc().  This is especially broken in a library.  It is normal for
> errno to contain some garbage value from a previous failure, e.g.,
> ENOTTY from isatty().  So the expected behaviour of this library
> function is to usually fail and leak the successfully malloc()ed memory
> when the broken code is reached.  Coverity should find this bug.
> Perhaps it did.
> 
> If errno were set before the call to malloc(), then the code would just
> be unportable.  Setting errno when malloc() fails is a POSIX extension
> of C99.  Coverity should be aware of the standard being used, and should
> find this bug for C99 but not for POSIX.
> 
> The fix and the above patch don't fix styles bug related to the broken
> check.  First there is the lexical style bug of placing the comment
> on the check instead of on the result of the check.  The main bug is
> that it should go without saying that malloc failures are checked for
> by checking whether malloc() returned NULL.  But in the old version,
> the check was encrypted as the broken check of errno.  The comment
> decrypts this a little.
> 

I am genuinely flattered that so much thought is being placed around code that 
I wrote circa 1999.

My code there might even pre-date the C99 standard if memory serves.

When I wrote that code, I had tested it on extensively on over 20 different 
UNIX platforms.

Compatibility was a nightmare back then. I'm so happy we have all these 
wonderful shiny standards today.
-- 
Cheers,
Devin

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


Re: svn commit: r343480 - head/lib/libfigpar

2019-01-26 Thread Devin Teske


> On 26 Jan 2019, at 1:59 PM, Colin Percival  wrote:
> 
> On 1/26/19 1:36 PM, Rodney W. Grimes wrote:
>>> Author: se
>>> Date: Sat Jan 26 21:30:26 2019
>>> New Revision: 343480
>>> URL: https://svnweb.freebsd.org/changeset/base/343480
>>> 
>>> Log:
>>>  Silence Clang Scan warning about potentially unsafe use of strcpy.
>>> 
>>>  While this is a false positive, the use of strdup() simplifies the code.
>> 
>> Though that might be true, it also has to recalculate the
>> length of the string which was already known by slen.
>> 
>> I am not sure how often this code is called,
>> but that is wasted cycles in a library.
> 
> The length of the string was already being recalculated, by strcpy.
> 
> It seems to me that this could be written as
> 
>temp = malloc(slen + 1);
>if (temp == NULL) /* could not allocate memory */
>return (-1);
>memcpy(temp, source, slen + 1);
> 
> which avoids both recalculating the string length and using strcpy?
> 

Thanks for fixing that.
— 
Cheers,
Devin



>>> Modified: head/lib/libfigpar/string_m.c
>>> ==
>>> --- head/lib/libfigpar/string_m.cSat Jan 26 20:43:28 2019(r343479)
>>> +++ head/lib/libfigpar/string_m.cSat Jan 26 21:30:26 2019(r343480)
>>> @@ -119,10 +119,9 @@ replaceall(char *source, const char *find, const char 
>>> 
>>>/* If replace is longer than find, we'll need to create a temp copy */
>>>if (rlen > flen) {
>>> -temp = malloc(slen + 1);
>>> -if (errno != 0) /* could not allocate memory */
>>> +temp = strdup(source);
>>> +if (temp == NULL) /* could not allocate memory */
>>>return (-1);
>>> -strcpy(temp, source);
>>>} else
>>>temp = source;

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


Re: svn commit: r343440 - head/bin/sh

2019-01-26 Thread Devin Teske



> On Jan 26, 2019, at 9:55 AM, Ian Lepore  wrote:
> 
> On Sat, 2019-01-26 at 09:17 -0800, Rodney W. Grimes wrote:
>>> On Sat, 2019-01-26 at 13:18 +, Edward Napierala wrote:
>>>> On 0125T1647, Devin Teske wrote:
>>>>>> On Jan 25, 2019, at 1:13 AM, Edward Napierala <
>>>>>> tr...@freebsd.org>
>>>>>> wrote:
>>>>>> On 0125T1530, Devin Teske wrote:
>>>>>>>> On Jan 25, 2019, at 12:28 AM, Edward Napierala <
>>>>>>>> tr...@freebsd.org> wrote:
>>>>>>>> On 0125T1441, Devin Teske wrote:
>>>>>>>>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala <
>>>>>>>>>> tr...@freebsd.org> wrote:
>>>>>>>>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes
>>>>>>>>>> >>>>>>>>> free...@pdx.rh.cn85.dnsmgr.net>> napisa?(a):
>> 
>> ...
>>>> 
>>> 
>>> No, it's not just the aliases. The part that angers me the most is
>>> the
>>> changing of PS1. I still haven't seen anything that justifies any
>>> of
>>> these changes other than your opinion that you like your changes
>>> better
>>> than what was there before.
>> 
>> I have asked once in public, and once in private in not such a
>> polite tone (Uncalled for, sorry Traz) that this be reverted.
>> This discussion has gone on far too long on -committers and
>> this change is clearly controversial.
>> 
>> Ian, Please assert a request to revert as well, as it seems
>> Traz is stuck in the "this is just a bikeshed" and is not
>> going to move on my request alone, though it was also asserted
>> by Devin.
>> 
>> Thanks,
> 
> Since informal discussion doesn't seem to be getting through, I will
> indeed add my name to the list of those calling for a revert.
> 

I'm actually backing away slowly.
-- 
Devin

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


Re: svn commit: r343440 - head/bin/sh

2019-01-25 Thread Devin Teske


> On Jan 25, 2019, at 1:13 AM, Edward Napierala  wrote:
> 
> On 0125T1530, Devin Teske wrote:
>> 
>> 
>>> On Jan 25, 2019, at 12:28 AM, Edward Napierala  wrote:
>>> 
>>> On 0125T1441, Devin Teske wrote:
>>>> 
>>>> 
>>>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala  wrote:
>>>>> 
>>>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes
>>>>> mailto:free...@pdx.rh.cn85.dnsmgr.net>> 
>>>>> napisał(a):
>>>>>> 
>>>>>>> Author: trasz
>>>>>>> Date: Fri Jan 25 17:09:26 2019
>>>>>>> New Revision: 343440
>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/343440
>>>>>>> 
>>>>>>> Log:
>>>>>>> Comment out the default sh(1) aliases for root, introduced in r343416.
>>>>>>> The rest of this stuff is still to be discussed, but I think at this
>>>>>>> point we have the agreement that the aliases should go.
>>>>>>> 
>>>>>>> MFC after:  2 weeks
>>>>>>> Sponsored by:   DARPA, AFRL
>>>>>> 
>>>>>> Please just revert this and the prior commit out, and when
>>>>>> the path forward is clear commit it.  I would not want any of this
>>>>>> merged to 12/ or 11/ until the time that it is all settled.
>>>>> 
>>>>> Oops, my bad - neither this nor the previous commit is supposed
>>>>> to be MFC-ed; the "2 weeks" above comes from my default Subversion
>>>>> config.
>>>>> 
>>>>> Regarding the backoff - just a few hours ago you said you don't have
>>>>> any problem with this, except for aliases and the default ENV.  The
>>>>> aliases problem has been addressed, and you hadn't yet responded
>>>>> to my explanations regarding the ENV.  Another committer asked for
>>>>> backoff, because "sh is not an interactive shell", while in fact sh(1)
>>>>> is FreeBSD's default interactive shell except for root.  Finally, there's
>>>>> one person who asked for revert, but without giving any reasons
>>>>> whatsoever.
>>>>> 
>>>>> So far nobody had proposed any scenario where this would break
>>>>> anything, or even affect existing users.  It seems like a typical bikeshed
>>>>> situation.
>>>> 
>>>> It is not clear to me after reading r343416 and D18872 what this change is 
>>>> trying to solve.
>>> 
>>> The idea is to make it easy to replace the default root shell - which
>>> many people consider broken, due to not supporting basic shell syntax - with
>>> something that actually works.
>> 
>> How exactly does changing PS1 or adding 6 aliases fix the "basic shell 
>> syntax" which you claim to be unsupported?
>> 
>> If the number of aliases added to a shell are a measure of its brokenness, 
>> then bash must be hella broken (I have 43 aliases in my bash_profile).
> 
> The aliases are gone.

Fair enough, albeit the topic was r343416 and D18872.


>  Human-friendly PS1 is considered a standard feature
> nowadays.

I fail to see how ''$ " is unfriendly.

In fact, I am a bit amiss how you don't see "\u@\h:\w \\$ " as being unfriendly 
to TCL/Expect.

While it's certainly possible to use "expect -re" and formulate around it, the 
change itself would break existing scripts.



>  But the way it fixes things is that it makes it easy to replace
> csh with a shell which actually groks shell syntax and is reasonably useful
> out of the box,

This sounds like you are claiming csh is broken.

I see where you may be coming from:

+ /bin/sh supports a syntax
+ bash supports nearly all of /bin/sh
+ zsh supports nearly all of /bin/sh

So [t]csh must seem broken to you because it doesn't fall inline.

Being different doesn't mean you are broken. As I have stated previously, I 
know lots of people that would and do set their login shell to tcsh.

I personally have both a .tcshrc and a .bash_profile because I use both. I 
would never consider csh broken because it doesn't "grok shell syntax" -- it 
in-fact groks its own shell syntax just fine and dandy.


> with ~/.shrc you can customize etc.

As can ~/.profile



>  Think of it as a POLA,
> but horizontally, for folks coming from other systems, instead of the usual
> one.

POLA can affect multiple people at the same time.

Someone may be astonished that something is different when

Re: svn commit: r343440 - head/bin/sh

2019-01-25 Thread Devin Teske


> On Jan 25, 2019, at 12:28 AM, Edward Napierala  wrote:
> 
> On 0125T1441, Devin Teske wrote:
>> 
>> 
>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala  wrote:
>>> 
>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes
>>> mailto:free...@pdx.rh.cn85.dnsmgr.net>> 
>>> napisał(a):
>>>> 
>>>>> Author: trasz
>>>>> Date: Fri Jan 25 17:09:26 2019
>>>>> New Revision: 343440
>>>>> URL: https://svnweb.freebsd.org/changeset/base/343440
>>>>> 
>>>>> Log:
>>>>> Comment out the default sh(1) aliases for root, introduced in r343416.
>>>>> The rest of this stuff is still to be discussed, but I think at this
>>>>> point we have the agreement that the aliases should go.
>>>>> 
>>>>> MFC after:  2 weeks
>>>>> Sponsored by:   DARPA, AFRL
>>>> 
>>>> Please just revert this and the prior commit out, and when
>>>> the path forward is clear commit it.  I would not want any of this
>>>> merged to 12/ or 11/ until the time that it is all settled.
>>> 
>>> Oops, my bad - neither this nor the previous commit is supposed
>>> to be MFC-ed; the "2 weeks" above comes from my default Subversion
>>> config.
>>> 
>>> Regarding the backoff - just a few hours ago you said you don't have
>>> any problem with this, except for aliases and the default ENV.  The
>>> aliases problem has been addressed, and you hadn't yet responded
>>> to my explanations regarding the ENV.  Another committer asked for
>>> backoff, because "sh is not an interactive shell", while in fact sh(1)
>>> is FreeBSD's default interactive shell except for root.  Finally, there's
>>> one person who asked for revert, but without giving any reasons
>>> whatsoever.
>>> 
>>> So far nobody had proposed any scenario where this would break
>>> anything, or even affect existing users.  It seems like a typical bikeshed
>>> situation.
>> 
>> It is not clear to me after reading r343416 and D18872 what this change is 
>> trying to solve.
> 
> The idea is to make it easy to replace the default root shell - which
> many people consider broken, due to not supporting basic shell syntax - with
> something that actually works.

How exactly does changing PS1 or adding 6 aliases fix the "basic shell syntax" 
which you claim to be unsupported?

If the number of aliases added to a shell are a measure of its brokenness, then 
bash must be hella broken (I have 43 aliases in my bash_profile).

Also, the perhaps anecdotal consideration of brokenness is nearly laughable -- 
these can largely be lumped into one of three categories:

a. Considered broken because it doesn't support bashisms
b. Considered broken because lack of syntactical knowledge
c. Considered broken because (no reason given)

Other languages might fit that description as well, and so we should take this 
anecdote of "many people consider broken" with a grain of salt.

I personally have written more than 50,000 lines of shell for the FreeBSD base 
OS -- all utilizing /bin/sh


> 
>> PS1 should have a reasonable default. If that default is not reasonable, 
>> then we should change the C code.
>> 
>> Maybe I see things differently, but I'd rather see PS1 default change so no 
>> profile/shrc change is necessary.
> 
> Thank you, that's actually a valid argument.  I believe that's also what
> bash does.  It would be more intrusive, though, and I kind of don't like
> the idea of hardcoding things that can easily be dealt with with in a more
> "high-level" way.
> 
>> I prefer that sh, in its default configuration, not attempt to read 
>> $HOME/.shrc, for security reasons.
> 
> Can you elaborate?  It already reads $HOME/.profile; how is $HOME/.shrc
> different?

If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand the 
importance of "one place to exploit versus two."

(situation)

Say you've been running FreeBSD for 20 years (it turned 25 years old last year, 
so this is not only possible, but plausible).
You know all the areas of interest where an attacker could inject code.
You take care to lock down each one.
But come to your surprise ...

(hypothetical)

6 months after you upgraded from 11.2 to the latest 12.x, you find that you 
didn't take into account that $HOME/.profile (which you perhaps locked down 
with a "chflags" command) now branches out to a new file which you've never 
taken steps to lock down, keep an eye on, or audit (e.g., by using DTrace 
remote-logging, tripwire, or

Re: svn commit: r343440 - head/bin/sh

2019-01-25 Thread Devin Teske


> On Jan 25, 2019, at 2:41 PM, Devin Teske  wrote:
> 
> 
> 
>> On Jan 25, 2019, at 1:37 PM, Edward Napierala > <mailto:tr...@freebsd.org>> wrote:
>> 
>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes
>> mailto:free...@pdx.rh.cn85.dnsmgr.net>> 
>> napisał(a):
>>> 
>>>> Author: trasz
>>>> Date: Fri Jan 25 17:09:26 2019
>>>> New Revision: 343440
>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 
>>>> <https://svnweb.freebsd.org/changeset/base/343440>
>>>> 
>>>> Log:
>>>>  Comment out the default sh(1) aliases for root, introduced in r343416.
>>>>  The rest of this stuff is still to be discussed, but I think at this
>>>>  point we have the agreement that the aliases should go.
>>>> 
>>>>  MFC after:  2 weeks
>>>>  Sponsored by:   DARPA, AFRL
>>> 
>>> Please just revert this and the prior commit out, and when
>>> the path forward is clear commit it.  I would not want any of this
>>> merged to 12/ or 11/ until the time that it is all settled.
>> 
>> Oops, my bad - neither this nor the previous commit is supposed
>> to be MFC-ed; the "2 weeks" above comes from my default Subversion
>> config.
>> 
>> Regarding the backoff - just a few hours ago you said you don't have
>> any problem with this, except for aliases and the default ENV.  The
>> aliases problem has been addressed, and you hadn't yet responded
>> to my explanations regarding the ENV.  Another committer asked for
>> backoff, because "sh is not an interactive shell", while in fact sh(1)
>> is FreeBSD's default interactive shell except for root.  Finally, there's
>> one person who asked for revert, but without giving any reasons
>> whatsoever.
>> 
>> So far nobody had proposed any scenario where this would break
>> anything, or even affect existing users.  It seems like a typical bikeshed
>> situation.
> 
> It is not clear to me after reading r343416 and D18872 what this change is 
> trying to solve.
> 
> PS1 should have a reasonable default. If that default is not reasonable, then 
> we should change the C code.
> 
> Maybe I see things differently, but I'd rather see PS1 default change so no 
> profile/shrc change is necessary.
> 
> I prefer that sh, in its default configuration, not attempt to read 
> $HOME/.shrc, for security reasons.
> 
> Further, it is documented that the contents of ENV may be ignored in 
> privileged mode, negating these changes.
> 
> If you wanted your new shiny default PS1 to actually have an effect in all 
> modes (including privileged mode, where you probably want it), you would have 
> put it in /etc/profile and not in a file that is wholly ignored by some modes 
> (e.g., privileged mode).
> 
> So the solution is not even the right one for the desired result.

I would also like to add, that the current default for PS1 is static for a 
reason.

Long ago, people used to write things in TCL/Expect. If PS1 is not static, you 
either have to override it or account for the variance (# for root, $ for 
others).

This is an important distinction specifically because TCL/Expect is used in the 
control of interactive shells.
-- 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r343440 - head/bin/sh

2019-01-25 Thread Devin Teske


> On Jan 25, 2019, at 2:47 PM, Devin Teske  wrote:
> 
> 
> 
>> On Jan 25, 2019, at 2:41 PM, Devin Teske > <mailto:dte...@freebsd.org>> wrote:
>> 
>> 
>> 
>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala >> <mailto:tr...@freebsd.org>> wrote:
>>> 
>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes
>>> mailto:free...@pdx.rh.cn85.dnsmgr.net>> 
>>> napisał(a):
>>>> 
>>>>> Author: trasz
>>>>> Date: Fri Jan 25 17:09:26 2019
>>>>> New Revision: 343440
>>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 
>>>>> <https://svnweb.freebsd.org/changeset/base/343440>
>>>>> 
>>>>> Log:
>>>>>  Comment out the default sh(1) aliases for root, introduced in r343416.
>>>>>  The rest of this stuff is still to be discussed, but I think at this
>>>>>  point we have the agreement that the aliases should go.
>>>>> 
>>>>>  MFC after:  2 weeks
>>>>>  Sponsored by:   DARPA, AFRL
>>>> 
>>>> Please just revert this and the prior commit out, and when
>>>> the path forward is clear commit it.  I would not want any of this
>>>> merged to 12/ or 11/ until the time that it is all settled.
>>> 
>>> Oops, my bad - neither this nor the previous commit is supposed
>>> to be MFC-ed; the "2 weeks" above comes from my default Subversion
>>> config.
>>> 
>>> Regarding the backoff - just a few hours ago you said you don't have
>>> any problem with this, except for aliases and the default ENV.  The
>>> aliases problem has been addressed, and you hadn't yet responded
>>> to my explanations regarding the ENV.  Another committer asked for
>>> backoff, because "sh is not an interactive shell", while in fact sh(1)
>>> is FreeBSD's default interactive shell except for root.  Finally, there's
>>> one person who asked for revert, but without giving any reasons
>>> whatsoever.
>>> 
>>> So far nobody had proposed any scenario where this would break
>>> anything, or even affect existing users.  It seems like a typical bikeshed
>>> situation.
>> 
>> It is not clear to me after reading r343416 and D18872 what this change is 
>> trying to solve.
>> 
>> PS1 should have a reasonable default. If that default is not reasonable, 
>> then we should change the C code.
>> 
>> Maybe I see things differently, but I'd rather see PS1 default change so no 
>> profile/shrc change is necessary.
>> 
>> I prefer that sh, in its default configuration, not attempt to read 
>> $HOME/.shrc, for security reasons.
>> 
>> Further, it is documented that the contents of ENV may be ignored in 
>> privileged mode, negating these changes.
>> 
>> If you wanted your new shiny default PS1 to actually have an effect in all 
>> modes (including privileged mode, where you probably want it), you would 
>> have put it in /etc/profile and not in a file that is wholly ignored by some 
>> modes (e.g., privileged mode).
>> 
>> So the solution is not even the right one for the desired result.
> 
> I would also like to add, that the current default for PS1 is static for a 
> reason.
> 
> Long ago, people used to write things in TCL/Expect. If PS1 is not static, 
> you either have to override it or account for the variance (# for root, $ for 
> others).
> 
> This is an important distinction specifically because TCL/Expect is used in 
> the control of interactive shells.

And an aside:

I still program in TCL/Expect. I have been known to customize PS2 and PS4.

I may have neglected to give reasons previously, but that's because I was in a 
meeting and unable to expand on the particular technical intricacies:

1. The relationship default PS1, PS2, and PS4 have with software like TCL/Expect
2. The fact that ENV is wholly ignored in privileged mode
3. The fact that introducing ~/.shrc as a runnable file for interactive sh 
globally and by-default is something that should be run by secteam
-- 
Devin

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


Re: svn commit: r343440 - head/bin/sh

2019-01-25 Thread Devin Teske


> On Jan 25, 2019, at 1:37 PM, Edward Napierala  wrote:
> 
> pt., 25 sty 2019 o 19:57 Rodney W. Grimes
> mailto:free...@pdx.rh.cn85.dnsmgr.net>> 
> napisał(a):
>> 
>>> Author: trasz
>>> Date: Fri Jan 25 17:09:26 2019
>>> New Revision: 343440
>>> URL: https://svnweb.freebsd.org/changeset/base/343440
>>> 
>>> Log:
>>>  Comment out the default sh(1) aliases for root, introduced in r343416.
>>>  The rest of this stuff is still to be discussed, but I think at this
>>>  point we have the agreement that the aliases should go.
>>> 
>>>  MFC after:  2 weeks
>>>  Sponsored by:   DARPA, AFRL
>> 
>> Please just revert this and the prior commit out, and when
>> the path forward is clear commit it.  I would not want any of this
>> merged to 12/ or 11/ until the time that it is all settled.
> 
> Oops, my bad - neither this nor the previous commit is supposed
> to be MFC-ed; the "2 weeks" above comes from my default Subversion
> config.
> 
> Regarding the backoff - just a few hours ago you said you don't have
> any problem with this, except for aliases and the default ENV.  The
> aliases problem has been addressed, and you hadn't yet responded
> to my explanations regarding the ENV.  Another committer asked for
> backoff, because "sh is not an interactive shell", while in fact sh(1)
> is FreeBSD's default interactive shell except for root.  Finally, there's
> one person who asked for revert, but without giving any reasons
> whatsoever.
> 
> So far nobody had proposed any scenario where this would break
> anything, or even affect existing users.  It seems like a typical bikeshed
> situation.

It is not clear to me after reading r343416 and D18872 what this change is 
trying to solve.

PS1 should have a reasonable default. If that default is not reasonable, then 
we should change the C code.

Maybe I see things differently, but I'd rather see PS1 default change so no 
profile/shrc change is necessary.

I prefer that sh, in its default configuration, not attempt to read 
$HOME/.shrc, for security reasons.

Further, it is documented that the contents of ENV may be ignored in privileged 
mode, negating these changes.

If you wanted your new shiny default PS1 to actually have an effect in all 
modes (including privileged mode, where you probably want it), you would have 
put it in /etc/profile and not in a file that is wholly ignored by some modes 
(e.g., privileged mode).

So the solution is not even the right one for the desired result.
-- 
Devin


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


Re: svn commit: r343416 - head/bin/sh

2019-01-24 Thread Devin Teske



> On Jan 24, 2019, at 5:35 PM, Cy Schubert  wrote:
> 
> Agreed re samples though a comment in the default should point the user to 
> samples. Samples could also include some nifty tricks too, some of which are 
> in fortune or Power Tools.

What is this "Power Tools" you speak of (honest question)
-- 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r343416 - head/bin/sh

2019-01-24 Thread Devin Teske



> On Jan 24, 2019, at 4:23 PM, Rodney W. Grimes 
>  wrote:
> 
> [ Charset UTF-8 unsupported, converting... ]
>> On Thu, 2019-01-24 at 15:55 -0800, Rodney W. Grimes wrote:
 Author: trasz
 Date: Thu Jan 24 23:34:51 2019
 New Revision: 343416
 URL: https://svnweb.freebsd.org/changeset/base/343416
 
 Log:
  Install .shrc for root, and set PS1 for the toor account.
>>> 
>>> And a dozen other aliases :-(
>>> Please do not contaiminate the prestine environment with
>>> personal preferences.  In the start of the project we
>>> did a great deal of work to remove and eliminate these
>>> types of things, only the few csh aliases where retained.
>>> 
>>> This is really the domain of a systems administrator to
>>> decide and making work for them to clean this out is
>>> not going to make them happy.
>>> 
>>> The commands in an ENV file well be executed by
>>> every single shell that is started, not just an
>>> interactive shell, unless I am mis reading the
>>> man page:
>>> If the environment variable ENV is set on
>>> entry to a shell, or is set in the .profile of a login shell, the
>>> shell
>>> then subjects its value to parameter expansion and arithmetic
>>> expansion
>>> and reads commands from the named file.
> 
> The man page needs fixed here too, it does infact later state
> that THIS version of sh does not always run ENV, only for
> interactive shells.  Which is a good thing, but there is
> still this un needed contaimination with aliases.
> 
> You also just caused me to have to revive my .profile diff
> cause the addition of the ENV falls in the context range
> of my local mods.  I am sure this effects others.  Please
> do consider that these files have been very very rarely
> touched over decades of time.
> 

+1

Will be watching for the revert of this.
-- 
Devin

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


Re: svn commit: r342945 - in head: tools/build/mk usr.sbin/bluetooth usr.sbin/bluetooth/bluetooth-config

2019-01-11 Thread Devin Teske



> On Jan 11, 2019, at 11:16 AM, Rodney W. Grimes 
>  wrote:
> 
>>> On Jan 11, 2019, at 10:36 AM, Rodney W. Grimes 
>>>  wrote:
>>> 
 On Fri, Jan 11, 2019 at 10:10 AM Rodney W. Grimes <
 free...@pdx.rh.cn85.dnsmgr.net> wrote:
 
>> On Fri, Jan 11, 2019 at 08:04:33AM -0800, Rodney W. Grimes wrote:
>>> The style of this .sh does not match the normal style of
>>> such things in base, especially with respect to long lines
>>> and indentation.
>> 
>> Do we have a style guide for shell scripts in base? How should
>> indentation look like?
> 
> Not that I can locate, but I can state that almost all
> of the base code uses tab indenting and limited to 80
> column widths, independent of c, sh, make, etc.
> 
 
 We have a style.Makefile, style, style.mdoc and style.lua man pages. Maybe
 it's time for style.sh, eh?
>>> 
>>> Yes please!
>>> 
>> 
>> If we can agree to be professional and collegial, ...
>> 
>> I'll start with chapters from the Style section of my book:
>> https://freebsdfrau.gitbooks.io/serious-shell-programming/content/style/awk.html
>> 
> 
> If you can mdoc that and

Surely.


> take what applies to /bin/sh.
> 

It *exclusively* applies to /bin/sh (as does my entire book).


> Might be easier to start with one of the other style.foo pages though.

I already did. Started with style(9), going back to mdoc would be easy.


> And we don't want to go to far and put all of our sh code
> out of conformance.

The Style entry in my book is based on my FreeBSD sh code.



>   For one variable being $foo or ${foo}
> is varied greatly, IMHO the rule should be that the file just
> be consistent through out, and that one or the other is the
> prefered style, but either is acceptable.
> 

I talked about this at BSDCan in June. $foo is preferred (there
*is* a difference) and, as you say, if a file is consistently ${foo}
then it is fine.
-- 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r342945 - in head: tools/build/mk usr.sbin/bluetooth usr.sbin/bluetooth/bluetooth-config

2019-01-11 Thread Devin Teske



> On Jan 11, 2019, at 10:36 AM, Rodney W. Grimes 
>  wrote:
> 
> [ Charset UTF-8 unsupported, converting... ]
>> On Fri, Jan 11, 2019 at 10:10 AM Rodney W. Grimes <
>> free...@pdx.rh.cn85.dnsmgr.net> wrote:
>> 
 On Fri, Jan 11, 2019 at 08:04:33AM -0800, Rodney W. Grimes wrote:
> The style of this .sh does not match the normal style of
> such things in base, especially with respect to long lines
> and indentation.
 
 Do we have a style guide for shell scripts in base? How should
 indentation look like?
>>> 
>>> Not that I can locate, but I can state that almost all
>>> of the base code uses tab indenting and limited to 80
>>> column widths, independent of c, sh, make, etc.
>>> 
>> 
>> We have a style.Makefile, style, style.mdoc and style.lua man pages. Maybe
>> it's time for style.sh, eh?
> 
> Yes please!
> 

If we can agree to be professional and collegial, ...

I'll start with chapters from the Style section of my book:
https://freebsdfrau.gitbooks.io/serious-shell-programming/content/style/awk.html
 


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


Re: svn commit: r341803 - head/libexec/rc

2018-12-11 Thread Devin Teske



> On Dec 11, 2018, at 1:54 PM, Conrad Meyer  wrote:
> 
> On Tue, Dec 11, 2018 at 12:35 PM Devin Teske  wrote:
>>> On Dec 11, 2018, at 11:57 AM, Conrad Meyer  wrote:
>>> Is there any interest in a tee(2)-like syscall?
>>> 
>> 
>> Linux has vmsplice(2). I know jmg@ also expressed interest in having a
>> vmsplice in FreeBSD.
> 
> Sure; they're related.  See also splice(2).  But tee(2) is probably
> the one that would be most useful here.
> 
>> As for sh not being able to read more than a single byte at a time because
>> it could be reading from a pipe, what if it read into a buffer and returned
>> a line from the buffer. A subsequent read would return more data from the
>> buffer, ad nauseam until the buffer runs out -- in which case another chunk
>> is read to augment the data.
>> 
>> This buffer could be expunged when stdin collapses (e.g., when the sub-
>> shell completes.
> 
> Yeah, this is basically what "buffered input" means.  An example of
> the problem with the naive solution is the scenario Warner pasted a
> few emails ago.  Take:
> 
>foo | (read bar; baz)
> 
> (Where 'baz' is not a built-in.)  To implement this correctly with
> buffered 'read,' you have to somehow flush any input in the buffer
> beyond the end of the first line to the pipe that will be baz's stdin,
> as well as with the remaining contents of the pipe from foo (which
> may be indefinite).  That is what I suggested above as (A).
> 
> One big caveat is that you basically have to spawn a thread or process
> to keep feeding the input from the first pipe to the magical implicit
> pipe.  This overhead can be avoided readily in most scenarios if only
> the 'read' command is buffered.  Also, the described (read bar; baz)
> sub-program is a fairly odd construction, and the feeding isn't needed
> if no non-builtin programs after 'read' will access stdin.
> 
> If it helps paint a more concrete picture, imagine 'foo' as 'yes' and
> 'baz' as 'pv > /dev/null' or something (i.e., indefinite data source,
> indefinite data sink).

Thanks, this definitely illustrates the trouble.

In that case, would it be appropriate to say that:

blah | while read x; do ...; done

Is always more efficiently written as:

IFS=$'\n'
for x in $( blah ); do ...; done

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


Re: svn commit: r341803 - head/libexec/rc

2018-12-11 Thread Devin Teske


> On Dec 11, 2018, at 11:57 AM, Conrad Meyer  wrote:
> 
> On Tue, Dec 11, 2018 at 10:04 AM Warner Losh  wrote:
>> On Tue, Dec 11, 2018, 9:55 AM John Baldwin >> 
>>> The 'read' builtin in sh can't use buffering, so it is always going to be 
>>> slow
>> 
>> It can't use it because of pipes. The example from the parts of this that 
>> was on IRC was basically:
>> 
>> foo | (read bar; baz)
>> 
>> Which reads one line into the bar variable and then sends the rest to the 
>> bar command.
> 
> It can't trivially, but it's not impossible.  sh could play games and
> buffer its own use of stdin, and then open a fresh pipe for stdin of
> subsequent non-builtins, writing out unused portions of the buffer.[A]
> 
> Some other alternatives that would require kernel support but are
> things we've talked about doing in the kernel before anyway:
> 
> * If we had something like eBPF programs attached to IO, maybe sh's
> read built-in could push a small eBPF program into the kernel that
> determined how many bytes could be read from the pipe in a single
> syscall without reading too far.  It's fairly trivial.  Simply
> returning a number of bytes up to and including the first '\n' would
> be a fine, if sometimes conservative amount.  (Input lines can be
> continued with a trailing backslash, except in -r mode, but as a
> first-cut approximation, reading-until-newline is probably good
> enough.)[B]
> 
> * Heck, even just a read_until_newline(2) syscall would work and
> probably be more broadly useful than just sh(1).  I don't think it
> passes the sniff test — not general enough, and probably not something
> you want beginners stumbling across instead of fgets(3) — but it'd be
> fine, and there are other pipe-abusing programs that care about
> reading ASCII text lines without overconsuming input than just
> sh(1).[C]
> 
> * If we had something like Linux's tee(2) system call (which is as it
> sounds — tee(1) for pipes), sh(1)'s read built-in could tee(2) for
> buffering without impacting stdin, and read(2) stdin only when it knew
> how many bytes were consumed (or when the pipe buffer became full).[D]
> 
> I suspect (C) would be the easiest to implement correctly, followed by
> (D).  (B) is requires some architectural design and bikeshedding and
> the details on the kernel side are tricky.  (A) would be a little
> tricky and probably require extensive changes to sh(1) itself, which
> is a risk to the base system.  But it would not impact the kernel.
> 
> Is there any interest in a tee(2)-like syscall?
> 

Linux has vmsplice(2). I know jmg@ also expressed interest in having a
vmsplice in FreeBSD.

As for sh not being able to read more than a single byte at a time because
it could be reading from a pipe, what if it read into a buffer and returned
a line from the buffer. A subsequent read would return more data from the
buffer, ad nauseam until the buffer runs out -- in which case another chunk
is read to augment the data.

This buffer could be expunged when stdin collapses (e.g., when the sub-
shell completes.
-- 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r341803 - head/libexec/rc

2018-12-11 Thread Devin Teske



> On Dec 11, 2018, at 9:23 AM, John Baldwin  wrote:
> 
> On 12/10/18 5:38 PM, Conrad Meyer wrote:
>> Author: cem
>> Date: Tue Dec 11 01:38:50 2018
>> New Revision: 341803
>> URL: https://svnweb.freebsd.org/changeset/base/341803
>> 
>> Log:
>>  rc.subr: Implement list_vars without using 'read'
>> 
>>  'read' pessimistically read(2)s one byte at a time, which can be quite
>>  silly for large environments in slow emulators.
>> 
>>  In my boring user environment, truss shows that the number of read()
>>  syscalls to source rc.subr and invoke list_vars is reduced by something like
>>  3400 to 60.  ministat(1) shows a significant time difference of about -71%
>>  for my environment.
>> 
>>  Suggested by:   jilles
>>  Discussed with: dteske, jhb, jilles
>>  Differential Revision:  https://reviews.freebsd.org/D18481
> 
> For some background, one my colleagues reported that it was taking hours in
> (an admittedly slow) CPU simulator to get through '/etc/rc.d/netif start'.
> I ended up running that script under truss in a RISC-V qemu machine.  The
> entire run took 212 seconds (truss did slow it down quite a bit).  Of that
> 212 seconds, the read side of each list_vars invocation took ~25.5 seconds,
> and with lo0 and vtnet0 there were 8 list_vars invocations, so 204 out of
> the 212 seconds were spent in the single-byte read() syscalls in 'while read'.
> 
> Even on qemu without truss during bootup 'netif start' took a couple of
> seconds (long enough to get 2-3 Ctrl-T's in) before this change and is now
> similar to bare metal with the change.  list_vars is rarely used outside of
> 'netif', so it probably doesn't make a measurable difference on bare metal.
> 

Thank you for the background which was lost by the time I got to the phab.

I can't help but ask though,...

If it was noticed that read(2) processes the stream one byte at a time,
why not just optimize read(2)?

I'm afraid of the prospect of having to hunt down every instance of while-read,
but if we can fix the underlying read(2) inefficiency then we make while-read 
OK.
-- 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r340348 - in stable/12: libexec/rc share/man/man5 share/man/man8

2018-11-10 Thread Devin Teske
Author: dteske
Date: Sun Nov 11 06:05:28 2018
New Revision: 340348
URL: https://svnweb.freebsd.org/changeset/base/340348

Log:
  MFC r339971: Add new rc keywords: enable, disable, delete
  
  This adds new keywords to rc/service to enable/disable a service's
  rc.conf(5) variable and "delete" to remove the variable.
  
  When the "service_delete_empty" variable in rc.conf(5) is set to "YES"
  (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is
  deleted if empty after modification using "service $foo delete".
  
  Submitted by: lme (modified)
  Reviewed by:  0mp (previous version), lme, bcr
  Approved by:  re (rgrimes)
  Relnotes: yes
  Sponsored by: Smule, Inc.
  Differential Revision:https://reviews.freebsd.org/D17113

Modified:
  stable/12/libexec/rc/rc.conf
  stable/12/libexec/rc/rc.subr
  stable/12/share/man/man5/rc.conf.5
  stable/12/share/man/man8/rc.8
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/libexec/rc/rc.conf
==
--- stable/12/libexec/rc/rc.confSun Nov 11 01:46:48 2018
(r340347)
+++ stable/12/libexec/rc/rc.confSun Nov 11 06:05:28 2018
(r340348)
@@ -617,6 +617,7 @@ savecore_enable="YES"   # Extract core from dump devices
 savecore_flags="-m 10" # Used if dumpdev is enabled above, and present.
# By default, only the 10 most recent kernel dumps
# are saved.
+service_delete_empty="NO" # Have 'service delete' remove empty rc.conf.d files.
 crashinfo_enable="YES" # Automatically generate crash dump summary.
 crashinfo_program="/usr/sbin/crashinfo"# Script to generate crash dump 
summary.
 quota_enable="NO"  # turn on quotas on startup (or NO).

Modified: stable/12/libexec/rc/rc.subr
==
--- stable/12/libexec/rc/rc.subrSun Nov 11 01:46:48 2018
(r340347)
+++ stable/12/libexec/rc/rc.subrSun Nov 11 06:05:28 2018
(r340348)
@@ -922,7 +922,7 @@ run_rc_command()
eval _override_command=\$${name}_program
command=${_override_command:-$command}
 
-   _keywords="start stop restart rcvar enabled describe extracommands 
$extra_commands"
+   _keywords="start stop restart rcvar enable disable delete enabled 
describe extracommands $extra_commands"
rc_pid=
_pidcmd=
_procname=${procname:-${command}}
@@ -977,12 +977,13 @@ run_rc_command()
if [ "$_elem" != "$rc_arg" ]; then
continue
fi
-   # if ${rcvar} is set, $1 is not "rcvar" 
and not "describe"
-   # and ${rc_pid} is not set, then run
+   # if ${rcvar} is set, $1 is not 
"rcvar", "describe",
+   # "enable" or "delete", and ${rc_pid} 
is not set, run:
#   checkyesno ${rcvar}
# and return if that failed
#
if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a "$rc_arg" != 
"stop" \
+   -a "$rc_arg" != "delete" -a "$rc_arg" != "enable" \
-a "$rc_arg" != "describe" ] ||
[ -n "${rcvar}" -a "$rc_arg" = "stop" -a -z "${rc_pid}" ]; 
then
if ! checkyesno ${rcvar}; then
@@ -1028,6 +1029,31 @@ run_rc_command()

extracommands)
echo "$extra_commands"
+   ;;
+
+   enable)
+   _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=YES") &&
+   echo "$name enabled in ${_out%%:*}" 
+   ;;
+
+   disable)
+   _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=NO") &&
+   echo "$name disabled in ${_out%%:*}"
+   ;;
+
+   delete)
+   _files=
+   for _file in $(sysrc -lEs "$name"); do
+   _out=$(sysrc -Fif $_file "$rcvar") && 
_files="$_files $_file"
+   done
+   /usr/sbin/sysrc -x "$rcvar" && echo "$rcvar deleted in 
${_files# }"
+   # delete file in rc.conf.d if desired and empty.
+   checkyesno service_delete_empty || _files=
+   for _file in $_files; do
+   [ "$_file" = "${_file#*/rc.conf.d/}" ] && 
continue
+   [ $(/usr/bin/stat -f%z $_file) -gt 0 ] && 
continue
+   /bin/rm "$_file" && echo "Empty file $_file 
removed"
+   done
;;
 
status)

Modified: 

Re: svn commit: r340321 - in head/libexec/rc: . rc.d

2018-11-10 Thread Devin Teske
This also allows "sysrc -d jail_conf" to print "Configuration file for jail(8)"

Thanks.
-- 
Cheers,
Devin

> On Nov 10, 2018, at 6:11 AM, Eugene Grosbein  wrote:
> 
> Author: eugen
> Date: Sat Nov 10 14:11:54 2018
> New Revision: 340321
> URL: https://svnweb.freebsd.org/changeset/base/340321
> 
> Log:
>  Move definition of $jail_conf variable to /etc/defaults/rc.conf
>  from jail startup script so it can be successfully queried
>  with the command "sysrc jail_conf".
> 
>  MFC after:   1 month
> 
> Modified:
>  head/libexec/rc/rc.conf
>  head/libexec/rc/rc.d/jail
> 
> Modified: head/libexec/rc/rc.conf
> ==
> --- head/libexec/rc/rc.conf   Sat Nov 10 13:16:54 2018(r340320)
> +++ head/libexec/rc/rc.conf   Sat Nov 10 14:11:54 2018(r340321)
> @@ -703,6 +703,7 @@ iovctl_files=""   # Config files for iovctl(8)
> ### Jail Configuration (see rc.conf(5) manual page) ##
> ##
> jail_enable="NO"  # Set to NO to disable starting of any jails
> +jail_conf="/etc/jail.conf"   # Configuration file for jail(8)
> jail_confwarn="YES"   # Prevent warning about obsolete per-jail configuration
> jail_parallel_start="NO"  # Start jails in the background
> jail_list=""  # Space separated list of names of jails
> 
> Modified: head/libexec/rc/rc.d/jail
> ==
> --- head/libexec/rc/rc.d/jail Sat Nov 10 13:16:54 2018(r340320)
> +++ head/libexec/rc/rc.d/jail Sat Nov 10 14:11:54 2018(r340321)
> @@ -21,7 +21,6 @@ config_cmd="jail_config"
> console_cmd="jail_console"
> status_cmd="jail_status"
> extra_commands="config console status"
> -: ${jail_conf:=/etc/jail.conf}
> : ${jail_program:=/usr/sbin/jail}
> : ${jail_consolecmd:=/usr/bin/login -f root}
> : ${jail_jexec:=/usr/sbin/jexec}
> 

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


svn commit: r340091 - head/contrib/one-true-awk

2018-11-02 Thread Devin Teske
Author: dteske
Date: Fri Nov  2 23:03:40 2018
New Revision: 340091
URL: https://svnweb.freebsd.org/changeset/base/340091

Log:
  Update awk(1) manual to state an exception to egrep(1)-like RE syntax
  
  Reviewed by:  imp, jmg
  MFC after:3 days
  Sponsored by: Smule, Inc.
  Differential Revision:https://reviews.freebsd.org/D17739

Modified:
  head/contrib/one-true-awk/awk.1

Modified: head/contrib/one-true-awk/awk.1
==
--- head/contrib/one-true-awk/awk.1 Fri Nov  2 22:50:13 2018
(r340090)
+++ head/contrib/one-true-awk/awk.1 Fri Nov  2 23:03:40 2018
(r340091)
@@ -352,9 +352,13 @@ Patterns are arbitrary Boolean combinations
 of regular expressions and
 relational expressions.
 Regular expressions are as in
-.IR egrep ; 
-see
-.IR grep (1).
+.IR egrep (1) 
+except numeric quantifiers are not supported beyond the basic
+.B +
+and
+.B ?
+for quantities \&\f(CW"0 or 1"\fP and \&\f(CW"1 or more"\fP
+respectively.
 Isolated regular expressions
 in a pattern apply to the entire line.
 Regular expressions may also occur in
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r339971 - in head: libexec/rc share/man/man5 share/man/man8

2018-11-01 Thread Devin Teske


> On Nov 1, 2018, at 11:33 AM, Oliver Pinter  
> wrote:
> 
> 
> 
> On Wednesday, October 31, 2018, Devin Teske  <mailto:dte...@freebsd.org>> wrote:
> Author: dteske
> Date: Wed Oct 31 20:37:12 2018
> New Revision: 339971
> URL: https://svnweb.freebsd.org/changeset/base/339971 
> <https://svnweb.freebsd.org/changeset/base/339971>
> 
> Log:
>   Add new rc keywords: enable, disable, delete
> 
>   This adds new keywords to rc/service to enable/disable a service's
>   rc.conf(5) variable and "delete" to remove the variable.
> 
>   When the "service_delete_empty" variable in rc.conf(5) is set to "YES"
>   (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is
>   deleted if empty after modification using "service $foo delete".
> 
>   Submitted by: lme (modified)
>   Reviewed by:  0mp (previous version), lme, bcr
>   Relnotes: yes
>   Sponsored by: Smule, Inc.
>   Differential Revision:https://reviews.freebsd.org/D17113 
> <https://reviews.freebsd.org/D17113>
> 
> 
> Hi!
> 
> Really nice. Do you plan to MFC this commit to stable branches?
> 

It will be eligible for MFC on Nov 3. I'll submit the request, but it's up to 
re@
--
Devin


signature.asc
Description: Message signed with OpenPGP


Re: svn commit: r339971 - in head: libexec/rc share/man/man5 share/man/man8

2018-11-01 Thread Devin Teske


> On 31 Oct 2018, at 11:06 PM, Alex Kozlov  wrote:
> 
>> On Wed, Oct 31, 2018 at 08:37:12PM +, Devin Teske wrote:
>> Author: dteske
>> Date: Wed Oct 31 20:37:12 2018
>> New Revision: 339971
>> URL: https://svnweb.freebsd.org/changeset/base/339971
>> 
>> Log:
>>  Add new rc keywords: enable, disable, delete
>> 
>>  This adds new keywords to rc/service to enable/disable a service's
>>  rc.conf(5) variable and "delete" to remove the variable.
> The enable command is just one typo away from enabled, so it's quite
> easy to enable rc-script instead of checking if it enabled.
> 

Thankfully, easily fixed unlike so many other one-character typos (e.g., one 
involving rm)
— 
Devin

>>  When the "service_delete_empty" variable in rc.conf(5) is set to "YES"
>>  (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is
>>  deleted if empty after modification using "service $foo delete".
>> 
>>  Submitted by:lme (modified)
>>  Reviewed by:0mp (previous version), lme, bcr
>>  Relnotes:yes
>>  Sponsored by:Smule, Inc.
>>  Differential Revision:https://reviews.freebsd.org/D17113
> 
> 
> -- 
> Alex
> 

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


svn commit: r339977 - stable/12/share/examples/jails

2018-10-31 Thread Devin Teske
Author: dteske
Date: Wed Oct 31 23:07:47 2018
New Revision: 339977
URL: https://svnweb.freebsd.org/changeset/base/339977

Log:
  MFC r339843: Fix jail examples in jib, jng, README
  
  Submitted by: Ryan Moeller 
  Reported by:  Ryan Moeller 
  Approved by:  re (gjb)
  Sponsored by: Smule, Inc.
  Differential Revision:https://reviews.freebsd.org/D17697

Modified:
  stable/12/share/examples/jails/README
  stable/12/share/examples/jails/jib
  stable/12/share/examples/jails/jng
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/examples/jails/README
==
--- stable/12/share/examples/jails/README   Wed Oct 31 23:05:44 2018
(r339976)
+++ stable/12/share/examples/jails/README   Wed Oct 31 23:07:47 2018
(r339977)
@@ -8,6 +8,16 @@ The below 4 samples require a VIMAGE enabled kernel:
$ make KERNCONF=VIMAGE kernel
$ reboot
 
+FreeBSD 12 has VIMAGE enabled in GENERIC on amd64.
+In that case, for jng simply load the ng_ether module first
+(ng_bridge and ng_eiface will load on demand):
+
+   # (as root)
+   # Load the ng_ether module at boot:
+   $ sysrc kld_list+=ng_ether
+   # Load ng_ether at once without rebooting:
+   $ kldload ng_ether
+
 Sample 1: jail.conf(5)
 
$ cp jib jng /usr/sbin/

Modified: stable/12/share/examples/jails/jib
==
--- stable/12/share/examples/jails/jib  Wed Oct 31 23:05:44 2018
(r339976)
+++ stable/12/share/examples/jails/jib  Wed Oct 31 23:07:47 2018
(r339977)
@@ -51,7 +51,7 @@
 #  # arguments given to `jib addm xxx' in exec.prestart value.
 #  #
 #  vnet;
-#  vnet.interface = "e0b_xxx e1b_xxx ...";
+#  vnet.interface = e0b_xxx, e1b_xxx, ...;
 # 
 #  exec.clean;
 #  exec.system_user = "root";

Modified: stable/12/share/examples/jails/jng
==
--- stable/12/share/examples/jails/jng  Wed Oct 31 23:05:44 2018
(r339976)
+++ stable/12/share/examples/jails/jng  Wed Oct 31 23:07:47 2018
(r339977)
@@ -51,7 +51,7 @@
 #  # arguments given to `jng bridge xxx' in exec.prestart value.
 #  #
 #  vnet;
-#  vnet.interface = "ng0_xxx ng1_xxx ...";
+#  vnet.interface = ng0_xxx, ng1_xxx, ...;
 # 
 #  exec.clean;
 #  exec.system_user = "root";
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339971 - in head: libexec/rc share/man/man5 share/man/man8

2018-10-31 Thread Devin Teske
Author: dteske
Date: Wed Oct 31 20:37:12 2018
New Revision: 339971
URL: https://svnweb.freebsd.org/changeset/base/339971

Log:
  Add new rc keywords: enable, disable, delete
  
  This adds new keywords to rc/service to enable/disable a service's
  rc.conf(5) variable and "delete" to remove the variable.
  
  When the "service_delete_empty" variable in rc.conf(5) is set to "YES"
  (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is
  deleted if empty after modification using "service $foo delete".
  
  Submitted by: lme (modified)
  Reviewed by:  0mp (previous version), lme, bcr
  Relnotes: yes
  Sponsored by: Smule, Inc.
  Differential Revision:https://reviews.freebsd.org/D17113

Modified:
  head/libexec/rc/rc.conf
  head/libexec/rc/rc.subr
  head/share/man/man5/rc.conf.5
  head/share/man/man8/rc.8

Modified: head/libexec/rc/rc.conf
==
--- head/libexec/rc/rc.conf Wed Oct 31 19:59:20 2018(r339970)
+++ head/libexec/rc/rc.conf Wed Oct 31 20:37:12 2018(r339971)
@@ -617,6 +617,7 @@ savecore_enable="YES"   # Extract core from dump devices
 savecore_flags="-m 10" # Used if dumpdev is enabled above, and present.
# By default, only the 10 most recent kernel dumps
# are saved.
+service_delete_empty="NO" # Have 'service delete' remove empty rc.conf.d files.
 crashinfo_enable="YES" # Automatically generate crash dump summary.
 crashinfo_program="/usr/sbin/crashinfo"# Script to generate crash dump 
summary.
 quota_enable="NO"  # turn on quotas on startup (or NO).

Modified: head/libexec/rc/rc.subr
==
--- head/libexec/rc/rc.subr Wed Oct 31 19:59:20 2018(r339970)
+++ head/libexec/rc/rc.subr Wed Oct 31 20:37:12 2018(r339971)
@@ -922,7 +922,7 @@ run_rc_command()
eval _override_command=\$${name}_program
command=${_override_command:-$command}
 
-   _keywords="start stop restart rcvar enabled describe extracommands 
$extra_commands"
+   _keywords="start stop restart rcvar enable disable delete enabled 
describe extracommands $extra_commands"
rc_pid=
_pidcmd=
_procname=${procname:-${command}}
@@ -977,12 +977,13 @@ run_rc_command()
if [ "$_elem" != "$rc_arg" ]; then
continue
fi
-   # if ${rcvar} is set, $1 is not "rcvar" 
and not "describe"
-   # and ${rc_pid} is not set, then run
+   # if ${rcvar} is set, $1 is not 
"rcvar", "describe",
+   # "enable" or "delete", and ${rc_pid} 
is not set, run:
#   checkyesno ${rcvar}
# and return if that failed
#
if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a "$rc_arg" != 
"stop" \
+   -a "$rc_arg" != "delete" -a "$rc_arg" != "enable" \
-a "$rc_arg" != "describe" ] ||
[ -n "${rcvar}" -a "$rc_arg" = "stop" -a -z "${rc_pid}" ]; 
then
if ! checkyesno ${rcvar}; then
@@ -1028,6 +1029,31 @@ run_rc_command()

extracommands)
echo "$extra_commands"
+   ;;
+
+   enable)
+   _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=YES") &&
+   echo "$name enabled in ${_out%%:*}" 
+   ;;
+
+   disable)
+   _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=NO") &&
+   echo "$name disabled in ${_out%%:*}"
+   ;;
+
+   delete)
+   _files=
+   for _file in $(sysrc -lEs "$name"); do
+   _out=$(sysrc -Fif $_file "$rcvar") && 
_files="$_files $_file"
+   done
+   /usr/sbin/sysrc -x "$rcvar" && echo "$rcvar deleted in 
${_files# }"
+   # delete file in rc.conf.d if desired and empty.
+   checkyesno service_delete_empty || _files=
+   for _file in $_files; do
+   [ "$_file" = "${_file#*/rc.conf.d/}" ] && 
continue
+   [ $(/usr/bin/stat -f%z $_file) -gt 0 ] && 
continue
+   /bin/rm "$_file" && echo "Empty file $_file 
removed"
+   done
;;
 
status)

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Wed Oct 31 19:59:20 2018   

svn commit: r339845 - head/usr.sbin/bsdinstall/scripts

2018-10-28 Thread Devin Teske
Author: dteske
Date: Sun Oct 28 22:09:18 2018
New Revision: 339845
URL: https://svnweb.freebsd.org/changeset/base/339845

Log:
  Sort i18n messages in bsdinstall zfsboot
  
  No functional change.
  
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdinstall/scripts/zfsboot

Modified: head/usr.sbin/bsdinstall/scripts/zfsboot
==
--- head/usr.sbin/bsdinstall/scripts/zfsbootSun Oct 28 19:29:07 2018
(r339844)
+++ head/usr.sbin/bsdinstall/scripts/zfsbootSun Oct 28 22:09:18 2018
(r339845)
@@ -246,8 +246,8 @@ msg_configure_options="Configure Options:"
 msg_detailed_disk_info="gpart(8) show %s:\n%s\n\ncamcontrol(8) inquiry 
%s:\n%s\n\n\ncamcontrol(8) identify %s:\n%s\n"
 msg_disk_info="Disk Info"
 msg_disk_info_help="Get detailed information on disk device(s)"
-msg_disk_singular="disk"
 msg_disk_plural="disks"
+msg_disk_singular="disk"
 msg_encrypt_disks="Encrypt Disks?"
 msg_encrypt_disks_help="Use geli(8) to encrypt all data partitions"
 msg_error="Error"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339844 - head/usr.sbin/bsdconfig/share

2018-10-28 Thread Devin Teske
Author: dteske
Date: Sun Oct 28 19:29:07 2018
New Revision: 339844
URL: https://svnweb.freebsd.org/changeset/base/339844

Log:
  Fix dialog autosizing to accomodate for hline
  
  dialog will conditionally ignore the --hline option if not enough space
  was available to accomodate for the text width. Traditionally the width
  of the widget had to be 10 wider than the text. Recent updates to dialog
  have changed the requirement to be at least 12 wider than the hline text
  else the hline text is not rendered at the bottom of the widget.
  
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdconfig/share/dialog.subr

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==
--- head/usr.sbin/bsdconfig/share/dialog.subr   Sun Oct 28 18:32:47 2018
(r339843)
+++ head/usr.sbin/bsdconfig/share/dialog.subr   Sun Oct 28 19:29:07 2018
(r339844)
@@ -646,7 +646,7 @@ f_dialog_infobox_size()
# Xdialog(1)).
#
if [ ! "$USE_XDIALOG" ]; then
-   __n=$(( ${#__hline} + 10 ))
+   __n=$(( ${#__hline} + 12 ))
[ $__n -gt $__width ] && __width=$__n
fi
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339843 - head/share/examples/jails

2018-10-28 Thread Devin Teske
Author: dteske
Date: Sun Oct 28 18:32:47 2018
New Revision: 339843
URL: https://svnweb.freebsd.org/changeset/base/339843

Log:
  Fix jail examples in jib, jng, README
  
  The provided example jail configs do not work for multiple interfaces.
  Multiple interfaces need to be specified as a comma separated list or
  using multiple += lines in jail.conf. In the given example, a space-
  separated string is used, which doesn't work with multiple interfaces.
  
  Also added a note to the README about VIMAGE being built-in by default
  on amd64 in FreeBSD 12, with appropriate instructions for loading the
  necessary netgraph ether module (ng_ether) since it is neither built-
  in nor autoloads.
  
  Submitted by: Ryan Moeller 
  Reported by:  Ryan Moeller 
  MFC after:3 days
  Sponsored by: Smule, Inc.
  Differential Revision:https://reviews.freebsd.org/D17697

Modified:
  head/share/examples/jails/README
  head/share/examples/jails/jib
  head/share/examples/jails/jng

Modified: head/share/examples/jails/README
==
--- head/share/examples/jails/READMESun Oct 28 18:23:13 2018
(r339842)
+++ head/share/examples/jails/READMESun Oct 28 18:32:47 2018
(r339843)
@@ -8,6 +8,16 @@ The below 4 samples require a VIMAGE enabled kernel:
$ make KERNCONF=VIMAGE kernel
$ reboot
 
+FreeBSD 12 has VIMAGE enabled in GENERIC on amd64.
+In that case, for jng simply load the ng_ether module first
+(ng_bridge and ng_eiface will load on demand):
+
+   # (as root)
+   # Load the ng_ether module at boot:
+   $ sysrc kld_list+=ng_ether
+   # Load ng_ether at once without rebooting:
+   $ kldload ng_ether
+
 Sample 1: jail.conf(5)
 
$ cp jib jng /usr/sbin/

Modified: head/share/examples/jails/jib
==
--- head/share/examples/jails/jib   Sun Oct 28 18:23:13 2018
(r339842)
+++ head/share/examples/jails/jib   Sun Oct 28 18:32:47 2018
(r339843)
@@ -51,7 +51,7 @@
 #  # arguments given to `jib addm xxx' in exec.prestart value.
 #  #
 #  vnet;
-#  vnet.interface = "e0b_xxx e1b_xxx ...";
+#  vnet.interface = e0b_xxx, e1b_xxx, ...;
 # 
 #  exec.clean;
 #  exec.system_user = "root";

Modified: head/share/examples/jails/jng
==
--- head/share/examples/jails/jng   Sun Oct 28 18:23:13 2018
(r339842)
+++ head/share/examples/jails/jng   Sun Oct 28 18:32:47 2018
(r339843)
@@ -51,7 +51,7 @@
 #  # arguments given to `jng bridge xxx' in exec.prestart value.
 #  #
 #  vnet;
-#  vnet.interface = "ng0_xxx ng1_xxx ...";
+#  vnet.interface = ng0_xxx, ng1_xxx, ...;
 # 
 #  exec.clean;
 #  exec.system_user = "root";
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339830 - head/usr.sbin/bsdinstall/scripts

2018-10-27 Thread Devin Teske
Author: dteske
Date: Sun Oct 28 00:58:39 2018
New Revision: 339830
URL: https://svnweb.freebsd.org/changeset/base/339830

Log:
  Adjust for 80-columns.
  
  No functional change.
  
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdinstall/scripts/zfsboot

Modified: head/usr.sbin/bsdinstall/scripts/zfsboot
==
--- head/usr.sbin/bsdinstall/scripts/zfsbootSun Oct 28 00:57:44 2018
(r339829)
+++ head/usr.sbin/bsdinstall/scripts/zfsbootSun Oct 28 00:58:39 2018
(r339830)
@@ -347,8 +347,8 @@ dialog_menu_main()
'>>> $msg_install'  '$msg_install_desc'
'$msg_install_help'
'T $msg_pool_type_disks'
-   '$ZFSBOOT_VDEV_TYPE: $n $disks_grammar'
-   '$msg_pool_type_disks_help'
+  '$ZFSBOOT_VDEV_TYPE: $n $disks_grammar'
+  '$msg_pool_type_disks_help'
'- $msg_rescan_devices' '*'
'$msg_rescan_devices_help'
'- $msg_disk_info'  '*'
@@ -361,8 +361,8 @@ dialog_menu_main()
'E $msg_encrypt_disks'  '$usegeli'
'$msg_encrypt_disks_help'
'P $msg_partition_scheme'
-   '$ZFSBOOT_PARTITION_SCHEME 
($ZFSBOOT_BOOT_TYPE)'
-   '$msg_partition_scheme_help'
+  '$ZFSBOOT_PARTITION_SCHEME ($ZFSBOOT_BOOT_TYPE)'
+  '$msg_partition_scheme_help'
'S $msg_swap_size'  '$ZFSBOOT_SWAP_SIZE'
'$msg_swap_size_help'
'M $msg_swap_mirror''$swapmirror'
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339783 - head/usr.sbin/ngctl

2018-10-26 Thread Devin Teske
Author: dteske
Date: Fri Oct 26 19:16:17 2018
New Revision: 339783
URL: https://svnweb.freebsd.org/changeset/base/339783

Log:
  Add blank line after each item in "ngctl ls -l"
  
  The output of "ngctl ls -l" is hard to read. To make it easier, add a blank
  line after each listed item much how traditional "ls -l" does when listing
  the contents of multiple directories.
  
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/ngctl/list.c

Modified: head/usr.sbin/ngctl/list.c
==
--- head/usr.sbin/ngctl/list.c  Fri Oct 26 19:03:30 2018(r339782)
+++ head/usr.sbin/ngctl/list.c  Fri Oct 26 19:16:17 2018(r339783)
@@ -125,6 +125,8 @@ ListCmd(int ac, char **av)
break;
ninfo++;
nlist->numnames--;
+   if (nlist->numnames > 0)
+   printf("\n");
}
} else {
while (nlist->numnames > 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339768 - head/usr.sbin/bsdinstall/scripts

2018-10-25 Thread Devin Teske
Author: dteske
Date: Fri Oct 26 05:25:22 2018
New Revision: 339768
URL: https://svnweb.freebsd.org/changeset/base/339768

Log:
  Adjust bsdinstall zfsboot code to 80-columns and whitespace fixes
  
  No functional changes.
  
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdinstall/scripts/zfsboot

Modified: head/usr.sbin/bsdinstall/scripts/zfsboot
==
--- head/usr.sbin/bsdinstall/scripts/zfsbootFri Oct 26 05:12:56 2018
(r339767)
+++ head/usr.sbin/bsdinstall/scripts/zfsbootFri Oct 26 05:25:22 2018
(r339768)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #-
 # Copyright (c) 2013-2016 Allan Jude
-# Copyright (c) 2013-2015 Devin Teske
+# Copyright (c) 2013-2018 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -627,7 +627,7 @@ dialog_menu_layout()
# Not enough disks selected
f_dprintf "$funcname: %s: %s (%u < %u minimum)" \
  "$ZFSBOOT_VDEV_TYPE" \
- "Not enough disks selected." \
+ "Not enough disks selected." \
  $ndisks $want_disks
f_interactive || return $FAILURE
msg_yes="$msg_change_selection" msg_no="$msg_cancel" \
@@ -843,15 +843,17 @@ zfs_create_diskpart()
#
# 2. Add small freebsd-boot and/or efi partition
#
-   if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" -o "$ZFSBOOT_BOOT_TYPE" = 
"BIOS+UEFI" ]; then
+   if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" -o \
+"$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ]
+   then
f_eval_catch $funcname gpart \
 "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \
 "$align_small" efiboot$index efi 200M \
-$disk ||
-return $FAILURE
+$disk || return $FAILURE
 
f_eval_catch $funcname mkdir "$MKDIR_P" \
-"$BSDINSTALL_TMPETC/esp" || return $FAILURE
+"$BSDINSTALL_TMPETC/esp" ||
+return $FAILURE
f_eval_catch $funcname newfs_msdos "$NEWFS_ESP" "16" \
 "EFISYS" "/dev/${disk}p1" ||
 return $FAILURE
@@ -874,19 +876,23 @@ zfs_create_diskpart()
 return $FAILURE
fi
 
-   if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS" -o "$ZFSBOOT_BOOT_TYPE" = 
"BIOS+UEFI" ]; then
+   if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS" -o \
+"$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ]
+   then
f_eval_catch $funcname gpart \
 "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \
-"$align_small" gptboot$index freebsd-boot \
-512k $disk || return $FAILURE
+"$align_small" gptboot$index \
+freebsd-boot 512k $disk || return $FAILURE
if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS" ]; then
-   f_eval_catch $funcname gpart 
"$GPART_BOOTCODE_PART" \
-/boot/pmbr /boot/gptzfsboot 1 
$disk ||
-return $FAILURE
+   f_eval_catch $funcname gpart \
+"$GPART_BOOTCODE_PART" \
+/boot/pmbr /boot/gptzfsboot 1 \
+$disk || return $FAILURE
else
-   f_eval_catch $funcname gpart 
"$GPART_BOOTCODE_PART" \
-/boot/pmbr /boot/gptzfsboot 2 
$disk ||
-return $FAILURE
+   f_eval_catch $funcname gpart \
+"$GPART_BOOTCODE_PART" \
+/boot/pmbr /boot/gptzfsboot 2 \
+$disk || return $FAILURE
fi
fi
 
@@ -918,8 +924,7 @@ zfs_creat

svn commit: r339760 - head/usr.sbin/bsdinstall/scripts

2018-10-25 Thread Devin Teske
Author: dteske
Date: Fri Oct 26 02:08:44 2018
New Revision: 339760
URL: https://svnweb.freebsd.org/changeset/base/339760

Log:
  Fix dialog autosizing in bsdinstall auto error messages
  
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdinstall/scripts/auto

Modified: head/usr.sbin/bsdinstall/scripts/auto
==
--- head/usr.sbin/bsdinstall/scripts/auto   Fri Oct 26 01:57:32 2018
(r339759)
+++ head/usr.sbin/bsdinstall/scripts/auto   Fri Oct 26 02:08:44 2018
(r339760)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #-
 # Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2018 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -33,30 +33,58 @@ BSDCFG_SHARE="/usr/share/bsdconfig"
 . $BSDCFG_SHARE/common.subr || exit 1
 f_include $BSDCFG_SHARE/dialog.subr
 
- FUNCTIONS
+ GLOBALS
 
-error() {
-   local msg
-   if [ -n "$1" ]; then
-   msg="$1\n\n"
-   fi
-   test -n "$DISTDIR_IS_UNIONFS" && umount -f $BSDINSTALL_DISTDIR
-   test -f $PATH_FSTAB && bsdinstall umount
-   dialog --backtitle "FreeBSD Installer" --title "Abort" \
-   --no-label "Exit" --yes-label "Restart" --yesno \
-   "${msg}An installation step has been aborted. Would you like to 
restart the installation or exit the installer?" 0 0
-   if [ $? -ne 0 ]; then
-   exit 1
-   else
-   exec $0
-   fi
-}
-
+#
+# Strings that should be moved to an i18n file and loaded with f_include_lang()
+#
 hline_arrows_tab_enter="Press arrows, TAB or ENTER"
+hline_arrows_tab_space_enter="Press arrows, TAB, SPACE or ENTER"
+msg_abort="Abort"
+msg_exit="Exit"
+msg_freebsd_installer="FreeBSD Installer"
 msg_gpt_active_fix="Your hardware is known to have issues booting in 
CSM/Legacy/BIOS mode from GPT partitions that are not set active. Would you 
like the installer to apply this workaround for you?"
 msg_lenovo_fix="Your model of Lenovo is known to have a BIOS bug that prevents 
it booting from GPT partitions without UEFI. Would you like the installer to 
apply a workaround for you?"
+msg_an_installation_step_has_been_aborted="An installation step has been 
aborted. Would you like\nto restart the installation or exit the installer?"
 msg_no="NO"
+msg_restart="Restart"
 msg_yes="YES"
+
+ FUNCTIONS
+
+# error [$msg]
+#
+# Display generic error message when a script fails. An optional message
+# argument can preceed the generic message. User is given the choice of
+# restarting the installer or exiting.
+#
+error()
+{
+   local title="$msg_abort"
+   local btitle="$msg_freebsd_installer"
+   local prompt="${1:+$1\n\n}$msg_an_installation_step_has_been_aborted"
+   local hline="$hline_arrows_tab_space_enter"
+
+   [ "$DISTDIR_IS_UNIONFS" ] && umount -f "$BSDINSTALL_DISTDIR"
+   [ -f "$PATH_FSTAB" ] && bsdinstall umount
+
+   local height width
+   f_dialog_buttonbox_size height width \
+   "$title" "$btitle" "$prompt" "$hline"
+
+   if $DIALOG \
+   --title "$title"   \
+   --backtitle "$btitle"  \
+   --hline "$hline"   \
+   --no-label "$msg_exit" \
+   --yes-label "$msg_restart" \
+   --yesno "$prompt" $height $width
+   then
+   exec $0
+   # NOTREACHED
+   fi
+   exit 1
+}
 
 # dialog_workaround
 #
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339759 - head/usr.sbin/bsdinstall/scripts

2018-10-25 Thread Devin Teske
Author: dteske
Date: Fri Oct 26 01:57:32 2018
New Revision: 339759
URL: https://svnweb.freebsd.org/changeset/base/339759

Log:
  Whitespace alignment in bsdinstall hostname
  
  Aligning line-continuation characters to prevent mistakes.
  This is also the prevalent style replication throughout.
  
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdinstall/scripts/hostname

Modified: head/usr.sbin/bsdinstall/scripts/hostname
==
--- head/usr.sbin/bsdinstall/scripts/hostname   Fri Oct 26 01:47:52 2018
(r339758)
+++ head/usr.sbin/bsdinstall/scripts/hostname   Fri Oct 26 01:57:32 2018
(r339759)
@@ -79,13 +79,13 @@ dialog_hostname()
"$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$prompt" "$value" "$hline"
 
$DIALOG \
-   --title "$DIALOG_TITLE" \
+   --title "$DIALOG_TITLE" \
--backtitle "$DIALOG_BACKTITLE" \
-   --hline "$hline" \
-   --ok-label "$msg_ok" \
-   --no-cancel \
-   --inputbox "$prompt" \
-   $height $width "$value" \
+   --hline "$hline"\
+   --ok-label "$msg_ok"\
+   --no-cancel \
+   --inputbox "$prompt"\
+   $height $width "$value" \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339758 - head/usr.sbin/bsdinstall/scripts

2018-10-25 Thread Devin Teske
Author: dteske
Date: Fri Oct 26 01:47:52 2018
New Revision: 339758
URL: https://svnweb.freebsd.org/changeset/base/339758

Log:
  Sort i18n strings in bsdinstall hostname
  
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdinstall/scripts/hostname

Modified: head/usr.sbin/bsdinstall/scripts/hostname
==
--- head/usr.sbin/bsdinstall/scripts/hostname   Fri Oct 26 01:13:20 2018
(r339757)
+++ head/usr.sbin/bsdinstall/scripts/hostname   Fri Oct 26 01:47:52 2018
(r339758)
@@ -51,10 +51,10 @@ f_include $BSDCFG_SHARE/dialog.subr
 #
 # Strings that should be moved to an i18n file and loaded with f_include_lang()
 #
-msg_set_hostname="Set Hostname"
-msg_please_choose_a_hostname="Please choose a hostname for this machine.\n\nIf 
you are running on a managed network, please ask\nyour network administrator 
for an appropriate name."
-msg_ok="OK"
 msg_freebsd_installer="FreeBSD Installer"
+msg_ok="OK"
+msg_please_choose_a_hostname="Please choose a hostname for this machine.\n\nIf 
you are running on a managed network, please ask\nyour network administrator 
for an appropriate name."
+msg_set_hostname="Set Hostname"
 
 #
 # Command strings for various tasks
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339756 - head/usr.sbin/bsdinstall/scripts

2018-10-25 Thread Devin Teske
Author: dteske
Date: Fri Oct 26 01:06:03 2018
New Revision: 339756
URL: https://svnweb.freebsd.org/changeset/base/339756

Log:
  Add improved error checking to bsdinstall hostname
  
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdinstall/scripts/hostname

Modified: head/usr.sbin/bsdinstall/scripts/hostname
==
--- head/usr.sbin/bsdinstall/scripts/hostname   Fri Oct 26 00:08:27 2018
(r339755)
+++ head/usr.sbin/bsdinstall/scripts/hostname   Fri Oct 26 01:06:03 2018
(r339756)
@@ -56,6 +56,12 @@ msg_please_choose_a_hostname="Please choose a hostname
 msg_ok="OK"
 msg_freebsd_installer="FreeBSD Installer"
 
+#
+# Command strings for various tasks
+#
+ECHO_OVERWRITE='echo "%s" > "%s"'
+SET_HOSTNAME='hostname -s "%s"'
+
  FUNCTIONS
 
 # dialog_hostname
@@ -100,14 +106,15 @@ HOSTNAME=$( dialog_hostname "$HOSTNAME" )
 #
 # Store the user's choice
 #
-echo "hostname=\"$HOSTNAME\"" > "$HOSTNAMEFILE"
+f_eval_catch "$pgm" echo "$ECHO_OVERWRITE" \
+   'hostname=\"$HOSTNAME\"' "$HOSTNAMEFILE"
 retval=$?
 
 #
 # Activate entry if configured
 #
 if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
-   hostname -s "$HOSTNAME"
+   f_eval_catch "$pgm" hostname "$SET_HOSTNAME" "$HOSTNAME"
retval=$?
 fi
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339755 - head/usr.sbin/bsdinstall/scripts

2018-10-25 Thread Devin Teske
Author: dteske
Date: Fri Oct 26 00:08:27 2018
New Revision: 339755
URL: https://svnweb.freebsd.org/changeset/base/339755

Log:
  Fix dialog autosizing in bsdinstall hostname
  
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdinstall/scripts/hostname

Modified: head/usr.sbin/bsdinstall/scripts/hostname
==
--- head/usr.sbin/bsdinstall/scripts/hostname   Fri Oct 26 00:05:46 2018
(r339754)
+++ head/usr.sbin/bsdinstall/scripts/hostname   Fri Oct 26 00:08:27 2018
(r339755)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #-
 # Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2015 Devin Teske
+# Copyright (c) 2015-2018 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -26,27 +26,93 @@
 # SUCH DAMAGE.
 #
 # $FreeBSD$
+#
+ INCLUDES
 
-: ${DIALOG_OK=0}
-: ${DIALOG_CANCEL=1}
-: ${DIALOG_HELP=2}
-: ${DIALOG_EXTRA=3}
-: ${DIALOG_ITEM_HELP=4}
-: ${DIALOG_ESC=255}
+BSDCFG_SHARE="/usr/share/bsdconfig"
+. $BSDCFG_SHARE/common.subr || exit 1
+f_dprintf "%s: loading_includes..." "$0"
+f_include $BSDCFG_SHARE/dialog.subr
 
-exec 3>&1
-HOSTNAME=`dialog --backtitle 'FreeBSD Installer' --title 'Set Hostname' 
--nocancel --inputbox \
-   'Please choose a hostname for this machine.
+ CONFIGURATION
 
-If you are running on a managed network, please ask your network administrator 
for an appropriate name.' \
-   0 0 $(hostname) 2>&1 1>&3`
-if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi
-exec 3>&-
+#
+# Default value
+#
+: ${HOSTNAME=$( hostname )}
 
-echo "hostname=\"$HOSTNAME\"" > $BSDINSTALL_TMPETC/rc.conf.hostname
+#
+# Default file to store hostname entry in
+#
+: ${HOSTNAMEFILE:=$BSDINSTALL_TMPETC/rc.conf.hostname}
+
+ GLOBALS
+
+#
+# Strings that should be moved to an i18n file and loaded with f_include_lang()
+#
+msg_set_hostname="Set Hostname"
+msg_please_choose_a_hostname="Please choose a hostname for this machine.\n\nIf 
you are running on a managed network, please ask\nyour network administrator 
for an appropriate name."
+msg_ok="OK"
+msg_freebsd_installer="FreeBSD Installer"
+
+ FUNCTIONS
+
+# dialog_hostname
+#
+# Display input box (without cancel button) for user to enter desired hostname.
+#
+dialog_hostname()
+{
+   local prompt="$msg_please_choose_a_hostname"
+   local hline=
+   local value="$*"
+
+   local height width
+   f_dialog_inputbox_size height width \
+   "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$prompt" "$value" "$hline"
+
+   $DIALOG \
+   --title "$DIALOG_TITLE" \
+   --backtitle "$DIALOG_BACKTITLE" \
+   --hline "$hline" \
+   --ok-label "$msg_ok" \
+   --no-cancel \
+   --inputbox "$prompt" \
+   $height $width "$value" \
+   2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
+}
+
+ MAIN
+
+#
+# Initialize
+#
+f_dialog_title "$msg_set_hostname"
+f_dialog_backtitle "$msg_freebsd_installer"
+
+#
+# Get user input
+#
+HOSTNAME=$( dialog_hostname "$HOSTNAME" )
+[ $? -eq $DIALOG_CANCEL ] && exit 1
+
+#
+# Store the user's choice
+#
+echo "hostname=\"$HOSTNAME\"" > "$HOSTNAMEFILE"
 retval=$?
+
+#
+# Activate entry if configured
+#
 if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
hostname -s "$HOSTNAME"
retval=$?
 fi
+
 exit $retval
+
+
+# END
+
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339752 - head/usr.sbin/bsdconfig/share

2018-10-25 Thread Devin Teske
Author: dteske
Date: Thu Oct 25 23:32:32 2018
New Revision: 339752
URL: https://svnweb.freebsd.org/changeset/base/339752

Log:
  Remove vestigial DIALOG_ITEM_HELP value in bsdconfig dialog.subr
  
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdconfig/share/dialog.subr

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==
--- head/usr.sbin/bsdconfig/share/dialog.subr   Thu Oct 25 23:13:19 2018
(r339751)
+++ head/usr.sbin/bsdconfig/share/dialog.subr   Thu Oct 25 23:32:32 2018
(r339752)
@@ -79,7 +79,6 @@ unset XDIALOG_INFOBOX_TIMEOUT
 DIALOG_OK=${SUCCESS:-0}
 DIALOG_CANCEL=${FAILURE:-1}
 DIALOG_HELP=2
-DIALOG_ITEM_HELP=2
 DIALOG_EXTRA=3
 DIALOG_ITEM_HELP=4
 export DIALOG_ERROR=254 # sh(1) can't handle the default of `-1'
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339699 - stable/9/sys/boot/forth

2018-10-24 Thread Devin Teske
Author: dteske
Date: Wed Oct 24 23:31:33 2018
New Revision: 339699
URL: https://svnweb.freebsd.org/changeset/base/339699

Log:
  MFC r339509: Fix loader.conf(5) "password" feature
  
  Restore the ability to prevent the user from interrupting the boot process
  without first entering the password stored in loader.conf(5).
  
  PR:   kern/207069
  Reported by:  da...@dcrosstech.com
  Sponsored by: Smule, Inc.

Modified:
  stable/9/sys/boot/forth/check-password.4th
Directory Properties:
  stable/9/   (props changed)

Modified: stable/9/sys/boot/forth/check-password.4th
==
--- stable/9/sys/boot/forth/check-password.4th  Wed Oct 24 23:21:12 2018
(r339698)
+++ stable/9/sys/boot/forth/check-password.4th  Wed Oct 24 23:31:33 2018
(r339699)
@@ -154,6 +154,7 @@ variable readlen\ input length
\ We should prevent the user from visiting the menu or dropping to the
\ interactive loader(8) prompt, but still allow the machine to boot...
 
+   any_conf_read? if load_kernel load_modules then
0 autoboot
 
\ Only reached if autoboot fails for any reason (including if/when
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339698 - stable/10/sys/boot/forth

2018-10-24 Thread Devin Teske
Author: dteske
Date: Wed Oct 24 23:21:12 2018
New Revision: 339698
URL: https://svnweb.freebsd.org/changeset/base/339698

Log:
  MFC r339509: Fix loader.conf(5) "password" feature
  
  Restore the ability to prevent the user from interrupting the boot process
  without first entering the password stored in loader.conf(5).
  
  PR:   kern/207069
  Reported by:  da...@dcrosstech.com
  Sponsored by: Smule, Inc.

Modified:
  stable/10/sys/boot/forth/check-password.4th
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/boot/forth/check-password.4th
==
--- stable/10/sys/boot/forth/check-password.4th Wed Oct 24 23:17:17 2018
(r339697)
+++ stable/10/sys/boot/forth/check-password.4th Wed Oct 24 23:21:12 2018
(r339698)
@@ -129,7 +129,7 @@ variable readlen \ input length
again \ Enter was not pressed; repeat
 ;
 
-only forth definitions also password-processing
+only forth definitions also password-processing also support-functions
 
 : check-password ( -- )
 
@@ -161,6 +161,7 @@ only forth definitions also password-processing
\ We should prevent the user from visiting the menu or dropping to the
\ interactive loader(8) prompt, but still allow the machine to boot...
 
+   any_conf_read? if load_kernel load_modules then
0 autoboot
 
\ Only reached if autoboot fails for any reason (including if/when
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339697 - stable/11/stand/forth

2018-10-24 Thread Devin Teske
Author: dteske
Date: Wed Oct 24 23:17:17 2018
New Revision: 339697
URL: https://svnweb.freebsd.org/changeset/base/339697

Log:
  MFC r339509: Fix loader.conf(5) "password" feature
  
  Restore the ability to prevent the user from interrupting the boot process
  without first entering the password stored in loader.conf(5).
  
  PR:   kern/207069
  Reported by:  da...@dcrosstech.com
  Sponsored by: Smule, Inc.

Modified:
  stable/11/stand/forth/check-password.4th
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/forth/check-password.4th
==
--- stable/11/stand/forth/check-password.4thWed Oct 24 23:13:53 2018
(r339696)
+++ stable/11/stand/forth/check-password.4thWed Oct 24 23:17:17 2018
(r339697)
@@ -129,7 +129,7 @@ variable readlen \ input length
again \ Enter was not pressed; repeat
 ;
 
-only forth definitions also password-processing
+only forth definitions also password-processing also support-functions
 
 : check-password ( -- )
 
@@ -161,6 +161,7 @@ only forth definitions also password-processing
\ We should prevent the user from visiting the menu or dropping to the
\ interactive loader(8) prompt, but still allow the machine to boot...
 
+   any_conf_read? if load_kernel load_modules then
0 autoboot
 
\ Only reached if autoboot fails for any reason (including if/when
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339696 - stable/12/stand/forth

2018-10-24 Thread Devin Teske
Author: dteske
Date: Wed Oct 24 23:13:53 2018
New Revision: 339696
URL: https://svnweb.freebsd.org/changeset/base/339696

Log:
  MFC r339509: Fix loader.conf(5) "password" feature
  
  Restore the ability to prevent the user from interrupting the boot process
  without first entering the password stored in loader.conf(5).
  
  PR:   kern/207069
  Reported by:  da...@dcrosstech.com
  Approved by:  re (rgrimes)
  Sponsored by: Smule, Inc.

Modified:
  stable/12/stand/forth/check-password.4th
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/stand/forth/check-password.4th
==
--- stable/12/stand/forth/check-password.4thWed Oct 24 20:49:51 2018
(r339695)
+++ stable/12/stand/forth/check-password.4thWed Oct 24 23:13:53 2018
(r339696)
@@ -129,7 +129,7 @@ variable readlen \ input length
again \ Enter was not pressed; repeat
 ;
 
-only forth definitions also password-processing
+only forth definitions also password-processing also support-functions
 
 : check-password ( -- )
 
@@ -161,6 +161,7 @@ only forth definitions also password-processing
\ We should prevent the user from visiting the menu or dropping to the
\ interactive loader(8) prompt, but still allow the machine to boot...
 
+   any_conf_read? if load_kernel load_modules then
0 autoboot
 
\ Only reached if autoboot fails for any reason (including if/when
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339509 - head/stand/forth

2018-10-20 Thread Devin Teske
Author: dteske
Date: Sun Oct 21 00:15:51 2018
New Revision: 339509
URL: https://svnweb.freebsd.org/changeset/base/339509

Log:
  Restore the ability to prevent the user from interrupting the boot process
  without first entering the password stored in loader.conf(5).
  
  PR:   kern/207069
  Reported by:  da...@dcrosstech.com
  MFC after:3 days
  Sponsored by: Smule, Inc.

Modified:
  head/stand/forth/check-password.4th

Modified: head/stand/forth/check-password.4th
==
--- head/stand/forth/check-password.4th Sun Oct 21 00:11:56 2018
(r339508)
+++ head/stand/forth/check-password.4th Sun Oct 21 00:15:51 2018
(r339509)
@@ -129,7 +129,7 @@ variable readlen \ input length
again \ Enter was not pressed; repeat
 ;
 
-only forth definitions also password-processing
+only forth definitions also password-processing also support-functions
 
 : check-password ( -- )
 
@@ -161,6 +161,7 @@ only forth definitions also password-processing
\ We should prevent the user from visiting the menu or dropping to the
\ interactive loader(8) prompt, but still allow the machine to boot...
 
+   any_conf_read? if load_kernel load_modules then
0 autoboot
 
\ Only reached if autoboot fails for any reason (including if/when
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r337611 - head/cddl/usr.sbin/dwatch/libexec

2018-08-11 Thread Devin Teske


> On Aug 11, 2018, at 9:09 AM, Brad Davis  wrote:
> 
>> On Sat, Aug 11, 2018, at 7:06 AM, Kristof Provost wrote:
>> Hi Devin,
>>> On 11 Aug 2018, at 8:32, Devin Teske wrote:
>>> Author: dteske
>>> Date: Sat Aug 11 06:32:31 2018
>>> New Revision: 337611
>>> URL: https://svnweb.freebsd.org/changeset/base/337611
>>> 
>>> Log:
>>> dwatch(1): Add systop profile
>>> 
>>> Provides a top-like view of syscall consumers.
>>> 
>>> MFC after:3 days
>>> X-MFC-to:stable/11
>>> Sponsored by:Smule, Inc.
>>> 
>>> Added:
>>> head/cddl/usr.sbin/dwatch/libexec/systop   (contents, props changed)
>>> Modified:
>>> head/cddl/usr.sbin/dwatch/libexec/Makefile
>>> 
>>> Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile
>>> ==
>>> --- head/cddl/usr.sbin/dwatch/libexec/MakefileSat Aug 11 06:13:11 2018  
>>>   (r337610)
>>> +++ head/cddl/usr.sbin/dwatch/libexec/MakefileSat Aug 11 06:32:31 2018  
>>>   (r337611)
>>> @@ -62,6 +62,7 @@ LINKS+=${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dw
>>> LINKS+=${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send
>>> LINKS+=${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg
>>> LINKS+=${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto
>>> +LINKS+=${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop
>> This breaks install world:
>> install: link 
>> /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop -> 
>> /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop: No 
>> such file or directory
> 
> Hi Devin,
> 
> I committed a fix in r337629 to just install systop, since that seems to be 
> what you meant.. If not, please let me know and I would be happy to help 
> correct that.
> 
> 

Thanks!

Silly me, the brain was not cooperating.

Modified the wrong aspect of the Makefile.
— 
Devin

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


Re: svn commit: r337629 - head/cddl/usr.sbin/dwatch/libexec

2018-08-11 Thread Devin Teske
Thanks.

Maybe no more commits on Friday evenings close to midnight.

Sent from my iPhone

> On Aug 11, 2018, at 9:06 AM, Brad Davis  wrote:
> 
> Author: brd
> Date: Sat Aug 11 16:06:32 2018
> New Revision: 337629
> URL: https://svnweb.freebsd.org/changeset/base/337629
> 
> Log:
>  Fix the build by just installing systop since testing shows it works with:
> 
>  dwatch -X systop
> 
>  Reviewed by:kp
>  Approved by:allanjude (mentor)
> 
> Modified:
>  head/cddl/usr.sbin/dwatch/libexec/Makefile
> 
> Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile
> ==
> --- head/cddl/usr.sbin/dwatch/libexec/MakefileSat Aug 11 14:45:33 2018
> (r337628)
> +++ head/cddl/usr.sbin/dwatch/libexec/MakefileSat Aug 11 16:06:32 2018
> (r337629)
> @@ -12,6 +12,7 @@ FILES=chmod \
>rw \
>sched \
>sendrecv \
> +systop \
>tcp \
>udp \
>udplite \
> @@ -62,7 +63,6 @@ LINKS+=${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dw
> LINKS+=${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send
> LINKS+=${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg
> LINKS+=${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto
> -LINKS+=${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop
> LINKS+=${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept
> LINKS+=${LIBEXECDIR}/dwatch/tcp 
> ${LIBEXECDIR}/dwatch/tcp-accept-established
> LINKS+=${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-refused
> 

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


svn commit: r337611 - head/cddl/usr.sbin/dwatch/libexec

2018-08-11 Thread Devin Teske
Author: dteske
Date: Sat Aug 11 06:32:31 2018
New Revision: 337611
URL: https://svnweb.freebsd.org/changeset/base/337611

Log:
  dwatch(1): Add systop profile
  
  Provides a top-like view of syscall consumers.
  
  MFC after:3 days
  X-MFC-to: stable/11
  Sponsored by: Smule, Inc.

Added:
  head/cddl/usr.sbin/dwatch/libexec/systop   (contents, props changed)
Modified:
  head/cddl/usr.sbin/dwatch/libexec/Makefile

Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile
==
--- head/cddl/usr.sbin/dwatch/libexec/Makefile  Sat Aug 11 06:13:11 2018
(r337610)
+++ head/cddl/usr.sbin/dwatch/libexec/Makefile  Sat Aug 11 06:32:31 2018
(r337611)
@@ -62,6 +62,7 @@ LINKS+=   ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dw
 LINKS+=${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send
 LINKS+=${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg
 LINKS+=${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto
+LINKS+=${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop
 LINKS+=${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept
 LINKS+=${LIBEXECDIR}/dwatch/tcp 
${LIBEXECDIR}/dwatch/tcp-accept-established
 LINKS+=${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-refused

Added: head/cddl/usr.sbin/dwatch/libexec/systop
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/cddl/usr.sbin/dwatch/libexec/systopSat Aug 11 06:32:31 2018
(r337611)
@@ -0,0 +1,84 @@
+# -*- tab-width: 4 -*- ;; Emacs
+# vi: set filetype=sh tabstop=8 shiftwidth=8 noexpandtab :: Vi/ViM
+ IDENT(1)
+#
+# $Title: dwatch(8) profile for top-like syscall $
+# $Copyright: 2014-2018 Devin Teske. All rights reserved. $
+# $FreeBSD$
+#
+ DESCRIPTION
+#
+# Every 3 seconds update the screen with syscall consumers.
+#
+ PRAGMAS
+
+# Optional: You can override the default pragmas (shown below)
+
+DTRACE_PRAGMA="
+   option quiet
+   option aggsortrev
+" # END-QUOTE
+
+ PROBE
+
+: ${PROBE:=profile:::tick-3s}
+
+ ACTIONS
+
+exec 9< /dev/null )
+rows="${size%% *}"
+cols="${size#* }"
+
+exec 9<https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r337610 - head/cddl/usr.sbin/dwatch/libexec

2018-08-11 Thread Devin Teske
Author: dteske
Date: Sat Aug 11 06:13:11 2018
New Revision: 337610
URL: https://svnweb.freebsd.org/changeset/base/337610

Log:
  dwatch(1): Fix syntax error in vop_readdir profile
  
  Reported by:  Arne Ehrlich 
  MFC after:3 days
  X-MFC-to: stable/11
  Sponsored by: Smule, Inc.

Modified:
  head/cddl/usr.sbin/dwatch/libexec/vop_readdir

Modified: head/cddl/usr.sbin/dwatch/libexec/vop_readdir
==
--- head/cddl/usr.sbin/dwatch/libexec/vop_readdir   Sat Aug 11 04:55:47 
2018(r337609)
+++ head/cddl/usr.sbin/dwatch/libexec/vop_readdir   Sat Aug 11 06:13:11 
2018(r337610)
@@ -163,6 +163,7 @@ $PROBE /this->fi_mount != 0/ /* probe ID $(( $ID + $MA
this->path = strjoin(this->path, strjoin(this->name =
(this->d_name != 0 ? this->d_name : ""),
this->name != "" ? "/" : ""));
+}
 EOF
 ACTIONS=$( cat <&9 )
 ID=$(( $ID + $MAX_DEPTH + 5 ))
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r337589 - in head/sys: dev/cx i386/include net80211 netinet

2018-08-10 Thread Devin Teske
Author: dteske
Date: Fri Aug 10 20:37:32 2018
New Revision: 337589
URL: https://svnweb.freebsd.org/changeset/base/337589

Log:
  Fix misspellings of transmitter/transmitted
  
  Reviewed by:  emaste, bcr
  Sponsored by: Smule, Inc.
  Differential Revision:https://reviews.freebsd.org/D16025

Modified:
  head/sys/dev/cx/cxddk.c
  head/sys/i386/include/cserial.h
  head/sys/net80211/ieee80211_hwmp.c
  head/sys/netinet/sctp_indata.c

Modified: head/sys/dev/cx/cxddk.c
==
--- head/sys/dev/cx/cxddk.c Fri Aug 10 20:07:59 2018(r337588)
+++ head/sys/dev/cx/cxddk.c Fri Aug 10 20:37:32 2018(r337589)
@@ -215,7 +215,7 @@ void cx_enable_receive (cx_chan_t *c, int on)
 }
 
 /*
- * Turn the transmiter on/off.
+ * Turn the transmitter on/off.
  */
 void cx_enable_transmit (cx_chan_t *c, int on)
 {

Modified: head/sys/i386/include/cserial.h
==
--- head/sys/i386/include/cserial.h Fri Aug 10 20:07:59 2018
(r337588)
+++ head/sys/i386/include/cserial.h Fri Aug 10 20:37:32 2018
(r337589)
@@ -89,7 +89,7 @@ struct e3_statistics {
 #define ER_SCC_FRAMING 7   /* subchannel framing error */
 #define ER_SCC_OVERFLOW8   /* subchannel receive buffer 
overflow */
 #define ER_SCC_OVERRUN 9   /* subchannel receiver overrun */
-#define ER_SCC_UNDERRUN10  /* subchannel transmiter 
underrun */
+#define ER_SCC_UNDERRUN10  /* subchannel transmitter 
underrun */
 #define ER_BUS 11  /* system bus is too busy (e.g PCI) */
 
 /*

Modified: head/sys/net80211/ieee80211_hwmp.c
==
--- head/sys/net80211/ieee80211_hwmp.c  Fri Aug 10 20:07:59 2018
(r337588)
+++ head/sys/net80211/ieee80211_hwmp.c  Fri Aug 10 20:37:32 2018
(r337589)
@@ -920,7 +920,7 @@ hwmp_update_transmitter(struct ieee80211vap *vap, stru
rttran->rt_metric > metric)
{
IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-   "%s path to transmiter %6D of %s, metric %d:%d",
+   "%s path to transmitter %6D of %s, metric %d:%d",
rttran->rt_flags & IEEE80211_MESHRT_FLAGS_VALID ?
"prefer" : "update", ni->ni_macaddr, ":", hwmp_frame,
rttran->rt_metric, metric);

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Fri Aug 10 20:07:59 2018
(r337588)
+++ head/sys/netinet/sctp_indata.c  Fri Aug 10 20:37:32 2018
(r337589)
@@ -3078,7 +3078,7 @@ sctp_process_segment_range(struct sctp_tcb *stcb, stru
tp1->whoTo->net_ack += 
tp1->send_size;
if (tp1->snd_count < 2) {
/*-
-* True 
non-retransmited chunk
+* True 
non-retransmitted chunk
 */
tp1->whoTo->net_ack2 += 
tp1->send_size;
 
@@ -4056,7 +4056,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32
tp1->whoTo->net_ack += tp1->send_size;
if (tp1->snd_count < 2) {
/*
-* True non-retransmited
+* True non-retransmitted
 * chunk
 */
tp1->whoTo->net_ack2 +=
@@ -4676,7 +4676,7 @@ hopeless_peer:
 
if (tp1->snd_count < 2) {
/*
-* True non-retransmited
+* True non-retransmitted
 * chunk
 */
tp1->whoTo->net_ack2 +=
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r337588 - in stable: 10/usr.sbin/sysrc 11/usr.sbin/sysrc 9/usr.sbin/sysrc

2018-08-10 Thread Devin Teske
Author: dteske
Date: Fri Aug 10 20:07:59 2018
New Revision: 337588
URL: https://svnweb.freebsd.org/changeset/base/337588

Log:
  MFC SVN r336350: Send sysrc(8) error message to stderr (not stdout)
  
  PR:   bin/229806
  Reported by:  Andreas Sommer 
  Sponsored by: Smule, Inc.

Modified:
  stable/11/usr.sbin/sysrc/sysrc
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/usr.sbin/sysrc/sysrc
  stable/9/usr.sbin/sysrc/sysrc
Directory Properties:
  stable/10/   (props changed)
  stable/9/   (props changed)
  stable/9/usr.sbin/   (props changed)
  stable/9/usr.sbin/sysrc/   (props changed)

Modified: stable/11/usr.sbin/sysrc/sysrc
==
--- stable/11/usr.sbin/sysrc/sysrc  Fri Aug 10 20:07:00 2018
(r337587)
+++ stable/11/usr.sbin/sysrc/sysrc  Fri Aug 10 20:07:59 2018
(r337588)
@@ -874,7 +874,8 @@ while [ $# -gt 0 ]; do
*)
if ! IGNORED=$( f_sysrc_get "$NAME?" ); then
[ "$IGNORE_UNKNOWNS" -o "$QUIET" ] ||
-   echo "$pgm: unknown variable '$NAME'"
+   f_err "%s: unknown variable '%s'\n" \
+   "$pgm" "$NAME"
shift 1
status=$FAILURE
continue
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r337588 - in stable: 10/usr.sbin/sysrc 11/usr.sbin/sysrc 9/usr.sbin/sysrc

2018-08-10 Thread Devin Teske
Author: dteske
Date: Fri Aug 10 20:07:59 2018
New Revision: 337588
URL: https://svnweb.freebsd.org/changeset/base/337588

Log:
  MFC SVN r336350: Send sysrc(8) error message to stderr (not stdout)
  
  PR:   bin/229806
  Reported by:  Andreas Sommer 
  Sponsored by: Smule, Inc.

Modified:
  stable/9/usr.sbin/sysrc/sysrc
Directory Properties:
  stable/9/   (props changed)
  stable/9/usr.sbin/   (props changed)
  stable/9/usr.sbin/sysrc/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/usr.sbin/sysrc/sysrc
  stable/11/usr.sbin/sysrc/sysrc
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/9/usr.sbin/sysrc/sysrc
==
--- stable/9/usr.sbin/sysrc/sysrc   Fri Aug 10 20:07:00 2018
(r337587)
+++ stable/9/usr.sbin/sysrc/sysrc   Fri Aug 10 20:07:59 2018
(r337588)
@@ -674,7 +674,8 @@ while [ $# -gt 0 ]; do
*)
if ! IGNORED=$( f_sysrc_get "$NAME?" ); then
[ "$IGNORE_UNKNOWNS" -o "$QUIET" ] ||
-   echo "$pgm: unknown variable '$NAME'"
+   f_err "%s: unknown variable '%s'\n" \
+   "$pgm" "$NAME"
shift 1
status=$FAILURE
continue
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r337588 - in stable: 10/usr.sbin/sysrc 11/usr.sbin/sysrc 9/usr.sbin/sysrc

2018-08-10 Thread Devin Teske
Author: dteske
Date: Fri Aug 10 20:07:59 2018
New Revision: 337588
URL: https://svnweb.freebsd.org/changeset/base/337588

Log:
  MFC SVN r336350: Send sysrc(8) error message to stderr (not stdout)
  
  PR:   bin/229806
  Reported by:  Andreas Sommer 
  Sponsored by: Smule, Inc.

Modified:
  stable/10/usr.sbin/sysrc/sysrc
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/usr.sbin/sysrc/sysrc
  stable/9/usr.sbin/sysrc/sysrc
Directory Properties:
  stable/11/   (props changed)
  stable/9/   (props changed)
  stable/9/usr.sbin/   (props changed)
  stable/9/usr.sbin/sysrc/   (props changed)

Modified: stable/10/usr.sbin/sysrc/sysrc
==
--- stable/10/usr.sbin/sysrc/sysrc  Fri Aug 10 20:07:00 2018
(r337587)
+++ stable/10/usr.sbin/sysrc/sysrc  Fri Aug 10 20:07:59 2018
(r337588)
@@ -860,7 +860,8 @@ while [ $# -gt 0 ]; do
*)
if ! IGNORED=$( f_sysrc_get "$NAME?" ); then
[ "$IGNORE_UNKNOWNS" -o "$QUIET" ] ||
-   echo "$pgm: unknown variable '$NAME'"
+   f_err "%s: unknown variable '%s'\n" \
+   "$pgm" "$NAME"
shift 1
status=$FAILURE
continue
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r336481 - head/share/misc

2018-07-20 Thread Devin Teske


> On Jul 20, 2018, at 4:12 PM, Mateusz Piotrowski <0...@freebsd.org> wrote:
> 
> On Thu, 19 Jul 2018 15:37:21 +0200
> "Piotr P. Stefaniak"  wrote:
> 
>> On 2018-07-19 12:58:10, Mateusz Piotrowski wrote:
>>> Author: 0mp (ports committer)
>>> Date: Thu Jul 19 12:58:10 2018
>>> New Revision: 336481
>>> URL: https://svnweb.freebsd.org/changeset/base/336481
>>> 
>>> Log:
>>> Update mentor and mentee information.
>>> 
>>> Reviewed by:mat (mentor)
>>> Approved by:mat (mentor)
>>> Differential Revision:  https://reviews.freebsd.org/D16295
>>> 
>>> Modified:
>>> head/share/misc/committers-ports.dot
>>> 
>>> Modified: head/share/misc/committers-ports.dot
>>> ==
>>> --- head/share/misc/committers-ports.dotThu Jul 19 12:56:54 2018
>>> (r336480)
>>> +++ head/share/misc/committers-ports.dotThu Jul 19 12:58:10 2018
>>> (r336481)
>>> @@ -40,6 +40,7 @@ node [color=lightblue2, style=filled, bgcolor=black];
>>> 
>>> # Current ports committers go here. Try to keep things sorted.
>>> 
>>> +0mp [label="Mateusz Piotrowski\n...@freebsd.org\n2018/06/16"]
>>> ache [label="Andrey Chernov\na...@freebsd.org\n1994/11/15"]  
>> dot(1) doesn't like this.
> 
> Actually, I am not sure what we should do about it :/

Put double-quotes around "0mp".

Illegal:

0mp -> abc

Legal:

"0mp" -> abc

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


Re: svn commit: r336503 - in head/sys: netinet netinet6

2018-07-19 Thread Devin Teske


> On Jul 19, 2018, at 1:18 PM, Ian Lepore  wrote:
> 
> On Thu, 2018-07-19 at 13:12 -0700, Devin Teske wrote:
>>> 
>>> On Jul 19, 2018, at 12:59 PM, Ian Lepore  wrote:
>>> 
>>> On Thu, 2018-07-19 at 19:53 +, Alexey Dokuchaev wrote:
>>>> 
>>>>> 
>>>>> +++ head/sys/netinet/sctp_asconf.cThu Jul 19 19:33:42 2018
>>>>> (r336503)
>>>>>   static struct mbuf *
>>>>> -sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t 
>>>>> *error_tlv,
>>>>> +sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t * 
>>>>> error_tlv,
>>>> This looks strange now.  In C, asterisk is usually placed by the variable.
>>> "usually" may be true of freebsd, but most places I've worked consider
>>> the * (and & in c++) to be more associated with the type being declared
>>> than with the variable name, thus they get snugged up against the type
>>> info, not the var name. Putting the * or & with the var name leads to
>>> particularly bad constructs such as 
>>> 
>>>  int a, *b;
>>> 
>>> which, for maximal clarity, should be:
>>> 
>>>   int  a;
>>>   int* b;
>>> 
>> Are we free to prefer the former in C if that's how we've been coding in C 
>> for 20+ years?
> 
> Only if I'm free to consider that kind of sarcasm to be a completely
> inappropriate response to what I said.
> 

I sincerely believe you when you say you've worked at places that use "int* b".

I use "int *b;" and I want to know if I am free to use that for the stated 
reasons.
-- 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r336503 - in head/sys: netinet netinet6

2018-07-19 Thread Devin Teske


> On Jul 19, 2018, at 12:59 PM, Ian Lepore  wrote:
> 
> On Thu, 2018-07-19 at 19:53 +, Alexey Dokuchaev wrote:
>>> +++ head/sys/netinet/sctp_asconf.cThu Jul 19 19:33:42 2018
>>> (r336503)
>>>   static struct mbuf *
>>> -sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t *error_tlv,
>>> +sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t * 
>>> error_tlv,
>> 
>> This looks strange now.  In C, asterisk is usually placed by the variable.
> 
> "usually" may be true of freebsd, but most places I've worked consider
> the * (and & in c++) to be more associated with the type being declared
> than with the variable name, thus they get snugged up against the type
> info, not the var name. Putting the * or & with the var name leads to
> particularly bad constructs such as 
> 
>  int a, *b;
> 
> which, for maximal clarity, should be:
> 
>   int  a;
>   int* b;
> 

Are we free to prefer the former in C if that's how we've been coding in C for 
20+ years?
-- 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r336350 - head/usr.sbin/sysrc

2018-07-16 Thread Devin Teske
Author: dteske
Date: Mon Jul 16 18:53:17 2018
New Revision: 336350
URL: https://svnweb.freebsd.org/changeset/base/336350

Log:
  sysrc(8): Send error message to stderr (not stdout)
  
  PR:   bin/229806
  Reported by:  Andreas Sommer 
  MFC after:3 days
  X-MFC-to: stable/11 stable/10 stable/9
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/sysrc/sysrc

Modified: head/usr.sbin/sysrc/sysrc
==
--- head/usr.sbin/sysrc/sysrc   Mon Jul 16 18:21:29 2018(r336349)
+++ head/usr.sbin/sysrc/sysrc   Mon Jul 16 18:53:17 2018(r336350)
@@ -874,7 +874,8 @@ while [ $# -gt 0 ]; do
*)
if ! IGNORED=$( f_sysrc_get "$NAME?" ); then
[ "$IGNORE_UNKNOWNS" -o "$QUIET" ] ||
-   echo "$pgm: unknown variable '$NAME'"
+   f_err "%s: unknown variable '%s'\n" \
+   "$pgm" "$NAME"
shift 1
status=$FAILURE
continue
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335927 - stable/10

2018-07-03 Thread Devin Teske
Author: dteske
Date: Wed Jul  4 03:24:11 2018
New Revision: 335927
URL: https://svnweb.freebsd.org/changeset/base/335927

Log:
  MFC SVN r335750: Fix typo in top-level Makefile
  
  Submitted by: Ben Widawsky 
  Sponsored by: Smule, Inc.
  Differential Revision:https://reviews.freebsd.org/P186

Modified:
  stable/10/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/Makefile
==
--- stable/10/Makefile  Wed Jul  4 03:22:44 2018(r335926)
+++ stable/10/Makefile  Wed Jul  4 03:24:11 2018(r335927)
@@ -144,7 +144,7 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAK
 # We often need to use the tree's version of make to build it.
 # Choices add to complexity though.
 # We cannot blindly use a make which may not be the one we want
-# so be exlicit - until all choice is removed.
+# so be explicit - until all choice is removed.
 .if !defined(WITHOUT_BMAKE)
 WANT_MAKE= bmake
 .else
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335926 - stable/11

2018-07-03 Thread Devin Teske
Author: dteske
Date: Wed Jul  4 03:22:44 2018
New Revision: 335926
URL: https://svnweb.freebsd.org/changeset/base/335926

Log:
  MFC SVN r335750: Fix typo in top-level Makefile
  
  Submitted by: Ben Widawsky 
  Sponsored by: Smule, Inc.
  Differential Revision:https://reviews.freebsd.org/P186

Modified:
  stable/11/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/Makefile
==
--- stable/11/Makefile  Wed Jul  4 03:02:53 2018(r335925)
+++ stable/11/Makefile  Wed Jul  4 03:22:44 2018(r335926)
@@ -181,7 +181,7 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} MK_AU
 # We often need to use the tree's version of make to build it.
 # Choices add to complexity though.
 # We cannot blindly use a make which may not be the one we want
-# so be exlicit - until all choice is removed.
+# so be explicit - until all choice is removed.
 WANT_MAKE= bmake
 .if !empty(.MAKE.MODE:Mmeta)
 # 20160604 - support missing-meta,missing-filemon and performance improvements
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335914 - stable/10/usr.sbin/bsdinstall/distfetch

2018-07-03 Thread Devin Teske
Author: dteske
Date: Tue Jul  3 22:11:16 2018
New Revision: 335914
URL: https://svnweb.freebsd.org/changeset/base/335914

Log:
  MFC SVN r290340: Fix typo in error message
  
  Submitted by: git_johnko.ca (John Ko)
  Sponsored by: Smule, Inc.
  Differential Revision:https://reviews.freebsd.org/D3997

Modified:
  stable/10/usr.sbin/bsdinstall/distfetch/distfetch.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bsdinstall/distfetch/distfetch.c
==
--- stable/10/usr.sbin/bsdinstall/distfetch/distfetch.c Tue Jul  3 22:03:28 
2018(r335913)
+++ stable/10/usr.sbin/bsdinstall/distfetch/distfetch.c Tue Jul  3 22:11:16 
2018(r335914)
@@ -78,7 +78,7 @@ main(void)
 
if (chdir(getenv("BSDINSTALL_DISTDIR")) != 0) {
snprintf(error, sizeof(error),
-   "Could could change to directory %s: %s\n",
+   "Could not change to directory %s: %s\n",
getenv("BSDINSTALL_DISTDIR"), strerror(errno));
dialog_msgbox("Error", error, 0, 0, TRUE);
end_dialog();
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r335690 - head/sys/kern

2018-06-29 Thread Devin Teske


> On Jun 28, 2018, at 12:36 AM, Warner Losh  wrote:
> 
> 
> 
> On Thu, Jun 28, 2018 at 12:54 AM, Devin Teske  <mailto:dte...@freebsd.org>> wrote:
> 
>> On Jun 27, 2018, at 7:35 PM, Warner Losh > <mailto:i...@bsdimp.com>> wrote:
>> 
>> 
>> 
>> On Wed, Jun 27, 2018 at 8:14 PM, Devin Teske > <mailto:dte...@freebsd.org>> wrote:
>> 
>>> On Jun 27, 2018, at 6:58 PM, Warner Losh >> <mailto:i...@bsdimp.com>> wrote:
>>> 
>>> 
>>> 
>>> On Wed, Jun 27, 2018 at 7:49 PM, Devin Teske >> <mailto:dte...@freebsd.org>> wrote:
>>> 
>>>> On Jun 27, 2018, at 5:59 PM, Warner Losh >>> <mailto:i...@bsdimp.com>> wrote:
>>>> 
>>>> 
>>>> 
>>>> On Wed, Jun 27, 2018 at 5:52 PM, Gleb Smirnoff >>> <mailto:gleb...@freebsd.org>> wrote:
>>>> On Wed, Jun 27, 2018 at 04:11:09AM +, Warner Losh wrote:
>>>> W> Author: imp
>>>> W> Date: Wed Jun 27 04:11:09 2018
>>>> W> New Revision: 335690
>>>> W> URL: https://svnweb.freebsd.org/changeset/base/335690 
>>>> <https://svnweb.freebsd.org/changeset/base/335690>
>>>> W> 
>>>> W> Log:
>>>> W>   Fix devctl generation for core files.
>>>> W>   
>>>> W>   We have a problem with vn_fullpath_global when the file exists. Work
>>>> W>   around it by printing the full path if the core file name starts with 
>>>> /,
>>>> W>   or current working directory followed by the filename if not.
>>>> 
>>>> Is this going to work when a core is dumped not at current working 
>>>> directory,
>>>> but at absolute path? e.g. kern.corefile=/var/log/cores/%N.core
>>>> 
>>>> Yes. That works.
>>>>  
>>>> Looks like the vn_fullpath_global needs to be fixed rather than problem
>>>> workarounded.
>>>> 
>>>> It can't be fixed reliably. FreeBSD does not and cannot map a vnode to a 
>>>> name. The only reason we're able to at all is due to the name cache. And 
>>>> when we recreate a file, we invalidate the name cache. And even if we 
>>>> fixed that, there's no guarantee the name cache won't get flushed before 
>>>> we translate the name Linux can do this because it keeps the path name 
>>>> associated with the inode. FreeBSD simply doesn't.
>>>> 
>>> 
>>> They said it couldn't be done, but I personally have done it ...
>>> 
>>> I map vnodes to full paths in dwatch. It's not impossible, just implausibly 
>>> hard.
>>> 
>>> I derived my formula by reading the C code which was very twisty-turny and 
>>> rather hard to read at times (and I have been using C since 1998 on 
>>> everything from AIX and OSF/1 to HP/UX, Cygwin, MinGW, FreeBSD, countless 
>>> Linux-like things, IRIX, and a God-awful remainder of many others; the 
>>> vnode code was an adventure to say the least).
>>> 
>>> You're welcome to see how it's done in /usr/libexec/dwatch/vop_create
>>> 
>>> I load up a clause-local variable named "path" with a path constructed from 
>>> a pointer to a vnode structure argument to VOP_CREATE(9).
>>> 
>>> The D code could easily be rewritten back into C to walk the vnode to 
>>> completion (compared to the D code which is bounded by depth-limit since 
>>> DTrace doesn't provide loops; so you have to, as I have done, use a 
>>> higher-level language wrapper to repeat the code to some desired limit; 
>>> dwatch defaulting to 64 for directory depth limit).
>>> 
>>> Compared this, say, to vfssnoop.d from Chapter 5 of the DTrace book which 
>>> utilizes the vfs:namei:lookup: probes. My approach in dwatch is far more 
>>> accurate, produces full paths, and I've benchmarked it at lower overhead 
>>> with better results.
>>> 
>>> Maybe some of this can be useful? If not, just ignore me.
>>> 
>>> IMHO, there's no benefit from the crazy hoops than the super simple 
>>> heuristic I did: if the path starts with / print it. If the path doesn't 
>>> print cwd / and then the path.
>>> 
>>> I look forward to seeing your conversion of the D to C that works, even 
>>> when there's namespace cache pressure.
>>> 
>> 
>> I was looking at the output of "dwatch -dX vop_create" (the -d flag to 
>> dwatch causes the g

svn commit: r335758 - stable/10

2018-06-28 Thread Devin Teske
Author: dteske
Date: Thu Jun 28 07:01:56 2018
New Revision: 335758
URL: https://svnweb.freebsd.org/changeset/base/335758

Log:
  Add mergeinfo for MFC r335607
  
  This is a direct commit on stable/10 accounting for missing mergeinfo from
  SVN r335744. Difficulties with dealing with 'stand' vs 'sys/boot' in MFCs.
  
  Reported by:  kevans
  Sponsored by: Smule, Inc.

Modified:
Directory Properties:
  stable/10/   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r335690 - head/sys/kern

2018-06-28 Thread Devin Teske


> On Jun 27, 2018, at 7:35 PM, Warner Losh  wrote:
> 
> 
> 
> On Wed, Jun 27, 2018 at 8:14 PM, Devin Teske  <mailto:dte...@freebsd.org>> wrote:
> 
>> On Jun 27, 2018, at 6:58 PM, Warner Losh > <mailto:i...@bsdimp.com>> wrote:
>> 
>> 
>> 
>> On Wed, Jun 27, 2018 at 7:49 PM, Devin Teske > <mailto:dte...@freebsd.org>> wrote:
>> 
>>> On Jun 27, 2018, at 5:59 PM, Warner Losh >> <mailto:i...@bsdimp.com>> wrote:
>>> 
>>> 
>>> 
>>> On Wed, Jun 27, 2018 at 5:52 PM, Gleb Smirnoff >> <mailto:gleb...@freebsd.org>> wrote:
>>> On Wed, Jun 27, 2018 at 04:11:09AM +, Warner Losh wrote:
>>> W> Author: imp
>>> W> Date: Wed Jun 27 04:11:09 2018
>>> W> New Revision: 335690
>>> W> URL: https://svnweb.freebsd.org/changeset/base/335690 
>>> <https://svnweb.freebsd.org/changeset/base/335690>
>>> W> 
>>> W> Log:
>>> W>   Fix devctl generation for core files.
>>> W>   
>>> W>   We have a problem with vn_fullpath_global when the file exists. Work
>>> W>   around it by printing the full path if the core file name starts with 
>>> /,
>>> W>   or current working directory followed by the filename if not.
>>> 
>>> Is this going to work when a core is dumped not at current working 
>>> directory,
>>> but at absolute path? e.g. kern.corefile=/var/log/cores/%N.core
>>> 
>>> Yes. That works.
>>>  
>>> Looks like the vn_fullpath_global needs to be fixed rather than problem
>>> workarounded.
>>> 
>>> It can't be fixed reliably. FreeBSD does not and cannot map a vnode to a 
>>> name. The only reason we're able to at all is due to the name cache. And 
>>> when we recreate a file, we invalidate the name cache. And even if we fixed 
>>> that, there's no guarantee the name cache won't get flushed before we 
>>> translate the name Linux can do this because it keeps the path name 
>>> associated with the inode. FreeBSD simply doesn't.
>>> 
>> 
>> They said it couldn't be done, but I personally have done it ...
>> 
>> I map vnodes to full paths in dwatch. It's not impossible, just implausibly 
>> hard.
>> 
>> I derived my formula by reading the C code which was very twisty-turny and 
>> rather hard to read at times (and I have been using C since 1998 on 
>> everything from AIX and OSF/1 to HP/UX, Cygwin, MinGW, FreeBSD, countless 
>> Linux-like things, IRIX, and a God-awful remainder of many others; the vnode 
>> code was an adventure to say the least).
>> 
>> You're welcome to see how it's done in /usr/libexec/dwatch/vop_create
>> 
>> I load up a clause-local variable named "path" with a path constructed from 
>> a pointer to a vnode structure argument to VOP_CREATE(9).
>> 
>> The D code could easily be rewritten back into C to walk the vnode to 
>> completion (compared to the D code which is bounded by depth-limit since 
>> DTrace doesn't provide loops; so you have to, as I have done, use a 
>> higher-level language wrapper to repeat the code to some desired limit; 
>> dwatch defaulting to 64 for directory depth limit).
>> 
>> Compared this, say, to vfssnoop.d from Chapter 5 of the DTrace book which 
>> utilizes the vfs:namei:lookup: probes. My approach in dwatch is far more 
>> accurate, produces full paths, and I've benchmarked it at lower overhead 
>> with better results.
>> 
>> Maybe some of this can be useful? If not, just ignore me.
>> 
>> IMHO, there's no benefit from the crazy hoops than the super simple 
>> heuristic I did: if the path starts with / print it. If the path doesn't 
>> print cwd / and then the path.
>> 
>> I look forward to seeing your conversion of the D to C that works, even when 
>> there's namespace cache pressure.
>> 
> 
> I was looking at the output of "dwatch -dX vop_create" (the -d flag to dwatch 
> causes the generated dwatch to be printed instead of executed) and thinking 
> to myself:
> 
> I could easily convert this, as I can recognize the flattened loop structure. 
> However, not many people will be able to do it. I wasn't really volunteering, 
> but now I'm curious what other people see when they run "dwatch -dX 
> vop_create". If it's half as bad as I think it is, then I'll gladly do it -- 
> but will have to balance it against work priorities.
> 
> We don't have the data you do in vop_create anymore, just the vp at the point 
> in the code w

Re: svn commit: r335690 - head/sys/kern

2018-06-27 Thread Devin Teske


> On Jun 27, 2018, at 6:58 PM, Warner Losh  wrote:
> 
> 
> 
> On Wed, Jun 27, 2018 at 7:49 PM, Devin Teske  <mailto:dte...@freebsd.org>> wrote:
> 
>> On Jun 27, 2018, at 5:59 PM, Warner Losh > <mailto:i...@bsdimp.com>> wrote:
>> 
>> 
>> 
>> On Wed, Jun 27, 2018 at 5:52 PM, Gleb Smirnoff > <mailto:gleb...@freebsd.org>> wrote:
>> On Wed, Jun 27, 2018 at 04:11:09AM +, Warner Losh wrote:
>> W> Author: imp
>> W> Date: Wed Jun 27 04:11:09 2018
>> W> New Revision: 335690
>> W> URL: https://svnweb.freebsd.org/changeset/base/335690 
>> <https://svnweb.freebsd.org/changeset/base/335690>
>> W> 
>> W> Log:
>> W>   Fix devctl generation for core files.
>> W>   
>> W>   We have a problem with vn_fullpath_global when the file exists. Work
>> W>   around it by printing the full path if the core file name starts with /,
>> W>   or current working directory followed by the filename if not.
>> 
>> Is this going to work when a core is dumped not at current working directory,
>> but at absolute path? e.g. kern.corefile=/var/log/cores/%N.core
>> 
>> Yes. That works.
>>  
>> Looks like the vn_fullpath_global needs to be fixed rather than problem
>> workarounded.
>> 
>> It can't be fixed reliably. FreeBSD does not and cannot map a vnode to a 
>> name. The only reason we're able to at all is due to the name cache. And 
>> when we recreate a file, we invalidate the name cache. And even if we fixed 
>> that, there's no guarantee the name cache won't get flushed before we 
>> translate the name Linux can do this because it keeps the path name 
>> associated with the inode. FreeBSD simply doesn't.
>> 
> 
> They said it couldn't be done, but I personally have done it ...
> 
> I map vnodes to full paths in dwatch. It's not impossible, just implausibly 
> hard.
> 
> I derived my formula by reading the C code which was very twisty-turny and 
> rather hard to read at times (and I have been using C since 1998 on 
> everything from AIX and OSF/1 to HP/UX, Cygwin, MinGW, FreeBSD, countless 
> Linux-like things, IRIX, and a God-awful remainder of many others; the vnode 
> code was an adventure to say the least).
> 
> You're welcome to see how it's done in /usr/libexec/dwatch/vop_create
> 
> I load up a clause-local variable named "path" with a path constructed from a 
> pointer to a vnode structure argument to VOP_CREATE(9).
> 
> The D code could easily be rewritten back into C to walk the vnode to 
> completion (compared to the D code which is bounded by depth-limit since 
> DTrace doesn't provide loops; so you have to, as I have done, use a 
> higher-level language wrapper to repeat the code to some desired limit; 
> dwatch defaulting to 64 for directory depth limit).
> 
> Compared this, say, to vfssnoop.d from Chapter 5 of the DTrace book which 
> utilizes the vfs:namei:lookup: probes. My approach in dwatch is far more 
> accurate, produces full paths, and I've benchmarked it at lower overhead with 
> better results.
> 
> Maybe some of this can be useful? If not, just ignore me.
> 
> IMHO, there's no benefit from the crazy hoops than the super simple heuristic 
> I did: if the path starts with / print it. If the path doesn't print cwd / 
> and then the path.
> 
> I look forward to seeing your conversion of the D to C that works, even when 
> there's namespace cache pressure.
> 

I was looking at the output of "dwatch -dX vop_create" (the -d flag to dwatch 
causes the generated dwatch to be printed instead of executed) and thinking to 
myself:

I could easily convert this, as I can recognize the flattened loop structure. 
However, not many people will be able to do it. I wasn't really volunteering, 
but now I'm curious what other people see when they run "dwatch -dX 
vop_create". If it's half as bad as I think it is, then I'll gladly do it -- 
but will have to balance it against work priorities.
-- 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r335690 - head/sys/kern

2018-06-27 Thread Devin Teske


> On Jun 27, 2018, at 5:59 PM, Warner Losh  wrote:
> 
> 
> 
> On Wed, Jun 27, 2018 at 5:52 PM, Gleb Smirnoff  > wrote:
> On Wed, Jun 27, 2018 at 04:11:09AM +, Warner Losh wrote:
> W> Author: imp
> W> Date: Wed Jun 27 04:11:09 2018
> W> New Revision: 335690
> W> URL: https://svnweb.freebsd.org/changeset/base/335690 
> 
> W> 
> W> Log:
> W>   Fix devctl generation for core files.
> W>   
> W>   We have a problem with vn_fullpath_global when the file exists. Work
> W>   around it by printing the full path if the core file name starts with /,
> W>   or current working directory followed by the filename if not.
> 
> Is this going to work when a core is dumped not at current working directory,
> but at absolute path? e.g. kern.corefile=/var/log/cores/%N.core
> 
> Yes. That works.
>  
> Looks like the vn_fullpath_global needs to be fixed rather than problem
> workarounded.
> 
> It can't be fixed reliably. FreeBSD does not and cannot map a vnode to a 
> name. The only reason we're able to at all is due to the name cache. And when 
> we recreate a file, we invalidate the name cache. And even if we fixed that, 
> there's no guarantee the name cache won't get flushed before we translate the 
> name Linux can do this because it keeps the path name associated with the 
> inode. FreeBSD simply doesn't.
> 

They said it couldn't be done, but I personally have done it ...

I map vnodes to full paths in dwatch. It's not impossible, just implausibly 
hard.

I derived my formula by reading the C code which was very twisty-turny and 
rather hard to read at times (and I have been using C since 1998 on everything 
from AIX and OSF/1 to HP/UX, Cygwin, MinGW, FreeBSD, countless Linux-like 
things, IRIX, and a God-awful remainder of many others; the vnode code was an 
adventure to say the least).

You're welcome to see how it's done in /usr/libexec/dwatch/vop_create

I load up a clause-local variable named "path" with a path constructed from a 
pointer to a vnode structure argument to VOP_CREATE(9).

The D code could easily be rewritten back into C to walk the vnode to 
completion (compared to the D code which is bounded by depth-limit since DTrace 
doesn't provide loops; so you have to, as I have done, use a higher-level 
language wrapper to repeat the code to some desired limit; dwatch defaulting to 
64 for directory depth limit).

Compared this, say, to vfssnoop.d from Chapter 5 of the DTrace book which 
utilizes the vfs:namei:lookup: probes. My approach in dwatch is far more 
accurate, produces full paths, and I've benchmarked it at lower overhead with 
better results.

Maybe some of this can be useful? If not, just ignore me.
-- 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r335744 - stable/10/sys/boot/forth

2018-06-27 Thread Devin Teske


> On Jun 27, 2018, at 2:58 PM, Kyle Evans  wrote:
> 
> On Wed, Jun 27, 2018 at 4:57 PM, Devin Teske  <mailto:dte...@freebsd.org>> wrote:
>> 
>> On Jun 27, 2018, at 2:24 PM, Kyle Evans  wrote:
>> 
>> On Wed, Jun 27, 2018 at 4:22 PM, Devin Teske  wrote:
>> 
>> Author: dteske
>> Date: Wed Jun 27 21:22:00 2018
>> New Revision: 335744
>> URL: https://svnweb.freebsd.org/changeset/base/335744
>> 
>> Log:
>> MFC r335607: check-password.4th(8): Fix manual [in]accuracy
>> 
>> SVN r280384 updated the maximum password length from 16 bytes to 255. The
>> manual was not updated to reflect this.
>> 
>> Sponsored by: Smule, Inc.
>> 
>> Modified:
>> stable/10/sys/boot/forth/check-password.4th.8
>> 
>> 
>> Hi,
>> 
>> I think this should probably have been supplemented with a record-only
>> merge of r335607 since it has actually been MFC'd, just in the old
>> location. I'm not sure how much it matters, though, other than
>> reflecting that this (general this; stable/10 commits) really wasn't a
>> direct commit.
>> 
>> 
>> I kept trying that and kept getting "tree conflict" because it wants to
>> record info in stand which doesn't exist.
>> 
>> Do you have a recommended way to achieve this that has a half-way chance of
>> working?
>> --
> 
> Target the base directory should be fine; assuming you're at base/:
> 
> svn merge -c r335607 --record-only ^/head stable/11

stable/11 ???
-- 
Devin

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


svn commit: r335750 - head

2018-06-27 Thread Devin Teske
Author: dteske
Date: Wed Jun 27 22:15:50 2018
New Revision: 335750
URL: https://svnweb.freebsd.org/changeset/base/335750

Log:
  Fix typo in top-level Makefile
  
  Submitted by: Ben Widawsky 
  MFC after:3 days
  X-MFC-to: stable/11 stable/10
  Sponsored by: Smule, Inc.
  Differential Revision:https://reviews.freebsd.org/P186

Modified:
  head/Makefile

Modified: head/Makefile
==
--- head/Makefile   Wed Jun 27 22:01:59 2018(r335749)
+++ head/Makefile   Wed Jun 27 22:15:50 2018(r335750)
@@ -205,7 +205,7 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAK
 # We often need to use the tree's version of make to build it.
 # Choices add to complexity though.
 # We cannot blindly use a make which may not be the one we want
-# so be exlicit - until all choice is removed.
+# so be explicit - until all choice is removed.
 WANT_MAKE= bmake
 .if !empty(.MAKE.MODE:Mmeta)
 # 20160604 - support missing-meta,missing-filemon and performance improvements
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r335744 - stable/10/sys/boot/forth

2018-06-27 Thread Devin Teske


> On Jun 27, 2018, at 2:24 PM, Kyle Evans  wrote:
> 
> On Wed, Jun 27, 2018 at 4:22 PM, Devin Teske  <mailto:dte...@freebsd.org>> wrote:
>> Author: dteske
>> Date: Wed Jun 27 21:22:00 2018
>> New Revision: 335744
>> URL: https://svnweb.freebsd.org/changeset/base/335744
>> 
>> Log:
>>  MFC r335607: check-password.4th(8): Fix manual [in]accuracy
>> 
>>  SVN r280384 updated the maximum password length from 16 bytes to 255. The
>>  manual was not updated to reflect this.
>> 
>>  Sponsored by: Smule, Inc.
>> 
>> Modified:
>>  stable/10/sys/boot/forth/check-password.4th.8
>> 
> 
> Hi,
> 
> I think this should probably have been supplemented with a record-only
> merge of r335607 since it has actually been MFC'd, just in the old
> location. I'm not sure how much it matters, though, other than
> reflecting that this (general this; stable/10 commits) really wasn't a
> direct commit.
> 

I kept trying that and kept getting "tree conflict" because it wants to record 
info in stand which doesn't exist.

Do you have a recommended way to achieve this that has a half-way chance of 
working?
-- 
Cheers,
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335744 - stable/10/sys/boot/forth

2018-06-27 Thread Devin Teske
Author: dteske
Date: Wed Jun 27 21:22:00 2018
New Revision: 335744
URL: https://svnweb.freebsd.org/changeset/base/335744

Log:
  MFC r335607: check-password.4th(8): Fix manual [in]accuracy
  
  SVN r280384 updated the maximum password length from 16 bytes to 255. The
  manual was not updated to reflect this.
  
  Sponsored by: Smule, Inc.

Modified:
  stable/10/sys/boot/forth/check-password.4th.8

Modified: stable/10/sys/boot/forth/check-password.4th.8
==
--- stable/10/sys/boot/forth/check-password.4th.8   Wed Jun 27 21:13:20 
2018(r335743)
+++ stable/10/sys/boot/forth/check-password.4th.8   Wed Jun 27 21:22:00 
2018(r335744)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2011-2015 Devin Teske
+.\" Copyright (c) 2011-2018 Devin Teske
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 20, 2015
+.Dd June 24, 2018
 .Dt CHECK-PASSWORD.4TH 8
 .Os
 .Sh NAME
@@ -91,7 +91,7 @@ for additional information.
 The environment variables that effect its behavior are:
 .Bl -tag -width bootlock_password -offset indent
 .It Va bootlock_password
-Sets the bootlock password (up to 16 characters long) that is required by
+Sets the bootlock password (up to 255 characters long) that is required by
 .Ic check-password
 to be entered before the system is allowed to boot.
 .It Va geom_eli_passphrase_prompt
@@ -100,7 +100,7 @@ kernel for later mounting of
 .Xr geli 8
 encrypted root device(s).
 .It Va password
-Sets the password (up to 16 characters long) that is required by
+Sets the password (up to 255 characters long) that is required by
 .Ic check-password
 before the user is allowed to visit the boot menu.
 .El
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335735 - stable/11/stand/forth

2018-06-27 Thread Devin Teske
Author: dteske
Date: Wed Jun 27 20:50:23 2018
New Revision: 335735
URL: https://svnweb.freebsd.org/changeset/base/335735

Log:
  MFC r335607: check-password.4th(8): Fix manual [in]accuracy
  
  SVN r280384 updated the maximum password length from 16 bytes to 255. The
  manual was not updated to reflect this.
  
  Sponsored by: Smule, Inc.

Modified:
  stable/11/stand/forth/check-password.4th.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/forth/check-password.4th.8
==
--- stable/11/stand/forth/check-password.4th.8  Wed Jun 27 19:42:55 2018
(r335734)
+++ stable/11/stand/forth/check-password.4th.8  Wed Jun 27 20:50:23 2018
(r335735)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2011-2015 Devin Teske
+.\" Copyright (c) 2011-2018 Devin Teske
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 20, 2015
+.Dd June 24, 2018
 .Dt CHECK-PASSWORD.4TH 8
 .Os
 .Sh NAME
@@ -91,7 +91,7 @@ for additional information.
 The environment variables that effect its behavior are:
 .Bl -tag -width bootlock_password -offset indent
 .It Va bootlock_password
-Sets the bootlock password (up to 16 characters long) that is required by
+Sets the bootlock password (up to 255 characters long) that is required by
 .Ic check-password
 to be entered before the system is allowed to boot.
 .It Va geom_eli_passphrase_prompt
@@ -100,7 +100,7 @@ kernel for later mounting of
 .Xr geli 8
 encrypted root device(s).
 .It Va password
-Sets the password (up to 16 characters long) that is required by
+Sets the password (up to 255 characters long) that is required by
 .Ic check-password
 before the user is allowed to visit the boot menu.
 .El
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335607 - head/stand/forth

2018-06-24 Thread Devin Teske
Author: dteske
Date: Sun Jun 24 19:29:29 2018
New Revision: 335607
URL: https://svnweb.freebsd.org/changeset/base/335607

Log:
  check-password.4th(8): Fix manual [in]accuracy
  
  SVN r280384 updated the maximum password length from 16 bytes to 255. The
  manual was not updated to reflect this. Found while working on kern/207069.
  
  MFC after:3 days
  X-MFC-to: stable/11 stable/10
  Sponsored by: Smule, Inc.

Modified:
  head/stand/forth/check-password.4th.8

Modified: head/stand/forth/check-password.4th.8
==
--- head/stand/forth/check-password.4th.8   Sun Jun 24 19:01:01 2018
(r335606)
+++ head/stand/forth/check-password.4th.8   Sun Jun 24 19:29:29 2018
(r335607)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2011-2015 Devin Teske
+.\" Copyright (c) 2011-2018 Devin Teske
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 20, 2015
+.Dd June 24, 2018
 .Dt CHECK-PASSWORD.4TH 8
 .Os
 .Sh NAME
@@ -91,7 +91,7 @@ for additional information.
 The environment variables that effect its behavior are:
 .Bl -tag -width bootlock_password -offset indent
 .It Va bootlock_password
-Sets the bootlock password (up to 16 characters long) that is required by
+Sets the bootlock password (up to 255 characters long) that is required by
 .Ic check-password
 to be entered before the system is allowed to boot.
 .It Va geom_eli_passphrase_prompt
@@ -100,7 +100,7 @@ kernel for later mounting of
 .Xr geli 8
 encrypted root device(s).
 .It Va password
-Sets the password (up to 16 characters long) that is required by
+Sets the password (up to 255 characters long) that is required by
 .Ic check-password
 before the user is allowed to visit the boot menu.
 .El
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335488 - stable/11/usr.sbin/bsdconfig

2018-06-21 Thread Devin Teske
Author: dteske
Date: Thu Jun 21 15:11:14 2018
New Revision: 335488
URL: https://svnweb.freebsd.org/changeset/base/335488

Log:
  MFC r335306: bsdconfig: Make examples optional
  
  PR:   bin/228485
  Submitted by: Dmitry Wagin 
  Reported by:  Dmitry Wagin 
  Sponsored by: Smule, Inc.

Modified:
  stable/11/usr.sbin/bsdconfig/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bsdconfig/Makefile
==
--- stable/11/usr.sbin/bsdconfig/Makefile   Thu Jun 21 15:02:17 2018
(r335487)
+++ stable/11/usr.sbin/bsdconfig/Makefile   Thu Jun 21 15:11:14 2018
(r335488)
@@ -1,10 +1,11 @@
 # $FreeBSD$
 
+.include 
+
 SUBDIR=console \
diskmgmt \
docsinstall \
dot \
-   examples \
include \
includes \
mouse \
@@ -17,6 +18,10 @@ SUBDIR=  console \
timezone \
ttys \
usermgmt
+
+.if ${MK_EXAMPLES} != "no"
+SUBDIR+= examples
+.endif
 
 FILESDIR=  ${LIBEXECDIR}/bsdconfig
 FILES= USAGE
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335487 - stable/10/usr.sbin/bsdconfig/usermgmt/share

2018-06-21 Thread Devin Teske
Author: dteske
Date: Thu Jun 21 15:02:17 2018
New Revision: 335487
URL: https://svnweb.freebsd.org/changeset/base/335487

Log:
  MFC r335308: bsdconfig: Fix a bug when editing users
  
  The usermgmt API was stomping on a global ($user_gid to be specific)
  so things would appear to work fine until you tried to make a second
  pass into the API with the now-tainted variable contents.
  
  Fixed by localizing menu-specific contents as to not leak outside API.
  
  PR:   bin/208774
  Reported by:  Martin Waschbuesch 
  Sponsored by: Smule, Inc.

Modified:
  stable/10/usr.sbin/bsdconfig/usermgmt/share/user_input.subr
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bsdconfig/usermgmt/share/user_input.subr
==
--- stable/10/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Thu Jun 21 
14:59:23 2018(r335486)
+++ stable/10/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Thu Jun 21 
15:02:17 2018(r335487)
@@ -1020,13 +1020,6 @@ f_dialog_menu_user_add()
user_password_expires_on="$user_password_expire"
fi
 
-   # Attempt to translate a numeric GID into `number (name)'
-   if f_isinteger "$user_gid"; then
-   local user_group
-   user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) &&
-   user_gid="$user_gid (${user_group%%:*})"
-   fi
-
# Localize potentially hostile variables and escape their values
# to the local variable (see f_shell_escape() of `strings.subr')
local var
@@ -1038,6 +1031,14 @@ f_dialog_menu_user_add()
eval f_shell_escape \"\$user_$var\" _user_$var
done
 
+   # Attempt to translate a numeric GID into `number (name)'
+   if f_isinteger "$_user_gid"; then
+   local _user_group
+   _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) &&
+   _user_group="${_user_group%%:*}" &&
+   f_shell_escape "$_user_gid ($_user_group)" _user_gid
+   fi
+
menu_list="
'X' '$msg_add/$msg_exit'
'1' '$msg_login: $_user_name'
@@ -1137,13 +1138,6 @@ f_dialog_menu_user_delete()
user_password_expires_on="$user_password_expire"
fi
 
-   # Attempt to translate a numeric GID into `number (name)'
-   if f_isinteger "$user_gid"; then
-   local user_group
-   user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) &&
-   user_gid="$user_gid (${user_group%%:*})"
-   fi
-
# Localize potentially hostile variables and escape their values
# to the local variable (see f_shell_escape() of `strings.subr')
local var
@@ -1155,6 +1149,14 @@ f_dialog_menu_user_delete()
eval f_shell_escape \"\$user_$var\" _user_$var
done
 
+   # Attempt to translate a numeric GID into `number (name)'
+   if f_isinteger "$_user_gid"; then
+   local _user_group
+   _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) &&
+   _user_group="${_user_group%%:*}" &&
+   f_shell_escape "$_user_gid ($_user_group)" _user_gid
+   fi
+
menu_list="
'X' '$msg_delete/$msg_exit'
'1' '$msg_login: $_user_name'
@@ -1254,13 +1256,6 @@ f_dialog_menu_user_edit()
user_password_expires_on="$user_password_expire"
fi
 
-   # Attempt to translate a numeric GID into `number (name)'
-   if f_isinteger "$user_gid"; then
-   local user_group
-   user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) &&
-   user_gid="$user_gid (${user_group%%:*})"
-   fi
-
# Localize potentially hostile variables and escape their values
# to the local variable (see f_shell_escape() of `strings.subr')
local var
@@ -1271,6 +1266,14 @@ f_dialog_menu_user_edit()
local _user_$var
eval f_shell_escape \"\$user_$var\" _user_$var
done
+
+   # Attempt to translate a numeric GID into `number (name)'
+   if f_isinteger "$_user_gid"; then
+   local _user_group
+   _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) &&
+   _user_group="${_user_group%%:*}" &&
+   f_shell_escape "$_user_gid ($_user_group)" _user_gid
+   fi
 
menu_list="
'X' '$msg_save/$msg_exit'
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335485 - stable/11/usr.sbin/bsdconfig/usermgmt/share

2018-06-21 Thread Devin Teske
Author: dteske
Date: Thu Jun 21 14:55:26 2018
New Revision: 335485
URL: https://svnweb.freebsd.org/changeset/base/335485

Log:
  MFC r335308: bsdconfig: Fix a bug when editing users
  
  The usermgmt API was stomping on a global ($user_gid to be specific)
  so things would appear to work fine until you tried to make a second
  pass into the API with the now-tainted variable contents.
  
  Fixed by localizing menu-specific contents as to not leak outside API.
  
  PR:   bin/208774
  Reported by:  Martin Waschbuesch 
  Sponsored by: Smule, Inc.

Modified:
  stable/11/usr.sbin/bsdconfig/usermgmt/share/user_input.subr
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bsdconfig/usermgmt/share/user_input.subr
==
--- stable/11/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Thu Jun 21 
14:41:58 2018(r335484)
+++ stable/11/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Thu Jun 21 
14:55:26 2018(r335485)
@@ -1020,13 +1020,6 @@ f_dialog_menu_user_add()
user_password_expires_on="$user_password_expire"
fi
 
-   # Attempt to translate a numeric GID into `number (name)'
-   if f_isinteger "$user_gid"; then
-   local user_group
-   user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) &&
-   user_gid="$user_gid (${user_group%%:*})"
-   fi
-
# Localize potentially hostile variables and escape their values
# to the local variable (see f_shell_escape() of `strings.subr')
local var
@@ -1038,6 +1031,14 @@ f_dialog_menu_user_add()
eval f_shell_escape \"\$user_$var\" _user_$var
done
 
+   # Attempt to translate a numeric GID into `number (name)'
+   if f_isinteger "$_user_gid"; then
+   local _user_group
+   _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) &&
+   _user_group="${_user_group%%:*}" &&
+   f_shell_escape "$_user_gid ($_user_group)" _user_gid
+   fi
+
menu_list="
'X' '$msg_add/$msg_exit'
'1' '$msg_login: $_user_name'
@@ -1137,13 +1138,6 @@ f_dialog_menu_user_delete()
user_password_expires_on="$user_password_expire"
fi
 
-   # Attempt to translate a numeric GID into `number (name)'
-   if f_isinteger "$user_gid"; then
-   local user_group
-   user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) &&
-   user_gid="$user_gid (${user_group%%:*})"
-   fi
-
# Localize potentially hostile variables and escape their values
# to the local variable (see f_shell_escape() of `strings.subr')
local var
@@ -1155,6 +1149,14 @@ f_dialog_menu_user_delete()
eval f_shell_escape \"\$user_$var\" _user_$var
done
 
+   # Attempt to translate a numeric GID into `number (name)'
+   if f_isinteger "$_user_gid"; then
+   local _user_group
+   _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) &&
+   _user_group="${_user_group%%:*}" &&
+   f_shell_escape "$_user_gid ($_user_group)" _user_gid
+   fi
+
menu_list="
'X' '$msg_delete/$msg_exit'
'1' '$msg_login: $_user_name'
@@ -1254,13 +1256,6 @@ f_dialog_menu_user_edit()
user_password_expires_on="$user_password_expire"
fi
 
-   # Attempt to translate a numeric GID into `number (name)'
-   if f_isinteger "$user_gid"; then
-   local user_group
-   user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) &&
-   user_gid="$user_gid (${user_group%%:*})"
-   fi
-
# Localize potentially hostile variables and escape their values
# to the local variable (see f_shell_escape() of `strings.subr')
local var
@@ -1271,6 +1266,14 @@ f_dialog_menu_user_edit()
local _user_$var
eval f_shell_escape \"\$user_$var\" _user_$var
done
+
+   # Attempt to translate a numeric GID into `number (name)'
+   if f_isinteger "$_user_gid"; then
+   local _user_group
+   _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) &&
+   _user_group="${_user_group%%:*}" &&
+   f_shell_escape "$_user_gid ($_user_group)" _user_gid
+   fi
 
menu_list="
'X' '$msg_save/$msg_exit'
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335484 - stable/11/usr.sbin/bsdconfig/share

2018-06-21 Thread Devin Teske
Author: dteske
Date: Thu Jun 21 14:41:58 2018
New Revision: 335484
URL: https://svnweb.freebsd.org/changeset/base/335484

Log:
  MFC r335280-r335281, r335302: sysrc.subr updates
  
  r335280: Fix handling of files with missing newline at EOF
  r335302: Fix a comment for accuracy
  
  PR:   bin/203435
  Reported by:  Andreas Sommer 
  
  r335281: Fix display when value is "-n"
  
  PR:   bin/226406
  Reported by:  Marius Halden 
  
  Sponsored by: Smule, Inc.

Modified:
  stable/11/usr.sbin/bsdconfig/share/sysrc.subr
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bsdconfig/share/sysrc.subr
==
--- stable/11/usr.sbin/bsdconfig/share/sysrc.subr   Thu Jun 21 14:30:14 
2018(r335483)
+++ stable/11/usr.sbin/bsdconfig/share/sysrc.subr   Thu Jun 21 14:41:58 
2018(r335484)
@@ -200,7 +200,7 @@ f_sysrc_get()
# such as "${varname?}" and "${varname:?}" (see "Parameter
# Expansion" in sh(1) for more information).
#
-   eval echo '"${'"$1"'}"' 2> /dev/null
+   eval printf "'%s\\n'" '"${'"$1"'}"' 2> /dev/null
)
 }
 
@@ -338,7 +338,7 @@ f_sysrc_get_default()
# such as "${varname?}" and "${varname:?}" (see "Parameter
# Expansion" in sh(1) for more information).
#
-   eval echo '"${'"$1"'}"' 2> /dev/null
+   eval printf "'%s\\n'" '"${'"$1"'}"' 2> /dev/null
)
 }
 
@@ -556,9 +556,16 @@ f_sysrc_set()
fi
 
#
-   # If not found, append new value to last file and return.
+   # If not found, append new value to first file and return.
#
if [ "$not_found" ]; then
+   # Add a newline if missing before appending to the file
+   awk 'BEGIN { wc = 0 } NR == 1 {
+   (cmd = "wc -l " FILENAME) | getline
+   close(cmd)
+   wc = $1
+   } END { exit wc != NR }' "$file" ||
+   echo >> "$file" || return $?
echo "$varname=\"$new_value\"" >> "$file"
return $?
fi
@@ -606,8 +613,11 @@ f_sysrc_set()
#
# Operate on the matching file, replacing only the last occurrence.
#
+   # Use awk to ensure LF at end of each line, else files without ending
+   # LF will trigger a bug in `tail -r' where last two lines are joined.
+   #
local new_contents retval
-   new_contents=$( tail -r $file 2> /dev/null )
+   new_contents=$( awk 1 "$file" 2> /dev/null | tail -r )
new_contents=$( echo "$new_contents" | awk -v varname="$varname" \
-v new_value="$new_value" "$f_sysrc_set_awk" )
retval=$?
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335480 - stable/11/share/examples

2018-06-21 Thread Devin Teske
Author: dteske
Date: Thu Jun 21 14:21:11 2018
New Revision: 335480
URL: https://svnweb.freebsd.org/changeset/base/335480

Log:
  MFC r330886: Install files added in SVN's r295373, r295457, r295542
  
  Reported by:  woodsb02
  Sponsored by: Smule, Inc.

Modified:
  stable/11/share/examples/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/examples/Makefile
==
--- stable/11/share/examples/Makefile   Thu Jun 21 14:04:02 2018
(r335479)
+++ stable/11/share/examples/Makefile   Thu Jun 21 14:21:11 2018
(r335480)
@@ -76,6 +76,12 @@ XFILES=  BSD_daemon/FreeBSD.pfa \
indent/indent.pro \
ipfw/change_rules.sh \
jails/README \
+   jails/VIMAGE \
+   jails/jail.xxx.conf \
+   jails/jib \
+   jails/jng \
+   jails/rc.conf.jails \
+   jails/rcjail.xxx.conf \
kld/Makefile \
kld/cdev/Makefile \
kld/cdev/README \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335409 - stable/11/usr.sbin/sysrc

2018-06-20 Thread Devin Teske
Author: dteske
Date: Wed Jun 20 06:24:03 2018
New Revision: 335409
URL: https://svnweb.freebsd.org/changeset/base/335409

Log:
  MFC r334303: sysrc(8): Test variable names for invalid characters
  
  PR:   bin/187461
  Reported by:  e...@looksharp.net
  Sponsored by: Smule, Inc.

Modified:
  stable/11/usr.sbin/sysrc/sysrc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/sysrc/sysrc
==
--- stable/11/usr.sbin/sysrc/sysrc  Wed Jun 20 06:11:51 2018
(r335408)
+++ stable/11/usr.sbin/sysrc/sysrc  Wed Jun 20 06:24:03 2018
(r335409)
@@ -370,6 +370,18 @@ if [ "$LIST_SERVICE_CONFS" ]; then
 fi
 
 #
+# Validate arguments
+#
+for name in "$@"; do
+   # NB: shell expansion syntax removed first
+   name="${name%%:[+=-]*}"
+   name="${name%%[%#+=-]*}"
+   [ "$name" = "${name#*[!$VALID_VARNAME_CHARS]}" ] || die \
+   "%s: %s: name contains characters not allowed in shell" \
+   "$pgm" "$name"
+done
+
+#
 # Process `-s name' argument
 #
 if [ "$SERVICE" -a ! "${RC_CONFS+set}" ]; then
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335408 - in stable/11: lib/libdpv lib/libfigpar usr.bin/dpv usr.sbin/bsdconfig

2018-06-20 Thread Devin Teske
Author: dteske
Date: Wed Jun 20 06:11:51 2018
New Revision: 335408
URL: https://svnweb.freebsd.org/changeset/base/335408

Log:
  MFC r330878-r330879, r330939, r330948: Man-page updates
  
  r330878: Fix typo and lint/igor warnings
  r330879: Fix lint/igor warnings
  r330939: Use full month in dpv(3), figpar(3), and bsdconfig(8) manuals
  r330948: Bump copyright following recent changes
  
  Sponsored by: Smule, Inc.

Modified:
  stable/11/lib/libdpv/dpv.3
  stable/11/lib/libfigpar/figpar.3
  stable/11/usr.bin/dpv/dpv.1
  stable/11/usr.sbin/bsdconfig/bsdconfig.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libdpv/dpv.3
==
--- stable/11/lib/libdpv/dpv.3  Wed Jun 20 05:50:54 2018(r335407)
+++ stable/11/lib/libdpv/dpv.3  Wed Jun 20 06:11:51 2018(r335408)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2013-2016 Devin Teske
+.\" Copyright (c) 2013-2018 Devin Teske
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd Jan 26, 2016
+.Dd March 13, 2018
 .Dt DPV 3
 .Os
 .Sh NAME
@@ -36,7 +36,8 @@
 .In dpv.h
 .Ft int
 .Fo dpv
-.Fa "struct dpv_config *config, struct dpv_file_node *file_list"
+.Fa "struct dpv_config *config"
+.Fa "struct dpv_file_node *file_list"
 .Fc
 .Ft void
 .Fo dpv_free
@@ -60,8 +61,7 @@ or
 The
 .Fn dpv
 .Fa config
-argument contains the following properties for configuring global display
-features:
+argument properties for configuring global display features:
 .Bd -literal -offset indent
 struct dpv_config {
 uint8_t  keep_tite; /* Cleaner exit for scripts */
@@ -113,11 +113,12 @@ member of the
 .Fn dpv
 .Fa config
 argument is a mask of bit fields indicating various processing options.
-Possible flags are as follows:
+Possible flags are:
 .Bl -tag -width DPV_NO_OVERRUN
 .It Dv DPV_TEST_MODE
 Enable test mode.
-In test mode, the
+In test mode,
+the
 .Fn action
 callback of the
 .Fa config
@@ -126,18 +127,21 @@ Appends
 .Dq [TEST MODE]
 to the status line
 .Po
-to override, set the
+to override,
+set the
 .Va status_format
 member of the
 .Fn dpv
 .Fa config
 argument;
-e.g., to
+for example,
+to
 .Dv DPV_STATUS_DEFAULT
 .Pc .
 .It Dv DPV_WIDE_MODE
 Enable wide mode.
-In wide mode, the length of the
+In wide mode,
+the length of the
 .Va aprompt
 and
 .Va pprompt
@@ -169,7 +173,8 @@ does not support color
 environment variable is ignored
 .Pc .
 .It Dv DPV_NO_OVERRUN
-When enabled, callbacks for the current
+When enabled,
+callbacks for the current
 .Vt dpv_file_node
 are terminated when
 .Fn action
@@ -189,7 +194,7 @@ argument to
 .Fn dpv
 is a pointer to a
 .Dq linked-list ,
-described as follows in
+described in
 .In dpv.h :
 .Bd -literal -offset indent
 struct dpv_file_node {
@@ -206,7 +211,8 @@ struct dpv_file_node {
 For each of the items in the
 .Fa file_list
 .Dq linked-list
-argument, the
+argument,
+the
 .Fn action
 callback member of the
 .Fn dpv
@@ -214,7 +220,7 @@ callback member of the
 argument is called.
 The
 .Fn action
-function should perform a
+function performs a
 .Dq nominal
 action on the file and return.
 The return value of
@@ -231,7 +237,7 @@ provides a reference to the current
 .Vt dpv_file_node
 being processed.
 .Fa out
-provides a file descriptor where the data should go.
+provides a file descriptor where the data goes.
 .Pp
 If the
 .Va output
@@ -244,7 +250,7 @@ the
 .Fa out
 file descriptor of
 .Fn action
-will be zero and should be ignored.
+will be zero and can be ignored.
 If
 .Fa output
 was set to DPV_OUTPUT_FILE,
@@ -257,14 +263,16 @@ was set to DPV_OUTPUT_SHELL,
 will be an open file descriptor to a pipe for a spawned shell program.
 When
 .Fa out
-is greater than zero, you should write any data you have read back to
+is greater than zero,
+write data that has been read back to
 .Fa out .
 .Pp
 To abort
 .Fn dpv ,
 either from the
 .Fn action
-callback or asynchronously from a signal handler, two globals are provided via
+callback or asynchronously from a signal handler,
+two globals are provided via
 .In dpv.h :
 .Bd -literal -offset indent
 extern int dpv_interrupt; /* Set to TRUE in interrupt handler */
@@ -272,11 +280,12 @@ extern int dpv_abort; /* Set to true in callback t
 .Ed
 .Pp
 These globals are not automatically reset and must be manually maintained.
-Don't forget to reset these globals before subsequent invocations of
+Do not forget to reset these globals before subsequent invocations of
 .Fn dpv
 when making multiple calls from the same program.
 .Pp
-In addition, the
+In addition,
+the
 .Va status
 member of the
 .Fn action
@@ -284,7 +293,7 @@ member of the
 argument can be used to control callbacks for the current file.
 The
 .Va status
-member can be set to any of the following from
+member can be set to any of the below from
 .In dpv.h :
 .Bd

svn commit: r335407 - stable/10/lib/libdpv

2018-06-19 Thread Devin Teske
Author: dteske
Date: Wed Jun 20 05:50:54 2018
New Revision: 335407
URL: https://svnweb.freebsd.org/changeset/base/335407

Log:
  dpv(3): MFC r330943, r335264
  
  r330943:
  Fix bad error messages from dpv(3)
  
  Before = dpv: <__func__>: posix_spawnp(3): No such file or directory
   After = dpv: : No such file or directory
  
  Most notably, show the 2nd argument being passed to posix_spawnp(3)
  so we know what path/cmd failed.
  
  Also, we don't need to have "posix_spawnp(3)" in the error message
  nor the function because that can [a] change and [b] traversed using
  a debugger if necessary.
  
  r335264:
  Fix comparison between pointer and char literal
  
  PR:   misc/204252
  Reported by:  David Binderman 
  Sponsored by: Smule, Inc.

Modified:
  stable/10/lib/libdpv/dialog_util.c
  stable/10/lib/libdpv/dprompt.c
  stable/10/lib/libdpv/util.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libdpv/dialog_util.c
==
--- stable/10/lib/libdpv/dialog_util.c  Wed Jun 20 05:45:41 2018
(r335406)
+++ stable/10/lib/libdpv/dialog_util.c  Wed Jun 20 05:50:54 2018
(r335407)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013-2014 Devin Teske 
+ * Copyright (c) 2013-2018 Devin Teske 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -328,8 +328,7 @@ dialog_spawn_gauge(char *init_prompt, pid_t *pid)
posix_spawn_file_actions_addclose(, stdin_pipe[1]);
error = posix_spawnp(pid, dialog, ,
(const posix_spawnattr_t *)NULL, dargv, environ);
-   if (error != 0)
-   err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__);
+   if (error != 0) err(EXIT_FAILURE, "%s", dialog);
 
/* NB: Do not free(3) *dargv[], else SIGSEGV */
 

Modified: stable/10/lib/libdpv/dprompt.c
==
--- stable/10/lib/libdpv/dprompt.c  Wed Jun 20 05:45:41 2018
(r335406)
+++ stable/10/lib/libdpv/dprompt.c  Wed Jun 20 05:50:54 2018
(r335407)
@@ -89,7 +89,7 @@ spin_char(void)
 {
char ch;
 
-   if (spin_cp == '\0')
+   if (*spin_cp == '\0')
spin_cp = spin;
ch = *spin_cp;
 

Modified: stable/10/lib/libdpv/util.c
==
--- stable/10/lib/libdpv/util.c Wed Jun 20 05:45:41 2018(r335406)
+++ stable/10/lib/libdpv/util.c Wed Jun 20 05:50:54 2018(r335407)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013-2014 Devin Teske 
+ * Copyright (c) 2013-2018 Devin Teske 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -100,8 +100,7 @@ shell_spawn_pipecmd(const char *cmd, const char *label
posix_spawn_file_actions_addclose(, stdin_pipe[1]);
error = posix_spawnp(pid, shellcmd, ,
(const posix_spawnattr_t *)NULL, shellcmd_argv, environ);
-   if (error != 0)
-   err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__);
+   if (error != 0) err(EXIT_FAILURE, "%s", shellcmd);
 
return stdin_pipe[1];
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335406 - stable/11/lib/libdpv

2018-06-19 Thread Devin Teske
Author: dteske
Date: Wed Jun 20 05:45:41 2018
New Revision: 335406
URL: https://svnweb.freebsd.org/changeset/base/335406

Log:
  dpv(3): MFC r330943, r335264
  
  r330943:
  Fix bad error messages from dpv(3)
  
  Before = dpv: <__func__>: posix_spawnp(3): No such file or directory
   After = dpv: : No such file or directory
  
  Most notably, show the 2nd argument being passed to posix_spawnp(3)
  so we know what path/cmd failed.
  
  Also, we don't need to have "posix_spawnp(3)" in the error message
  nor the function because that can [a] change and [b] traversed using
  a debugger if necessary.
  
  r335264:
  Fix comparison between pointer and char literal
  
  PR:   misc/204252
  Reported by:  David Binderman 
  Sponsored by: Smule, Inc.

Modified:
  stable/11/lib/libdpv/dialog_util.c
  stable/11/lib/libdpv/dprompt.c
  stable/11/lib/libdpv/util.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libdpv/dialog_util.c
==
--- stable/11/lib/libdpv/dialog_util.c  Wed Jun 20 05:10:30 2018
(r335405)
+++ stable/11/lib/libdpv/dialog_util.c  Wed Jun 20 05:45:41 2018
(r335406)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013-2014 Devin Teske 
+ * Copyright (c) 2013-2018 Devin Teske 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -328,8 +328,7 @@ dialog_spawn_gauge(char *init_prompt, pid_t *pid)
posix_spawn_file_actions_addclose(, stdin_pipe[1]);
error = posix_spawnp(pid, dialog, ,
(const posix_spawnattr_t *)NULL, dargv, environ);
-   if (error != 0)
-   err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__);
+   if (error != 0) err(EXIT_FAILURE, "%s", dialog);
 
/* NB: Do not free(3) *dargv[], else SIGSEGV */
 

Modified: stable/11/lib/libdpv/dprompt.c
==
--- stable/11/lib/libdpv/dprompt.c  Wed Jun 20 05:10:30 2018
(r335405)
+++ stable/11/lib/libdpv/dprompt.c  Wed Jun 20 05:45:41 2018
(r335406)
@@ -89,7 +89,7 @@ spin_char(void)
 {
char ch;
 
-   if (spin_cp == '\0')
+   if (*spin_cp == '\0')
spin_cp = spin;
ch = *spin_cp;
 

Modified: stable/11/lib/libdpv/util.c
==
--- stable/11/lib/libdpv/util.c Wed Jun 20 05:10:30 2018(r335405)
+++ stable/11/lib/libdpv/util.c Wed Jun 20 05:45:41 2018(r335406)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013-2014 Devin Teske 
+ * Copyright (c) 2013-2018 Devin Teske 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -100,8 +100,7 @@ shell_spawn_pipecmd(const char *cmd, const char *label
posix_spawn_file_actions_addclose(, stdin_pipe[1]);
error = posix_spawnp(pid, shellcmd, ,
(const posix_spawnattr_t *)NULL, shellcmd_argv, environ);
-   if (error != 0)
-   err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__);
+   if (error != 0) err(EXIT_FAILURE, "%s", shellcmd);
 
return stdin_pipe[1];
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335405 - stable/11/usr.sbin/sysrc

2018-06-19 Thread Devin Teske
Author: dteske
Date: Wed Jun 20 05:10:30 2018
New Revision: 335405
URL: https://svnweb.freebsd.org/changeset/base/335405

Log:
  MFC r335277:
  
  sysrc(8): Exit with failure on API error
  
  Fix exit status when f_sysrc_set() fails. Errors in the underlying API
  provided by bsdconfig(8) -- /usr/share/bsdconfig/sysrc.subr -- were not
  being communicated back to the command-line. This was affecting ansible
  modules using sysrc as they were not able to accurately test for error.
  
  PR:   bin/211448
  Reported by:  Christian Schwarz 
  Sponsored by: Smule, Inc.

Modified:
  stable/11/usr.sbin/sysrc/sysrc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/sysrc/sysrc
==
--- stable/11/usr.sbin/sysrc/sysrc  Wed Jun 20 03:31:19 2018
(r335404)
+++ stable/11/usr.sbin/sysrc/sysrc  Wed Jun 20 05:10:30 2018
(r335405)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #-
-# Copyright (c) 2010-2016 Devin Teske
+# Copyright (c) 2010-2018 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig"
 #
 # Version information
 #
-SYSRC_VERSION="7.1 Feb-2,2016"
+SYSRC_VERSION="7.2 Jun-16,2018"
 
 #
 # Options
@@ -842,7 +842,7 @@ while [ $# -gt 0 ]; do
#
if [ ! "$SHOW_VALUE" ]; then
echo "$NAME"
-   f_sysrc_set "$NAME" "$new"
+   f_sysrc_set "$NAME" "$new" || status=$FAILURE
else
if f_sysrc_set "$NAME" "$new"; then
if [ "$SHOW_FILE" ]; then
@@ -854,6 +854,8 @@ while [ $# -gt 0 ]; do
echo -n "$before${SHOW_EQUALS:+\" #}"
echo -n " -> ${SHOW_EQUALS:+\"}$after"
echo "${SHOW_EQUALS:+\"}"
+   else
+   status=$FAILURE
fi
fi
;;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335308 - head/usr.sbin/bsdconfig/usermgmt/share

2018-06-17 Thread Devin Teske
Author: dteske
Date: Sun Jun 17 22:09:43 2018
New Revision: 335308
URL: https://svnweb.freebsd.org/changeset/base/335308

Log:
  bsdconfig: Fix a bug when editing users
  
  The usermgmt API was stomping on a global ($user_gid to be specific)
  so things would appear to work fine until you tried to make a second
  pass into the API with the now-tainted variable contents.
  
  Fixed by localizing menu-specific contents as to not leak outside API.
  
  PR:   bin/208774
  Reported by:  Martin Waschbuesch 
  MFC after:1 week
  X-MFC-to: stable/11, stable/10
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr

Modified: head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr
==
--- head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr  Sun Jun 17 
21:29:35 2018(r335307)
+++ head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr  Sun Jun 17 
22:09:43 2018(r335308)
@@ -1020,13 +1020,6 @@ f_dialog_menu_user_add()
user_password_expires_on="$user_password_expire"
fi
 
-   # Attempt to translate a numeric GID into `number (name)'
-   if f_isinteger "$user_gid"; then
-   local user_group
-   user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) &&
-   user_gid="$user_gid (${user_group%%:*})"
-   fi
-
# Localize potentially hostile variables and escape their values
# to the local variable (see f_shell_escape() of `strings.subr')
local var
@@ -1038,6 +1031,14 @@ f_dialog_menu_user_add()
eval f_shell_escape \"\$user_$var\" _user_$var
done
 
+   # Attempt to translate a numeric GID into `number (name)'
+   if f_isinteger "$_user_gid"; then
+   local _user_group
+   _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) &&
+   _user_group="${_user_group%%:*}" &&
+   f_shell_escape "$_user_gid ($_user_group)" _user_gid
+   fi
+
menu_list="
'X' '$msg_add/$msg_exit'
'1' '$msg_login: $_user_name'
@@ -1137,13 +1138,6 @@ f_dialog_menu_user_delete()
user_password_expires_on="$user_password_expire"
fi
 
-   # Attempt to translate a numeric GID into `number (name)'
-   if f_isinteger "$user_gid"; then
-   local user_group
-   user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) &&
-   user_gid="$user_gid (${user_group%%:*})"
-   fi
-
# Localize potentially hostile variables and escape their values
# to the local variable (see f_shell_escape() of `strings.subr')
local var
@@ -1155,6 +1149,14 @@ f_dialog_menu_user_delete()
eval f_shell_escape \"\$user_$var\" _user_$var
done
 
+   # Attempt to translate a numeric GID into `number (name)'
+   if f_isinteger "$_user_gid"; then
+   local _user_group
+   _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) &&
+   _user_group="${_user_group%%:*}" &&
+   f_shell_escape "$_user_gid ($_user_group)" _user_gid
+   fi
+
menu_list="
'X' '$msg_delete/$msg_exit'
'1' '$msg_login: $_user_name'
@@ -1254,13 +1256,6 @@ f_dialog_menu_user_edit()
user_password_expires_on="$user_password_expire"
fi
 
-   # Attempt to translate a numeric GID into `number (name)'
-   if f_isinteger "$user_gid"; then
-   local user_group
-   user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) &&
-   user_gid="$user_gid (${user_group%%:*})"
-   fi
-
# Localize potentially hostile variables and escape their values
# to the local variable (see f_shell_escape() of `strings.subr')
local var
@@ -1271,6 +1266,14 @@ f_dialog_menu_user_edit()
local _user_$var
eval f_shell_escape \"\$user_$var\" _user_$var
done
+
+   # Attempt to translate a numeric GID into `number (name)'
+   if f_isinteger "$_user_gid"; then
+   local _user_group
+   _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) &&
+   _user_group="${_user_group%%:*}" &&
+   f_shell_escape "$_user_gid ($_user_group)" _user_gid
+   fi
 
menu_list="
'X' '$msg_save/$msg_exit'
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335306 - head/usr.sbin/bsdconfig

2018-06-17 Thread Devin Teske
Author: dteske
Date: Sun Jun 17 21:09:21 2018
New Revision: 335306
URL: https://svnweb.freebsd.org/changeset/base/335306

Log:
  bsdconfig: Make examples optional
  
  PR:   bin/228485
  Submitted by: Dmitry Wagin 
  Reported by:  Dmitry Wagin 
  MFC after:1 week
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdconfig/Makefile

Modified: head/usr.sbin/bsdconfig/Makefile
==
--- head/usr.sbin/bsdconfig/MakefileSun Jun 17 20:45:48 2018
(r335305)
+++ head/usr.sbin/bsdconfig/MakefileSun Jun 17 21:09:21 2018
(r335306)
@@ -1,10 +1,11 @@
 # $FreeBSD$
 
+.include 
+
 SUBDIR=console \
diskmgmt \
docsinstall \
dot \
-   examples \
include \
includes \
mouse \
@@ -17,6 +18,10 @@ SUBDIR=  console \
timezone \
ttys \
usermgmt
+
+.if ${MK_EXAMPLES} != "no"
+SUBDIR+= examples
+.endif
 
 FILESDIR=  ${LIBEXECDIR}/bsdconfig
 FILES= USAGE
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335302 - head/usr.sbin/bsdconfig/share

2018-06-17 Thread Devin Teske
Author: dteske
Date: Sun Jun 17 20:32:43 2018
New Revision: 335302
URL: https://svnweb.freebsd.org/changeset/base/335302

Log:
  sysrc.subr: Fix a comment for accuracy
  
  PR:   bin/203435
  Reported by:  Andreas Sommer 
  MFC after:6 days
  X-MFC-to: stable/11
  X-MFC-with:   r335280
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdconfig/share/sysrc.subr

Modified: head/usr.sbin/bsdconfig/share/sysrc.subr
==
--- head/usr.sbin/bsdconfig/share/sysrc.subrSun Jun 17 20:10:48 2018
(r335301)
+++ head/usr.sbin/bsdconfig/share/sysrc.subrSun Jun 17 20:32:43 2018
(r335302)
@@ -556,7 +556,7 @@ f_sysrc_set()
fi
 
#
-   # If not found, append new value to last file and return.
+   # If not found, append new value to first file and return.
#
if [ "$not_found" ]; then
# Add a newline if missing before appending to the file
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335281 - head/usr.sbin/bsdconfig/share

2018-06-17 Thread Devin Teske
Author: dteske
Date: Sun Jun 17 06:25:32 2018
New Revision: 335281
URL: https://svnweb.freebsd.org/changeset/base/335281

Log:
  sysrc.subr: Fix display when value is "-n"
  
  PR:   bin/226406
  Reported by:  Marius Halden 
  MFC after:1 week
  X-MFC-to: stable/11
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdconfig/share/sysrc.subr

Modified: head/usr.sbin/bsdconfig/share/sysrc.subr
==
--- head/usr.sbin/bsdconfig/share/sysrc.subrSun Jun 17 06:03:48 2018
(r335280)
+++ head/usr.sbin/bsdconfig/share/sysrc.subrSun Jun 17 06:25:32 2018
(r335281)
@@ -200,7 +200,7 @@ f_sysrc_get()
# such as "${varname?}" and "${varname:?}" (see "Parameter
# Expansion" in sh(1) for more information).
#
-   eval echo '"${'"$1"'}"' 2> /dev/null
+   eval printf "'%s\\n'" '"${'"$1"'}"' 2> /dev/null
)
 }
 
@@ -338,7 +338,7 @@ f_sysrc_get_default()
# such as "${varname?}" and "${varname:?}" (see "Parameter
# Expansion" in sh(1) for more information).
#
-   eval echo '"${'"$1"'}"' 2> /dev/null
+   eval printf "'%s\\n'" '"${'"$1"'}"' 2> /dev/null
)
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335280 - head/usr.sbin/bsdconfig/share

2018-06-17 Thread Devin Teske
Author: dteske
Date: Sun Jun 17 06:03:48 2018
New Revision: 335280
URL: https://svnweb.freebsd.org/changeset/base/335280

Log:
  sysrc.subr: Fix handling of files with missing newline at EOF
  
  PR:   bin/203435
  Reported by:  Andreas Sommer 
  MFC after:1 week
  X-MFC-to: stable/11
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/bsdconfig/share/sysrc.subr

Modified: head/usr.sbin/bsdconfig/share/sysrc.subr
==
--- head/usr.sbin/bsdconfig/share/sysrc.subrSun Jun 17 05:55:31 2018
(r335279)
+++ head/usr.sbin/bsdconfig/share/sysrc.subrSun Jun 17 06:03:48 2018
(r335280)
@@ -559,6 +559,13 @@ f_sysrc_set()
# If not found, append new value to last file and return.
#
if [ "$not_found" ]; then
+   # Add a newline if missing before appending to the file
+   awk 'BEGIN { wc = 0 } NR == 1 {
+   (cmd = "wc -l " FILENAME) | getline
+   close(cmd)
+   wc = $1
+   } END { exit wc != NR }' "$file" ||
+   echo >> "$file" || return $?
echo "$varname=\"$new_value\"" >> "$file"
return $?
fi
@@ -606,8 +613,11 @@ f_sysrc_set()
#
# Operate on the matching file, replacing only the last occurrence.
#
+   # Use awk to ensure LF at end of each line, else files without ending
+   # LF will trigger a bug in `tail -r' where last two lines are joined.
+   #
local new_contents retval
-   new_contents=$( tail -r $file 2> /dev/null )
+   new_contents=$( awk 1 "$file" 2> /dev/null | tail -r )
new_contents=$( echo "$new_contents" | awk -v varname="$varname" \
-v new_value="$new_value" "$f_sysrc_set_awk" )
retval=$?
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335277 - head/usr.sbin/sysrc

2018-06-16 Thread Devin Teske
Author: dteske
Date: Sun Jun 17 03:33:29 2018
New Revision: 335277
URL: https://svnweb.freebsd.org/changeset/base/335277

Log:
  sysrc(8): Exit with failure on API error
  
  Fix exit status when f_sysrc_set() fails. Errors in the underlying API
  provided by bsdconfig(8) -- /usr/share/bsdconfig/sysrc.subr -- were not
  being communicated back to the command-line. This was affecting ansible
  modules using sysrc as they were not able to accurately test for error.
  
  PR:   bin/211448
  Reported by:  Christian Schwarz 
  MFC after:3 days
  X-MFC-to: stable/11
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/sysrc/sysrc

Modified: head/usr.sbin/sysrc/sysrc
==
--- head/usr.sbin/sysrc/sysrc   Sun Jun 17 03:18:56 2018(r335276)
+++ head/usr.sbin/sysrc/sysrc   Sun Jun 17 03:33:29 2018(r335277)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #-
-# Copyright (c) 2010-2016 Devin Teske
+# Copyright (c) 2010-2018 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig"
 #
 # Version information
 #
-SYSRC_VERSION="7.1 Feb-2,2016"
+SYSRC_VERSION="7.2 Jun-16,2018"
 
 #
 # Options
@@ -854,7 +854,7 @@ while [ $# -gt 0 ]; do
#
if [ ! "$SHOW_VALUE" ]; then
echo "$NAME"
-   f_sysrc_set "$NAME" "$new"
+   f_sysrc_set "$NAME" "$new" || status=$FAILURE
else
if f_sysrc_set "$NAME" "$new"; then
if [ "$SHOW_FILE" ]; then
@@ -866,6 +866,8 @@ while [ $# -gt 0 ]; do
echo -n "$before${SHOW_EQUALS:+\" #}"
echo -n " -> ${SHOW_EQUALS:+\"}$after"
echo "${SHOW_EQUALS:+\"}"
+   else
+   status=$FAILURE
fi
fi
;;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r335264 - head/lib/libdpv

2018-06-16 Thread Devin Teske
Author: dteske
Date: Sat Jun 16 20:00:41 2018
New Revision: 335264
URL: https://svnweb.freebsd.org/changeset/base/335264

Log:
  Fix comparison between pointer and char literal
  
  PR:   misc/204252
  Reported by:  David Binderman 
  MFC after:3 days
  X-MFC-to: stable/11, stable/10

Modified:
  head/lib/libdpv/dprompt.c

Modified: head/lib/libdpv/dprompt.c
==
--- head/lib/libdpv/dprompt.c   Sat Jun 16 19:45:06 2018(r335263)
+++ head/lib/libdpv/dprompt.c   Sat Jun 16 20:00:41 2018(r335264)
@@ -89,7 +89,7 @@ spin_char(void)
 {
char ch;
 
-   if (spin_cp == '\0')
+   if (*spin_cp == '\0')
spin_cp = spin;
ch = *spin_cp;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334939 - head/stand/lua

2018-06-12 Thread Devin Teske


> On Jun 12, 2018, at 7:10 AM, Warner Losh  wrote:
> 
> 
> 
>> On Mon, Jun 11, 2018 at 6:23 PM, Devin Teske  wrote:
>> 
>>> On Jun 11, 2018, at 11:20 AM, Warner Losh  wrote:
>>> 
>>> 
>>> 
>>> On Mon, Jun 11, 2018 at 11:54 AM, Devin Teske  wrote:
>>>> 
>>>>> On Jun 11, 2018, at 7:07 AM, Warner Losh  wrote:
>>>>> 
>>>>> 
>>>>> 
>>>>> On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske  wrote:
>>>>>> 
>>>> 
>>>> At BSD Can there was the boot working group where we discussed that an FCP 
>>>> would be required to decide this.
>>> 
>>> In the working group you weren't listening and being rather combative and 
>>> demanding that I do stuff,
>> 
>> I think that's an unfair characterization of the situation, but it doesn't 
>> matter -- that's your opinion and you are entitled to it.
> 
> I would like to unconditionally apologize for my harsh words to Devin here. I 
> let my frustration get the better of me, which I should not have done. Devin 
> has been quite helpful for a long time with the boot loader and things 
> related to FORTH, and I should not have lashed out like this. I hope she can 
> forgive my ill-chosen words.

Thanks Warner. Forgiven if you can forgive any harshness from me at BSDCan.

I also have to apologize for my performance in the working group. It could have 
been better and I kind of monopolized the conversation. Apologies.

>>> so I stopped talking.
>> 
>> Hopefully we can _start_ talking. As the principled author of this work, I 
>> want to have a say in its deprecation since I still maintain that body of 
>> work.
> 
> Yes. Work is underway to get a draft of a FCP together to start a discussion 
> in arch to come to a data-driven decision. There's no desire to exclude you 
> from this process.
> 

Excellent. Looking forward to helping strike a good balance for the path 
forward for a smooth transition between boot languages.

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


Re: svn commit: r334939 - head/stand/lua

2018-06-11 Thread Devin Teske

> On Jun 11, 2018, at 5:32 PM, Kyle Evans  wrote:
> 
> On Mon, Jun 11, 2018 at 7:23 PM, Devin Teske  <mailto:dte...@freebsd.org>> wrote:
>> 
>> On Jun 11, 2018, at 11:20 AM, Warner Losh  wrote:
>> 
>> 
>> 
>> On Mon, Jun 11, 2018 at 11:54 AM, Devin Teske  wrote:
>>> 
>>> 
>>> On Jun 11, 2018, at 7:07 AM, Warner Losh  wrote:
>>> 
>>> 
>>> 
>>> On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske  wrote:
>>>> 
>>>> 
>>>> 
>>>>> On Jun 10, 2018, at 6:32 PM, Kyle Evans  wrote:
>>>>> 
>>>>> Author: kevans
>>>>> Date: Mon Jun 11 01:32:18 2018
>>>>> New Revision: 334939
>>>>> URL: https://svnweb.freebsd.org/changeset/base/334939
>>>>> 
>>>>> Log:
>>>>> lualoader: Allow brand-*.lua for adding new brands
>>>>> 
>>>>> dteske@, I believe, had originally pointed out that lualoader failed
>>>>> to
>>>>> allow logo-*.lua for new logos to be added. When correcting this
>>>>> mistake, I
>>>>> failed to do the same for brands.
>>>>> 
>>>> 
>>>> You’re doing an amazing job, Kyle.
>>>> 
>>>> I continually see nothing but genuine effort toward feature parity which
>>>> makes me think one day I can pass the reigns.
>>>> 
>>>> Yeah, I will always love Forth. It will always hold a special place in my
>>>> heart as that whacky language that simultaneously exudes great power while
>>>> also having the image ability to induce vomiting 冷 by the uninitiated.
>>>> 
>>>> However, all that being said, I’d actually like to keep the Ficl boot
>>>> stuff as an option through to 14.0 and here is why ...
>>>> 
>>>> Last year we were looking to update from ficl3 to ficl4. That may not
>>>> sound too exciting to most folks, but most folks don’t know the power that
>>>> ficl4 brings — like the capability to use full networking in the loader! 
>>>> Can
>>>> lua do that? How cool would it be to be able to communicate with the 
>>>> network
>>>> from the loader before the kernel is even loaded into memory? I had a few
>>>> hair-brained schemes left for Forth which might be exciting, lol
>>> 
>>> 
>>> The current boot loader can already communicate via NFS or TFTP today.
>>> Adding http would be easy, https would be harder due to crypto being huge
>>> and space being small (though bear ssl might be small enough).
>>> 
>>> The last articulated plan in arch@ was that LUA will be default in 12, and
>>> we plan to remove FORTH in 13. Last time I said it there in February, there
>>> was only email agreeing that I could find. This matches the in-person
>>> consensus poll I took at BSDcan as well. I think it would take a very
>>> extraordinary set circumstance and severe problems with LUA to change those
>>> plans.
>>> 
>>> 
>>> At BSD Can there was the boot working group where we discussed that an FCP
>>> would be required to decide this.
>> 
>> 
>> In the working group you weren't listening and being rather combative and
>> demanding that I do stuff,
>> 
>> 
>> I think that's an unfair characterization of the situation, but it doesn't
>> matter -- that's your opinion and you are entitled to it.
>> 
>> 
>> 
>> so I stopped talking.
>> 
>> 
>> Hopefully we can _start_ talking. As the principled author of this work, I
>> want to have a say in its deprecation since I still maintain that body of
>> work.
>> 
>> 
>> It should not be taken as a sign of my consent, but more a sign of not
>> wanting to get into a yelling match in public on a topic I thought had been
>> settled months ago.
>> 
>> 
>> Nobody asked *me* about how I would like to see *my* work removed from the
>> tree. I think I should have a say.
>> 
>> I think I've been pretty darn helpful in the process by providing
>> substantive and helpful feedback to not only Kyle but also on the GSoC
>> project etc. I've not stood in any ones way. For being so helpful, I would
>> expect a level respect in this matter.
>> 
>> 
>> 
>>> I raised my desires that I would like to be able to flip a knob in 13 and
>>> reboot between Ficl and Lua, back and forth.
>>> 
>>> Give people a choice until we have done 

Re: svn commit: r334939 - head/stand/lua

2018-06-11 Thread Devin Teske

> On Jun 11, 2018, at 11:20 AM, Warner Losh  wrote:
> 
> 
> 
> On Mon, Jun 11, 2018 at 11:54 AM, Devin Teske  <mailto:dte...@freebsd.org>> wrote:
> 
>> On Jun 11, 2018, at 7:07 AM, Warner Losh > <mailto:i...@bsdimp.com>> wrote:
>> 
>> 
>> 
>> On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske > <mailto:dte...@freebsd.org>> wrote:
>> 
>> 
>> > On Jun 10, 2018, at 6:32 PM, Kyle Evans > > <mailto:kev...@freebsd.org>> wrote:
>> > 
>> > Author: kevans
>> > Date: Mon Jun 11 01:32:18 2018
>> > New Revision: 334939
>> > URL: https://svnweb.freebsd.org/changeset/base/334939 
>> > <https://svnweb.freebsd.org/changeset/base/334939>
>> > 
>> > Log:
>> >  lualoader: Allow brand-*.lua for adding new brands
>> > 
>> >  dteske@, I believe, had originally pointed out that lualoader failed to
>> >  allow logo-*.lua for new logos to be added. When correcting this mistake, 
>> > I
>> >  failed to do the same for brands.
>> > 
>> 
>> You’re doing an amazing job, Kyle.
>> 
>> I continually see nothing but genuine effort toward feature parity which 
>> makes me think one day I can pass the reigns.
>> 
>> Yeah, I will always love Forth. It will always hold a special place in my 
>> heart as that whacky language that simultaneously exudes great power while 
>> also having the image ability to induce vomiting 冷 by the uninitiated.
>> 
>> However, all that being said, I’d actually like to keep the Ficl boot stuff 
>> as an option through to 14.0 and here is why ...
>> 
>> Last year we were looking to update from ficl3 to ficl4. That may not sound 
>> too exciting to most folks, but most folks don’t know the power that ficl4 
>> brings — like the capability to use full networking in the loader! Can lua 
>> do that? How cool would it be to be able to communicate with the network 
>> from the loader before the kernel is even loaded into memory? I had a few 
>> hair-brained schemes left for Forth which might be exciting, lol
>> 
>> The current boot loader can already communicate via NFS or TFTP today. 
>> Adding http would be easy, https would be harder due to crypto being huge 
>> and space being small (though bear ssl might be small enough).
>> 
>> The last articulated plan in arch@ was that LUA will be default in 12, and 
>> we plan to remove FORTH in 13. Last time I said it there in February, there 
>> was only email agreeing that I could find. This matches the in-person 
>> consensus poll I took at BSDcan as well. I think it would take a very 
>> extraordinary set circumstance and severe problems with LUA to change those 
>> plans.
>> 
> 
> At BSD Can there was the boot working group where we discussed that an FCP 
> would be required to decide this.
> 
> In the working group you weren't listening and being rather combative and 
> demanding that I do stuff,

I think that's an unfair characterization of the situation, but it doesn't 
matter -- that's your opinion and you are entitled to it.



> so I stopped talking.

Hopefully we can _start_ talking. As the principled author of this work, I want 
to have a say in its deprecation since I still maintain that body of work.


> It should not be taken as a sign of my consent, but more a sign of not 
> wanting to get into a yelling match in public on a topic I thought had been 
> settled months ago.
> 

Nobody asked *me* about how I would like to see *my* work removed from the 
tree. I think I should have a say.

I think I've been pretty darn helpful in the process by providing substantive 
and helpful feedback to not only Kyle but also on the GSoC project etc. I've 
not stood in any ones way. For being so helpful, I would expect a level respect 
in this matter.



> I raised my desires that I would like to be able to flip a knob in 13 and 
> reboot between Ficl and Lua, back and forth.
> 
> Give people a choice until we have done a "shake-out" through an entire major 
> version.
> 
> An honest-to-goodness procession would be, in my mind:
> 
> 13: Has both; both are installed. End-user can boot back and forth between 
> the two
> 
> Problems that arise in one or the other are non-critical because there is 
> always an "out" by running the other.
> 
> 14: Has both but both are not installed. The installer media doesn't even 
> have it. You can't install the Forth booth stuff unless you twist a knob in 
> buildworld, optionally going down the path of generating release media which 
> has the Forth boot stuff.
> 
> 15. It's removed from tree. Yo

Re: svn commit: r334939 - head/stand/lua

2018-06-11 Thread Devin Teske

> On Jun 11, 2018, at 7:07 AM, Warner Losh  wrote:
> 
> 
> 
> On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske  <mailto:dte...@freebsd.org>> wrote:
> 
> 
> > On Jun 10, 2018, at 6:32 PM, Kyle Evans  wrote:
> > 
> > Author: kevans
> > Date: Mon Jun 11 01:32:18 2018
> > New Revision: 334939
> > URL: https://svnweb.freebsd.org/changeset/base/334939 
> > <https://svnweb.freebsd.org/changeset/base/334939>
> > 
> > Log:
> >  lualoader: Allow brand-*.lua for adding new brands
> > 
> >  dteske@, I believe, had originally pointed out that lualoader failed to
> >  allow logo-*.lua for new logos to be added. When correcting this mistake, I
> >  failed to do the same for brands.
> > 
> 
> You’re doing an amazing job, Kyle.
> 
> I continually see nothing but genuine effort toward feature parity which 
> makes me think one day I can pass the reigns.
> 
> Yeah, I will always love Forth. It will always hold a special place in my 
> heart as that whacky language that simultaneously exudes great power while 
> also having the image ability to induce vomiting 冷 by the uninitiated.
> 
> However, all that being said, I’d actually like to keep the Ficl boot stuff 
> as an option through to 14.0 and here is why ...
> 
> Last year we were looking to update from ficl3 to ficl4. That may not sound 
> too exciting to most folks, but most folks don’t know the power that ficl4 
> brings — like the capability to use full networking in the loader! Can lua do 
> that? How cool would it be to be able to communicate with the network from 
> the loader before the kernel is even loaded into memory? I had a few 
> hair-brained schemes left for Forth which might be exciting, lol
> 
> The current boot loader can already communicate via NFS or TFTP today. Adding 
> http would be easy, https would be harder due to crypto being huge and space 
> being small (though bear ssl might be small enough).
> 
> The last articulated plan in arch@ was that LUA will be default in 12, and we 
> plan to remove FORTH in 13. Last time I said it there in February, there was 
> only email agreeing that I could find. This matches the in-person consensus 
> poll I took at BSDcan as well. I think it would take a very extraordinary set 
> circumstance and severe problems with LUA to change those plans.
> 

At BSD Can there was the boot working group where we discussed that an FCP 
would be required to decide this.

I raised my desires that I would like to be able to flip a knob in 13 and 
reboot between Ficl and Lua, back and forth.

Give people a choice until we have done a "shake-out" through an entire major 
version.

An honest-to-goodness procession would be, in my mind:

13: Has both; both are installed. End-user can boot back and forth between the 
two

Problems that arise in one or the other are non-critical because there is 
always an "out" by running the other.

14: Has both but both are not installed. The installer media doesn't even have 
it. You can't install the Forth booth stuff unless you twist a knob in 
buildworld, optionally going down the path of generating release media which 
has the Forth boot stuff.

15. It's removed from tree. You can't build Forth boot. Lua only. No looking 
back, no way to build it with Forth, to get Ficl you need to go to ports. A 
Ficl with FreeBSD boot words no longer exists and is no longer maintained. All 
of bhyve userboot also therefore uses Lua.
-- 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334939 - head/stand/lua

2018-06-11 Thread Devin Teske


> On Jun 10, 2018, at 6:32 PM, Kyle Evans  wrote:
> 
> Author: kevans
> Date: Mon Jun 11 01:32:18 2018
> New Revision: 334939
> URL: https://svnweb.freebsd.org/changeset/base/334939
> 
> Log:
>  lualoader: Allow brand-*.lua for adding new brands
> 
>  dteske@, I believe, had originally pointed out that lualoader failed to
>  allow logo-*.lua for new logos to be added. When correcting this mistake, I
>  failed to do the same for brands.
> 

You’re doing an amazing job, Kyle.

I continually see nothing but genuine effort toward feature parity which makes 
me think one day I can pass the reigns.

Yeah, I will always love Forth. It will always hold a special place in my heart 
as that whacky language that simultaneously exudes great power while also 
having the image ability to induce vomiting 冷 by the uninitiated.

However, all that being said, I’d actually like to keep the Ficl boot stuff as 
an option through to 14.0 and here is why ...

Last year we were looking to update from ficl3 to ficl4. That may not sound too 
exciting to most folks, but most folks don’t know the power that ficl4 brings — 
like the capability to use full networking in the loader! Can lua do that? How 
cool would it be to be able to communicate with the network from the loader 
before the kernel is even loaded into memory? I had a few hair-brained schemes 
left for Forth which might be exciting, lol

Anywho, keep up the great work. I love it and support you all the way.
— 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334780 - stable/11/cddl/usr.sbin/dwatch

2018-06-07 Thread Devin Teske
Author: dteske
Date: Thu Jun  7 13:06:56 2018
New Revision: 334780
URL: https://svnweb.freebsd.org/changeset/base/334780

Log:
  MFC r334594: dwatch(1): Update manual to reference actual release
  
  Sponsored by: Smule, Inc.

Modified:
  stable/11/cddl/usr.sbin/dwatch/dwatch.1
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/usr.sbin/dwatch/dwatch.1
==
--- stable/11/cddl/usr.sbin/dwatch/dwatch.1 Thu Jun  7 13:03:07 2018
(r334779)
+++ stable/11/cddl/usr.sbin/dwatch/dwatch.1 Thu Jun  7 13:06:56 2018
(r334780)
@@ -761,6 +761,6 @@ dwatch -F 'pid$target:::entry' -c true
 .Sh HISTORY
 .Nm
 first appeared in
-.Fx 12.0-CURRENT .
+.Fx 11.2 .
 .Sh AUTHORS
 .An Devin Teske Aq Mt dte...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334594 - head/cddl/usr.sbin/dwatch

2018-06-03 Thread Devin Teske
Author: dteske
Date: Sun Jun  3 23:49:02 2018
New Revision: 334594
URL: https://svnweb.freebsd.org/changeset/base/334594

Log:
  dwatch(1): Update manual to reference actual release
  
  MFC after:3 days
  X-MFC-to: stable/11
  Sponsored by: Smule, Inc.

Modified:
  head/cddl/usr.sbin/dwatch/dwatch.1

Modified: head/cddl/usr.sbin/dwatch/dwatch.1
==
--- head/cddl/usr.sbin/dwatch/dwatch.1  Sun Jun  3 23:40:54 2018
(r334593)
+++ head/cddl/usr.sbin/dwatch/dwatch.1  Sun Jun  3 23:49:02 2018
(r334594)
@@ -761,6 +761,6 @@ dwatch -F 'pid$target:::entry' -c true
 .Sh HISTORY
 .Nm
 first appeared in
-.Fx 12.0-CURRENT .
+.Fx 11.2 .
 .Sh AUTHORS
 .An Devin Teske Aq Mt dte...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334392 - in stable/11: cddl/usr.sbin/dwatch sys/sys

2018-05-30 Thread Devin Teske
Author: dteske
Date: Wed May 30 18:27:48 2018
New Revision: 334392
URL: https://svnweb.freebsd.org/changeset/base/334392

Log:
  MFC SVN r334261-334262,334359: dwatch(1) touch-ups
  
  r334261: Guard against error when given -t "*..."
  r334262: Eliminate ANSI dimming in developer mode
  r334359: Fix "-t test" for post-processing profiles
  
  Bump FreeBSD_version directly in stable/11 for ports IGNORE (as in r334290)
  
  Reviewed by:  gjb
  Approved by:  re (gjb)
  Sponsored by: Smule, Inc.

Modified:
  stable/11/cddl/usr.sbin/dwatch/dwatch
  stable/11/sys/sys/param.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/usr.sbin/dwatch/dwatch
==
--- stable/11/cddl/usr.sbin/dwatch/dwatch   Wed May 30 18:04:25 2018
(r334391)
+++ stable/11/cddl/usr.sbin/dwatch/dwatch   Wed May 30 18:27:48 2018
(r334392)
@@ -47,7 +47,7 @@ DTRACE_PRAGMA="
 
  GLOBALS
 
-VERSION='$Version: 1.2 $' # -V
+VERSION='$Version: 1.4 $' # -V
 
 pgm="${0##*/}" # Program basename
 
@@ -576,8 +576,8 @@ load_profile()
ARGV="$ARGV -z '$( shell_escape "$EXECREGEX" )'"
[ "$CUSTOM_DETAILS" ] &&
ARGV="$ARGV -E '$( shell_escape "$EVENT_DETAILS" )'"
-   [ "$EVENT_TEST" ] &&
-   ARGV="$ARGV -t '$( shell_escape "$EVENT_TEST" )'"
+   [ "$CUSTOM_TEST" ] &&
+   ARGV="$ARGV -t '$( shell_escape "$CUSTOM_TEST" )'"
[ "$OUTPUT" ] &&
ARGV="$ARGV -o '$( shell_escape "$OUTPUT" )'"
[ "$OUTPUT_CMD" ] &&
@@ -1057,10 +1057,6 @@ PSARGS_ACTION=$( cat <&9 )
slen = length(sprintf("%u", start))
elen = length(sprintf("%u", end))
N = elen > slen ? elen : slen
-   for (i = start; i <= end; i++) {
-   ti[i] = "\033[2m"
-   te[i] = "\033[22m"
-   }
ti[line] = "\033[31m"
te[line] = "\033[39m"
fmt = "%s%*u %s%s\n"
@@ -1353,7 +1349,7 @@ $ACTIONS
 }
 /*/
 
-$PROBE${EVENT_TEST:+ /$EVENT_TEST/} /* probe ID $ID */
+$PROBE${EVENT_TEST:+ / $EVENT_TEST /} /* probe ID $ID */
 {${TRACE:+
printf("<$ID>");
 }

Modified: stable/11/sys/sys/param.h
==
--- stable/11/sys/sys/param.h   Wed May 30 18:04:25 2018(r334391)
+++ stable/11/sys/sys/param.h   Wed May 30 18:27:48 2018(r334392)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1101515  /* Master, propagated to newvers */
+#define __FreeBSD_version 1101516  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334359 - head/cddl/usr.sbin/dwatch

2018-05-29 Thread Devin Teske
Author: dteske
Date: Tue May 29 22:36:37 2018
New Revision: 334359
URL: https://svnweb.freebsd.org/changeset/base/334359

Log:
  dwatch(1): Fix "-t test" for post-processing profiles
  
  Profiles that perform post-processing of the DTrace output were
  dropping the "-t test" option on the floor. Fix handling of this
  option for said profiles.
  
  X-MFC-to: stable/11
  X-MFC-with:   r334261-334262
  Sponsored by: Smule, Inc.

Modified:
  head/cddl/usr.sbin/dwatch/dwatch

Modified: head/cddl/usr.sbin/dwatch/dwatch
==
--- head/cddl/usr.sbin/dwatch/dwatchTue May 29 21:56:39 2018
(r334358)
+++ head/cddl/usr.sbin/dwatch/dwatchTue May 29 22:36:37 2018
(r334359)
@@ -47,7 +47,7 @@ DTRACE_PRAGMA="
 
  GLOBALS
 
-VERSION='$Version: 1.3 $' # -V
+VERSION='$Version: 1.4 $' # -V
 
 pgm="${0##*/}" # Program basename
 
@@ -576,8 +576,8 @@ load_profile()
ARGV="$ARGV -z '$( shell_escape "$EXECREGEX" )'"
[ "$CUSTOM_DETAILS" ] &&
ARGV="$ARGV -E '$( shell_escape "$EVENT_DETAILS" )'"
-   [ "$EVENT_TEST" ] &&
-   ARGV="$ARGV -t '$( shell_escape "$EVENT_TEST" )'"
+   [ "$CUSTOM_TEST" ] &&
+   ARGV="$ARGV -t '$( shell_escape "$CUSTOM_TEST" )'"
[ "$OUTPUT" ] &&
ARGV="$ARGV -o '$( shell_escape "$OUTPUT" )'"
[ "$OUTPUT_CMD" ] &&
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334303 - head/usr.sbin/sysrc

2018-05-28 Thread Devin Teske
Author: dteske
Date: Mon May 28 23:34:23 2018
New Revision: 334303
URL: https://svnweb.freebsd.org/changeset/base/334303

Log:
  sysrc(8): Test variable names for invalid characters
  
  PR:   bin/187461
  Reported by:  e...@looksharp.net
  MFC after:4 weeks
  X-MFC-to: stable/11 (after 11.2-R)
  Sponsored by: Smule, Inc.

Modified:
  head/usr.sbin/sysrc/sysrc

Modified: head/usr.sbin/sysrc/sysrc
==
--- head/usr.sbin/sysrc/sysrc   Mon May 28 23:20:08 2018(r334302)
+++ head/usr.sbin/sysrc/sysrc   Mon May 28 23:34:23 2018(r334303)
@@ -370,6 +370,18 @@ if [ "$LIST_SERVICE_CONFS" ]; then
 fi
 
 #
+# Validate arguments
+#
+for name in "$@"; do
+   # NB: shell expansion syntax removed first
+   name="${name%%:[+=-]*}"
+   name="${name%%[%#+=-]*}"
+   [ "$name" = "${name#*[!$VALID_VARNAME_CHARS]}" ] || die \
+   "%s: %s: name contains characters not allowed in shell" \
+   "$pgm" "$name"
+done
+
+#
 # Process `-s name' argument
 #
 if [ "$SERVICE" -a ! "${RC_CONFS+set}" ]; then
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334290 - head/sys/sys

2018-05-28 Thread Devin Teske
Author: dteske
Date: Mon May 28 17:47:32 2018
New Revision: 334290
URL: https://svnweb.freebsd.org/changeset/base/334290

Log:
  Bump FreeBSD_version after r333517
  
  Sponsored by: Smule, Inc.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hMon May 28 17:09:29 2018(r334289)
+++ head/sys/sys/param.hMon May 28 17:47:32 2018(r334290)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200064  /* Master, propagated to newvers */
+#define __FreeBSD_version 1200065  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


  1   2   3   4   5   6   7   8   9   10   >