Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Jan Beich
Jan Beich  writes:

> grarpamp  writes:
>
>> BSD community can definitely volunteer to make benchmark of
>> its shell vs others, determine if and where improvements to make.
>> Many apps never get checked for obvious speedups,
>> if so it might become fastest shell even with the new features.
>
> Like https://github.com/shellspec/shellbench ?
> I did check a month ago (on 2021-08-31) but forgot NetBSD sh(1).
> Obviously, the results may vary per OS/version/architecture/hardware.

Nevemind. I've tested inside jail (probably 12.2 amd64) instead of -CURRENT.



Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Jan Beich
grarpamp  writes:

> BSD community can definitely volunteer to make benchmark of
> its shell vs others, determine if and where improvements to make.
> Many apps never get checked for obvious speedups,
> if so it might become fastest shell even with the new features.

Like https://github.com/shellspec/shellbench ?
I did check a month ago (on 2021-08-31) but forgot NetBSD sh(1).
Obviously, the results may vary per OS/version/architecture/hardware.

$ ./shellbench -s sh,dash,busybox/sh,bash,zsh,oksh,ksh93,yash sample/*.sh
--
name   sh   dash busybox/sh   bash  
  zsh   oksh  ksh93   yash
--
assign.sh: positional params1,983,164747,830666,979443,083
551,071875,915479,129395,225
assign.sh: variable 2,405,745827,904741,112616,017  
1,308,457  1,013,153588,698510,636
assign.sh: local var2,398,554834,027747,871603,486  
1,293,027  1,007,511  error503,410
assign.sh: local var (typeset)  error  error  error616,483  
1,306,641  1,011,383544,136504,782
cmp.sh: [ ] 1,628,216567,700465,761352,438
336,288713,738518,768297,987
cmp.sh: [[ ]]   error  error  error480,974
595,441903,502613,269376,550
cmp.sh: case2,527,633  1,196,339  1,024,253606,588
632,811959,232628,183450,893
count.sh: posix 1,640,683717,178589,330463,934
907,140700,233376,361398,937
count.sh: typeset -ierror  error  error452,029
907,541652,885385,585  error
count.sh: increment error  error  error581,631  
1,264,962845,738581,111  error
eval.sh: direct assign  1,670,797564,299518,082308,709
198,714722,050285,150279,020
eval.sh: eval assign1,102,774393,161332,925194,636
156,834476,164173,156192,191
eval.sh: command subs   2,188  5,828  4,830  2,208  
1,597  5,015  ?  4,302
func.sh: no func2,451,641836,115756,258614,579
711,116  1,087,770571,210507,644
func.sh: func   1,947,254596,731542,519349,748
187,903845,681306,506313,989
null.sh: blank  3,094,116  error  error  error  
1,529,326  1,304,367  error593,711
null.sh: assign variable2,419,811845,676751,887669,694  
1,374,858  1,012,724599,490533,401
null.sh: define function2,687,933  1,259,149  1,076,947661,432  
1,270,777  1,085,654584,490525,184
null.sh: undefined variable 2,445,429839,334750,904505,147
631,862  1,048,805473,900501,851
null.sh: : command  2,418,617839,744742,385610,307
701,972  1,064,089565,323500,879
output.sh: echo 1,518,368669,539620,417404,729
544,030781,488540,064380,174
output.sh: printf   1,481,745632,454535,170395,649
534,303  1,556258,827365,724
output.sh: printerror  error  error  error
542,740775,812353,320  error
subshell.sh: no subshell2,330,179819,359729,753571,353
705,892  1,005,262560,780485,498
subshell.sh: brace  2,343,747833,142728,803554,948
568,470984,156557,069413,438
subshell.sh: subshell   3,444  6,917  2,814  1,190  
3,578  3,391240,738  2,570
subshell.sh: command subs   1,871,462  3,806  5,966  2,766  
2,709  4,564146,388  3,691
subshell.sh: external command   1,112996579893  
2,190  2,529  1,728  1,778
--
* count: number of executions per second



Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Baptiste Daroussin
On Wed, Sep 22, 2021 at 10:03:40PM +0200, Alban Hertroys wrote:
> 
> > On 22 Sep 2021, at 10:36, Baptiste Daroussin  wrote:
> > 
> > Hello,
> > 
> > TL;DR: this is not a proposal to deorbit csh from base!!!
> 
> (…)
> 
> > Recently our sh(1) has receive update to make it more user friendly in
> > interactive mode:
> > * command completion (thanks pstef@)
> > * improvement in the emacs mode, to make it behave by default like other 
> > shells
> > * improvement in the vi mode (in particular the vi edit to respect $EDITOR)
> > * support for history as described by POSIX.
> > 
> > This makes it a usable shell by default, which is why I would like to 
> > propose to
> > make it the default shell for root starting FreeBSD 14.0-RELEASE (not MFCed)
> 
> My one concern is this: what is the impact of these usability improvements to 
> sh on its usage in scripts?

None, those are in a code path with doesn't get executed when in non interactive
mode.

Best regards,
Bapt



Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Chris

On 2021-09-22 12:26, Marek Zarychta wrote:

W dniu 22.09.2021 o 19:46, Warner Losh pisze:

On Wed, Sep 22, 2021 at 9:35 AM John Baldwin  wrote:


On 9/22/21 1:36 AM, Baptiste Daroussin wrote:

Hello,

TL;DR: this is not a proposal to deorbit csh from base!!!

For years now, csh is the default root shell for FreeBSD, csh can be

confusing

as a default shell for many as all other unix like settled on a bourne

shell

compatible interactive shell: zsh, bash, or variant of ksh.

Recently our sh(1) has receive update to make it more user friendly in
interactive mode:
* command completion (thanks pstef@)
* improvement in the emacs mode, to make it behave by default like other

shells

* improvement in the vi mode (in particular the vi edit to respect

$EDITOR)

* support for history as described by POSIX.

This makes it a usable shell by default, which is why I would like to

propose to

make it the default shell for root starting FreeBSD 14.0-RELEASE (not

MFCed)


If no strong arguments has been raised until October 15th, I will make

this

proposal happen.

Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!


I think this is fine.  I would also be fine with either removing 'toor'
from the
default password file or just leaving it as-is for POLA.  (I would 
probably

prefer removing it outright.)



I think this is also fine. I also think we should remove toor from the
default
password file for one fewer attack surfaces. I strongly prefer this. Users
that want toor can add it to their system and/or provisioning scripts.

Warner



I am curious which attacks you are referring to since I have never heard
of attacks on toor account. I have seen a lot of malware attacking root,
admin, nobody, and other accounts, but never toor.

In the 30 some yrs I've been on UNIX and the likes. I've only ever known
~half a dozen administrators that ever choose toor. Those that want to
continue doing so, will not be prevented from continuing to do so.


TBH toor might be handy as a backdoor account if you are familiar with
FreeBSD enough to take advantage of it. It can also act as an account of
last resort when someone breaks into your system and changes root
password, wipes ssh keys etc, so it cuts both ways, not even mentioning
 POLA.

TBH this is a non-issue. toor is simply an alias to root.
Anyone that has a root hacked system need only spin up the FreeBSD mini
iso/img, mount their hacked system && hack back into shape. :-)

Props to all the work and proposed changes here. Thanks! :-)

--Chris

P.S. This is NOT a bike shed.


The transition from csh to sh as a default root's shell will probably
save some CPU cycles for people using Chef, Ansible, etc thus pushing
FreeBSD toward green computing. Sysadmins bound to csh will be fine
until it remains in the base system and chsh works.

I shouldn't probably post here since I am only a voice from the userbase
but can't help doing so.

Kind regards,


0xBDE49540.asc
Description: application/pgp-keys


Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Juraj Lutter


> On 22 Sep 2021, at 10:36, Baptiste Daroussin  wrote:

> Hello,
> 
> TL;DR: this is not a proposal to deorbit csh from base!!!
> 
> 
> This makes it a usable shell by default, which is why I would like to propose 
> to
> make it the default shell for root starting FreeBSD 14.0-RELEASE (not MFCed)
> 


Thanks for this!

What I miss a bit is a completion triggered by delete-char-or-list-or-eof (^D) 
as it was in (t)csh.

otis

—
Juraj Lutter
o...@freebsd.org



Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread grarpamp
> propose to make it the default shell for root starting FreeBSD 14.0-RELEASE

Make it so.

The whole rest of rc, pkg, base scripts and subsystems use a lot of sh, not csh.
So this is a good compatibility, consistancy, and gotcha-removing update,
needed for decades.

Even "bash" is a majority spoken shell in Linux/world, helping
make crossovers if BSD becomes a bit more bash-like.
The bsd sh feature updates are filling useful/needed capability gaps.

"csh considered harmful"

toor needs to go as part of simple cruft removal for a cleaner base,
else you would have to add zoor, koor, boor, toor, etc. No no no no!

Nobody leave FreeBSD just to get run csh on their windows command prompt ;)

Users are always free to customize local installs as desired.

BSD community can definitely volunteer to make benchmark of
its shell vs others, determine if and where improvements to make.
Many apps never get checked for obvious speedups,
if so it might become fastest shell even with the new features.



Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Alban Hertroys


> On 22 Sep 2021, at 10:36, Baptiste Daroussin  wrote:
> 
> Hello,
> 
> TL;DR: this is not a proposal to deorbit csh from base!!!

(…)

> Recently our sh(1) has receive update to make it more user friendly in
> interactive mode:
> * command completion (thanks pstef@)
> * improvement in the emacs mode, to make it behave by default like other 
> shells
> * improvement in the vi mode (in particular the vi edit to respect $EDITOR)
> * support for history as described by POSIX.
> 
> This makes it a usable shell by default, which is why I would like to propose 
> to
> make it the default shell for root starting FreeBSD 14.0-RELEASE (not MFCed)

My one concern is this: what is the impact of these usability improvements to 
sh on its usage in scripts?

I can imagine that there is merit to having a separate shell that is optimised 
for scriptability and script performance and having a different shell for user 
interaction. It seems to me the former was a primary purpose of sh? How much 
“weight” did it gain in becoming more user friendly and how will that impact 
script performance?

I’ve been using FreeBSD with some frequency since 2.2.5 or so, so I am used 
enough to getting csh as root shell to not be able to see the problem that this 
change is trying to solve. Call me biased.

My purpose is just to throw in a different point of view here, I’m not a big sh 
script user myself (I think I wrote less than a dozen over the years), this is 
not something for me to judge.

Alban Hertroys
--
There is always an exception to always.







Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Marek Zarychta
W dniu 22.09.2021 o 19:46, Warner Losh pisze:
> On Wed, Sep 22, 2021 at 9:35 AM John Baldwin  wrote:
> 
>> On 9/22/21 1:36 AM, Baptiste Daroussin wrote:
>>> Hello,
>>>
>>> TL;DR: this is not a proposal to deorbit csh from base!!!
>>>
>>> For years now, csh is the default root shell for FreeBSD, csh can be
>> confusing
>>> as a default shell for many as all other unix like settled on a bourne
>> shell
>>> compatible interactive shell: zsh, bash, or variant of ksh.
>>>
>>> Recently our sh(1) has receive update to make it more user friendly in
>>> interactive mode:
>>> * command completion (thanks pstef@)
>>> * improvement in the emacs mode, to make it behave by default like other
>> shells
>>> * improvement in the vi mode (in particular the vi edit to respect
>> $EDITOR)
>>> * support for history as described by POSIX.
>>>
>>> This makes it a usable shell by default, which is why I would like to
>> propose to
>>> make it the default shell for root starting FreeBSD 14.0-RELEASE (not
>> MFCed)
>>>
>>> If no strong arguments has been raised until October 15th, I will make
>> this
>>> proposal happen.
>>>
>>> Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!
>>
>> I think this is fine.  I would also be fine with either removing 'toor'
>> from the
>> default password file or just leaving it as-is for POLA.  (I would probably
>> prefer removing it outright.)
>>
> 
> I think this is also fine. I also think we should remove toor from the
> default
> password file for one fewer attack surfaces. I strongly prefer this. Users
> that want toor can add it to their system and/or provisioning scripts.
> 
> Warner
> 

I am curious which attacks you are referring to since I have never heard
of attacks on toor account. I have seen a lot of malware attacking root,
admin, nobody, and other accounts, but never toor.

TBH toor might be handy as a backdoor account if you are familiar with
FreeBSD enough to take advantage of it. It can also act as an account of
last resort when someone breaks into your system and changes root
password, wipes ssh keys etc, so it cuts both ways, not even mentioning
 POLA.

The transition from csh to sh as a default root's shell will probably
save some CPU cycles for people using Chef, Ansible, etc thus pushing
FreeBSD toward green computing. Sysadmins bound to csh will be fine
until it remains in the base system and chsh works.

I shouldn't probably post here since I am only a voice from the userbase
but can't help doing so.

Kind regards,
-- 
Marek Zarychta



OpenPGP_signature
Description: OpenPGP digital signature


Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Tom Jones
On Wed, Sep 22, 2021 at 08:34:58AM -0700, John Baldwin wrote:
> On 9/22/21 1:36 AM, Baptiste Daroussin wrote:
> > Hello,
> > 
> > TL;DR: this is not a proposal to deorbit csh from base!!!
> > 
> > For years now, csh is the default root shell for FreeBSD, csh can be 
> > confusing
> > as a default shell for many as all other unix like settled on a bourne shell
> > compatible interactive shell: zsh, bash, or variant of ksh.
> > 
> > Recently our sh(1) has receive update to make it more user friendly in
> > interactive mode:
> > * command completion (thanks pstef@)
> > * improvement in the emacs mode, to make it behave by default like other 
> > shells
> > * improvement in the vi mode (in particular the vi edit to respect $EDITOR)
> > * support for history as described by POSIX.
> > 
> > This makes it a usable shell by default, which is why I would like to 
> > propose to
> > make it the default shell for root starting FreeBSD 14.0-RELEASE (not MFCed)
> > 
> > If no strong arguments has been raised until October 15th, I will make this
> > proposal happen.
> > 
> > Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!
> 
> I think this is fine.  I would also be fine with either removing 'toor' from 
> the
> default password file or just leaving it as-is for POLA.  (I would probably
> prefer removing it outright.)

I support both of these suggestions, when I first installed FreeBSD
~2006 toor already felt like a strange an anachronism.

- Tom



WITH_LLVM_BINUTILS: objcopy: error: invalid output format: 'efi-app-x86_64' *** [boot1.efi]

2021-09-22 Thread FreeBSD User
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Hello list,

Trying to "crosscompile" a 13-STABLE appliance on 14-CURRENT ( FreeBSD 
14.0-CURRENT #8
main-n249550-8db1669959ce: Wed Sep 22 05:39:53 CEST 2021 amd64) with

WITH_LLVM_BINUTILS=YES

set in /etc/src.conf (and a complete fresh rebuild of the whole OS afterwards) 
results in some
serious fallout lately.

Compiling a recent, just updated this minute, 13-STABLE source, I face this 
error now and
relate this to the llvm-binutils: 

[...]
- --- boot1.efi ---
if nm boot1.sym | grep ' U '; then  echo "Undefined symbols in boot1.sym";  
exit 1;  fi
SOURCE_DATE_EPOCH=1451606400  objcopy -j .peheader -j .text -j .sdata -j .data  
-j .dynamic -j
.dynsym -j .rel.dyn  -j .rela.dyn -j .reloc -j .eh_frame  
--output-target=efi-app-x86_64
boot1.sym boot1.efi 
objcopy: error: invalid output format: 'efi-app-x86_64' *** [boot1.efi]
Error code 1

I guess this is fallout from the binutils migration and compiling 13-STABLE on 
14-CURRENT host
is a special case. Can this be fixed easily or is the migration process to 
immature at this
point?

Kind regards,

Oliver Hartmann 



- -- 
O. Hartmann

Ich widerspreche der Nutzung oder Übermittlung meiner Daten für
Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 BDSG).
-BEGIN PGP SIGNATURE-

iHUEARYKAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCYUtsZgAKCRA4N1ZZPba5
R9JSAQDozG5xwFhGxPTbhOPCJ731/GrxdI0lfjERziGMbXbg7QEApvkWChAKg9NM
Ztgos3LH/+1Q9/gQ9CTYQbebxgcRgQM=
=8J4u
-END PGP SIGNATURE-


-- 
O. Hartmann



Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Gary Jennejohn
On Wed, 22 Sep 2021 08:52:53 -0700 (PDT)
"Rodney W. Grimes"  wrote:

> > On Wed, Sep 22, 2021 at 08:34:58AM -0700, John Baldwin wrote:  
> > > On 9/22/21 1:36 AM, Baptiste Daroussin wrote:  
> > > > Hello,
> > > > 
> > > > TL;DR: this is not a proposal to deorbit csh from base!!!
> > > > 
> > > > For years now, csh is the default root shell for FreeBSD, csh can be 
> > > > confusing
> > > > as a default shell for many as all other unix like settled on a bourne 
> > > > shell
> > > > compatible interactive shell: zsh, bash, or variant of ksh.
> > > > 
> > > > Recently our sh(1) has receive update to make it more user friendly in
> > > > interactive mode:
> > > > * command completion (thanks pstef@)
> > > > * improvement in the emacs mode, to make it behave by default like 
> > > > other shells
> > > > * improvement in the vi mode (in particular the vi edit to respect 
> > > > $EDITOR)
> > > > * support for history as described by POSIX.
> > > > 
> > > > This makes it a usable shell by default, which is why I would like to 
> > > > propose to
> > > > make it the default shell for root starting FreeBSD 14.0-RELEASE (not 
> > > > MFCed)
> > > > 
> > > > If no strong arguments has been raised until October 15th, I will make 
> > > > this
> > > > proposal happen.
> > > > 
> > > > Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!  
> > > 
> > > I think this is fine.  I would also be fine with either removing 'toor' 
> > > from the
> > > default password file or just leaving it as-is for POLA.  (I would 
> > > probably
> > > prefer removing it outright.)  
> > 
> > HardenedBSD recently removed toor. No one has complained (yet?). A
> > small Twitter poll[0] showed that 85% of people who responded do not
> > use toor.  
> 
> A truely disastisified customer does not complain, they simply
> go some place else for there products.  Be carefull in what you
> believe silence to be saying.
> 

I use toor on every FreeBSD machine as the root login using bash.
I never log in as root.

But removing it wouldn't be a deal breaker for me.  I'd just put it
back into /etc/passwd.

> > 
> > [0]: https://twitter.com/HardenedBSD/status/1415781911063056389
> > 
> > Thanks,
> > 
> > -- 
> > Shawn Webb
> > Cofounder / Security Engineer
> > HardenedBSD
> > 
> > https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc
> >   
> 
> -- 
> Rod Grimes rgri...@freebsd.org
> 


-- 
Gary Jennejohn



Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Warner Losh
On Wed, Sep 22, 2021 at 9:35 AM John Baldwin  wrote:

> On 9/22/21 1:36 AM, Baptiste Daroussin wrote:
> > Hello,
> >
> > TL;DR: this is not a proposal to deorbit csh from base!!!
> >
> > For years now, csh is the default root shell for FreeBSD, csh can be
> confusing
> > as a default shell for many as all other unix like settled on a bourne
> shell
> > compatible interactive shell: zsh, bash, or variant of ksh.
> >
> > Recently our sh(1) has receive update to make it more user friendly in
> > interactive mode:
> > * command completion (thanks pstef@)
> > * improvement in the emacs mode, to make it behave by default like other
> shells
> > * improvement in the vi mode (in particular the vi edit to respect
> $EDITOR)
> > * support for history as described by POSIX.
> >
> > This makes it a usable shell by default, which is why I would like to
> propose to
> > make it the default shell for root starting FreeBSD 14.0-RELEASE (not
> MFCed)
> >
> > If no strong arguments has been raised until October 15th, I will make
> this
> > proposal happen.
> >
> > Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!
>
> I think this is fine.  I would also be fine with either removing 'toor'
> from the
> default password file or just leaving it as-is for POLA.  (I would probably
> prefer removing it outright.)
>

I think this is also fine. I also think we should remove toor from the
default
password file for one fewer attack surfaces. I strongly prefer this. Users
that want toor can add it to their system and/or provisioning scripts.

Warner


Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Rodney W. Grimes
> On Wed, Sep 22, 2021 at 08:34:58AM -0700, John Baldwin wrote:
> > On 9/22/21 1:36 AM, Baptiste Daroussin wrote:
> > > Hello,
> > > 
> > > TL;DR: this is not a proposal to deorbit csh from base!!!
> > > 
> > > For years now, csh is the default root shell for FreeBSD, csh can be 
> > > confusing
> > > as a default shell for many as all other unix like settled on a bourne 
> > > shell
> > > compatible interactive shell: zsh, bash, or variant of ksh.
> > > 
> > > Recently our sh(1) has receive update to make it more user friendly in
> > > interactive mode:
> > > * command completion (thanks pstef@)
> > > * improvement in the emacs mode, to make it behave by default like other 
> > > shells
> > > * improvement in the vi mode (in particular the vi edit to respect 
> > > $EDITOR)
> > > * support for history as described by POSIX.
> > > 
> > > This makes it a usable shell by default, which is why I would like to 
> > > propose to
> > > make it the default shell for root starting FreeBSD 14.0-RELEASE (not 
> > > MFCed)
> > > 
> > > If no strong arguments has been raised until October 15th, I will make 
> > > this
> > > proposal happen.
> > > 
> > > Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!
> > 
> > I think this is fine.  I would also be fine with either removing 'toor' 
> > from the
> > default password file or just leaving it as-is for POLA.  (I would probably
> > prefer removing it outright.)
> 
> HardenedBSD recently removed toor. No one has complained (yet?). A
> small Twitter poll[0] showed that 85% of people who responded do not
> use toor.

A truely disastisified customer does not complain, they simply
go some place else for there products.  Be carefull in what you
believe silence to be saying.

> 
> [0]: https://twitter.com/HardenedBSD/status/1415781911063056389
> 
> Thanks,
> 
> -- 
> Shawn Webb
> Cofounder / Security Engineer
> HardenedBSD
> 
> https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc

-- 
Rod Grimes rgri...@freebsd.org



Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Shawn Webb
On Wed, Sep 22, 2021 at 08:34:58AM -0700, John Baldwin wrote:
> On 9/22/21 1:36 AM, Baptiste Daroussin wrote:
> > Hello,
> > 
> > TL;DR: this is not a proposal to deorbit csh from base!!!
> > 
> > For years now, csh is the default root shell for FreeBSD, csh can be 
> > confusing
> > as a default shell for many as all other unix like settled on a bourne shell
> > compatible interactive shell: zsh, bash, or variant of ksh.
> > 
> > Recently our sh(1) has receive update to make it more user friendly in
> > interactive mode:
> > * command completion (thanks pstef@)
> > * improvement in the emacs mode, to make it behave by default like other 
> > shells
> > * improvement in the vi mode (in particular the vi edit to respect $EDITOR)
> > * support for history as described by POSIX.
> > 
> > This makes it a usable shell by default, which is why I would like to 
> > propose to
> > make it the default shell for root starting FreeBSD 14.0-RELEASE (not MFCed)
> > 
> > If no strong arguments has been raised until October 15th, I will make this
> > proposal happen.
> > 
> > Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!
> 
> I think this is fine.  I would also be fine with either removing 'toor' from 
> the
> default password file or just leaving it as-is for POLA.  (I would probably
> prefer removing it outright.)

HardenedBSD recently removed toor. No one has complained (yet?). A
small Twitter poll[0] showed that 85% of people who responded do not
use toor.

[0]: https://twitter.com/HardenedBSD/status/1415781911063056389

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc


signature.asc
Description: PGP signature


Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread John Baldwin

On 9/22/21 1:36 AM, Baptiste Daroussin wrote:

Hello,

TL;DR: this is not a proposal to deorbit csh from base!!!

For years now, csh is the default root shell for FreeBSD, csh can be confusing
as a default shell for many as all other unix like settled on a bourne shell
compatible interactive shell: zsh, bash, or variant of ksh.

Recently our sh(1) has receive update to make it more user friendly in
interactive mode:
* command completion (thanks pstef@)
* improvement in the emacs mode, to make it behave by default like other shells
* improvement in the vi mode (in particular the vi edit to respect $EDITOR)
* support for history as described by POSIX.

This makes it a usable shell by default, which is why I would like to propose to
make it the default shell for root starting FreeBSD 14.0-RELEASE (not MFCed)

If no strong arguments has been raised until October 15th, I will make this
proposal happen.

Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!


I think this is fine.  I would also be fine with either removing 'toor' from the
default password file or just leaving it as-is for POLA.  (I would probably
prefer removing it outright.)

--
John Baldwin



Re: latest current fails to boot.

2021-09-22 Thread Johan Hendriks



On 22/09/2021 16:09, Tomoaki AOKI wrote:

On Wed, 22 Sep 2021 05:47:46 -0700
David Wolfskill  wrote:


On Wed, Sep 22, 2021 at 02:39:37PM +0200, Johan Hendriks wrote:

I did a git pull this morning and it fails to boot.
I hangs at Setting hostid : 0x917bf354

This is a vm running on vmware.
If i boot the old kernel from yesterday it boots normally.

uname -a
FreeBSD varnish-cdn-node03 14.0-CURRENT FreeBSD 14.0-CURRENT #0
main-n249518-5572fda3a2f: Tue Sep 21 14:40:22 CEST 2021
root@varnish-cdn-node03:/usr/obj/usr/src/amd64.amd64/sys/KRNL amd64


I had no issues with my build machine or either of two laptops, either
from yesterday:

FreeBSD g1-55.catwhisker.org 14.0-CURRENT FreeBSD 14.0-CURRENT #358 
main-n249518-5572fda3a2f3: Tue Sep 21 05:15:22 PDT 2021 
r...@g1-55.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/CANARY  amd64 
1400033 1400033

or today:

FreeBSD g1-55.catwhisker.org 14.0-CURRENT FreeBSD 14.0-CURRENT #359 
main-n249556-c96da1994587: Wed Sep 22 04:24:17 PDT 2021 
r...@g1-55.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/CANARY  amd64 
1400033 1400033

[uname strings from my main laptop shown, but I keep the machines
in sync rather aggressively.]

Perhaps the issue you are encountering involves things not in my
environment (such as VMs or ZFS)?

Peace,
david
--
David H. Wolfskill  da...@catwhisker.org
Life is not intended to be a zero-sum game.

See https://www.catwhisker.org/~david/publickey.gpg for my public key.

For me, on bare metal (non-vm) amd64 with root-on-ZFS,

   Fails to boot to multiuser at git: 8db1669959ce
   Boot fine at git: 0b79a76f8487

Boot to singleuser is fine even with failed revision.

Failure mode:
  Hard hangup or spinning and non-operable. Hard power-off needed.
  Seems to happen after starting rc.conf processing and before setting
  hostid.


For me a boot in single user works also.



Re: latest current fails to boot.

2021-09-22 Thread Tomoaki AOKI
On Wed, 22 Sep 2021 05:47:46 -0700
David Wolfskill  wrote:

> On Wed, Sep 22, 2021 at 02:39:37PM +0200, Johan Hendriks wrote:
> > I did a git pull this morning and it fails to boot.
> > I hangs at Setting hostid : 0x917bf354
> > 
> > This is a vm running on vmware.
> > If i boot the old kernel from yesterday it boots normally.
> > 
> > uname -a
> > FreeBSD varnish-cdn-node03 14.0-CURRENT FreeBSD 14.0-CURRENT #0 
> > main-n249518-5572fda3a2f: Tue Sep 21 14:40:22 CEST 2021 
> > root@varnish-cdn-node03:/usr/obj/usr/src/amd64.amd64/sys/KRNL amd64
> > 
> 
> I had no issues with my build machine or either of two laptops, either
> from yesterday:
> 
> FreeBSD g1-55.catwhisker.org 14.0-CURRENT FreeBSD 14.0-CURRENT #358 
> main-n249518-5572fda3a2f3: Tue Sep 21 05:15:22 PDT 2021 
> r...@g1-55.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/CANARY  
> amd64 1400033 1400033
> 
> or today:
> 
> FreeBSD g1-55.catwhisker.org 14.0-CURRENT FreeBSD 14.0-CURRENT #359 
> main-n249556-c96da1994587: Wed Sep 22 04:24:17 PDT 2021 
> r...@g1-55.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/CANARY  
> amd64 1400033 1400033
> 
> [uname strings from my main laptop shown, but I keep the machines
> in sync rather aggressively.]
> 
> Perhaps the issue you are encountering involves things not in my
> environment (such as VMs or ZFS)?
> 
> Peace,
> david
> -- 
> David H. Wolfskill  da...@catwhisker.org
> Life is not intended to be a zero-sum game.
> 
> See https://www.catwhisker.org/~david/publickey.gpg for my public key.

For me, on bare metal (non-vm) amd64 with root-on-ZFS,

  Fails to boot to multiuser at git: 8db1669959ce
  Boot fine at git: 0b79a76f8487

Boot to singleuser is fine even with failed revision.

Failure mode:
 Hard hangup or spinning and non-operable. Hard power-off needed.
 Seems to happen after starting rc.conf processing and before setting
 hostid.

-- 
Tomoaki AOKI



Re: Using modern APIs in Rust on FreeBSD

2021-09-22 Thread Konstantin Belousov
On Wed, Sep 22, 2021 at 06:27:09AM +0200, Damjan Jovanovic wrote:
> On Wed, Sep 22, 2021 at 6:08 AM Alan Somers  wrote:
> 
> > tldr; should the Rust ecosystem ditch FreeBSD 10 compat for new code?
> >
> > Rust uses FFI to talk to the OS's C library.  That makes cross-compiling a
> > breeze.  Unfortunately, it also fossilizes the ABI.  FreeBSD's libc makes
> > careful use of ELF symbol versioning.  That's how we were able to change
> > ino_t to 64-bits while maintaining backwards-compatibility with old
> > binaries, for example.  But the Rust toolchain isn't able to take
> > advantage.  Right now, the toolchain uses a FreeBSD 10 ABI, and the libc
> > crate (which virtually all crates depend on) uses a FreeBSD 11 ABI.
> >
> 
> How exactly is the ABI fossilized? If Rust's FFI uses run-time dynamic
> linking, it should be able to use dlvsym() to access the correct version of
> libc symbols.

No, FFI does not use dynamic linking in dynamic sense, i.e. it does not
utilize dlopen/dlsym.  Rust directly calls into extern "C" functions, and
this is quite useful feature, because using dlsym for everything you need
from system libraries is beyond the pain point.

Rust can link to specific version of the symbol, and libc uses this feature,
like this:
#[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = 
"statfs@FBSD_1.0")]
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
There it requests pre-ino64 statfs().

More, libc already has configurations for freebsd11 and later, as can be
seen from the citation above. And I see nothing that would prevent libc
from defining freebsd11 and freebsd12 variants of struct stat, struct
statfs, struct dirent, and so on.

That said, I definitely do not want spend (more) time on this. Due to
the way libc is structured, to make an impression that definitions are
shared between different *BSDs, it is extremely painful to add new
bindings and not break other BSDs. I tried something as simple as adding
missing MNT_XXX constants for mnt_flags and gave up after full day when
I realized that I have to test on Net/Open/DragonflyBSD as well.



Re: latest current fails to boot.

2021-09-22 Thread Konstantin Belousov
On Wed, Sep 22, 2021 at 02:39:37PM +0200, Johan Hendriks wrote:
> I did a git pull this morning and it fails to boot.
> I hangs at Setting hostid : 0x917bf354
> 
> This is a vm running on vmware.
> If i boot the old kernel from yesterday it boots normally.
> 
> uname -a
> FreeBSD varnish-cdn-node03 14.0-CURRENT FreeBSD 14.0-CURRENT #0
> main-n249518-5572fda3a2f: Tue Sep 21 14:40:22 CEST 2021
> root@varnish-cdn-node03:/usr/obj/usr/src/amd64.amd64/sys/KRNL amd64

You did not provided any useful information.

What is displayed on console if you press ^T ?
What processes are running, what do they wait for?



Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Renato Botelho

+1 for keeping this behavior on default config

On 22/09/21 06:19, Daniel Morante via freebsd-current wrote:
Will history/completion continue to work the same way? (for example 
typing part of the command, pressing UP and having it complete based on 
history)


On 9/22/2021 4:36 AM, Baptiste Daroussin wrote:

Hello,

TL;DR: this is not a proposal to deorbit csh from base!!!

For years now, csh is the default root shell for FreeBSD, csh can be 
confusing
as a default shell for many as all other unix like settled on a bourne 
shell

compatible interactive shell: zsh, bash, or variant of ksh.

Recently our sh(1) has receive update to make it more user friendly in
interactive mode:
* command completion (thanks pstef@)
* improvement in the emacs mode, to make it behave by default like 
other shells
* improvement in the vi mode (in particular the vi edit to respect 
$EDITOR)

* support for history as described by POSIX.

This makes it a usable shell by default, which is why I would like to 
propose to
make it the default shell for root starting FreeBSD 14.0-RELEASE (not 
MFCed)


If no strong arguments has been raised until October 15th, I will make 
this

proposal happen.

Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!

Best regards,
Baptiste






--
Renato Botelho



Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Piotr P. Stefaniak

On 2021-09-22 10:36:45, Baptiste Daroussin wrote:


Recently our sh(1) has receive update to make it more user friendly in
interactive mode:
* command completion (thanks pstef@)
* improvement in the emacs mode, to make it behave by default like other shells
* improvement in the vi mode (in particular the vi edit to respect $EDITOR)
* support for history as described by POSIX.


There are also prompt-related commits done by trasz:
r342577 Make sh(1) collapse $HOME into "~" in PS1
r342576 Simplify the way we set the default sh(1) PS1
r342645 Add current working directory to the default sh prompt
r342812 Give sh(1) a proper default prompt instead of just "$".
r342881 Make sh(1) recognize the default $HOME
r343231 Don't mess with BLOCKSIZE in shell startup files
r343399 Make sh(1) support \u in PS1
r343416 Install .shrc for root, and set PS1 for the toor account.

and this commit by me:
r363621 sh(1): print a newline when ^D quits sh

What I would like to see by default are these ctrl-arrow bindings in
emacs mode and an alias for "history":
bind "\\e[1;5C" em-next-word
bind "\\e[1;5D" ed-prev-word
alias history='fc -l'

Piotr



Re: latest current fails to boot.

2021-09-22 Thread David Wolfskill
On Wed, Sep 22, 2021 at 02:39:37PM +0200, Johan Hendriks wrote:
> I did a git pull this morning and it fails to boot.
> I hangs at Setting hostid : 0x917bf354
> 
> This is a vm running on vmware.
> If i boot the old kernel from yesterday it boots normally.
> 
> uname -a
> FreeBSD varnish-cdn-node03 14.0-CURRENT FreeBSD 14.0-CURRENT #0 
> main-n249518-5572fda3a2f: Tue Sep 21 14:40:22 CEST 2021 
> root@varnish-cdn-node03:/usr/obj/usr/src/amd64.amd64/sys/KRNL amd64
> 

I had no issues with my build machine or either of two laptops, either
from yesterday:

FreeBSD g1-55.catwhisker.org 14.0-CURRENT FreeBSD 14.0-CURRENT #358 
main-n249518-5572fda3a2f3: Tue Sep 21 05:15:22 PDT 2021 
r...@g1-55.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/CANARY  amd64 
1400033 1400033

or today:

FreeBSD g1-55.catwhisker.org 14.0-CURRENT FreeBSD 14.0-CURRENT #359 
main-n249556-c96da1994587: Wed Sep 22 04:24:17 PDT 2021 
r...@g1-55.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/CANARY  amd64 
1400033 1400033

[uname strings from my main laptop shown, but I keep the machines
in sync rather aggressively.]

Perhaps the issue you are encountering involves things not in my
environment (such as VMs or ZFS)?

Peace,
david
-- 
David H. Wolfskill  da...@catwhisker.org
Life is not intended to be a zero-sum game.

See https://www.catwhisker.org/~david/publickey.gpg for my public key.


signature.asc
Description: PGP signature


latest current fails to boot.

2021-09-22 Thread Johan Hendriks

I did a git pull this morning and it fails to boot.
I hangs at Setting hostid : 0x917bf354

This is a vm running on vmware.
If i boot the old kernel from yesterday it boots normally.

uname -a
FreeBSD varnish-cdn-node03 14.0-CURRENT FreeBSD 14.0-CURRENT #0 
main-n249518-5572fda3a2f: Tue Sep 21 14:40:22 CEST 2021 
root@varnish-cdn-node03:/usr/obj/usr/src/amd64.amd64/sys/KRNL amd64






Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Mariusz Zaborski
+1 from me.

On Wed, 22 Sept 2021 at 12:31, Chris Stephan  wrote:

> I completely agree. It will save me the ‘/bin/sh’ at the beginning of each
> ‘su -‘ session. Also, it will simplify building extra small FreeBSD images,
> allowing an easier removal of ‘csh’.
>
> I use csh from time to time, but I do wish it would take a much more
> explicit action so my brain has switched over to ‘csh mode’. I won’t lie
> that I’ve pasted script into my terminal and spent time troubleshooting why
> the commands didn’t work only to realize I forgot to change to /bin/sh
> first.
>
> Chris Stephan
>
> Sent from FreeBSD
> 
> From: owner-freebsd-curr...@freebsd.org 
> on behalf of Baptiste Daroussin 
> Sent: Wednesday, September 22, 2021 3:36:45 AM
> To: curr...@freebsd.org ; a...@freebsd.org
> 
> Subject: [HEADSUP] making /bin/sh the default shell for root
>
> Hello,
>
> TL;DR: this is not a proposal to deorbit csh from base!!!
>
> For years now, csh is the default root shell for FreeBSD, csh can be
> confusing
> as a default shell for many as all other unix like settled on a bourne
> shell
> compatible interactive shell: zsh, bash, or variant of ksh.
>
> Recently our sh(1) has receive update to make it more user friendly in
> interactive mode:
> * command completion (thanks pstef@)
> * improvement in the emacs mode, to make it behave by default like other
> shells
> * improvement in the vi mode (in particular the vi edit to respect $EDITOR)
> * support for history as described by POSIX.
>
> This makes it a usable shell by default, which is why I would like to
> propose to
> make it the default shell for root starting FreeBSD 14.0-RELEASE (not
> MFCed)
>
> If no strong arguments has been raised until October 15th, I will make this
> proposal happen.
>
> Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!
>
> Best regards,
> Baptiste
>
>


Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Chris Stephan
I completely agree. It will save me the ‘/bin/sh’ at the beginning of each ‘su 
-‘ session. Also, it will simplify building extra small FreeBSD images, 
allowing an easier removal of ‘csh’.

I use csh from time to time, but I do wish it would take a much more explicit 
action so my brain has switched over to ‘csh mode’. I won’t lie that I’ve 
pasted script into my terminal and spent time troubleshooting why the commands 
didn’t work only to realize I forgot to change to /bin/sh first.

Chris Stephan

Sent from FreeBSD

From: owner-freebsd-curr...@freebsd.org  on 
behalf of Baptiste Daroussin 
Sent: Wednesday, September 22, 2021 3:36:45 AM
To: curr...@freebsd.org ; a...@freebsd.org 

Subject: [HEADSUP] making /bin/sh the default shell for root

Hello,

TL;DR: this is not a proposal to deorbit csh from base!!!

For years now, csh is the default root shell for FreeBSD, csh can be confusing
as a default shell for many as all other unix like settled on a bourne shell
compatible interactive shell: zsh, bash, or variant of ksh.

Recently our sh(1) has receive update to make it more user friendly in
interactive mode:
* command completion (thanks pstef@)
* improvement in the emacs mode, to make it behave by default like other shells
* improvement in the vi mode (in particular the vi edit to respect $EDITOR)
* support for history as described by POSIX.

This makes it a usable shell by default, which is why I would like to propose to
make it the default shell for root starting FreeBSD 14.0-RELEASE (not MFCed)

If no strong arguments has been raised until October 15th, I will make this
proposal happen.

Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!

Best regards,
Baptiste



Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Marek Zarychta
W dniu 22.09.2021 o 10:36, Baptiste Daroussin pisze:
> Hello,
> 
> TL;DR: this is not a proposal to deorbit csh from base!!!
> 
> For years now, csh is the default root shell for FreeBSD, csh can be confusing
> as a default shell for many as all other unix like settled on a bourne shell
> compatible interactive shell: zsh, bash, or variant of ksh.
> 
> Recently our sh(1) has receive update to make it more user friendly in
> interactive mode:
> * command completion (thanks pstef@)
> * improvement in the emacs mode, to make it behave by default like other 
> shells
> * improvement in the vi mode (in particular the vi edit to respect $EDITOR)
> * support for history as described by POSIX.
> 
> This makes it a usable shell by default, which is why I would like to propose 
> to
> make it the default shell for root starting FreeBSD 14.0-RELEASE (not MFCed)
> 
> If no strong arguments has been raised until October 15th, I will make this
> proposal happen.
> 
> Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!
> 
> Best regards,
> Baptiste
>

Is /bin/csh going to become default toor's default shell since then?

-- 
Marek Zarychta



OpenPGP_signature
Description: OpenPGP digital signature


Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Baptiste Daroussin
On Wed, Sep 22, 2021 at 05:19:38AM -0400, Daniel Morante via freebsd-current 
wrote:
> Will history/completion continue to work the same way? (for example typing
> part of the command, pressing UP and having it complete based on history)

No, this is a csh specific behaviour. (not it can probably be doable via
.shrc, but I haven't checked)

Best regards,
Bapt
> 
> On 9/22/2021 4:36 AM, Baptiste Daroussin wrote:
> > Hello,
> > 
> > TL;DR: this is not a proposal to deorbit csh from base!!!
> > 
> > For years now, csh is the default root shell for FreeBSD, csh can be 
> > confusing
> > as a default shell for many as all other unix like settled on a bourne shell
> > compatible interactive shell: zsh, bash, or variant of ksh.
> > 
> > Recently our sh(1) has receive update to make it more user friendly in
> > interactive mode:
> > * command completion (thanks pstef@)
> > * improvement in the emacs mode, to make it behave by default like other 
> > shells
> > * improvement in the vi mode (in particular the vi edit to respect $EDITOR)
> > * support for history as described by POSIX.
> > 
> > This makes it a usable shell by default, which is why I would like to 
> > propose to
> > make it the default shell for root starting FreeBSD 14.0-RELEASE (not MFCed)
> > 
> > If no strong arguments has been raised until October 15th, I will make this
> > proposal happen.
> > 
> > Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!
> > 
> > Best regards,
> > Baptiste
> > 
> 





Re: [HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Daniel Morante via freebsd-current
Will history/completion continue to work the same way? (for example 
typing part of the command, pressing UP and having it complete based on 
history)


On 9/22/2021 4:36 AM, Baptiste Daroussin wrote:

Hello,

TL;DR: this is not a proposal to deorbit csh from base!!!

For years now, csh is the default root shell for FreeBSD, csh can be confusing
as a default shell for many as all other unix like settled on a bourne shell
compatible interactive shell: zsh, bash, or variant of ksh.

Recently our sh(1) has receive update to make it more user friendly in
interactive mode:
* command completion (thanks pstef@)
* improvement in the emacs mode, to make it behave by default like other shells
* improvement in the vi mode (in particular the vi edit to respect $EDITOR)
* support for history as described by POSIX.

This makes it a usable shell by default, which is why I would like to propose to
make it the default shell for root starting FreeBSD 14.0-RELEASE (not MFCed)

If no strong arguments has been raised until October 15th, I will make this
proposal happen.

Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!

Best regards,
Baptiste





smime.p7s
Description: S/MIME Cryptographic Signature


[HEADSUP] making /bin/sh the default shell for root

2021-09-22 Thread Baptiste Daroussin
Hello,

TL;DR: this is not a proposal to deorbit csh from base!!!

For years now, csh is the default root shell for FreeBSD, csh can be confusing
as a default shell for many as all other unix like settled on a bourne shell
compatible interactive shell: zsh, bash, or variant of ksh.

Recently our sh(1) has receive update to make it more user friendly in
interactive mode:
* command completion (thanks pstef@)
* improvement in the emacs mode, to make it behave by default like other shells
* improvement in the vi mode (in particular the vi edit to respect $EDITOR)
* support for history as described by POSIX.

This makes it a usable shell by default, which is why I would like to propose to
make it the default shell for root starting FreeBSD 14.0-RELEASE (not MFCed)

If no strong arguments has been raised until October 15th, I will make this
proposal happen.

Again just in case: THIS IS NOT A PROPOSAL TO REMOVE CSH FROM BASE!

Best regards,
Baptiste