svn commit: r338465 - in head: share/misc usr.bin/calendar/calendars

2018-09-04 Thread Kevin Bowling
Author: kbowling (ports committer)
Date: Wed Sep  5 01:46:27 2018
New Revision: 338465
URL: https://svnweb.freebsd.org/changeset/base/338465

Log:
  Add kbowling to ports committer list and calendar
  
  Approved by:  re (rgrimes), timur (mentor), krion (mentor)
  Differential Revision:https://reviews.freebsd.org/D17021

Modified:
  head/share/misc/committers-ports.dot
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotWed Sep  5 01:33:30 2018
(r338464)
+++ head/share/misc/committers-ports.dotWed Sep  5 01:46:27 2018
(r338465)
@@ -149,6 +149,7 @@ jsm [label="Jesper Schmitz Mouridsen\n...@freebsd.org\
 junovitch [label="Jason Unovitch\njunovi...@freebsd.org\n2015/07/27"]
 jylefort [label="Jean-Yves Lefort\njylef...@freebsd.org\n2005/04/12"]
 kami [label="Dominic Fandrey\nk...@freebsd.org\n2014/09/09"]
+kbowling [label="Kevin Bowling\nkbowl...@freebsd.org\n2018/09/02"]
 kevlo [label="Kevin Lo\nke...@freebsd.org\n2003/02/21"]
 kmoore [label="Kris Moore\nkmo...@freebsd.org\n2009/04/14"]
 knu [label="Akinori Musha\n...@freebsd.org\n2000/03/22"]
@@ -487,6 +488,7 @@ koobs -> xmj
 
 krion -> "0mp"
 krion -> brooks
+krion -> kbowling
 krion -> miwi
 krion -> novel
 krion -> philip
@@ -703,6 +705,8 @@ tcberner -> arrowd
 
 thierry -> jadawin
 thierry -> riggs
+
+timur -> kbowling
 
 tmclaugh -> itetcu
 tmclaugh -> xride

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdWed Sep  5 01:33:30 
2018(r338464)
+++ head/usr.bin/calendar/calendars/calendar.freebsdWed Sep  5 01:46:27 
2018(r338465)
@@ -87,6 +87,7 @@
 02/23  Mathieu Arnold  born in Champigny sur Marne, Val de 
Marne, France, 1978
 02/24  Johan Karlsson  born in Mariannelund, Sweden, 1974
 02/24  Colin Percival  born in Burnaby, Canada, 1981
+02/24  Kevin Bowling  born in Scottsdale, Arizona, 
United States, 1989
 02/26  Pietro Cerutti  born in Faido, Switzerland, 1984
 02/28  Daichi GOTO  born in Shimizu Suntou, Shizuoka, 
Japan, 1980
 02/28  Ruslan Makhmatkhanov  born in Rostov-on-Don, USSR, 
1984
___
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: r338460 - head/sys/amd64/amd64

2018-09-04 Thread Konstantin Belousov
Author: kib
Date: Tue Sep  4 19:27:53 2018
New Revision: 338460
URL: https://svnweb.freebsd.org/changeset/base/338460

Log:
  amd64: Properly re-merge r334537 into SMAP-ified copyin(9) and copyout(9).
  
  Also this fixes the eflags.ac leak from copyin_smap() when the copied
  data length is multiple of eight bytes.
  
  Sponsored by: The FreeBSD Foundation
  Approved by:  re (gjb)

Modified:
  head/sys/amd64/amd64/support.S

Modified: head/sys/amd64/amd64/support.S
==
--- head/sys/amd64/amd64/support.S  Tue Sep  4 19:26:54 2018
(r338459)
+++ head/sys/amd64/amd64/support.S  Tue Sep  4 19:27:53 2018
(r338460)
@@ -312,9 +312,10 @@ ENTRY(copyout_smap)
movsq
movb%dl,%cl
andb$7,%cl
+   je  1f
rep
movsb
-   clac
+1: clac
 
 done_copyout:
xorl%eax,%eax
@@ -361,6 +362,7 @@ ENTRY(copyin_nosmap)
movsq
movb%al,%cl
andb$7,%cl  /* copy remaining bytes */
+   je  done_copyin
rep
movsb
 
@@ -393,10 +395,10 @@ ENTRY(copyin_smap)
movsq
movb%al,%cl
andb$7,%cl  /* copy remaining bytes */
-   je  done_copyin
+   je  1f
rep
movsb
-   clac
+1: clac
 
 done_copyin:
xorl%eax,%eax
___
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: r338461 - head/sys/dev/efidev

2018-09-04 Thread Konstantin Belousov
Author: kib
Date: Tue Sep  4 19:28:46 2018
New Revision: 338461
URL: https://svnweb.freebsd.org/changeset/base/338461

Log:
  Assign to correct structure members.
  
  Reported by:  cem from Coverity
  Sponsored by: The FreeBSD Foundation
  MFC after:6 days
  Approved by:  re (gjb)

Modified:
  head/sys/dev/efidev/efirt.c

Modified: head/sys/dev/efidev/efirt.c
==
--- head/sys/dev/efidev/efirt.c Tue Sep  4 19:27:53 2018(r338460)
+++ head/sys/dev/efidev/efirt.c Tue Sep  4 19:28:46 2018(r338461)
@@ -421,9 +421,9 @@ efi_reset_system(void)
ec.ec_name = "rt_reset";
ec.ec_argcnt = 4;
ec.ec_arg1 = (uintptr_t)EFI_RESET_WARM;
-   ec.ec_arg1 = (uintptr_t)0;
-   ec.ec_arg1 = (uintptr_t)0;
-   ec.ec_arg1 = (uintptr_t)NULL;
+   ec.ec_arg2 = (uintptr_t)0;
+   ec.ec_arg3 = (uintptr_t)0;
+   ec.ec_arg4 = (uintptr_t)NULL;
ec.ec_fptr = EFI_RT_METHOD_PA(rt_reset);
return (efi_call());
 }
___
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: r338459 - head/sys/amd64/amd64

2018-09-04 Thread Konstantin Belousov
Author: kib
Date: Tue Sep  4 19:26:54 2018
New Revision: 338459
URL: https://svnweb.freebsd.org/changeset/base/338459

Log:
  amd64: For non-PTI mode, do not initialize PCPU kcr3 to KPML4phys.
  
  Non-PTI mode does not switch kcr3, which means that kcr3 is almost
  always stale.  This is important for the NMI handler, which reloads
  %cr3 with PCPU(kcr3) if the value is different from PMAP_NO_CR3.
  
  The end result is that curpmap in NMI handler does not match the page
  table loaded into hardware.  The manifestation was copyin(9) looping
  forever when a usermode access page fault cannot be resolved by
  vm_fault() updating a different page table.
  
  Reported by:  mmacy
  Reviewed by:  markj
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days
  Approved by:  re (gjb)

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Tue Sep  4 19:22:31 2018(r338458)
+++ head/sys/amd64/amd64/pmap.c Tue Sep  4 19:26:54 2018(r338459)
@@ -7582,9 +7582,13 @@ pmap_activate_boot(pmap_t pmap)
CPU_SET(cpuid, >pm_active);
 #endif
PCPU_SET(curpmap, pmap);
-   kcr3 = pmap->pm_cr3;
-   if (pmap_pcid_enabled)
-   kcr3 |= pmap->pm_pcids[cpuid].pm_pcid | CR3_PCID_SAVE;
+   if (pti) {
+   kcr3 = pmap->pm_cr3;
+   if (pmap_pcid_enabled)
+   kcr3 |= pmap->pm_pcids[cpuid].pm_pcid | CR3_PCID_SAVE;
+   } else {
+   kcr3 = PMAP_NO_CR3;
+   }
PCPU_SET(kcr3, kcr3);
PCPU_SET(ucr3, PMAP_NO_CR3);
 }
___
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: r338458 - head/sys/dev/usb/input

2018-09-04 Thread Vladimir Kondratyev
Author: wulf
Date: Tue Sep  4 19:22:31 2018
New Revision: 338458
URL: https://svnweb.freebsd.org/changeset/base/338458

Log:
  wmt(4): Fix regression introduced in r337289
  
  r337289 has a side effect of reducing usb frame 0 buffer size down to
  touch report size. That broke some devices e.g. "Raydium Touch System"
  which are capable of generating non-touch frames of bigger length.
  Fix it with enlarging frame 0 buffer up to internal wmt(4) buffer size.
  
  Reported by:  Roberto Fernandez Cueto 
  Tested by:Roberto Fernandez Cueto 
  Approved by:  re (gjb)
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D16772

Modified:
  head/sys/dev/usb/input/wmt.c

Modified: head/sys/dev/usb/input/wmt.c
==
--- head/sys/dev/usb/input/wmt.cTue Sep  4 19:18:55 2018
(r338457)
+++ head/sys/dev/usb/input/wmt.cTue Sep  4 19:22:31 2018
(r338458)
@@ -521,7 +521,7 @@ tr_ignore:
 
case USB_ST_SETUP:
 tr_setup:
-   usbd_xfer_set_frame_len(xfer, 0, sc->isize);
+   usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
usbd_transfer_submit(xfer);
break;
default:
___
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: r338457 - head/sys/dev/extres/regulator

2018-09-04 Thread Emmanuel Vadot
Author: manu
Date: Tue Sep  4 19:18:55 2018
New Revision: 338457
URL: https://svnweb.freebsd.org/changeset/base/338457

Log:
  regulator: Use bool values instead of 0/1
  
  While here do not attempt to disable regulators if they are meant
  to be always on.
  
  Reviewed by:mmel
  Approved by:re (kib)

Modified:
  head/sys/dev/extres/regulator/regulator.c

Modified: head/sys/dev/extres/regulator/regulator.c
==
--- head/sys/dev/extres/regulator/regulator.c   Tue Sep  4 16:47:08 2018
(r338456)
+++ head/sys/dev/extres/regulator/regulator.c   Tue Sep  4 19:18:55 2018
(r338457)
@@ -172,7 +172,7 @@ regulator_shutdown(void *dummy)
REG_TOPO_SLOCK();
TUNABLE_INT_FETCH("hw.regulator.disable_unused", );
TAILQ_FOREACH(entry, _list, reglist_link) {
-   if (entry->std_param.always_on == 0 && disable) {
+   if (!entry->std_param.always_on && disable) {
if (bootverbose)
printf("regulator: shutting down %s\n",
entry->name);
@@ -595,8 +595,9 @@ regnode_disable(struct regnode *regnode)
 
REGNODE_XLOCK(regnode);
/* Disable regulator for each node in chain, starting from consumer. */
-   if ((regnode->enable_cnt == 1) &&
-   ((regnode->flags & REGULATOR_FLAGS_NOT_DISABLE) == 0)) {
+   if (regnode->enable_cnt == 1 &&
+   (regnode->flags & REGULATOR_FLAGS_NOT_DISABLE) == 0 &&
+   !regnode->std_param.always_on) {
rv = REGNODE_ENABLE(regnode, false, );
if (rv != 0) {
REGNODE_UNLOCK(regnode);
@@ -1048,10 +1049,10 @@ regulator_parse_ofw_stdparam(device_t pdev, phandle_t 
par->enable_delay = 0;
 
if (OF_hasprop(node, "regulator-boot-on"))
-   par->boot_on = 1;
+   par->boot_on = true;
 
if (OF_hasprop(node, "regulator-always-on"))
-   par->always_on = 1;
+   par->always_on = true;
 
if (OF_hasprop(node, "enable-active-high"))
par->enable_active_high = 1;
___
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: r338437 - in head/sys: amd64/amd64 amd64/include arm64/arm64 arm64/include conf dev/efidev modules/efirt sys

2018-09-04 Thread Konstantin Belousov
On Tue, Sep 04, 2018 at 08:48:15AM -0700, Conrad Meyer wrote:
> Hi Konstantin,
> 
> On Sun, Sep 2, 2018 at 2:37 PM, Konstantin Belousov  wrote:
> > Author: kib
> > Date: Sun Sep  2 21:37:05 2018
> > New Revision: 338437
> > URL: https://svnweb.freebsd.org/changeset/base/338437
> >
> > Log:
> >   Catch exceptions during EFI RT calls on amd64.
> >
> >   This appeared to be required to have EFI RT support and EFI RTC
> >   enabled by default, because there are too many reports of faulting
> >   calls on many different machines.  The knob is added to leave the
> >   exceptions unhandled to allow to debug the actual bugs.
> > ...
> >
> > Modified: head/sys/dev/efidev/efirt.c
> > ==
> > --- head/sys/dev/efidev/efirt.c Sun Sep  2 21:16:43 2018(r338436)
> > +++ head/sys/dev/efidev/efirt.c Sun Sep  2 21:37:05 2018(r338437)
> > ...
> > @@ -346,30 +413,35 @@ efi_get_time_capabilities(struct efi_tmcap *tmcap)
> >  int
> >  efi_reset_system(void)
> >  {
> > -   int error;
> > +   struct efirt_callinfo ec;
> >
> > -   error = efi_enter();
> > -   if (error != 0)
> > -   return (error);
> > -   efi_runtime->rt_reset(EFI_RESET_WARM, 0, 0, NULL);
> > -   efi_leave();
> > -   return (EIO);
> > +   if (efi_runtime == NULL)
> > +   return (ENXIO);
> > +   bzero(, sizeof(ec));
> > +   ec.ec_name = "rt_reset";
> > +   ec.ec_argcnt = 4;
> > +   ec.ec_arg1 = (uintptr_t)EFI_RESET_WARM;
> > +   ec.ec_arg1 = (uintptr_t)0;
> > +   ec.ec_arg1 = (uintptr_t)0;
> > +   ec.ec_arg1 = (uintptr_t)NULL;
> 
> Coverity warns about ec_arg1 being overwritten before use ??? should
> these be ec_arg2, 3, 4?  CID 1395456.
Indeed, thank you for reporting.

Amusingly it is innocent.
___
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: r338437 - in head/sys: amd64/amd64 amd64/include arm64/arm64 arm64/include conf dev/efidev modules/efirt sys

2018-09-04 Thread Conrad Meyer
Hi Konstantin,

On Sun, Sep 2, 2018 at 2:37 PM, Konstantin Belousov  wrote:
> Author: kib
> Date: Sun Sep  2 21:37:05 2018
> New Revision: 338437
> URL: https://svnweb.freebsd.org/changeset/base/338437
>
> Log:
>   Catch exceptions during EFI RT calls on amd64.
>
>   This appeared to be required to have EFI RT support and EFI RTC
>   enabled by default, because there are too many reports of faulting
>   calls on many different machines.  The knob is added to leave the
>   exceptions unhandled to allow to debug the actual bugs.
> ...
>
> Modified: head/sys/dev/efidev/efirt.c
> ==
> --- head/sys/dev/efidev/efirt.c Sun Sep  2 21:16:43 2018(r338436)
> +++ head/sys/dev/efidev/efirt.c Sun Sep  2 21:37:05 2018(r338437)
> ...
> @@ -346,30 +413,35 @@ efi_get_time_capabilities(struct efi_tmcap *tmcap)
>  int
>  efi_reset_system(void)
>  {
> -   int error;
> +   struct efirt_callinfo ec;
>
> -   error = efi_enter();
> -   if (error != 0)
> -   return (error);
> -   efi_runtime->rt_reset(EFI_RESET_WARM, 0, 0, NULL);
> -   efi_leave();
> -   return (EIO);
> +   if (efi_runtime == NULL)
> +   return (ENXIO);
> +   bzero(, sizeof(ec));
> +   ec.ec_name = "rt_reset";
> +   ec.ec_argcnt = 4;
> +   ec.ec_arg1 = (uintptr_t)EFI_RESET_WARM;
> +   ec.ec_arg1 = (uintptr_t)0;
> +   ec.ec_arg1 = (uintptr_t)0;
> +   ec.ec_arg1 = (uintptr_t)NULL;

Coverity warns about ec_arg1 being overwritten before use — should
these be ec_arg2, 3, 4?  CID 1395456.

> +   ec.ec_fptr = EFI_RT_METHOD_PA(rt_reset);
> +   return (efi_call());
>  }

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


svn commit: r338454 - in head: etc etc/etc.aarch64 etc/etc.amd64 etc/etc.arm etc/etc.i386 etc/etc.mips etc/etc.powerpc etc/etc.riscv etc/etc.sparc64 sbin/init

2018-09-04 Thread Brad Davis
Author: brd
Date: Tue Sep  4 15:48:13 2018
New Revision: 338454
URL: https://svnweb.freebsd.org/changeset/base/338454

Log:
  Move etc/ttys to sbin/init/.
  
  And simplify this a little by flattening the directory structure.
  
  Approved by:  re (gjb), will (mentor)
  Differential Revision:https://reviews.freebsd.org/D16955

Added:
  head/sbin/init/ttys.aarch64
 - copied unchanged from r338453, head/etc/etc.aarch64/ttys
  head/sbin/init/ttys.amd64
 - copied unchanged from r338453, head/etc/etc.amd64/ttys
  head/sbin/init/ttys.arm
 - copied unchanged from r338453, head/etc/etc.arm/ttys
  head/sbin/init/ttys.i386
 - copied unchanged from r338453, head/etc/etc.i386/ttys
  head/sbin/init/ttys.mips
 - copied unchanged from r338453, head/etc/etc.mips/ttys
  head/sbin/init/ttys.powerpc
 - copied unchanged from r338453, head/etc/etc.powerpc/ttys
  head/sbin/init/ttys.riscv
 - copied unchanged from r338453, head/etc/etc.riscv/ttys
  head/sbin/init/ttys.sparc64
 - copied unchanged from r338453, head/etc/etc.sparc64/ttys
Deleted:
  head/etc/etc.aarch64/
  head/etc/etc.amd64/
  head/etc/etc.arm/
  head/etc/etc.i386/
  head/etc/etc.mips/
  head/etc/etc.powerpc/
  head/etc/etc.riscv/
  head/etc/etc.sparc64/
Modified:
  head/etc/Makefile
  head/sbin/init/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Tue Sep  4 10:51:41 2018(r338453)
+++ head/etc/Makefile   Tue Sep  4 15:48:13 2018(r338454)
@@ -35,16 +35,6 @@ BIN1=crontab \
rpc \
termcap.small
 
-.if exists(${.CURDIR}/etc.${MACHINE}/ttys)
-BIN1+= etc.${MACHINE}/ttys
-.elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
-BIN1+= etc.${MACHINE_ARCH}/ttys
-.elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
-BIN1+= etc.${MACHINE_CPUARCH}/ttys
-.else
-.error etc.MACHINE/ttys missing
-.endif
-
 # NB: keep these sorted by MK_* knobs
 
 .if ${MK_AMD} != "no"

Modified: head/sbin/init/Makefile
==
--- head/sbin/init/Makefile Tue Sep  4 10:51:41 2018(r338453)
+++ head/sbin/init/Makefile Tue Sep  4 15:48:13 2018(r338454)
@@ -1,7 +1,7 @@
 #  @(#)Makefile8.1 (Berkeley) 7/19/93
 # $FreeBSD$
 
-CONFGROUPS=CONFETC CONFETCEXEC CONFETCDEFAULTS
+CONFGROUPS=CONFETC CONFETCEXEC CONFETCDEFAULTS CONFTTYS
 CONFETCDIR=/etc
 CONFETC=   network.subr rc rc.initdiskless rc.subr rc.shutdown
 CONFETCMODE=   644
@@ -18,6 +18,17 @@ PRECIOUSPROG=
 INSTALLFLAGS=-b -B.bak
 CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT
 LIBADD=util crypt
+
+CONFTTYSNAME=  ttys
+.if exists(${.CURDIR}/ttys.${MACHINE})
+CONFTTYS+= ttys.${MACHINE}
+.elif exists(${.CURDIR}/ttys.${MACHINE_ARCH})
+CONFTTYS+= ttys.${MACHINE_ARCH}
+.elif exists(${.CURDIR}/ttys.${MACHINE_CPUARCH})
+CONFTTYS+= ttys.${MACHINE_CPUARCH}
+.else
+.error MACHINE.ttys missing
+.endif
 
 # Needed for getmntopts.c
 MOUNT= ${SRCTOP}/sbin/mount

Copied: head/sbin/init/ttys.aarch64 (from r338453, head/etc/etc.aarch64/ttys)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sbin/init/ttys.aarch64 Tue Sep  4 15:48:13 2018(r338454, copy 
of r338453, head/etc/etc.aarch64/ttys)
@@ -0,0 +1,49 @@
+#
+# $FreeBSD$
+#  @(#)ttys5.1 (Berkeley) 4/17/89
+#
+# This file specifies various information about terminals on the system.
+# It is used by several different programs.  Common entries for the
+# various columns include:
+#
+# name  The name of the terminal device.
+#
+# getty The program to start running on the terminal.  Typically a
+#   getty program, as the name implies.  Other common entries
+#   include none, when no getty is needed, and xdm, to start the
+#   X Window System.
+#
+# type The initial terminal type for this port.  For hardwired
+#  terminal lines, this will contain the type of terminal used.
+#  For virtual consoles, the correct type is typically xterm.
+#  Other common values include dialup for incoming modem ports, and
+#  unknown when the terminal type cannot be predetermined.
+#
+# status Must be on or off.  If on, init will run the getty program on
+#the specified port.  If the word "secure" appears, this tty
+#allows root login.
+#
+# name getty   typestatus  comments
+#
+# If console is marked "insecure", then init will ask for the root password
+# when going to single-user mode.
+consolenoneunknown off secure
+#
+ttyv0  "/usr/libexec/getty Pc" xterm   onifexists secure
+# Virtual terminals
+ttyv1  "/usr/libexec/getty Pc" xterm   onifexists secure
+ttyv2  "/usr/libexec/getty Pc" xterm   onifexists secure
+ttyv3  "/usr/libexec/getty Pc" xterm   

svn commit: r338453 - head/lib/libpam/modules/pam_exec

2018-09-04 Thread Dag-Erling Smørgrav
Author: des
Date: Tue Sep  4 10:51:41 2018
New Revision: 338453
URL: https://svnweb.freebsd.org/changeset/base/338453

Log:
  For full Linux-PAM compatibility, add a trailing NUL character when
  passing the authentication token to the external program.
  
  Approved by:  re (kib)
  Submitted by: Thomas Munro 
  MFC after:1 week
  Differential Revision:D16950

Modified:
  head/lib/libpam/modules/pam_exec/pam_exec.8
  head/lib/libpam/modules/pam_exec/pam_exec.c

Modified: head/lib/libpam/modules/pam_exec/pam_exec.8
==
--- head/lib/libpam/modules/pam_exec/pam_exec.8 Tue Sep  4 09:58:13 2018
(r338452)
+++ head/lib/libpam/modules/pam_exec/pam_exec.8 Tue Sep  4 10:51:41 2018
(r338453)
@@ -74,7 +74,8 @@ Ignored for compatibility reasons.
 Use the program exit status as the return code of the pam_sm_* function.
 It must be a valid return value for this function.
 .It Cm expose_authtok
-Write the authentication token to the program's standard input stream.
+Write the authentication token to the program's standard input stream,
+followed by a NUL character.
 .It Cm --
 Stop options parsing;
 program and its arguments follow.

Modified: head/lib/libpam/modules/pam_exec/pam_exec.c
==
--- head/lib/libpam/modules/pam_exec/pam_exec.c Tue Sep  4 09:58:13 2018
(r338452)
+++ head/lib/libpam/modules/pam_exec/pam_exec.c Tue Sep  4 10:51:41 2018
(r338453)
@@ -254,7 +254,8 @@ _pam_exec(pam_handle_t *pamh,
}
rc = pam_get_authtok(pamh, PAM_AUTHTOK, , NULL);
if (rc == PAM_SUCCESS) {
-   authtok_size = strlen(authtok);
+   /* We include the trailing NUL-terminator. */
+   authtok_size = strlen(authtok) + 1;
} else {
openpam_log(PAM_LOG_ERROR, "%s: pam_get_authtok(): %s", 
func,
pam_strerror(pamh, rc));
___
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: r338374 - in head: bin/csh bin/sh etc etc/root

2018-09-04 Thread Hartmann, O.
On Thu, 30 Aug 2018 09:38:07 -0600
Brad Davis  wrote:

> On Thu, Aug 30, 2018, at 5:39 AM, O. Hartmann wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA512
> > 
> > Am Wed, 29 Aug 2018 16:59:19 + (UTC)
> > Brad Davis  schrieb:
> >   
> > > Author: brd
> > > Date: Wed Aug 29 16:59:19 2018
> > > New Revision: 338374
> > > URL: https://svnweb.freebsd.org/changeset/base/338374
> > > 
> > > Log:
> > >   Finish moving dot.cshrc and dot.profile to bin/csh/ and bin/sh/.
> > >   
> > >   Approved by:re (gjb), will (mentor)
> > >   Differential Revision:  https://reviews.freebsd.org/D16770
> > > 
> > > Added:
> > >   head/bin/csh/dot.cshrc
> > >  - copied unchanged from r338373, head/etc/root/dot.cshrc
> > >   head/bin/sh/dot.profile
> > >  - copied unchanged from r338373, head/etc/root/dot.profile
> > > Deleted:
> > >   head/etc/root/dot.cshrc
> > >   head/etc/root/dot.profile
> > > Modified:
> > >   head/bin/csh/Makefile
> > >   head/bin/sh/Makefile
> > >   head/etc/Makefile
> > > 
> > > Modified: head/bin/csh/Makefile
> > > ==
> > > --- head/bin/csh/Makefile Wed Aug 29 16:21:34 2018
> > > (r338373) +++ head/bin/csh/Makefile   Wed Aug 29 16:59:19
> > > 2018  (r338374) @@ -10,8 +10,9 @@
> > >  
> > >  CONFGROUPS=  ETC ROOT
> > >  ETC= csh.cshrc csh.login csh.logout
> > > -ROOT=dot.login
> > > +ROOT=dot.cshrc dot.login
> > >  ROOTDIR= /root
> > > +ROOTNAME_dot.cshrc=  .cshrc
> > >  ROOTNAME_dot.login=  .login
> > >  PACKAGE=runtime
> > >  TCSHDIR= ${SRCTOP}/contrib/tcsh
> > > @@ -152,5 +153,11 @@ tc.const.h: tc.const.c sh.char.h config.h
> > > config_f.h s sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char
> > > \1[];/' | \ sort >> ${.TARGET}
> > >   @echo '#endif /* _h_tc_const */' >> ${.TARGET}
> > > +
> > > +beforeinstallconfig:
> > > + rm -f ${DESTDIR}/.cshrc
> > > +
> > > +afterinstallconfig:
> > > + ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.cshrc
> > > ${DESTDIR}/.cshrc 
> > >  .include 
> > > 
> > > Copied: head/bin/csh/dot.cshrc (from r338373,
> > > head/etc/root/dot.cshrc)
> > > ==
> > > --- /dev/null 00:00:00 1970   (empty, because file is
> > > newly added) +++ head/bin/csh/dot.cshrc   Wed Aug 29
> > > 16:59:19 2018 (r338374, copy of r338373,
> > > head/etc/root/dot.cshrc) @@ -0,0 +1,43 @@ +# $FreeBSD$ +#
> > > +# .cshrc - csh resource script, read at beginning of execution
> > > by each shell +#
> > > +# see also csh(1), environ(7).
> > > +# more examples available at /usr/share/examples/csh/
> > > +#
> > > +
> > > +alias h  history 25
> > > +alias j  jobs -l
> > > +alias la ls -aF
> > > +alias lf ls -FA
> > > +alias ll ls -lAF
> > > +
> > > +# A righteous umask
> > > +umask 22
> > > +
> > > +set path =
> > > (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin
> > > $HOME/bin) + +setenv  EDITOR  vi
> > > +setenv   PAGER   less
> > > +setenv   BLOCKSIZE   K
> > > +
> > > +if ($?prompt) then
> > > + # An interactive shell -- set some stuff up
> > > + set prompt = "%N@%m:%~ %# "
> > > + set promptchars = "%#"
> > > +
> > > + set filec
> > > + set history = 1000
> > > + set savehist = (1000 merge)
> > > + set autolist = ambiguous
> > > + # Use history to aid expansion
> > > + set autoexpand
> > > + set autorehash
> > > + set mail = (/var/mail/$USER)
> > > + if ( $?tcsh ) then
> > > + bindkey "^W" backward-delete-word
> > > + bindkey -k up history-search-backward
> > > + bindkey -k down history-search-forward
> > > + endif
> > > +
> > > +endif
> > > 
> > > Modified: head/bin/sh/Makefile
> > > ==
> > > --- head/bin/sh/Makefile  Wed Aug 29 16:21:34 2018
> > > (r338373) +++ head/bin/sh/MakefileWed Aug 29 16:59:19
> > > 2018  (r338374) @@ -3,7 +3,9 @@
> > >  
> > >  .include 
> > >  
> > > -CONFS=   profile
> > > +CONFS=   dot.profile profile
> > > +CONFSDIR_dot.profile=/root
> > > +CONFSNAME_dot.profile=   .profile
> > >  PACKAGE=runtime
> > >  PROG=sh
> > >  INSTALLFLAGS= -S
> > > @@ -60,5 +62,11 @@ token.h: mktokens
> > >  
> > >  HAS_TESTS=
> > >  SUBDIR.${MK_TESTS}+= tests
> > > +
> > > +beforeinstallconfig:
> > > + rm -f ${DESTDIR}/.profile
> > > +
> > > +afterinstallconfig:
> > > + ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile
> > > ${DESTDIR}/.profile 
> > >  .include 
> > > 
> > > Copied: head/bin/sh/dot.profile (from r338373,
> > > head/etc/root/dot.profile)
> > > ==
> > > --- /dev/null 00:00:00 1970   (empty, because file is
> > > newly added) +++ head/bin/sh/dot.profile  Wed Aug 29
> > > 16:59:19 2018 (r338374, copy of r338373,
> > > head/etc/root/dot.profile) @@ -0,0 +1,16 @@ +# $FreeBSD$ +#
> > >