Re: svn commit: r342576 - head/share/skel

2018-12-28 Thread Yuri Pankov
Rodney W. Grimes wrote:
>> Author: trasz
>> Date: Fri Dec 28 17:50:40 2018
>> New Revision: 342576
>> URL: https://svnweb.freebsd.org/changeset/base/342576
>>
>> Log:
>>   Simplify the way we set the default sh(1) PS1.  No functional changes.
>>   
>>   Reviewed by:   jilles
>>   MFC after: 2 weeks
>>   Sponsored by:  DARPA, AFRL
>>   Differential Revision: https://reviews.freebsd.org/D18662
>>
>> Modified:
>>   head/share/skel/dot.shrc
>>
>> Modified: head/share/skel/dot.shrc
>> ==
>> --- head/share/skel/dot.shrc Fri Dec 28 17:00:12 2018(r342575)
>> +++ head/share/skel/dot.shrc Fri Dec 28 17:50:40 2018(r342576)
>> @@ -33,11 +33,7 @@ alias g='egrep -i'
>>  
>>  
>>  # # set prompt: ``username@hostname$ '' 
>> -# PS1="`whoami`@`hostname | sed 's/\..*//'`"
>> -# case `id -u` in
>> -#   0) PS1="${PS1}# ";;
>> -#   *) PS1="${PS1}$ ";;
>> -# esac
>> +# PS1="`whoami`@\h\\$ "
> 
> You lost the fact that for root the prompt ends in #

Note that '$' is not literal here.  '\$' is expanded to '$' for normal
users, and to '#' for superusers.

>>  
>>  # search path for cd(1)
>>  # CDPATH=:$HOME
>>
>>
> 




signature.asc
Description: OpenPGP digital signature


Re: svn commit: r342576 - head/share/skel

2018-12-28 Thread Rodney W. Grimes
> Author: trasz
> Date: Fri Dec 28 17:50:40 2018
> New Revision: 342576
> URL: https://svnweb.freebsd.org/changeset/base/342576
> 
> Log:
>   Simplify the way we set the default sh(1) PS1.  No functional changes.
>   
>   Reviewed by:jilles
>   MFC after:  2 weeks
>   Sponsored by:   DARPA, AFRL
>   Differential Revision:  https://reviews.freebsd.org/D18662
> 
> Modified:
>   head/share/skel/dot.shrc
> 
> Modified: head/share/skel/dot.shrc
> ==
> --- head/share/skel/dot.shrc  Fri Dec 28 17:00:12 2018(r342575)
> +++ head/share/skel/dot.shrc  Fri Dec 28 17:50:40 2018(r342576)
> @@ -33,11 +33,7 @@ alias g='egrep -i'
>  
>  
>  # # set prompt: ``username@hostname$ '' 
> -# PS1="`whoami`@`hostname | sed 's/\..*//'`"
> -# case `id -u` in
> -#0) PS1="${PS1}# ";;
> -#*) PS1="${PS1}$ ";;
> -# esac
> +# PS1="`whoami`@\h\\$ "

You lost the fact that for root the prompt ends in #

>  
>  # search path for cd(1)
>  # CDPATH=:$HOME
> 
> 

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


svn commit: r342580 - head/usr.bin/ar

2018-12-28 Thread Ed Maste
Author: emaste
Date: Fri Dec 28 22:47:55 2018
New Revision: 342580
URL: https://svnweb.freebsd.org/changeset/base/342580

Log:
  ar: detect and error out on 32-bit symbol table overflow
  
  BSD ar currently does not support the /SYM64/ 64-bit symbol table, and
  previously truncated to 32-bits, silently producing corrupted archives
  larger than 4GB.
  
  This is another overflow case in addtion to r342575.
  
  PR:   234454
  Reported by:  Aijaz Baig, imp
  MFC after:2 weeks
  MFC with: r342575
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/ar/write.c

Modified: head/usr.bin/ar/write.c
==
--- head/usr.bin/ar/write.c Fri Dec 28 21:26:45 2018(r342579)
+++ head/usr.bin/ar/write.c Fri Dec 28 22:47:55 2018(r342580)
@@ -628,6 +628,9 @@ write_objs(struct bsdar *bsdar)
if (strlen(obj->name) > _MAXNAMELEN_SVR4)
add_to_ar_str_table(bsdar, obj->name);
bsdar->rela_off += _ARHDR_LEN + obj->size + obj->size % 2;
+   if (bsdar->rela_off > UINT32_MAX)
+   bsdar_errc(bsdar, EX_SOFTWARE, 0,
+   "Symbol table offset overflow");
}
 
/*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r342579 - head/usr.sbin/efibootmgr

2018-12-28 Thread Rebecca Cran
Author: bcran
Date: Fri Dec 28 21:26:45 2018
New Revision: 342579
URL: https://svnweb.freebsd.org/changeset/base/342579

Log:
  Improve the efibootmgr(8) man page
  
  Fix formatting, typos, and attempt to improve the wording.
  
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D18646

Modified:
  head/usr.sbin/efibootmgr/efibootmgr.8

Modified: head/usr.sbin/efibootmgr/efibootmgr.8
==
--- head/usr.sbin/efibootmgr/efibootmgr.8   Fri Dec 28 19:49:58 2018
(r342578)
+++ head/usr.sbin/efibootmgr/efibootmgr.8   Fri Dec 28 21:26:45 2018
(r342579)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2017 Netflix, Inc
+.\" Copyright (c) 2017-2018 Netflix, Inc
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,19 +24,19 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 8, 2018
+.Dd December 28, 2018
 .Dt EFIBOOTMGR 8
 .Os
 .Sh NAME
 .Nm efibootmgr 
 .Nd manipulate the EFI Boot Manager
 .Sh SYNOPSIS
-.Op Fl aAnNB Ar Bootvar
+.Op Fl aAnNB Ar bootnum
 .Op Fl t Ar timeout
 .Op Fl T
 .Op Fl o Ar bootorder
-.Op Fl verbose
-.Op Fl c -k Ar kernel -l Ar loader [-L Ar label] [--dry-run] [-b Bootvar]
+.Op Fl v
+.Op Fl c l Ar loader [ Fl k Ar kernel ] [ Fl L Ar label ] [ Fl -dry-run ] [ Fl 
b Ar bootnum ]
 .Sh "DESCRIPTION"
 .Nm
 manipulates how UEFI Boot Managers boot the system.
@@ -59,7 +59,7 @@ The currently booting method is communicated using 
 A global timeout can also be set.
 .Pp
 .Nm
-requires that the kernel efirt module to get and set these
+requires that the kernel efirt module be loaded to get and set these
 non-volatile variables.
 .Pp
 The following options are available:
@@ -70,45 +70,45 @@ Create a new Boot Variable
 The path to and name of the loader.
 .It Fl k -kernel Ar kernel
 The path to and name of the kernel.
-.It Fl b Bootvar
-When creating an entry, use Bootvar as the index.
+.It Fl b -bootnum Ar bootnum
+When creating a new entry, use bootnum as the index.
 Fail if it already exists.
 .It Fl L -label Ar label
 An optional description for the entry.
 .It Fl D -dry-run
-Process but do not set the given BootVar.
-.It Fl B -delete Ar BootVarNum
-Delete the given BootVar Num.
-.It Fl a -activate Ar BootVarNum
-Activate the given BootVarNum.
-.It Fl A -deactivate Ar BootVarNum
-Deactivate the given BootVarNum.
-.It Fl n -bootnext  Ar BootVarNum
-Set BootVarNum as the BootNext variable.
+Process but do not change any variables.
+.It Fl B -delete Ar bootnum
+Delete the given bootnum boot entry.
+.It Fl a -activate Ar bootnum
+Activate the given bootnum boot entry.
+.It Fl A -deactivate Ar bootnum
+Deactivate the given bootnum boot entry.
+.It Fl n -bootnext Ar bootnum
+Set bootnum boot entry as the BootNext variable.
 .It Fl N -delete-bootnext 
-Delete the BootNext optional BootVar.
+Delete the BootNext optional variable.
 .It Fl o -bootorder Ar bootorder
-Set BootOrder variable to the given comma delimited set of BootVarNums.
+Set BootOrder variable to the given comma delimited set of bootnums.
 The numbers are in hex to match Boot, but may omit leading zeros.
 .It Fl t -set-timeout Ar timeout
 Set the bootmenu timeout value.
 .It Fl T -del-timeout
 Delete the BootTimeout variable.
 .It Fl v -verbose
-Display the device path of BootVars in the output.
+Display the device path of boot entries in the output.
 .El
 .Pp
-.Sh Exammples
+.Sh Examples
 .Pp
 To Display the current Boot related variables in the system:
 .Pp
 .Dl efibootmgr [-v]
 .Pp
-This will display the optional BootNext BootVar, BootCurrent,
-or currently booted BootVar, followed by the optional Timeout value, any
-BootOrder that maybe set, followed finally by all currently defined Boot
+This will display the optional BootNext bootnum, BootCurrent,
+or currently booted bootnum, followed by the optional Timeout value, any
+BootOrder that may be set, followed finally by all currently defined Boot
 variables, active or not. The verbose flag will augment this output with
-the hardrive partition uuids, size/offset and device-path of the
+the disk partition uuids, size/offset and device-path of the
 variable.
 .Pp
 The
@@ -117,28 +117,28 @@ program can be used to create new EFI boot variables. 
 boot var pointing to an installation with its EFI partition mounted
 under /mnt, the given loader and a label "FreeBSD-11":
 .Pp
-.Dl efibootmgr -c -l /mnt/EFI/BOOT/BOOTX64.EFI -L FreeBSD-11
+.Dl efibootmgr -c -l /mnt/EFI/freebsd/loader.efi -L FreeBSD-11
 .Pp
-This will result in the next available BootVarNum being assigned to a
-new UEFI load variable, and given the label "FreeBSD-11" such as:
+This will result in the next available bootnum being assigned to a
+new UEFI boot variable, and given the label "FreeBSD-11" such as:
 .Pp
 .Dl Boot0009 FreeBSD-11
 .Pp
-Note newly created BootVars are created inactive. The active state is denoted
-by an '*' following the BootVar name in the output.  

svn commit: r342578 - head/share/man/man5

2018-12-28 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Fri Dec 28 19:49:58 2018
New Revision: 342578
URL: https://svnweb.freebsd.org/changeset/base/342578

Log:
  Add a style.mdoc(5) manual page.
  
  The aim of this manual page is to act as a style and formatting guide for
  mdoc(7) manual pages. Currently, mdoc(7) does not provide much guidance
  when it comes to the usage of macros making it difficult to format manual
  pages in a consistent way.
  
  Reviewed by:  bcr
  Approved by:  bcr (doc), krion (mentor, implicit), mat (mentor, implicit)
  Differential Revision:https://reviews.freebsd.org/D18394

Added:
  head/share/man/man5/style.mdoc.5   (contents, props changed)
Modified:
  head/share/man/man5/Makefile

Modified: head/share/man/man5/Makefile
==
--- head/share/man/man5/MakefileFri Dec 28 17:51:40 2018
(r342577)
+++ head/share/man/man5/MakefileFri Dec 28 19:49:58 2018
(r342578)
@@ -66,6 +66,7 @@ MAN=  acct.5 \
src.conf.5 \
stab.5 \
style.Makefile.5 \
+   style.mdoc.5 \
sysctl.conf.5 \
tmpfs.5
 

Added: head/share/man/man5/style.mdoc.5
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man5/style.mdoc.5Fri Dec 28 19:49:58 2018
(r342578)
@@ -0,0 +1,205 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+.\"
+.\" Copyright (c) 2018 Mateusz Piotrowski <0...@freebsd.org>
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd December 28, 2018
+.Dt STYLE.MDOC 5
+.Os
+.Sh NAME
+.Nm style.mdoc
+.Nd
+.Fx
+.Xr mdoc 7
+file style guide
+.Sh DESCRIPTION
+This file specifies the preferred style for manual pages in the
+.Fx
+source tree.
+.Ss Code examples
+.Bl -dash -width ""
+.It
+Use literal formatting for examples and literal shell commands, e.g.:
+.Bd -literal -offset indent
+Then run
+\&.Dq Li make install clean .
+.Ed
+.Pp
+which renders as:
+.Bd -filled -offset indent
+Then run
+.Dq Li make install clean .
+.Ed
+.Pp
+The incorrect way would be to use macros like
+.Sy \
+to stylize the command invocation:
+.Bd -literal -offset indent
+Then run
+\&.Dq Nm make Cm install Cm clean .
+.Ed
+.Pp
+which renders as:
+.Bd -filled -offset indent
+Then run
+.Dq Nm make Cm install Cm clean .
+.Ed
+.El
+.Ss Synopsis formatting
+.Bl -dash -width ""
+.It
+Do not put whitespace between alternative parameters separated with a pipe
+.Pq Dq | ,
+e.g.:
+.Bd -literal -offset indent
+\&.Cm compression Cm on Ns | Ns Cm off
+\&.Cm install Fl -all Ns | Ns Ar portname Ar ...
+.Ed
+.Pp
+which in the SYNOPSIS section is rendered as:
+.Bd -unfilled -offset indent
+.Cm compression Cm on Ns | Ns Cm off
+.Cm install Fl -all Ns | Ns Ar portname Ar ...
+.Ed
+.It
+Use
+.Sy \
+to stylize characters that are command modifiers
+.Po e.g.,
+.Dq \&, ,
+.Dq @
+or
+.Dq "="
+.Pc .
+For example:
+.Bd -literal -offset indent
+\&.Sm off
+\&.Fl -meet Cm = Ar who Oo Cm \&, Ar who " " Ar "..." Oc Cm @ Ar where
+\&.Sm on
+.Ed
+.Pp
+which renders as:
+.Bd -filled -offset indent
+.Sm off
+.Fl -meet Cm = Ar who Oo Cm \&, Ar who " " Ar "..." Oc Cm @ Ar where
+.Sm on
+.Ed
+.Pp
+instead of:
+.Bd -literal -offset indent
+\&.Sm off
+\&.Fl -meet No = Ar who Oo , Ar who " " Ar "..." Oc @ Ar where
+\&.Sm on
+.Ed
+.Pp
+which would render as:
+.Bd -filled -offset indent
+.Sm off
+.Fl -meet No = Ar who Oo , Ar who " " Ar "..." Oc @ Ar where
+.Sm on
+.Ed
+.Pp
+It is important to realize that in the correct example,
+.Dq \&, ,
+.Dq @
+and
+.Dq =
+are stylized with
+.Sy \ .
+At the same time, the square brackets
+.Pq 

Re: svn commit: r342389 - head/share/man/man5

2018-12-28 Thread Chris Rees



On 28 December 2018 19:02:14 GMT+00:00, Niclas Zeising  
wrote:
>On 12/28/18 7:43 PM, Chris Rees wrote:
>> Hey,
>> 
>> On 28 December 2018 18:19:57 GMT+00:00, Niclas Zeising
> wrote:
>>> On 12/24/18 11:47 AM, Chris Rees wrote:
 Author: crees (doc,ports committer)
 Date: Mon Dec 24 10:47:48 2018
 New Revision: 342389
 URL: https://svnweb.freebsd.org/changeset/base/342389

 Log:
 Clarify kld_list format
 
 PR:docs/234248
 Submitted by:  David Fiander
 Submitted by:  Miroslav Lachman

 Modified:
 head/share/man/man5/rc.conf.5

 Modified: head/share/man/man5/rc.conf.5

>>>
>==
 --- head/share/man/man5/rc.conf.5  Mon Dec 24 06:14:32
>2018   (r342388)
 +++ head/share/man/man5/rc.conf.5  Mon Dec 24 10:47:48
>2018   (r342389)
 @@ -248,12 +248,14 @@ Default
.Pa /etc/ddb.conf .
.It Va kld_list
.Pq Vt str
 -A list of kernel modules to load right after the local
 -disks are mounted.
 +A whitespace-separated list of kernel modules to load right after
 +the local disks are mounted, without any
 +.Pa .ko
 +extension or path.
Loading modules at this point in the boot process is
much faster than doing it via
.Pa /boot/loader.conf
 -for those modules not necessary for mounting local disk.
 +for those modules not necessary for mounting local disks.
.It Va kldxref_enable
.Pq Vt bool
Set to
>>>
>>>
>>> Hi!
>>> Sorry for jumping into this so late.
>>> Please please PLEASE don't break loading modules by path in
>kld_list.
>>> This is used by the drm-kmod files to distinguish them from the base
>>> modules, and this has been communicated in documentation all over
>the
>>> place, including numerous ports.
>>>
>>> Can this please be reverted, or amended to match reality.
>>>
>>> In practice, adding both the path and the extension (.ko) to a
>module
>>> in
>>> kld_list works and the module loads.
>> 
>> As the code itself stands, it works for loading, but throws an error
>if you try to load an already loaded module adding a .ko extension.  In
>other words, it works but is wrong.  The path actually still does work,
>which was my mistake.
>> 
>> I'm awaiting approval for this, which correctly handles all cases:
>> 
>> https://reviews.freebsd.org/D18670
>> 
>> Konstantin has reviewed, but doesn't feel comfortable giving approval
>as it's not his area, which is fair enough.
>> 
>> Chris
>> 
>
>Ok.
>Will this continue to work when loading /path/to/foo.ko rather than 
>path/to/foo? (I assume it will)
>Regards

Unlike now, it will work correctly, including if the module is already loaded.

Chris

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: svn commit: r342389 - head/share/man/man5

2018-12-28 Thread Niclas Zeising

On 12/28/18 7:43 PM, Chris Rees wrote:

Hey,

On 28 December 2018 18:19:57 GMT+00:00, Niclas Zeising  
wrote:

On 12/24/18 11:47 AM, Chris Rees wrote:

Author: crees (doc,ports committer)
Date: Mon Dec 24 10:47:48 2018
New Revision: 342389
URL: https://svnweb.freebsd.org/changeset/base/342389

Log:
Clarify kld_list format

PR:		docs/234248

Submitted by:   David Fiander
Submitted by:   Miroslav Lachman

Modified:
head/share/man/man5/rc.conf.5

Modified: head/share/man/man5/rc.conf.5


==

--- head/share/man/man5/rc.conf.5   Mon Dec 24 06:14:32 2018
(r342388)
+++ head/share/man/man5/rc.conf.5   Mon Dec 24 10:47:48 2018
(r342389)
@@ -248,12 +248,14 @@ Default
   .Pa /etc/ddb.conf .
   .It Va kld_list
   .Pq Vt str
-A list of kernel modules to load right after the local
-disks are mounted.
+A whitespace-separated list of kernel modules to load right after
+the local disks are mounted, without any
+.Pa .ko
+extension or path.
   Loading modules at this point in the boot process is
   much faster than doing it via
   .Pa /boot/loader.conf
-for those modules not necessary for mounting local disk.
+for those modules not necessary for mounting local disks.
   .It Va kldxref_enable
   .Pq Vt bool
   Set to



Hi!
Sorry for jumping into this so late.
Please please PLEASE don't break loading modules by path in kld_list.
This is used by the drm-kmod files to distinguish them from the base
modules, and this has been communicated in documentation all over the
place, including numerous ports.

Can this please be reverted, or amended to match reality.

In practice, adding both the path and the extension (.ko) to a module
in
kld_list works and the module loads.


As the code itself stands, it works for loading, but throws an error if you try 
to load an already loaded module adding a .ko extension.  In other words, it 
works but is wrong.  The path actually still does work, which was my mistake.

I'm awaiting approval for this, which correctly handles all cases:

https://reviews.freebsd.org/D18670

Konstantin has reviewed, but doesn't feel comfortable giving approval as it's 
not his area, which is fair enough.

Chris



Ok.
Will this continue to work when loading /path/to/foo.ko rather than 
path/to/foo? (I assume it will)

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


Re: svn commit: r342389 - head/share/man/man5

2018-12-28 Thread Chris Rees
Hey,

On 28 December 2018 18:19:57 GMT+00:00, Niclas Zeising  
wrote:
>On 12/24/18 11:47 AM, Chris Rees wrote:
>> Author: crees (doc,ports committer)
>> Date: Mon Dec 24 10:47:48 2018
>> New Revision: 342389
>> URL: https://svnweb.freebsd.org/changeset/base/342389
>> 
>> Log:
>>Clarify kld_list format
>>
>>PR:   docs/234248
>>Submitted by: David Fiander
>>Submitted by: Miroslav Lachman
>> 
>> Modified:
>>head/share/man/man5/rc.conf.5
>> 
>> Modified: head/share/man/man5/rc.conf.5
>>
>==
>> --- head/share/man/man5/rc.conf.5Mon Dec 24 06:14:32 2018
>> (r342388)
>> +++ head/share/man/man5/rc.conf.5Mon Dec 24 10:47:48 2018
>> (r342389)
>> @@ -248,12 +248,14 @@ Default
>>   .Pa /etc/ddb.conf .
>>   .It Va kld_list
>>   .Pq Vt str
>> -A list of kernel modules to load right after the local
>> -disks are mounted.
>> +A whitespace-separated list of kernel modules to load right after
>> +the local disks are mounted, without any
>> +.Pa .ko
>> +extension or path.
>>   Loading modules at this point in the boot process is
>>   much faster than doing it via
>>   .Pa /boot/loader.conf
>> -for those modules not necessary for mounting local disk.
>> +for those modules not necessary for mounting local disks.
>>   .It Va kldxref_enable
>>   .Pq Vt bool
>>   Set to
>
>
>Hi!
>Sorry for jumping into this so late.
>Please please PLEASE don't break loading modules by path in kld_list. 
>This is used by the drm-kmod files to distinguish them from the base 
>modules, and this has been communicated in documentation all over the 
>place, including numerous ports.
>
>Can this please be reverted, or amended to match reality.
>
>In practice, adding both the path and the extension (.ko) to a module
>in 
>kld_list works and the module loads.

As the code itself stands, it works for loading, but throws an error if you try 
to load an already loaded module adding a .ko extension.  In other words, it 
works but is wrong.  The path actually still does work, which was my mistake.

I'm awaiting approval for this, which correctly handles all cases:

https://reviews.freebsd.org/D18670

Konstantin has reviewed, but doesn't feel comfortable giving approval as it's 
not his area, which is fair enough.

Chris

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: svn commit: r342389 - head/share/man/man5

2018-12-28 Thread Niclas Zeising

On 12/24/18 11:47 AM, Chris Rees wrote:

Author: crees (doc,ports committer)
Date: Mon Dec 24 10:47:48 2018
New Revision: 342389
URL: https://svnweb.freebsd.org/changeset/base/342389

Log:
   Clarify kld_list format
   
   PR:		docs/234248

   Submitted by:David Fiander
   Submitted by:Miroslav Lachman

Modified:
   head/share/man/man5/rc.conf.5

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Mon Dec 24 06:14:32 2018
(r342388)
+++ head/share/man/man5/rc.conf.5   Mon Dec 24 10:47:48 2018
(r342389)
@@ -248,12 +248,14 @@ Default
  .Pa /etc/ddb.conf .
  .It Va kld_list
  .Pq Vt str
-A list of kernel modules to load right after the local
-disks are mounted.
+A whitespace-separated list of kernel modules to load right after
+the local disks are mounted, without any
+.Pa .ko
+extension or path.
  Loading modules at this point in the boot process is
  much faster than doing it via
  .Pa /boot/loader.conf
-for those modules not necessary for mounting local disk.
+for those modules not necessary for mounting local disks.
  .It Va kldxref_enable
  .Pq Vt bool
  Set to



Hi!
Sorry for jumping into this so late.
Please please PLEASE don't break loading modules by path in kld_list. 
This is used by the drm-kmod files to distinguish them from the base 
modules, and this has been communicated in documentation all over the 
place, including numerous ports.


Can this please be reverted, or amended to match reality.

In practice, adding both the path and the extension (.ko) to a module in 
kld_list works and the module loads.


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


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

2018-12-28 Thread John Baldwin
On 12/28/18 9:51 AM, Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Fri Dec 28 17:51:40 2018
> New Revision: 342577
> URL: https://svnweb.freebsd.org/changeset/base/342577
> 
> Log:
>   Make sh(1) collapse $HOME into "~" in PS1.
>   
>   Reviewed by:jilles
>   MFC after:  2 weeks
>   Sponsored by:   DARPA, AFRL
>   Differential Revision:  https://reviews.freebsd.org/D18663
> 
> Modified:
>   head/bin/sh/parser.c
> 
> Modified: head/bin/sh/parser.c
> ==
> --- head/bin/sh/parser.c  Fri Dec 28 17:50:40 2018(r342576)
> +++ head/bin/sh/parser.c  Fri Dec 28 17:51:40 2018(r342577)
> @@ -1978,7 +1978,9 @@ getprompt(void *unused __unused)
>  {
>   static char ps[PROMPTLEN];
>   const char *fmt;
> + const char *home;
>   const char *pwd;
> + size_t homelen;
>   int i, trim;
>   static char internal_error[] = "??";
>  
> @@ -2039,8 +2041,24 @@ getprompt(void *unused __unused)
>   *pwd == '/' && pwd[1] != '\0')
>   strlcpy([i], strrchr(pwd, '/') + 1,
>   PROMPTLEN - i);
> - else
> - strlcpy([i], pwd, PROMPTLEN - i);
> + else {
> + home = lookupvar("HOME");
> + if (home != NULL)
> + homelen = strlen(home);
> + if (home != NULL &&
> + strcmp(home, "/") != 0 &&
> + strncmp(pwd, home, homelen) == 0 &&
> + (pwd[homelen] == '/' ||
> + pwd[homelen] == '\0')) {
> + strlcpy([i], "~",
> + PROMPTLEN - i);
> + strlcpy([i + 1],
> + pwd + homelen,
> + PROMPTLEN - i - 1);
> + } else {
> + strlcpy([i], pwd, PROMPTLEN 
> - i);
> + }
> + }

The existing code already did this, but isn't the fancy math with the size
passed to strlcpy() one of the things strlcpy() tries to prevent?  Using
strlcat would seem to be harder to get wrong, that is:

 if (...) {
 strlcat(ps, "~", PROMPTLEN);
 strlcat(ps, pwd + homelen, PROMPTLEN);
 } else
 strlcat(ps, pwd, PROMPTLEN);

looks simpler to read and seems less error prone.

-- 
John Baldwin


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


svn commit: r342577 - head/bin/sh

2018-12-28 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Dec 28 17:51:40 2018
New Revision: 342577
URL: https://svnweb.freebsd.org/changeset/base/342577

Log:
  Make sh(1) collapse $HOME into "~" in PS1.
  
  Reviewed by:  jilles
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D18663

Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==
--- head/bin/sh/parser.cFri Dec 28 17:50:40 2018(r342576)
+++ head/bin/sh/parser.cFri Dec 28 17:51:40 2018(r342577)
@@ -1978,7 +1978,9 @@ getprompt(void *unused __unused)
 {
static char ps[PROMPTLEN];
const char *fmt;
+   const char *home;
const char *pwd;
+   size_t homelen;
int i, trim;
static char internal_error[] = "??";
 
@@ -2039,8 +2041,24 @@ getprompt(void *unused __unused)
*pwd == '/' && pwd[1] != '\0')
strlcpy([i], strrchr(pwd, '/') + 1,
PROMPTLEN - i);
-   else
-   strlcpy([i], pwd, PROMPTLEN - i);
+   else {
+   home = lookupvar("HOME");
+   if (home != NULL)
+   homelen = strlen(home);
+   if (home != NULL &&
+   strcmp(home, "/") != 0 &&
+   strncmp(pwd, home, homelen) == 0 &&
+   (pwd[homelen] == '/' ||
+   pwd[homelen] == '\0')) {
+   strlcpy([i], "~",
+   PROMPTLEN - i);
+   strlcpy([i + 1],
+   pwd + homelen,
+   PROMPTLEN - i - 1);
+   } else {
+   strlcpy([i], pwd, PROMPTLEN 
- i);
+   }
+   }
/* Skip to end of path. */
while (ps[i + 1] != '\0')
i++;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r342576 - head/share/skel

2018-12-28 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Dec 28 17:50:40 2018
New Revision: 342576
URL: https://svnweb.freebsd.org/changeset/base/342576

Log:
  Simplify the way we set the default sh(1) PS1.  No functional changes.
  
  Reviewed by:  jilles
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D18662

Modified:
  head/share/skel/dot.shrc

Modified: head/share/skel/dot.shrc
==
--- head/share/skel/dot.shrcFri Dec 28 17:00:12 2018(r342575)
+++ head/share/skel/dot.shrcFri Dec 28 17:50:40 2018(r342576)
@@ -33,11 +33,7 @@ alias g='egrep -i'
 
 
 # # set prompt: ``username@hostname$ '' 
-# PS1="`whoami`@`hostname | sed 's/\..*//'`"
-# case `id -u` in
-#  0) PS1="${PS1}# ";;
-#  *) PS1="${PS1}$ ";;
-# esac
+# PS1="`whoami`@\h\\$ "
 
 # search path for cd(1)
 # CDPATH=:$HOME
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r342575 - head/usr.bin/ar

2018-12-28 Thread Ed Maste
Author: emaste
Date: Fri Dec 28 17:00:12 2018
New Revision: 342575
URL: https://svnweb.freebsd.org/changeset/base/342575

Log:
  ar: detect and error out on 32-bit symbol table overflow
  
  BSD ar currently does not support the /SYM64/ 64-bit symbol table, and
  previously truncated to 32-bits, silently producing corrupted archives
  larger than 4GB.
  
  Note that this is only a partial fix; additional checks will come.
  
  PR:   234454
  Reported by:  Aijaz Baig, imp
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/ar/write.c

Modified: head/usr.bin/ar/write.c
==
--- head/usr.bin/ar/write.c Fri Dec 28 16:08:49 2018(r342574)
+++ head/usr.bin/ar/write.c Fri Dec 28 17:00:12 2018(r342575)
@@ -659,9 +659,13 @@ write_objs(struct bsdar *bsdar)
pm_sz = _ARMAG_LEN + (_ARHDR_LEN + s_sz);
if (bsdar->as != NULL)
pm_sz += _ARHDR_LEN + bsdar->as_sz;
-   for (i = 0; (size_t)i < bsdar->s_cnt; i++)
+   for (i = 0; (size_t)i < bsdar->s_cnt; i++) {
+   if (*(bsdar->s_so + i) > UINT32_MAX - pm_sz)
+   bsdar_errc(bsdar, EX_SOFTWARE, 0,
+   "Symbol table offset overflow");
*(bsdar->s_so + i) = htobe32(*(bsdar->s_so + i) +
pm_sz);
+   }
}
 
if ((a = archive_write_new()) == NULL)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r342574 - head/lib/libc/string

2018-12-28 Thread Konstantin Belousov
Author: kib
Date: Fri Dec 28 16:08:49 2018
New Revision: 342574
URL: https://svnweb.freebsd.org/changeset/base/342574

Log:
  Fix WITHOUT_NLS build after r342551.
  
  Reported by:  gj
  MFC after:13 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libc/string/strerror.c

Modified: head/lib/libc/string/strerror.c
==
--- head/lib/libc/string/strerror.c Fri Dec 28 15:11:22 2018
(r342573)
+++ head/lib/libc/string/strerror.c Fri Dec 28 16:08:49 2018
(r342574)
@@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
  * statically linked binaries.
  */
 static void
-errstr(int num, char *uprefix, char *buf, size_t len)
+errstr(int num, const char *uprefix, char *buf, size_t len)
 {
char *t;
unsigned int uerr;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r342573 - head/usr.sbin/autofs

2018-12-28 Thread Chris Rees
Author: crees (doc,ports committer)
Date: Fri Dec 28 15:11:22 2018
New Revision: 342573
URL: https://svnweb.freebsd.org/changeset/base/342573

Log:
  There is no way of escaping literal $ signs in auto_master(5), which
  makes for difficulty with hidden Samba shares; shares with $ at the end
  of their name.  This enables the use of ${DOLLAR} to work around this.
  
  Reviewed by:  bcr (man page)
  Approved by:  trasz
  Differential Revision:https://reviews.freebsd.org/D7048

Modified:
  head/usr.sbin/autofs/auto_master.5
  head/usr.sbin/autofs/defined.c

Modified: head/usr.sbin/autofs/auto_master.5
==
--- head/usr.sbin/autofs/auto_master.5  Fri Dec 28 13:32:14 2018
(r342572)
+++ head/usr.sbin/autofs/auto_master.5  Fri Dec 28 15:11:22 2018
(r342573)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 13, 2015
+.Dd December 28, 2018
 .Dt AUTO_MASTER 5
 .Os
 .Sh NAME
@@ -187,6 +187,8 @@ Expands to the output of
 .Li "uname -p" .
 .It Li CPU
 Same as ARCH.
+.It Li DOLLAR
+A literal $ sign.
 .It Li HOST
 Expands to the output of
 .Li "uname -n" .

Modified: head/usr.sbin/autofs/defined.c
==
--- head/usr.sbin/autofs/defined.c  Fri Dec 28 13:32:14 2018
(r342572)
+++ head/usr.sbin/autofs/defined.c  Fri Dec 28 15:11:22 2018
(r342573)
@@ -266,6 +266,7 @@ defined_init(void)
 
defined_add("ARCH", name.machine);
defined_add("CPU", name.machine);
+   defined_add("DOLLAR", "$");
defined_add("HOST", name.nodename);
defined_add("OSNAME", name.sysname);
defined_add("OSREL", name.release);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r342572 - head/sys/kern

2018-12-28 Thread Jilles Tjoelker
Author: jilles
Date: Fri Dec 28 13:32:14 2018
New Revision: 342572
URL: https://svnweb.freebsd.org/changeset/base/342572

Log:
  pfind, pfind_any: Correct zombie logic
  
  SVN r340744 erroneously changed pfind() to return any process including
  zombies and pfind_any() to return only non-zombie processes.
  
  In particular, this caused kill() on a zombie process to fail with [ESRCH].
  There is no direct test case for this but /usr/tests/bin/sh/builtins/kill1.0
  occasionally triggers it (as reported by lwhsu).
  
  Conversely, returning zombies from pfind() seems likely to violate
  invariants and cause panics, but I have not looked at this.
  
  PR:   233646
  Reviewed by:  mjg, kib, ngie
  Differential Revision:https://reviews.freebsd.org/D18665

Modified:
  head/sys/kern/kern_proc.c

Modified: head/sys/kern/kern_proc.c
==
--- head/sys/kern/kern_proc.c   Fri Dec 28 10:10:16 2018(r342571)
+++ head/sys/kern/kern_proc.c   Fri Dec 28 13:32:14 2018(r342572)
@@ -388,7 +388,7 @@ _pfind(pid_t pid, bool zombie)
if (p->p_pid == pid) {
PROC_LOCK(p);
if (p->p_state == PRS_NEW ||
-   (zombie && p->p_state == PRS_ZOMBIE)) {
+   (!zombie && p->p_state == PRS_ZOMBIE)) {
PROC_UNLOCK(p);
p = NULL;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"