svn commit: r359628 - head/sys/security/mac

2020-04-03 Thread Jason A. Harmening
Author: jah
Date: Sat Apr  4 04:03:10 2020
New Revision: 359628
URL: https://svnweb.freebsd.org/changeset/base/359628

Log:
  mac_policy: Remove mac_policy_sx
  
  This lock was made unnecessary by the addition of mac_policy_rms in r356120.
  
  Reviewed by:  mjg, kib
  Differential Revision:https://reviews.freebsd.org/D24283

Modified:
  head/sys/security/mac/mac_framework.c

Modified: head/sys/security/mac/mac_framework.c
==
--- head/sys/security/mac/mac_framework.c   Sat Apr  4 00:56:56 2020
(r359627)
+++ head/sys/security/mac/mac_framework.c   Sat Apr  4 04:03:10 2020
(r359628)
@@ -184,7 +184,7 @@ MALLOC_DEFINE(M_MACTEMP, "mactemp", "MAC temporary lab
  * The dynamic policy list is protected by two locks: modifying the list
  * requires both locks to be held exclusively.  One of the locks,
  * mac_policy_rm, is acquired over policy entry points that will never sleep;
- * the other, mac_policy_sx, is acquire over policy entry points that may
+ * the other, mac_policy_rms, is acquired over policy entry points that may
  * sleep.  The former category will be used when kernel locks may be held
  * over calls to the MAC Framework, during network processing in ithreads,
  * etc.  The latter will tend to involve potentially blocking memory
@@ -192,8 +192,7 @@ MALLOC_DEFINE(M_MACTEMP, "mactemp", "MAC temporary lab
  */
 #ifndef MAC_STATIC
 static struct rmlock mac_policy_rm;/* Non-sleeping entry points. */
-static struct sx mac_policy_sx;/* Sleeping entry points. */
-static struct rmslock mac_policy_rms;
+static struct rmslock mac_policy_rms;  /* Sleeping entry points. */
 #endif
 
 struct mac_policy_list_head mac_policy_list;
@@ -266,7 +265,6 @@ mac_policy_xlock(void)
if (!mac_late)
return;
 
-   sx_xlock(_policy_sx);
rms_wlock(_policy_rms);
rm_wlock(_policy_rm);
 #endif
@@ -282,7 +280,6 @@ mac_policy_xunlock(void)
 
rm_wunlock(_policy_rm);
rms_wunlock(_policy_rms);
-   sx_xunlock(_policy_sx);
 #endif
 }
 
@@ -294,8 +291,7 @@ mac_policy_xlock_assert(void)
if (!mac_late)
return;
 
-   /* XXXRW: rm_assert(_policy_rm, RA_WLOCKED); */
-   sx_assert(_policy_sx, SA_XLOCKED);
+   rm_assert(_policy_rm, RA_WLOCKED);
 #endif
 }
 
@@ -313,7 +309,6 @@ mac_init(void)
 #ifndef MAC_STATIC
rm_init_flags(_policy_rm, "mac_policy_rm", RM_NOWITNESS |
RM_RECURSE);
-   sx_init_flags(_policy_sx, "mac_policy_sx", SX_NOWITNESS);
rms_init(_policy_rms, "mac_policy_rms");
 #endif
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359627 - in head: include/protocols sbin/dump sbin/restore

2020-04-03 Thread Kirk McKusick
Author: mckusick
Date: Sat Apr  4 00:56:56 2020
New Revision: 359627
URL: https://svnweb.freebsd.org/changeset/base/359627

Log:
  Clean up global variable declarations in the dump and restore
  utilities so that they will compile with -fno-common.
  
  Started by:  Kyle Evans (kevans)
  Reviewed by: Kyle Evans (kevans)
  MFC after:   1 week
  Differential Revision: https://reviews.freebsd.org/D24210

Modified:
  head/include/protocols/dumprestore.h
  head/sbin/dump/dump.h
  head/sbin/dump/dumprmt.c
  head/sbin/dump/itime.c
  head/sbin/dump/main.c
  head/sbin/dump/pathnames.h
  head/sbin/dump/tape.c
  head/sbin/restore/restore.h
  head/sbin/restore/tape.c

Modified: head/include/protocols/dumprestore.h
==
--- head/include/protocols/dumprestore.hSat Apr  4 00:31:30 2020
(r359626)
+++ head/include/protocols/dumprestore.hSat Apr  4 00:56:56 2020
(r359627)
@@ -76,7 +76,7 @@
  */
 typedef uint32_t dump_ino_t;
 
-union u_spcl {
+extern union u_spcl {
char dummy[TP_BSIZE];
struct  s_spcl {
int32_t c_type; /* record type (see below) */

Modified: head/sbin/dump/dump.h
==
--- head/sbin/dump/dump.h   Sat Apr  4 00:31:30 2020(r359626)
+++ head/sbin/dump/dump.h   Sat Apr  4 00:56:56 2020(r359627)
@@ -36,10 +36,10 @@
 /*
  * Dump maps used to describe what is to be dumped.
  */
-intmapsize;/* size of the state maps */
-char   *usedinomap;/* map of allocated inodes */
-char   *dumpdirmap;/* map of directories to be dumped */
-char   *dumpinomap;/* map of files to be dumped */
+extern int mapsize;/* size of the state maps */
+extern char *usedinomap;   /* map of allocated inodes */
+extern char *dumpdirmap;   /* map of directories to be dumped */
+extern char *dumpinomap;   /* map of files to be dumped */
 /*
  * Map manipulation macros.
  */
@@ -56,40 +56,40 @@ char*dumpinomap;/* map of files to be dumped */
 /*
  * All calculations done in 0.1" units!
  */
-char   *disk;  /* name of the disk file */
-char   *tape;  /* name of the tape file */
-char   *popenout;  /* popen(3) per-"tape" command */
-char   *dumpdates; /* name of the file containing dump date information*/
-char   *temp;  /* name of the file for doing rewrite of dumpdates */
-intlastlevel;  /* dump level of previous dump */
-intlevel;  /* dump level of this dump */
-intuflag;  /* update flag */
-intdiskfd; /* disk file descriptor */
-inttapefd; /* tape file descriptor */
-intpipeout;/* true => output to standard output */
-ino_t  curino; /* current inumber; used globally */
-intnewtape;/* new tape flag */
-intdensity;/* density in 0.1" units */
-long   tapesize;   /* estimated tape size, blocks */
-long   tsize;  /* tape size in 0.1" units */
-long   asize;  /* number of 0.1" units written on current tape */
-intetapes; /* estimated number of tapes */
-intnonodump;   /* if set, do not honor UF_NODUMP user flags */
-intunlimited;  /* if set, write to end of medium */
-intcachesize;  /* size of block cache in bytes */
-intrsync_friendly; /* be friendly with rsync */
+extern char *disk; /* name of the disk file */
+extern char *tape; /* name of the tape file */
+extern char *popenout; /* popen(3) per-"tape" command */
+extern char *dumpdates;/* name of the file containing dump date info */
+extern int lastlevel;  /* dump level of previous dump */
+extern int level;  /* dump level of this dump */
+extern int uflag;  /* update flag */
+extern int diskfd; /* disk file descriptor */
+extern int pipeout;/* true => output to standard output */
+extern ino_t curino;   /* current inumber; used globally */
+extern int newtape;/* new tape flag */
+extern int density;/* density in 0.1" units */
+extern long tapesize;  /* estimated tape size, blocks */
+extern long tsize; /* tape size in 0.1" units */
+extern int etapes; /* estimated number of tapes */
+extern int nonodump;   /* if set, do not honor UF_NODUMP user flags */
+extern int unlimited;  /* if set, write to end of medium */
+extern int cachesize;  /* size of block cache in bytes */
+extern int rsync_friendly; /* be friendly with rsync */
+extern int notify; /* notify operator flag */
+extern int blockswritten;  /* number of blocks written on current tape */
+extern int tapeno; /* current tape number */
+extern int ntrec;  /* blocking factor on tape */
+extern long blocksperfile; /* 

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

2020-04-03 Thread Ed Maste
Author: emaste
Date: Sat Apr  4 00:31:30 2020
New Revision: 359626
URL: https://svnweb.freebsd.org/changeset/base/359626

Log:
  vt: avoid overrun when stride is not a multiple of bytes per pixel
  
  The reporter is developing a frame buffer driver for hardware using
  3 bytes per pixel, but a stride that's a multiple of 256.  Previously
  this resulted in writing beyond the end of each stride.  On the last
  row this attempted to write past the end of the frame buffer, triggering
  the assertion in vt_fb_mem_wr1().
  
  PR:   243533
  MFC after:2 weeks
  Submitted by: Thomas Skibo

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

Modified: head/sys/dev/vt/hw/fb/vt_fb.c
==
--- head/sys/dev/vt/hw/fb/vt_fb.c   Fri Apr  3 23:00:26 2020
(r359625)
+++ head/sys/dev/vt/hw/fb/vt_fb.c   Sat Apr  4 00:31:30 2020
(r359626)
@@ -235,12 +235,12 @@ vt_fb_blank(struct vt_device *vd, term_color_t color)
break;
case 2:
for (h = 0; h < info->fb_height; h++)
-   for (o = 0; o < info->fb_stride; o += 2)
+   for (o = 0; o < info->fb_stride - 1; o += 2)
vt_fb_mem_wr2(info, h*info->fb_stride + o, c);
break;
case 3:
for (h = 0; h < info->fb_height; h++)
-   for (o = 0; o < info->fb_stride; o += 3) {
+   for (o = 0; o < info->fb_stride - 2; o += 3) {
vt_fb_mem_wr1(info, h*info->fb_stride + o,
(c >> 16) & 0xff);
vt_fb_mem_wr1(info, h*info->fb_stride + o + 1,
@@ -251,7 +251,7 @@ vt_fb_blank(struct vt_device *vd, term_color_t color)
break;
case 4:
for (h = 0; h < info->fb_height; h++)
-   for (o = 0; o < info->fb_stride; o += 4)
+   for (o = 0; o < info->fb_stride - 3; o += 4)
vt_fb_mem_wr4(info, h*info->fb_stride + o, c);
break;
default:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359622 - in head/lib/libpmc/pmu-events/arch/x86: . bonnell broadwell broadwellde broadwellx cascadelakex goldmont goldmontplus haswell haswellx icelake ivybridge ivytown jaketown knigh...

2020-04-03 Thread Matt Macy
Author: mmacy
Date: Fri Apr  3 22:36:22 2020
New Revision: 359622
URL: https://svnweb.freebsd.org/changeset/base/359622

Log:
  Update x86 counters
  
  MFC after:1 week

Added:
  head/lib/libpmc/pmu-events/arch/x86/cascadelakex/
  head/lib/libpmc/pmu-events/arch/x86/cascadelakex/cache.json   (contents, 
props changed)
  head/lib/libpmc/pmu-events/arch/x86/cascadelakex/clx-metrics.json   
(contents, props changed)
  head/lib/libpmc/pmu-events/arch/x86/cascadelakex/floating-point.json   
(contents, props changed)
  head/lib/libpmc/pmu-events/arch/x86/cascadelakex/frontend.json   (contents, 
props changed)
  head/lib/libpmc/pmu-events/arch/x86/cascadelakex/memory.json   (contents, 
props changed)
  head/lib/libpmc/pmu-events/arch/x86/cascadelakex/other.json   (contents, 
props changed)
  head/lib/libpmc/pmu-events/arch/x86/cascadelakex/pipeline.json   (contents, 
props changed)
  head/lib/libpmc/pmu-events/arch/x86/cascadelakex/uncore-memory.json   
(contents, props changed)
  head/lib/libpmc/pmu-events/arch/x86/cascadelakex/uncore-other.json   
(contents, props changed)
  head/lib/libpmc/pmu-events/arch/x86/cascadelakex/virtual-memory.json   
(contents, props changed)
  head/lib/libpmc/pmu-events/arch/x86/icelake/
  head/lib/libpmc/pmu-events/arch/x86/icelake/cache.json   (contents, props 
changed)
  head/lib/libpmc/pmu-events/arch/x86/icelake/floating-point.json   (contents, 
props changed)
  head/lib/libpmc/pmu-events/arch/x86/icelake/frontend.json   (contents, props 
changed)
  head/lib/libpmc/pmu-events/arch/x86/icelake/memory.json   (contents, props 
changed)
  head/lib/libpmc/pmu-events/arch/x86/icelake/other.json   (contents, props 
changed)
  head/lib/libpmc/pmu-events/arch/x86/icelake/pipeline.json   (contents, props 
changed)
  head/lib/libpmc/pmu-events/arch/x86/icelake/virtual-memory.json   (contents, 
props changed)
  head/lib/libpmc/pmu-events/arch/x86/silvermont/other.json   (contents, props 
changed)
  head/lib/libpmc/pmu-events/arch/x86/tremontx/
  head/lib/libpmc/pmu-events/arch/x86/tremontx/cache.json   (contents, props 
changed)
  head/lib/libpmc/pmu-events/arch/x86/tremontx/frontend.json   (contents, props 
changed)
  head/lib/libpmc/pmu-events/arch/x86/tremontx/memory.json   (contents, props 
changed)
  head/lib/libpmc/pmu-events/arch/x86/tremontx/other.json   (contents, props 
changed)
  head/lib/libpmc/pmu-events/arch/x86/tremontx/pipeline.json   (contents, props 
changed)
  head/lib/libpmc/pmu-events/arch/x86/tremontx/uncore-memory.json   (contents, 
props changed)
  head/lib/libpmc/pmu-events/arch/x86/tremontx/uncore-other.json   (contents, 
props changed)
  head/lib/libpmc/pmu-events/arch/x86/tremontx/uncore-power.json   (contents, 
props changed)
  head/lib/libpmc/pmu-events/arch/x86/tremontx/virtual-memory.json   (contents, 
props changed)
Modified:
  head/lib/libpmc/pmu-events/arch/x86/bonnell/frontend.json
  head/lib/libpmc/pmu-events/arch/x86/bonnell/pipeline.json
  head/lib/libpmc/pmu-events/arch/x86/broadwell/bdw-metrics.json
  head/lib/libpmc/pmu-events/arch/x86/broadwell/cache.json
  head/lib/libpmc/pmu-events/arch/x86/broadwell/floating-point.json
  head/lib/libpmc/pmu-events/arch/x86/broadwell/frontend.json
  head/lib/libpmc/pmu-events/arch/x86/broadwell/memory.json
  head/lib/libpmc/pmu-events/arch/x86/broadwell/pipeline.json
  head/lib/libpmc/pmu-events/arch/x86/broadwellde/bdwde-metrics.json
  head/lib/libpmc/pmu-events/arch/x86/broadwellde/pipeline.json
  head/lib/libpmc/pmu-events/arch/x86/broadwellx/bdx-metrics.json
  head/lib/libpmc/pmu-events/arch/x86/broadwellx/cache.json
  head/lib/libpmc/pmu-events/arch/x86/broadwellx/floating-point.json
  head/lib/libpmc/pmu-events/arch/x86/broadwellx/memory.json
  head/lib/libpmc/pmu-events/arch/x86/broadwellx/pipeline.json
  head/lib/libpmc/pmu-events/arch/x86/goldmont/cache.json
  head/lib/libpmc/pmu-events/arch/x86/goldmont/memory.json
  head/lib/libpmc/pmu-events/arch/x86/goldmont/pipeline.json
  head/lib/libpmc/pmu-events/arch/x86/goldmont/virtual-memory.json
  head/lib/libpmc/pmu-events/arch/x86/goldmontplus/cache.json
  head/lib/libpmc/pmu-events/arch/x86/goldmontplus/pipeline.json
  head/lib/libpmc/pmu-events/arch/x86/goldmontplus/virtual-memory.json
  head/lib/libpmc/pmu-events/arch/x86/haswell/cache.json
  head/lib/libpmc/pmu-events/arch/x86/haswell/floating-point.json
  head/lib/libpmc/pmu-events/arch/x86/haswell/hsw-metrics.json
  head/lib/libpmc/pmu-events/arch/x86/haswell/memory.json
  head/lib/libpmc/pmu-events/arch/x86/haswell/pipeline.json
  head/lib/libpmc/pmu-events/arch/x86/haswellx/cache.json
  head/lib/libpmc/pmu-events/arch/x86/haswellx/hsx-metrics.json
  head/lib/libpmc/pmu-events/arch/x86/haswellx/memory.json
  head/lib/libpmc/pmu-events/arch/x86/haswellx/pipeline.json
  head/lib/libpmc/pmu-events/arch/x86/ivybridge/cache.json
  head/lib/libpmc/pmu-events/arch/x86/ivybridge/ivb-metrics.json
  head/lib/libpmc/pmu-events/arch/x86/ivybridge/pipeline.json
  

svn commit: r359614 - in head/sys: conf powerpc/amigaone

2020-04-03 Thread Justin Hibbits
Author: jhibbits
Date: Fri Apr  3 20:45:16 2020
New Revision: 359614
URL: https://svnweb.freebsd.org/changeset/base/359614

Log:
  powerpc/amigaone: Add CPLD driver for AmigaOne A1222 "Tabor"
  
  Like the X5000, the main CPLD on the A1222 is the communication medium
  between the CPU and the GPIO CPLD.  It provides a mailbox communication
  feature, along with dual-port RAM accessible from both the CPU and GPIO
  CPLD, and 3 fan speed reporting registers.

Added:
  head/sys/powerpc/amigaone/cpld_a1222.c   (contents, props changed)
Modified:
  head/sys/conf/files.powerpc

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Fri Apr  3 20:43:25 2020(r359613)
+++ head/sys/conf/files.powerpc Fri Apr  3 20:45:16 2020(r359614)
@@ -140,7 +140,8 @@ powerpc/aim/moea64_native.c optionalaim
 powerpc/aim/mp_cpudep.coptionalaim
 powerpc/aim/slb.c  optionalaim powerpc64
 powerpc/amigaone/platform_amigaone.c   optionalamigaone
-powerpc/amigaone/cpld_x5000.c  optionalpowerpc amigaone | 
powerpc64 amigaone
+powerpc/amigaone/cpld_a1222.c  optionalpowerpc amigaone | powerpcspe 
amigaone
+powerpc/amigaone/cpld_x5000.c  optionalpowerpc amigaone | powerpc64 
amigaone
 powerpc/booke/locore.S optionalbooke no-obj
 powerpc/booke/booke_machdep.c  optionalbooke
 powerpc/booke/machdep_e500.c   optionalbooke_e500

Added: head/sys/powerpc/amigaone/cpld_a1222.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/powerpc/amigaone/cpld_a1222.c  Fri Apr  3 20:45:16 2020
(r359614)
@@ -0,0 +1,401 @@
+/*-
+ * Copyright (c) 2020 Justin Hibbits
+ *
+ * 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 ``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 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.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include "cpld.h"
+
+/*
+ * A driver for the AmigaOne A1222 "Tabor" Main CPLD.
+ *
+ * The main CPLD is the interface between the CPU and the GPIO CPLD.
+ * Communication with the GPIO CPLD is over the main CPLD's mailbox interface,
+ * along with the dual-port RAM on the CPLD.
+ *
+ * Only one process can open the CPLD character device at a time.  The driver
+ * enforces this to simplify the communication protocol.
+ */
+
+/* Resource access addresses. */
+#defineCPLD_MEM_ADDR_H 0x00
+#defineCPLD_MEM_ADDR_L 0x01
+#defineCPLD_MEM_DATA   0x80
+
+#defineCPLD_MAX_DRAM_WORDS 0x800
+
+/* CPLD Registers. */
+#defineCPLD_REG_SIG1   0x00
+#defineCPLD_REG_SIG2   0x01
+#defineCPLD_REG_HWREV  0x02
+#defineCPLD_REG_CPLDREV0x03
+#defineCPLD_REG_MBC2X  0x04
+#defineCPLD_REG_MBX2C  0x05
+#defineCPLD_REG_FAN1_TACHO_U   0x10
+#defineCPLD_REG_FAN1_TACHO_L   0x11
+#defineCPLD_REG_FAN2_TACHO_U   0x12
+#defineCPLD_REG_FAN2_TACHO_L   0x13
+#defineCPLD_REG_FAN3_TACHO_U   0x14
+#defineCPLD_REG_FAN3_TACHO_L   0x15
+#defineCPLD_REG_DATE_UU0x20
+#defineCPLD_REG_DATE_UL0x21
+#defineCPLD_REG_DATE_LU0x22
+#defineCPLD_REG_DATE_LL0x23
+#defineCPLD_REG_TIME_UU0x24
+#defineCPLD_REG_TIME_UL0x25
+#defineCPLD_REG_TIME_LU0x26
+#defineCPLD_REG_TIME_LL0x27
+#defineCPLD_REG_SCR1   0x5c

svn commit: r359615 - head/lib/libmd

2020-04-03 Thread Ed Maste
Author: emaste
Date: Fri Apr  3 20:56:43 2020
New Revision: 359615
URL: https://svnweb.freebsd.org/changeset/base/359615

Log:
  ANSIfy and KNF function arg definitions in libmd/md4.c
  
  Reported by:  bde, in 2017

Modified:
  head/lib/libmd/md4c.c

Modified: head/lib/libmd/md4c.c
==
--- head/lib/libmd/md4c.c   Fri Apr  3 20:45:16 2020(r359614)
+++ head/lib/libmd/md4c.c   Fri Apr  3 20:56:43 2020(r359615)
@@ -93,8 +93,8 @@ static unsigned char PADDING[64] = {
 
 /* MD4 initialization. Begins an MD4 operation, writing a new context.
  */
-void MD4Init (context)
-MD4_CTX *context;/* context */
+void
+MD4Init(MD4_CTX *context)
 {
   context->count[0] = context->count[1] = 0;
 
@@ -110,10 +110,8 @@ MD4_CTX *context; 
  operation, processing another message block, and updating the
  context.
  */
-void MD4Update (context, in, inputLen)
-MD4_CTX *context;/* context */
-const void *in;/* input block */
-unsigned int inputLen; /* length of input block */
+void
+MD4Update(MD4_CTX *context, const void *in, unsigned int inputLen)
 {
   unsigned int i, idx, partLen;
   const unsigned char *input = in;
@@ -149,8 +147,8 @@ unsigned int inputLen; /* length o
 }
 
 /* MD4 padding. */
-void MD4Pad (context)
-MD4_CTX *context;/* context */
+void
+MD4Pad(MD4_CTX *context)
 {
   unsigned char bits[8];
   unsigned int idx, padLen;
@@ -171,9 +169,8 @@ MD4_CTX *context; 
 /* MD4 finalization. Ends an MD4 message-digest operation, writing the
  the message digest and zeroizing the context.
  */
-void MD4Final (digest, context)
-unsigned char digest[16]; /* message digest */
-MD4_CTX *context;/* context */
+void
+MD4Final(unsigned char digest[16], MD4_CTX *context)
 {
   /* Do padding */
   MD4Pad (context);
@@ -188,9 +185,8 @@ MD4_CTX *context; 
 
 /* MD4 basic transformation. Transforms state based on block.
  */
-static void MD4Transform (state, block)
-UINT4 state[4];
-const unsigned char block[64];
+static void
+MD4Transform(UINT4 state[4], const unsigned char block[64])
 {
   UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
 
@@ -263,10 +259,8 @@ const unsigned char block[64];
 /* Encodes input (UINT4) into output (unsigned char). Assumes len is
  a multiple of 4.
  */
-static void Encode (output, input, len)
-unsigned char *output;
-UINT4 *input;
-unsigned int len;
+static void
+Encode(unsigned char *output, UINT4 *input, unsigned int len)
 {
   unsigned int i, j;
 
@@ -281,11 +275,8 @@ unsigned int len;
 /* Decodes input (unsigned char) into output (UINT4). Assumes len is
  a multiple of 4.
  */
-static void Decode (output, input, len)
-
-UINT4 *output;
-const unsigned char *input;
-unsigned int len;
+static void
+Decode(UINT4 *output, const unsigned char *input, unsigned int len)
 {
   unsigned int i, j;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359613 - head/sys/ufs/ffs

2020-04-03 Thread Kirk McKusick
Author: mckusick
Date: Fri Apr  3 20:43:25 2020
New Revision: 359613
URL: https://svnweb.freebsd.org/changeset/base/359613

Log:
  When shrinking the size of a directory it is sometimes necessary to
  sync it to disk before shrinking it. Complete the sync before getting
  the buffer for the block to be updated to do the shrink to avoid
  panicing with a recursive lock on one of the directory's buffers.
  
  Reviewed by:  Chuck Silvers (chs)
  MFC after:3 days
  Sponsored by: Netflix

Modified:
  head/sys/ufs/ffs/ffs_inode.c

Modified: head/sys/ufs/ffs/ffs_inode.c
==
--- head/sys/ufs/ffs/ffs_inode.cFri Apr  3 20:30:45 2020
(r359612)
+++ head/sys/ufs/ffs/ffs_inode.cFri Apr  3 20:43:25 2020
(r359613)
@@ -426,11 +426,6 @@ ffs_truncate(vp, length, flags, cred)
ip->i_size = length;
DIP_SET(ip, i_size, length);
} else {
-   lbn = lblkno(fs, length);
-   flags |= BA_CLRBUF;
-   error = UFS_BALLOC(vp, length - 1, 1, cred, flags, );
-   if (error)
-   return (error);
/*
 * When we are doing soft updates and the UFS_BALLOC
 * above fills in a direct block hole with a full sized
@@ -439,9 +434,14 @@ ffs_truncate(vp, length, flags, cred)
 * so that we do not get a soft updates inconsistency
 * when we create the fragment below.
 */
+   lbn = lblkno(fs, length);
if (DOINGSOFTDEP(vp) && lbn < UFS_NDADDR &&
fragroundup(fs, blkoff(fs, length)) < fs->fs_bsize &&
(error = ffs_syncvnode(vp, MNT_WAIT, 0)) != 0)
+   return (error);
+   flags |= BA_CLRBUF;
+   error = UFS_BALLOC(vp, length - 1, 1, cred, flags, );
+   if (error)
return (error);
ip->i_size = length;
DIP_SET(ip, i_size, length);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359612 - head/sys/ufs/ufs

2020-04-03 Thread Kirk McKusick
Author: mckusick
Date: Fri Apr  3 20:30:45 2020
New Revision: 359612
URL: https://svnweb.freebsd.org/changeset/base/359612

Log:
  Convert DOINGSOFTDEP, MOUNTEDSOFTDEP, DOINGSUJ, and MOUNTEDSUJ to being
  boolean expressions so that their values are not lost when assigned to
  `bool' or `int' variables.
  
  Reviewed by:  Chuck Silvers (chs)
  MFC after:3 days
  Sponsored by: Netflix

Modified:
  head/sys/ufs/ufs/inode.h

Modified: head/sys/ufs/ufs/inode.h
==
--- head/sys/ufs/ufs/inode.hFri Apr  3 19:42:16 2020(r359611)
+++ head/sys/ufs/ufs/inode.hFri Apr  3 20:30:45 2020(r359612)
@@ -230,10 +230,11 @@ struct indir {
 #defineITOV(ip)((ip)->i_vnode)
 
 /* Determine if soft dependencies are being done */
-#defineDOINGSOFTDEP(vp)   ((vp)->v_mount->mnt_flag & (MNT_SOFTDEP | 
MNT_SUJ))
-#defineMOUNTEDSOFTDEP(mp) ((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ))
-#defineDOINGSUJ(vp)   ((vp)->v_mount->mnt_flag & MNT_SUJ)
-#defineMOUNTEDSUJ(mp) ((mp)->mnt_flag & MNT_SUJ)
+#defineDOINGSOFTDEP(vp)   \
+   (((vp)->v_mount->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) != 0)
+#defineMOUNTEDSOFTDEP(mp) (((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) 
!= 0)
+#defineDOINGSUJ(vp)   (((vp)->v_mount->mnt_flag & MNT_SUJ) != 0)
+#defineMOUNTEDSUJ(mp) (((mp)->mnt_flag & MNT_SUJ) != 0)
 
 /* This overlays the fid structure (see mount.h). */
 struct ufid {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2020-04-03 Thread Ed Maste
Author: emaste
Date: Fri Apr  3 19:42:16 2020
New Revision: 359611
URL: https://svnweb.freebsd.org/changeset/base/359611

Log:
  elf.5: remove commented out leftovers

Modified:
  head/share/man/man5/elf.5

Modified: head/share/man/man5/elf.5
==
--- head/share/man/man5/elf.5   Fri Apr  3 19:00:11 2020(r359610)
+++ head/share/man/man5/elf.5   Fri Apr  3 19:42:16 2020(r359611)
@@ -1318,8 +1318,6 @@ Contains the MACHINE_ARCH that the executable was buil
 .It Dv NT_FREEBSD_FEATURE_CTL Pq Value: 4
 Contains a bitmask of mitigations and features to enable:
 .Bl -tag -width 4n
-.\" .Bl -column "NT_FREEBSD_FCTL_PROTMAX_DISABLE" "0x00" "Disable implicit 
PROT_MAX"
-.\" .Sy Name Ta Sy Value Ta Sy Description
 .It NT_FREEBSD_FCTL_ASLR_DISABLE Pq Value: 0x01
 Request that address randomization (ASLR) not be performed.
 See
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359610 - stable/11/tools/tools/netmap

2020-04-03 Thread Vincenzo Maffione
Author: vmaffione
Date: Fri Apr  3 19:00:11 2020
New Revision: 359610
URL: https://svnweb.freebsd.org/changeset/base/359610

Log:
  netmap: vale-ctl: fix typo in man page
  
  Submitted by:   Jose Luis Duran

Modified:
  stable/11/tools/tools/netmap/vale-ctl.4

Modified: stable/11/tools/tools/netmap/vale-ctl.4
==
--- stable/11/tools/tools/netmap/vale-ctl.4 Fri Apr  3 18:55:22 2020
(r359609)
+++ stable/11/tools/tools/netmap/vale-ctl.4 Fri Apr  3 19:00:11 2020
(r359610)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 24, 2018
+.Dd April 3, 2020
 .Dt VALE-CTL 4
 .Os
 .Sh NAME
@@ -95,7 +95,7 @@ Create a new persistent VALE port with name
 .Ar interface .
 The name must be different from any other network interface
 already present in the system.
-.It Fl d Ar interface
+.It Fl r Ar interface
 Destroy the persistent VALE port with name
 .Ar inteface .
 .It Fl l Ar valeSSS:PPP
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359609 - stable/12/usr.sbin/valectl

2020-04-03 Thread Vincenzo Maffione
Author: vmaffione
Date: Fri Apr  3 18:55:22 2020
New Revision: 359609
URL: https://svnweb.freebsd.org/changeset/base/359609

Log:
  MFC r359489
  
  valectl: fix typo in man page
  
  Submitted by:   Jose Luis Duran
  MFC after:  3 days

Modified:
  stable/12/usr.sbin/valectl/valectl.8
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/valectl/valectl.8
==
--- stable/12/usr.sbin/valectl/valectl.8Fri Apr  3 17:17:17 2020
(r359608)
+++ stable/12/usr.sbin/valectl/valectl.8Fri Apr  3 18:55:22 2020
(r359609)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 26, 2019
+.Dd March 31, 2020
 .Dt VALECTL 8
 .Os
 .Sh NAME
@@ -95,7 +95,7 @@ Create a new persistent VALE port with name
 .Ar interface .
 The name must be different from any other network interface
 already present in the system.
-.It Fl d Ar interface
+.It Fl r Ar interface
 Destroy the persistent VALE port with name
 .Ar inteface .
 .It Fl l Ar valeSSS:PPP
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359605 - in stable/12/sys: amd64/linux32 compat/linux i386/linux

2020-04-03 Thread Mark Johnston
Author: markj
Date: Fri Apr  3 16:31:45 2020
New Revision: 359605
URL: https://svnweb.freebsd.org/changeset/base/359605

Log:
  MFC r356945, r356946:
  Fix 64-bit syscall argument fetching in 32-bit Linux syscall handlers.
  
  PR:   243155

Modified:
  stable/12/sys/amd64/linux32/linux32_machdep.c
  stable/12/sys/amd64/linux32/linux32_proto.h
  stable/12/sys/amd64/linux32/linux32_systrace_args.c
  stable/12/sys/amd64/linux32/syscalls.master
  stable/12/sys/compat/linux/linux_file.c
  stable/12/sys/i386/linux/linux_machdep.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/linux32/linux32_machdep.c
==
--- stable/12/sys/amd64/linux32/linux32_machdep.c   Fri Apr  3 16:28:39 
2020(r359604)
+++ stable/12/sys/amd64/linux32/linux32_machdep.c   Fri Apr  3 16:31:45 
2020(r359605)
@@ -654,19 +654,6 @@ linux_sigaltstack(struct thread *td, struct linux_siga
 }
 
 int
-linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args)
-{
-
-#ifdef DEBUG
-   if (ldebug(ftruncate64))
-   printf(ARGS(ftruncate64, "%u, %jd"), args->fd,
-   (intmax_t)args->length);
-#endif
-
-   return (kern_ftruncate(td, args->fd, args->length));
-}
-
-int
 linux_gettimeofday(struct thread *td, struct linux_gettimeofday_args *uap)
 {
struct timeval atv;

Modified: stable/12/sys/amd64/linux32/linux32_proto.h
==
--- stable/12/sys/amd64/linux32/linux32_proto.h Fri Apr  3 16:28:39 2020
(r359604)
+++ stable/12/sys/amd64/linux32/linux32_proto.h Fri Apr  3 16:31:45 2020
(r359605)
@@ -574,13 +574,15 @@ struct linux_pread_args {
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char 
nbyte_r_[PADR_(l_size_t)];
-   char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char 
offset_r_[PADR_(l_loff_t)];
+   char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char 
offset1_r_[PADR_(uint32_t)];
+   char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char 
offset2_r_[PADR_(uint32_t)];
 };
 struct linux_pwrite_args {
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char 
nbyte_r_[PADR_(l_size_t)];
-   char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char 
offset_r_[PADR_(l_loff_t)];
+   char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char 
offset1_r_[PADR_(uint32_t)];
+   char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char 
offset2_r_[PADR_(uint32_t)];
 };
 struct linux_chown16_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
@@ -623,11 +625,13 @@ struct linux_mmap2_args {
 };
 struct linux_truncate64_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
-   char length_l_[PADL_(l_loff_t)]; l_loff_t length; char 
length_r_[PADR_(l_loff_t)];
+   char length1_l_[PADL_(uint32_t)]; uint32_t length1; char 
length1_r_[PADR_(uint32_t)];
+   char length2_l_[PADL_(uint32_t)]; uint32_t length2; char 
length2_r_[PADR_(uint32_t)];
 };
 struct linux_ftruncate64_args {
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
-   char length_l_[PADL_(l_loff_t)]; l_loff_t length; char 
length_r_[PADR_(l_loff_t)];
+   char length1_l_[PADL_(uint32_t)]; uint32_t length1; char 
length1_r_[PADR_(uint32_t)];
+   char length2_l_[PADL_(uint32_t)]; uint32_t length2; char 
length2_r_[PADR_(uint32_t)];
 };
 struct linux_stat64_args {
char filename_l_[PADL_(const char *)]; const char * filename; char 
filename_r_[PADR_(const char *)];
@@ -756,7 +760,8 @@ struct linux_set_thread_area_args {
 };
 struct linux_fadvise64_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
-   char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char 
offset_r_[PADR_(l_loff_t)];
+   char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char 
offset1_r_[PADR_(uint32_t)];
+   char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char 
offset2_r_[PADR_(uint32_t)];
char len_l_[PADL_(l_size_t)]; l_size_t len; char 
len_r_[PADR_(l_size_t)];
char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)];
 };
@@ -847,8 +852,10 @@ struct linux_utimes_args {
 };
 struct linux_fadvise64_64_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
-   char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char 
offset_r_[PADR_(l_loff_t)];
-   char len_l_[PADL_(l_loff_t)]; l_loff_t len; char 
len_r_[PADR_(l_loff_t)];
+   char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char 
offset1_r_[PADR_(uint32_t)];
+   char 

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

2020-04-03 Thread Ed Maste
Author: emaste
Date: Fri Apr  3 17:17:17 2020
New Revision: 359608
URL: https://svnweb.freebsd.org/changeset/base/359608

Log:
  elf.5: expand on NT_FREEBSD_FEATURE_CTL bit definitions
  
  Based on suggestions from kib in review D23982.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/man/man5/elf.5

Modified: head/share/man/man5/elf.5
==
--- head/share/man/man5/elf.5   Fri Apr  3 17:08:47 2020(r359607)
+++ head/share/man/man5/elf.5   Fri Apr  3 17:17:17 2020(r359608)
@@ -1317,12 +1317,24 @@ is ignored.
 Contains the MACHINE_ARCH that the executable was built for.
 .It Dv NT_FREEBSD_FEATURE_CTL Pq Value: 4
 Contains a bitmask of mitigations and features to enable:
-.Bl -column "NT_FREEBSD_FCTL_PROTMAX_DISABLE" "0x00" "Disable implicit 
PROT_MAX"
-.Sy Name Ta Sy Value Ta Sy Description
-.It NT_FREEBSD_FCTL_ASLR_DISABLETa 0x01 Ta Disable ASLR
-.It NT_FREEBSD_FCTL_PROTMAX_DISABLE Ta 0x02 Ta Disable implicit PROT_MAX
-.It NT_FREEBSD_FCTL_STKGAP_DISABLE  Ta 0x04 Ta Disable stack gap
-.It NT_FREEBSD_FCTL_WXNEEDEDTa 0x08 Ta Binary makes W+X mappings
+.Bl -tag -width 4n
+.\" .Bl -column "NT_FREEBSD_FCTL_PROTMAX_DISABLE" "0x00" "Disable implicit 
PROT_MAX"
+.\" .Sy Name Ta Sy Value Ta Sy Description
+.It NT_FREEBSD_FCTL_ASLR_DISABLE Pq Value: 0x01
+Request that address randomization (ASLR) not be performed.
+See
+.Xr security 7 .
+.It NT_FREEBSD_FCTL_PROTMAX_DISABLE Pq Value: 0x02
+Request that 
+.Xr mmap 2
+calls not set PROT_MAX to the initial value of the
+.Fa prot
+argument.
+.It NT_FREEBSD_FCTL_STKGAP_DISABLE Pq Value: 0x04
+Disable stack gap.
+.It NT_FREEBSD_FCTL_WXNEEDED Pq Value: 0x08
+Indicate that the binary requires mappings that are simultaneously
+writeable and executable.
 .El
 .El
 .Sh SEE ALSO
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359601 - head/usr.sbin/pmc

2020-04-03 Thread Brooks Davis
Author: brooks
Date: Fri Apr  3 16:10:42 2020
New Revision: 359601
URL: https://svnweb.freebsd.org/changeset/base/359601

Log:
  pmc: diable position-independent builds, they fail to link on amd64
  
  PR:   245189
  Reported by:  Gordon Bergling
  Sponsored by: DARPA

Modified:
  head/usr.sbin/pmc/Makefile

Modified: head/usr.sbin/pmc/Makefile
==
--- head/usr.sbin/pmc/Makefile  Fri Apr  3 15:55:58 2020(r359600)
+++ head/usr.sbin/pmc/Makefile  Fri Apr  3 16:10:42 2020(r359601)
@@ -11,6 +11,9 @@ CXXSTD= c++14
 CWARNFLAGS.gcc+= -Wno-redundant-decls
 CFLAGS+= -I${SRCTOP}/lib/libpmcstat
 
+# Does not link when built position-independent.
+MK_PIE=no
+
 LIBADD=kvm pmc m ncursesw pmcstat elf
 
 SRCS=  pmc.c pmc_util.c cmd_pmc_stat.c \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359607 - in stable/12: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/bn crypto/openssl/crypto/conf crypto/openssl/crypto/err crypto/openssl/crypto/pkcs...

2020-04-03 Thread Jung-uk Kim
Author: jkim
Date: Fri Apr  3 17:08:47 2020
New Revision: 359607
URL: https://svnweb.freebsd.org/changeset/base/359607

Log:
  MFC:  r359486
  
  Merge OpenSSL 1.1.1f.
  
  PR:   245073

Modified:
  stable/12/crypto/openssl/CHANGES
  stable/12/crypto/openssl/NEWS
  stable/12/crypto/openssl/README
  stable/12/crypto/openssl/apps/rehash.c
  stable/12/crypto/openssl/apps/s_server.c
  stable/12/crypto/openssl/crypto/bn/bn_local.h
  stable/12/crypto/openssl/crypto/bn/bn_prime.c
  stable/12/crypto/openssl/crypto/conf/conf_lib.c
  stable/12/crypto/openssl/crypto/err/openssl.txt
  stable/12/crypto/openssl/crypto/ex_data.c
  stable/12/crypto/openssl/crypto/pkcs12/p12_crt.c
  stable/12/crypto/openssl/crypto/ts/ts_rsp_sign.c
  stable/12/crypto/openssl/crypto/ts/ts_rsp_verify.c
  stable/12/crypto/openssl/crypto/x509/x509_cmp.c
  stable/12/crypto/openssl/crypto/x509/x509_trs.c
  stable/12/crypto/openssl/crypto/x509/x509_vfy.c
  stable/12/crypto/openssl/crypto/x509/x_all.c
  stable/12/crypto/openssl/crypto/x509/x_crl.c
  stable/12/crypto/openssl/crypto/x509v3/v3_purp.c
  stable/12/crypto/openssl/doc/man3/BN_generate_prime.pod
  stable/12/crypto/openssl/doc/man3/SSL_get_error.pod
  stable/12/crypto/openssl/doc/man3/X509_get_extension_flags.pod
  stable/12/crypto/openssl/include/openssl/opensslv.h
  stable/12/crypto/openssl/include/openssl/sslerr.h
  stable/12/crypto/openssl/ssl/record/rec_layer_s3.c
  stable/12/crypto/openssl/ssl/ssl_err.c
  stable/12/secure/lib/libcrypto/Makefile.inc
  stable/12/secure/lib/libcrypto/man/man3/ADMISSIONS.3
  stable/12/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3
  stable/12/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3
  stable/12/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3
  stable/12/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3
  stable/12/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3
  stable/12/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3
  stable/12/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3
  stable/12/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3
  stable/12/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3
  stable/12/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3
  stable/12/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3
  stable/12/secure/lib/libcrypto/man/man3/ASYNC_start_job.3
  stable/12/secure/lib/libcrypto/man/man3/BF_encrypt.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_ADDR.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_connect.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_ctrl.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_f_base64.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_f_buffer.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_f_cipher.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_f_md.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_f_null.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_f_ssl.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_find_type.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_get_data.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_meth_new.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_new.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_new_CMS.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_printf.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_push.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_read.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_s_accept.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_s_bio.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_s_connect.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_s_fd.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_s_file.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_s_mem.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_s_null.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_s_socket.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_set_callback.3
  stable/12/secure/lib/libcrypto/man/man3/BIO_should_retry.3
  stable/12/secure/lib/libcrypto/man/man3/BN_BLINDING_new.3
  stable/12/secure/lib/libcrypto/man/man3/BN_CTX_new.3
  stable/12/secure/lib/libcrypto/man/man3/BN_CTX_start.3
  stable/12/secure/lib/libcrypto/man/man3/BN_add.3
  stable/12/secure/lib/libcrypto/man/man3/BN_add_word.3
  stable/12/secure/lib/libcrypto/man/man3/BN_bn2bin.3
  stable/12/secure/lib/libcrypto/man/man3/BN_cmp.3
  stable/12/secure/lib/libcrypto/man/man3/BN_copy.3
  stable/12/secure/lib/libcrypto/man/man3/BN_generate_prime.3
  stable/12/secure/lib/libcrypto/man/man3/BN_mod_inverse.3
  stable/12/secure/lib/libcrypto/man/man3/BN_mod_mul_montgomery.3
  stable/12/secure/lib/libcrypto/man/man3/BN_mod_mul_reciprocal.3
  stable/12/secure/lib/libcrypto/man/man3/BN_new.3
  stable/12/secure/lib/libcrypto/man/man3/BN_num_bytes.3
  stable/12/secure/lib/libcrypto/man/man3/BN_rand.3
  stable/12/secure/lib/libcrypto/man/man3/BN_security_bits.3
  

svn commit: r359606 - in head: lib/clang/include/lldb/Host lib/clang/liblldb usr.bin/clang/lldb

2020-04-03 Thread Ed Maste
Author: emaste
Date: Fri Apr  3 16:54:13 2020
New Revision: 359606
URL: https://svnweb.freebsd.org/changeset/base/359606

Log:
  lldb: build and enable lua script bindings
  
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D24266

Modified:
  head/lib/clang/include/lldb/Host/Config.h
  head/lib/clang/liblldb/Makefile
  head/usr.bin/clang/lldb/Makefile

Modified: head/lib/clang/include/lldb/Host/Config.h
==
--- head/lib/clang/include/lldb/Host/Config.h   Fri Apr  3 16:31:45 2020
(r359605)
+++ head/lib/clang/include/lldb/Host/Config.h   Fri Apr  3 16:54:13 2020
(r359606)
@@ -43,7 +43,7 @@
 
 #define LLDB_ENABLE_LIBXML2 0
 
-#define LLDB_ENABLE_LUA 0
+#define LLDB_ENABLE_LUA 1
 
 #define LLDB_ENABLE_PYTHON 0
 

Modified: head/lib/clang/liblldb/Makefile
==
--- head/lib/clang/liblldb/Makefile Fri Apr  3 16:31:45 2020
(r359605)
+++ head/lib/clang/liblldb/Makefile Fri Apr  3 16:54:13 2020
(r359606)
@@ -13,6 +13,8 @@ CFLAGS+=  -I${LLDB_SRCS}/source/Plugins/Process/Utility
 CFLAGS+=   -I${OBJTOP}/lib/clang/libllvm
 CFLAGS+=   -I${OBJTOP}/lib/clang/libclang
 CFLAGS+=   -I${OBJTOP}/lib/clang/liblldb
+CFLAGS+=   -I${SRCTOP}/contrib/lua/src
+CFLAGS+=   -I${SRCTOP}/lib/liblua
 
 SRCS+= API/SBAddress.cpp
 SRCS+= API/SBAttachInfo.cpp
@@ -462,6 +464,8 @@ SRCS+=  
Plugins/Process/gdb-remote/GDBRemoteRegisterCo
 SRCS+= Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
 SRCS+= Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
 SRCS+= Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
+SRCS+= Plugins/ScriptInterpreter/Lua/Lua.cpp
+SRCS+= Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
 SRCS+= Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
 SRCS+= Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
 SRCS+= Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
@@ -642,6 +646,7 @@ SRCS+=  Utility/UserID.cpp
 SRCS+= Utility/UserIDResolver.cpp
 SRCS+= Utility/VASprintf.cpp
 SRCS+= Utility/VMRange.cpp
+SRCS+= LLDBWrapLua.cpp
 SRCS+= lldb.cpp
 
 LLDB_TBLGEN?=  lldb-tblgen

Modified: head/usr.bin/clang/lldb/Makefile
==
--- head/usr.bin/clang/lldb/MakefileFri Apr  3 16:31:45 2020
(r359605)
+++ head/usr.bin/clang/lldb/MakefileFri Apr  3 16:54:13 2020
(r359606)
@@ -36,6 +36,7 @@ CLEANFILES+=  ${TGHDRS} ${TGHDRS:C/$/.d/}
 
 LIBADD+=   edit
 LIBADD+=   execinfo
+LIBADD+=   lua
 LIBADD+=   lzma
 LIBADD+=   ncursesw
 LIBADD+=   panel
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359604 - in stable/12/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux

2020-04-03 Thread Mark Johnston
Author: markj
Date: Fri Apr  3 16:28:39 2020
New Revision: 359604
URL: https://svnweb.freebsd.org/changeset/base/359604

Log:
  MFC r355754, r355807 (trasz):
  Add sync_file_range(2) implementation to linux(4).

Modified:
  stable/12/sys/amd64/linux/linux_dummy.c
  stable/12/sys/amd64/linux32/linux32_dummy.c
  stable/12/sys/arm64/linux/linux_dummy.c
  stable/12/sys/compat/linux/linux_file.c
  stable/12/sys/compat/linux/linux_file.h
  stable/12/sys/i386/linux/linux_dummy.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/linux/linux_dummy.c
==
--- stable/12/sys/amd64/linux/linux_dummy.c Fri Apr  3 16:19:07 2020
(r359603)
+++ stable/12/sys/amd64/linux/linux_dummy.c Fri Apr  3 16:28:39 2020
(r359604)
@@ -100,7 +100,6 @@ DUMMY(unshare);
 /* Linux 2.6.17: */
 DUMMY(splice);
 DUMMY(tee);
-DUMMY(sync_file_range);
 DUMMY(vmsplice);
 /* Linux 2.6.18: */
 DUMMY(move_pages);

Modified: stable/12/sys/amd64/linux32/linux32_dummy.c
==
--- stable/12/sys/amd64/linux32/linux32_dummy.c Fri Apr  3 16:19:07 2020
(r359603)
+++ stable/12/sys/amd64/linux32/linux32_dummy.c Fri Apr  3 16:28:39 2020
(r359604)
@@ -105,7 +105,6 @@ DUMMY(migrate_pages);
 DUMMY(unshare);
 /* Linux 2.6.17: */
 DUMMY(splice);
-DUMMY(sync_file_range);
 DUMMY(tee);
 DUMMY(vmsplice);
 /* Linux 2.6.18: */

Modified: stable/12/sys/arm64/linux/linux_dummy.c
==
--- stable/12/sys/arm64/linux/linux_dummy.c Fri Apr  3 16:19:07 2020
(r359603)
+++ stable/12/sys/arm64/linux/linux_dummy.c Fri Apr  3 16:28:39 2020
(r359604)
@@ -102,7 +102,6 @@ DUMMY(unshare);
 /* Linux 2.6.17: */
 DUMMY(splice);
 DUMMY(tee);
-DUMMY(sync_file_range);
 DUMMY(vmsplice);
 /* Linux 2.6.18: */
 DUMMY(move_pages);

Modified: stable/12/sys/compat/linux/linux_file.c
==
--- stable/12/sys/compat/linux/linux_file.c Fri Apr  3 16:19:07 2020
(r359603)
+++ stable/12/sys/compat/linux/linux_file.c Fri Apr  3 16:28:39 2020
(r359604)
@@ -997,10 +997,22 @@ linux_linkat(struct thread *td, struct linux_linkat_ar
 }
 
 int
-linux_fdatasync(td, uap)
-   struct thread *td;
-   struct linux_fdatasync_args *uap;
+linux_fdatasync(struct thread *td, struct linux_fdatasync_args *uap)
 {
+
+   return (kern_fsync(td, uap->fd, false));
+}
+
+int
+linux_sync_file_range(struct thread *td, struct linux_sync_file_range_args 
*uap)
+{
+
+   if (uap->offset < 0 || uap->nbytes < 0 ||
+   (uap->flags & ~(LINUX_SYNC_FILE_RANGE_WAIT_BEFORE |
+   LINUX_SYNC_FILE_RANGE_WRITE |
+   LINUX_SYNC_FILE_RANGE_WAIT_AFTER)) != 0) {
+   return (EINVAL);
+   }
 
return (kern_fsync(td, uap->fd, false));
 }

Modified: stable/12/sys/compat/linux/linux_file.h
==
--- stable/12/sys/compat/linux/linux_file.h Fri Apr  3 16:19:07 2020
(r359603)
+++ stable/12/sys/compat/linux/linux_file.h Fri Apr  3 16:28:39 2020
(r359604)
@@ -127,4 +127,11 @@
 #defineLINUX_F_UNLCK   2
 #endif
 
+/*
+ * sync_file_range flags
+ */
+#defineLINUX_SYNC_FILE_RANGE_WAIT_BEFORE   1
+#defineLINUX_SYNC_FILE_RANGE_WRITE 2
+#defineLINUX_SYNC_FILE_RANGE_WAIT_AFTER4
+
 #endif /* !_LINUX_FILE_H_ */

Modified: stable/12/sys/i386/linux/linux_dummy.c
==
--- stable/12/sys/i386/linux/linux_dummy.c  Fri Apr  3 16:19:07 2020
(r359603)
+++ stable/12/sys/i386/linux/linux_dummy.c  Fri Apr  3 16:28:39 2020
(r359604)
@@ -101,7 +101,6 @@ DUMMY(migrate_pages);
 DUMMY(unshare);
 /* Linux 2.6.17: */
 DUMMY(splice);
-DUMMY(sync_file_range);
 DUMMY(tee);
 DUMMY(vmsplice);
 /* Linux 2.6.18: */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359603 - head

2020-04-03 Thread Brooks Davis
Author: brooks
Date: Fri Apr  3 16:19:07 2020
New Revision: 359603
URL: https://svnweb.freebsd.org/changeset/base/359603

Log:
  Pass the real value of MK_TESTS_SUPPORT to distribution.
  
  This allows kyua's config file to actually be installed.
  
  Reported by:  arichardson
  Reviewed by:  arichardson
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D24268

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Fri Apr  3 16:11:39 2020(r359602)
+++ head/Makefile.inc1  Fri Apr  3 16:19:07 2020(r359603)
@@ -1509,7 +1509,8 @@ distrib-dirs distribution: .MAKE .PHONY
 .if make(distribution)
${_+_}cd ${.CURDIR}; ${CROSSENV} PATH=${TMPPATH} \
${MAKE} -f Makefile.inc1 ${IMAKE_INSTALL} \
-   METALOG=${METALOG} MK_TESTS=no installconfig
+   METALOG=${METALOG} MK_TESTS=no \
+   MK_TESTS_SUPPORT=${MK_TESTS_SUPPORT} installconfig
 .endif
 
 #
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359602 - in stable/12/sys: amd64/linux amd64/linux32 arm64/linux i386/linux

2020-04-03 Thread Mark Johnston
Author: markj
Date: Fri Apr  3 16:11:39 2020
New Revision: 359602
URL: https://svnweb.freebsd.org/changeset/base/359602

Log:
  MFC r355752, r355753 (by trasz):
  Fix definitions for linuxulator's sync_file_range(2).

Modified:
  stable/12/sys/amd64/linux/linux_proto.h
  stable/12/sys/amd64/linux/linux_sysent.c
  stable/12/sys/amd64/linux/linux_systrace_args.c
  stable/12/sys/amd64/linux/syscalls.master
  stable/12/sys/amd64/linux32/linux32_proto.h
  stable/12/sys/amd64/linux32/linux32_sysent.c
  stable/12/sys/amd64/linux32/linux32_systrace_args.c
  stable/12/sys/amd64/linux32/syscalls.master
  stable/12/sys/arm64/linux/linux_proto.h
  stable/12/sys/arm64/linux/linux_sysent.c
  stable/12/sys/arm64/linux/linux_systrace_args.c
  stable/12/sys/arm64/linux/syscalls.master
  stable/12/sys/i386/linux/linux_proto.h
  stable/12/sys/i386/linux/linux_sysent.c
  stable/12/sys/i386/linux/linux_systrace_args.c
  stable/12/sys/i386/linux/syscalls.master
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/linux/linux_proto.h
==
--- stable/12/sys/amd64/linux/linux_proto.h Fri Apr  3 16:10:42 2020
(r359601)
+++ stable/12/sys/amd64/linux/linux_proto.h Fri Apr  3 16:11:39 2020
(r359602)
@@ -940,7 +940,10 @@ struct linux_tee_args {
register_t dummy;
 };
 struct linux_sync_file_range_args {
-   register_t dummy;
+   char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
+   char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char 
offset_r_[PADR_(l_loff_t)];
+   char nbytes_l_[PADL_(l_loff_t)]; l_loff_t nbytes; char 
nbytes_r_[PADR_(l_loff_t)];
+   char flags_l_[PADL_(unsigned int)]; unsigned int flags; char 
flags_r_[PADR_(unsigned int)];
 };
 struct linux_vmsplice_args {
register_t dummy;

Modified: stable/12/sys/amd64/linux/linux_sysent.c
==
--- stable/12/sys/amd64/linux/linux_sysent.cFri Apr  3 16:10:42 2020
(r359601)
+++ stable/12/sys/amd64/linux/linux_sysent.cFri Apr  3 16:11:39 2020
(r359602)
@@ -294,7 +294,7 @@ struct sysent linux_sysent[] = {
{ AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, 
AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = linux_get_robust_list */
{ 0, (sy_call_t *)linux_splice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC 
},   /* 275 = linux_splice */
{ 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },  
/* 276 = linux_tee */
-   { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, 
SY_THR_STATIC },  /* 277 = linux_sync_file_range */
+   { AS(linux_sync_file_range_args), (sy_call_t *)linux_sync_file_range, 
AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 277 = linux_sync_file_range */
{ 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, 
SY_THR_STATIC }, /* 278 = linux_vmsplice */
{ 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, 
SY_THR_STATIC },   /* 279 = linux_move_pages */
{ AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, 
AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC },/* 280 = linux_utimensat 
*/

Modified: stable/12/sys/amd64/linux/linux_systrace_args.c
==
--- stable/12/sys/amd64/linux/linux_systrace_args.c Fri Apr  3 16:10:42 
2020(r359601)
+++ stable/12/sys/amd64/linux/linux_systrace_args.c Fri Apr  3 16:11:39 
2020(r359602)
@@ -1977,7 +1977,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg
}
/* linux_sync_file_range */
case 277: {
-   *n_args = 0;
+   struct linux_sync_file_range_args *p = params;
+   iarg[0] = p->fd; /* l_int */
+   iarg[1] = p->offset; /* l_loff_t */
+   iarg[2] = p->nbytes; /* l_loff_t */
+   uarg[3] = p->flags; /* unsigned int */
+   *n_args = 4;
break;
}
/* linux_vmsplice */
@@ -5553,6 +5558,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d
break;
/* linux_sync_file_range */
case 277:
+   switch(ndx) {
+   case 0:
+   p = "l_int";
+   break;
+   case 1:
+   p = "l_loff_t";
+   break;
+   case 2:
+   p = "l_loff_t";
+   break;
+   case 3:
+   p = "unsigned int";
+   break;
+   default:
+   break;
+   };
break;
/* linux_vmsplice */
case 278:
@@ -7509,6 +7530,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char *
case 276:
/* linux_sync_file_range */
  

svn commit: r359599 - head/lib/clang/liblldb

2020-04-03 Thread Ed Maste
Author: emaste
Date: Fri Apr  3 15:52:44 2020
New Revision: 359599
URL: https://svnweb.freebsd.org/changeset/base/359599

Log:
  lldb: add rule to generate LLDBWrapLua.cpp
  
  Building lldb's lua/python bindings requires swig, but we do not want to
  include it in the FreeBSD base system (as a build tool) because it has
  non-trivial dependencies.  As a workaround, add a make rule to generate
  LLDBWrapLua.cpp, and we will commit the generated file.
  
  Requires the swig30 package.
  
  Reviewed by:  brooks
  Discussed with:   dim
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D24265

Modified:
  head/lib/clang/liblldb/Makefile

Modified: head/lib/clang/liblldb/Makefile
==
--- head/lib/clang/liblldb/Makefile Fri Apr  3 15:47:15 2020
(r359598)
+++ head/lib/clang/liblldb/Makefile Fri Apr  3 15:52:44 2020
(r359599)
@@ -679,4 +679,17 @@ CLEANFILES+=   ${TGHDRS} ${TGHDRS:C/$/.d/}
 
 INTERNALLIB=
 
+# Building lldb's bindings requires swig, but we do not want to include it in
+# the FreeBSD base system (as a build tool) because it has non-trivial
+# dependencies.  As a workaround we commit the generated file.  Requires the
+# swig30 package.
+#
+# After importing an updated llvm/lldb into FreeBSD run `make run-swig` in
+# this directory to generate generate LLDBWrapLua.cpp, and commit the result.
+.PHONY:run-swig
+run-swig:
+   swig3.0 -I${LLDB_SRCS}/include \
+   -c++ -features autodoc -lua -w503 \
+   -o ${.CURDIR}/LLDBWrapLua.cpp ${LLDB_SRCS}/bindings/lua.swig
+
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359600 - head/lib/clang/liblldb

2020-04-03 Thread Ed Maste
Author: emaste
Date: Fri Apr  3 15:55:58 2020
New Revision: 359600
URL: https://svnweb.freebsd.org/changeset/base/359600

Log:
  lldb: commit generated LLDBWrapLua.cpp

Added:
  head/lib/clang/liblldb/LLDBWrapLua.cpp   (contents, props changed)

Added: head/lib/clang/liblldb/LLDBWrapLua.cpp
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/clang/liblldb/LLDBWrapLua.cpp  Fri Apr  3 15:55:58 2020
(r359600)
@@ -0,0 +1,71334 @@
+/* 
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 3.0.12
+ *
+ * This file is not intended to be easily readable and contains a number of
+ * coding conventions designed to improve portability and efficiency. Do not 
make
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
+ * 
- */
+
+
+#ifndef SWIGLUA
+#define SWIGLUA
+#endif
+
+#define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
+#define SWIG_LUA_MODULE_GLOBAL
+
+
+#ifdef __cplusplus
+/* SwigValueWrapper is described in swig.swg */
+template class SwigValueWrapper {
+  struct SwigMovePointer {
+T *ptr;
+SwigMovePointer(T *p) : ptr(p) { }
+~SwigMovePointer() { delete ptr; }
+SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 
0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
+  } pointer;
+  SwigValueWrapper& operator=(const SwigValueWrapper& rhs);
+  SwigValueWrapper(const SwigValueWrapper& rhs);
+public:
+  SwigValueWrapper() : pointer(0) { }
+  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); 
pointer = tmp; return *this; }
+  operator T&() const { return *pointer.ptr; }
+  T *operator&() { return pointer.ptr; }
+};
+
+template  T SwigValueInit() {
+  return T();
+}
+#endif
+
+/* 
-
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * 
- */
+
+/* template workaround for compilers that cannot correctly implement the C++ 
standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 
*/
+/* If we find a maximum version that requires this, the test would be __HP_aCC 
<= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && 
__GNUC_MINOR__ >= 4))
+# define SWIGUNUSED __attribute__ ((__unused__))
+#   else
+# define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__))
+# else
+#   define SWIGUNUSED
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been 
removed */
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if defined(__GNUC__)
+#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#ifndef GCC_HASCLASSVISIBILITY
+#  define GCC_HASCLASSVISIBILITY
+#endif
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+# define SWIGEXPORT
+#   else
+# define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+# define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+# define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if 

svn commit: r359598 - head/usr.bin/kyua

2020-04-03 Thread Brooks Davis
Author: brooks
Date: Fri Apr  3 15:47:15 2020
New Revision: 359598
URL: https://svnweb.freebsd.org/changeset/base/359598

Log:
  Install a kyua.conf based on the one in devel/kyua.
  
  The kyua.conf from examples doesn't match the expected config and
  contains a lot of undesirable entries such as setting the architecture
  to amd64 explicitly.
  
  Reported by:  arichardson (missing config)
  Reviewed by:  emaste
  Obtained from:CheriBSD
  Differential Revision:https://reviews.freebsd.org/D24267

Added:
  head/usr.bin/kyua/kyua.conf-default   (contents, props changed)
Modified:
  head/usr.bin/kyua/Makefile

Modified: head/usr.bin/kyua/Makefile
==
--- head/usr.bin/kyua/Makefile  Fri Apr  3 14:47:40 2020(r359597)
+++ head/usr.bin/kyua/Makefile  Fri Apr  3 15:47:15 2020(r359598)
@@ -30,8 +30,11 @@ CFLAGS+= -Wno-deprecated-declarations
 
 FILESGROUPS=   DOCS EXAMPLES MISC STORE
 
-CONFS= kyua.conf
+# Install a minimal default config that uses the 'tests' user.
+# The examples config is not appropriate for general use.
+CONFS= kyua.conf-default
 CONFSDIR=  ${KYUA_CONFDIR}
+CONFSNAME= kyua.conf
 
 DOCS=  AUTHORS CONTRIBUTORS LICENSE
 DOCSDIR=   ${KYUA_DOCDIR}

Added: head/usr.bin/kyua/kyua.conf-default
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/kyua/kyua.conf-default Fri Apr  3 15:47:15 2020
(r359598)
@@ -0,0 +1,14 @@
+-- $FreeBSD$
+--
+-- System-wide configuration file for kyua(1).  See kyua.conf(5) for details
+-- on the syntax.
+--
+
+syntax(2)
+
+-- User to drop privileges to when invoking kyua(1) as root and a test case
+-- requests to be run with non-root permissions.
+unprivileged_user = 'tests'
+
+-- An example to set a configuration property specific to FreeBSD.
+--test_suites.FreeBSD.fstype = 'ffs'
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r359594 - head/usr.bin/top

2020-04-03 Thread Mark Johnston
On Fri, Apr 03, 2020 at 04:15:28PM +0200, Mateusz Piotrowski wrote:
> Hi,
> 
> On 4/3/20 3:35 PM, Mark Johnston wrote:
> > Author: markj
> > Date: Fri Apr  3 13:35:44 2020
> > New Revision: 359594
> > URL: https://svnweb.freebsd.org/changeset/base/359594
> > 
> > Log:
> >Fix the description of the -m flag in top.1.
> >PR:  244153
> >Submitted by:fehmi noyan isi 
> >MFC after:   3 days
> > 
> > Modified:
> >head/usr.bin/top/top.1
> > 
> > Modified: head/usr.bin/top/top.1
> > ==
> > --- head/usr.bin/top/top.1  Fri Apr  3 13:26:38 2020(r359593)
> > +++ head/usr.bin/top/top.1  Fri Apr  3 13:35:44 2020(r359594)
> > @@ -103,7 +103,7 @@ Toggle displaying thread ID (tid) instead of process i
> >   Do not display the
> >   .Nm
> >   process itself.
> > -.It Fl display
> > +.It Fl m
> Shoudn't it be It "Fl m Ar display"?

Thanks, you are right.  Fixed in r359597.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359597 - head/usr.bin/top

2020-04-03 Thread Mark Johnston
Author: markj
Date: Fri Apr  3 14:47:40 2020
New Revision: 359597
URL: https://svnweb.freebsd.org/changeset/base/359597

Log:
  Fix up r359594: -m takes an argument.
  
  PR:   244153
  Reported by:  0mp
  MFC with: r359594

Modified:
  head/usr.bin/top/top.1

Modified: head/usr.bin/top/top.1
==
--- head/usr.bin/top/top.1  Fri Apr  3 14:03:58 2020(r359596)
+++ head/usr.bin/top/top.1  Fri Apr  3 14:47:40 2020(r359597)
@@ -103,7 +103,7 @@ Toggle displaying thread ID (tid) instead of process i
 Do not display the
 .Nm
 process itself.
-.It Fl m
+.It Fl m Ar display
 Display either 'cpu' or 'io' statistics.
 Default is 'cpu'.
 .It Fl n
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359592 - in stable/12/sys: kern sys

2020-04-03 Thread Mark Johnston
Author: markj
Date: Fri Apr  3 13:25:53 2020
New Revision: 359592
URL: https://svnweb.freebsd.org/changeset/base/359592

Log:
  MFC r359170:
  Remove UNP_NASCENT, reverting r303855.

Modified:
  stable/12/sys/kern/uipc_usrreq.c
  stable/12/sys/sys/unpcb.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/uipc_usrreq.c
==
--- stable/12/sys/kern/uipc_usrreq.cFri Apr  3 13:05:26 2020
(r359591)
+++ stable/12/sys/kern/uipc_usrreq.cFri Apr  3 13:25:53 2020
(r359592)
@@ -523,8 +523,6 @@ uipc_attach(struct socket *so, int proto, struct threa
unp->unp_socket = so;
so->so_pcb = unp;
unp->unp_refcount = 1;
-   if (so->so_listen != NULL)
-   unp->unp_flags |= UNP_NASCENT;
 
if ((locked = UNP_LINK_WOWNED()) == false)
UNP_LINK_WLOCK();
@@ -796,9 +794,6 @@ uipc_detach(struct socket *so)
UNP_PCB_UNLOCK(unp);
goto restart;
}
-   if ((unp->unp_flags & UNP_NASCENT) != 0) {
-   goto teardown;
-   }
if ((vp = unp->unp_vnode) != NULL) {
VOP_UNP_DETACH(vp);
unp->unp_vnode = NULL;
@@ -840,7 +835,6 @@ uipc_detach(struct socket *so)
freeunp = unp_pcb_rele(unp);
MPASS(freeunp == 0);
local_unp_rights = unp_rights;
-teardown:
unp->unp_socket->so_pcb = NULL;
saved_unp_addr = unp->unp_addr;
unp->unp_addr = NULL;
@@ -1682,7 +1676,6 @@ unp_connect2(struct socket *so, struct socket *so2, in
 
if (so2->so_type != so->so_type)
return (EPROTOTYPE);
-   unp2->unp_flags &= ~UNP_NASCENT;
unp->unp_conn = unp2;
unp_pcb_hold(unp2);
unp_pcb_hold(unp);

Modified: stable/12/sys/sys/unpcb.h
==
--- stable/12/sys/sys/unpcb.h   Fri Apr  3 13:05:26 2020(r359591)
+++ stable/12/sys/sys/unpcb.h   Fri Apr  3 13:25:53 2020(r359592)
@@ -108,7 +108,6 @@ struct unpcb {
  */
 #defineUNP_CONNECTING  0x010   /* Currently 
connecting. */
 #defineUNP_BINDING 0x020   /* Currently binding. */
-#defineUNP_NASCENT 0x040   /* Newborn child 
socket. */
 
 /*
  * Flags in unp_gcflag.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r359594 - head/usr.bin/top

2020-04-03 Thread Mateusz Piotrowski

Hi,

On 4/3/20 3:35 PM, Mark Johnston wrote:

Author: markj
Date: Fri Apr  3 13:35:44 2020
New Revision: 359594
URL: https://svnweb.freebsd.org/changeset/base/359594

Log:
   Fix the description of the -m flag in top.1.
   
   PR:		244153

   Submitted by:fehmi noyan isi 
   MFC after:   3 days

Modified:
   head/usr.bin/top/top.1

Modified: head/usr.bin/top/top.1
==
--- head/usr.bin/top/top.1  Fri Apr  3 13:26:38 2020(r359593)
+++ head/usr.bin/top/top.1  Fri Apr  3 13:35:44 2020(r359594)
@@ -103,7 +103,7 @@ Toggle displaying thread ID (tid) instead of process i
  Do not display the
  .Nm
  process itself.
-.It Fl display
+.It Fl m

Shoudn't it be It "Fl m Ar display"?
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359596 - head/usr.bin/xargs

2020-04-03 Thread Mark Johnston
Author: markj
Date: Fri Apr  3 14:03:58 2020
New Revision: 359596
URL: https://svnweb.freebsd.org/changeset/base/359596

Log:
  xargs: Fix exit status expression when a child process fails to exec.
  
  PR:   244327
  Submitted by: thomas.duffy...@alumni.brown.edu
  MFC after:1 week

Modified:
  head/usr.bin/xargs/xargs.c

Modified: head/usr.bin/xargs/xargs.c
==
--- head/usr.bin/xargs/xargs.c  Fri Apr  3 13:57:41 2020(r359595)
+++ head/usr.bin/xargs/xargs.c  Fri Apr  3 14:03:58 2020(r359596)
@@ -650,7 +650,7 @@ waitchildren(const char *name, int waitall)
if (childerr != 0 && cause_exit == 0) {
errno = childerr;
waitall = 1;
-   cause_exit = ENOENT ? 127 : 126;
+   cause_exit = errno == ENOENT ? 127 : 126;
warn("%s", name);
} else if (WIFSIGNALED(status)) {
waitall = cause_exit = 1;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359595 - head/sys/geom/journal

2020-04-03 Thread Mark Johnston
Author: markj
Date: Fri Apr  3 13:57:41 2020
New Revision: 359595
URL: https://svnweb.freebsd.org/changeset/base/359595

Log:
  geom_journal: Only stop the switcher process if one was started.
  
  PR:   243196
  MFC after:1 week

Modified:
  head/sys/geom/journal/g_journal.c

Modified: head/sys/geom/journal/g_journal.c
==
--- head/sys/geom/journal/g_journal.c   Fri Apr  3 13:35:44 2020
(r359594)
+++ head/sys/geom/journal/g_journal.c   Fri Apr  3 13:57:41 2020
(r359595)
@@ -2757,7 +2757,8 @@ g_journal_fini(struct g_class *mp)
}
if (g_journal_event_lowmem != NULL)
EVENTHANDLER_DEREGISTER(vm_lowmem, g_journal_event_lowmem);
-   g_journal_stop_switcher();
+   if (g_journal_switcher_proc != NULL)
+   g_journal_stop_switcher();
 }
 
 DECLARE_GEOM_CLASS(g_journal_class, g_journal);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359594 - head/usr.bin/top

2020-04-03 Thread Mark Johnston
Author: markj
Date: Fri Apr  3 13:35:44 2020
New Revision: 359594
URL: https://svnweb.freebsd.org/changeset/base/359594

Log:
  Fix the description of the -m flag in top.1.
  
  PR:   244153
  Submitted by: fehmi noyan isi 
  MFC after:3 days

Modified:
  head/usr.bin/top/top.1

Modified: head/usr.bin/top/top.1
==
--- head/usr.bin/top/top.1  Fri Apr  3 13:26:38 2020(r359593)
+++ head/usr.bin/top/top.1  Fri Apr  3 13:35:44 2020(r359594)
@@ -103,7 +103,7 @@ Toggle displaying thread ID (tid) instead of process i
 Do not display the
 .Nm
 process itself.
-.It Fl display
+.It Fl m
 Display either 'cpu' or 'io' statistics.
 Default is 'cpu'.
 .It Fl n
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359593 - stable/12/sys/kern

2020-04-03 Thread Mark Johnston
Author: markj
Date: Fri Apr  3 13:26:38 2020
New Revision: 359593
URL: https://svnweb.freebsd.org/changeset/base/359593

Log:
  MFC r359171:
  Simplify uipc_detach() slightly.

Modified:
  stable/12/sys/kern/uipc_usrreq.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/uipc_usrreq.c
==
--- stable/12/sys/kern/uipc_usrreq.cFri Apr  3 13:25:53 2020
(r359592)
+++ stable/12/sys/kern/uipc_usrreq.cFri Apr  3 13:26:38 2020
(r359593)
@@ -763,7 +763,6 @@ uipc_detach(struct socket *so)
 {
struct unpcb *unp, *unp2;
struct mtx *vplock;
-   struct sockaddr_un *saved_unp_addr;
struct vnode *vp;
int freeunp, local_unp_rights;
 
@@ -787,8 +786,7 @@ uipc_detach(struct socket *so)
mtx_lock(vplock);
}
UNP_PCB_LOCK(unp);
-   if (unp->unp_vnode != vp &&
-   unp->unp_vnode != NULL) {
+   if (unp->unp_vnode != vp && unp->unp_vnode != NULL) {
if (vplock)
mtx_unlock(vplock);
UNP_PCB_UNLOCK(unp);
@@ -801,21 +799,20 @@ uipc_detach(struct socket *so)
if (__predict_false(unp == unp->unp_conn)) {
unp_disconnect(unp, unp);
unp2 = NULL;
-   goto connect_self;
+   } else {
+   if ((unp2 = unp->unp_conn) != NULL) {
+   unp_pcb_owned_lock2(unp, unp2, freeunp);
+   if (freeunp)
+   unp2 = NULL;
+   }
+   unp_pcb_hold(unp);
+   if (unp2 != NULL) {
+   unp_pcb_hold(unp2);
+   unp_disconnect(unp, unp2);
+   if (unp_pcb_rele(unp2) == 0)
+   UNP_PCB_UNLOCK(unp2);
+   }
}
-   if ((unp2 = unp->unp_conn) != NULL) {
-   unp_pcb_owned_lock2(unp, unp2, freeunp);
-   if (freeunp)
-   unp2 = NULL;
-   }
-   unp_pcb_hold(unp);
-   if (unp2 != NULL) {
-   unp_pcb_hold(unp2);
-   unp_disconnect(unp, unp2);
-   if (unp_pcb_rele(unp2) == 0)
-   UNP_PCB_UNLOCK(unp2);
-   }
- connect_self:
UNP_PCB_UNLOCK(unp);
UNP_REF_LIST_LOCK();
while (!LIST_EMPTY(>unp_refs)) {
@@ -836,13 +833,10 @@ uipc_detach(struct socket *so)
MPASS(freeunp == 0);
local_unp_rights = unp_rights;
unp->unp_socket->so_pcb = NULL;
-   saved_unp_addr = unp->unp_addr;
-   unp->unp_addr = NULL;
unp->unp_socket = NULL;
-   freeunp = unp_pcb_rele(unp);
-   if (saved_unp_addr != NULL)
-   free(saved_unp_addr, M_SONAME);
-   if (!freeunp)
+   free(unp->unp_addr, M_SONAME);
+   unp->unp_addr = NULL;
+   if (!unp_pcb_rele(unp))
UNP_PCB_UNLOCK(unp);
if (vp) {
mtx_unlock(vplock);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359591 - head/sbin/recoverdisk

2020-04-03 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Fri Apr  3 13:05:26 2020
New Revision: 359591
URL: https://svnweb.freebsd.org/changeset/base/359591

Log:
  Bump date after recent changes and lint

Modified:
  head/sbin/recoverdisk/recoverdisk.1

Modified: head/sbin/recoverdisk/recoverdisk.1
==
--- head/sbin/recoverdisk/recoverdisk.1 Fri Apr  3 05:11:16 2020
(r359590)
+++ head/sbin/recoverdisk/recoverdisk.1 Fri Apr  3 13:05:26 2020
(r359591)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 1, 2013
+.Dd April 3, 2020
 .Dt RECOVERDISK 1
 .Os
 .Sh NAME
@@ -72,9 +72,12 @@ The default is 60 and the unit is "progress messages" 
 go well, this is the same as once per minute.
 .It Fl u Ar pattern
 By default blocks which encounter read errors will be filled with
-the pattern "_UNREAD_" in the output file.  This option can be
-used to specify another pattern.  Nothing gets written if the string
-is empty.
+the pattern
+.Ql _UNREAD_
+in the output file.
+This option can be
+used to specify another pattern.
+Nothing gets written if the string is empty.
 .It Fl v
 Enables nicer status report using ANSI escapes and UTF-8.
 .It Fl w Ar writelist
@@ -164,7 +167,7 @@ This is harmless and can be avoided by setting
 to no more than 128kB.
 .Pp
 .Nm
-needs to know about read errors as fast as possible, i.e. retries by lower
+needs to know about read errors as fast as possible, i.e., retries by lower
 layers will usually slow down the operation.
 When using
 .Xr cam 4
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359589 - in stable/12/usr.sbin/pw: . tests

2020-04-03 Thread Baptiste Daroussin
Author: bapt
Date: Fri Apr  3 05:08:06 2020
New Revision: 359589
URL: https://svnweb.freebsd.org/changeset/base/359589

Log:
  MFC r359232:
  
  pw: do not removed home directories if not owned
  
  When deleting a user, if its home directory does not belong to it, it should
  not be removed. This is the promise that the manpage makes, the tool should
  ensure that it respects that promise.
  
  Add a regression test about it
  
  PR:  244967
  Submitted by: Eric Hanneken 

Modified:
  stable/12/usr.sbin/pw/rm_r.c
  stable/12/usr.sbin/pw/tests/pw_userdel_test.sh
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/pw/rm_r.c
==
--- stable/12/usr.sbin/pw/rm_r.cFri Apr  3 05:06:08 2020
(r359588)
+++ stable/12/usr.sbin/pw/rm_r.cFri Apr  3 05:08:06 2020
(r359589)
@@ -71,5 +71,8 @@ rm_r(int rootfd, const char *path, uid_t uid)
closedir(d);
if (fstatat(rootfd, path, , AT_SYMLINK_NOFOLLOW) != 0)
return;
-   unlinkat(rootfd, path, S_ISDIR(st.st_mode) ? AT_REMOVEDIR : 0);
+   if (S_ISLNK(st.st_mode))
+   unlinkat(rootfd, path, 0);
+   else if (st.st_uid == uid)
+   unlinkat(rootfd, path, AT_REMOVEDIR);
 }

Modified: stable/12/usr.sbin/pw/tests/pw_userdel_test.sh
==
--- stable/12/usr.sbin/pw/tests/pw_userdel_test.sh  Fri Apr  3 05:06:08 
2020(r359588)
+++ stable/12/usr.sbin/pw/tests/pw_userdel_test.sh  Fri Apr  3 05:08:06 
2020(r359589)
@@ -67,10 +67,30 @@ home_not_a_dir_body() {
atf_check ${RPW} userdel foo -r
 }
 
+atf_test_case home_shared
+home_shared_body() {
+   populate_root_etc_skel
+   mkdir ${HOME}/shared
+   atf_check ${RPW} useradd -n testuser1 -d /shared
+   atf_check ${RPW} useradd -n testuser2 -d /shared
+   atf_check ${RPW} userdel -n testuser1 -r
+   test -d ${HOME}/shared || atf_fail "Shared home has been removed"
+}
+
+atf_test_case home_regular_dir
+home_regular_dir_body() {
+   populate_root_etc_skel
+   atf_check ${RPW} useradd -n foo -d /foo
+   atf_check ${RPW} userdel -n foo -r
+   [ ! -d ${HOME}/foo ] || atf_fail "Home has not been removed"
+}
+
 atf_init_test_cases() {
atf_add_test_case rmuser_seperate_group
atf_add_test_case user_do_not_try_to_delete_root_if_user_unknown
atf_add_test_case delete_files
atf_add_test_case delete_numeric_name
atf_add_test_case home_not_a_dir
+   atf_add_test_case home_shared
+   atf_add_test_case home_regular_dir
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"