--- old/usr/src/cmd/find/find.c	Thu Feb 20 06:47:06 2020
+++ new/usr/src/cmd/find/find.c	Thu Feb 20 06:47:06 2020
@@ -22,6 +22,7 @@
  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
  * Copyright (c) 2013 Andrew Stormont.  All rights reserved.
+ * Copyright 2020 Joyent, Inc.
  */
 
 
@@ -1027,9 +1028,12 @@
 			 * /usr/bin/find  will not pattern match a leading
 			 * '.' in a filename, unless '.' is explicitly
 			 * specified.
+			 *
+			 * The legacy behavior makes no sense for PATH.
 			 */
 #ifndef XPG4
-			fnmflags |= FNM_PERIOD;
+			if (np->action == NAME || np->action == INAME)
+				fnmflags |= FNM_PERIOD;
 #endif
 
 			val = !fnmatch(np->first.cp,
--- old/usr/src/man/man1/find.1	Thu Feb 20 06:47:06 2020
+++ new/usr/src/man/man1/find.1	Thu Feb 20 06:47:06 2020
@@ -45,12 +45,12 @@
 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
 .\" Copyright 2011 Nexenta Systems, Inc. All rights reserved.
 .\" Copyright (c) 2013 Andrew Stormont.  All rights reserved.
+.\" Copyright 2020 Joyent, Inc.
 .\"
-.TH FIND 1 "Sep 5, 2011"
+.TH FIND 1 "Feb 20, 2020"
 .SH NAME
 find \- find files
 .SH SYNOPSIS
-.LP
 .nf
 \fB/usr/bin/find\fR [\fB-E\fR] [\fB-H\fR | \fB-L\fR] \fIpath\fR... \fIexpression\fR
 .fi
@@ -61,7 +61,6 @@
 .fi
 
 .SH DESCRIPTION
-.LP
 The \fBfind\fR utility recursively descends the directory hierarchy for each
 \fIpath\fR seeking files that match a Boolean \fIexpression\fR written in the
 primaries specified below.
@@ -75,7 +74,6 @@
 \fBfind\fR detects infinite loops; that is, entering a previously visited
 directory that is an ancestor of the last file encountered.
 .SH OPTIONS
-.LP
 The following options are supported:
 .sp
 .ne 2
@@ -117,7 +115,6 @@
 \fB-L\fR is not considered an error. The last option specified determines the
 behavior of the utility.
 .SH OPERANDS
-.LP
 The following operands are supported:
 .sp
 .ne 2
@@ -169,7 +166,6 @@
 .RE
 
 .SS "Expressions"
-.LP
 Valid expressions are:
 .sp
 .ne 2
@@ -549,7 +545,8 @@
 \fB\fB-path\fR\fR
 .ad
 .RS 17n
-Like \fB-name\fR, but matches the entire file path and not just basename.
+Like \fB-name\fR, but matches the entire file path and not just basename, and
+without any special treatment of leading periods.
 .RE
 
 .sp
@@ -717,7 +714,6 @@
 .RE
 
 .SS "Complex Expressions"
-.LP
 The primaries can be combined using the following operators (in order of
 decreasing precedence):
 .sp
@@ -783,11 +779,9 @@
 respective arguments only once. Invocation of \fIcommand\fR specified by
 \fB-exec\fR or \fB-ok\fR does not affect subsequent primaries on the same file.
 .SH USAGE
-.LP
 See \fBlargefile\fR(5) for the description of the behavior of \fBfind\fR when
 encountering files greater than or equal to 2 Gbyte (2^31 bytes).
 .SH EXAMPLES
-.LP
 \fBExample 1 \fRWriting Out the Hierarchy Directory
 .sp
 .LP
@@ -957,7 +951,6 @@
 .sp
 
 .SH ENVIRONMENT VARIABLES
-.LP
 See \fBenviron\fR(5) for descriptions of the following environment variables
 that affect the execution of \fBfind\fR: \fBLANG\fR, \fBLC_ALL\fR,
 \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
@@ -982,7 +975,6 @@
 bytes of text data a characters, the behavior of character classes used in the
 expression defined for the \fByesexpr\fR. See \fBlocale\fR(5).
 .SH EXIT STATUS
-.LP
 The following exit values are returned:
 .sp
 .ne 2
@@ -1030,7 +1022,6 @@
 .RE
 
 .SH ATTRIBUTES
-.LP
 See \fBattributes\fR(5) for descriptions of the following attributes:
 .sp
 
@@ -1049,13 +1040,11 @@
 .TE
 
 .SH SEE ALSO
-.LP
 \fBchmod\fR(1), \fBcpio\fR(1), \fBsh\fR(1), \fBtest\fR(1), \fBls\fR(1B),
 \fBacl\fR(5), \fBregex\fR(5), \fBstat\fR(2), \fBumask\fR(2),
 \fBattributes\fR(5), \fBenviron\fR(5), \fBfsattr\fR(5), \fBlargefile\fR(5),
 \fBlocale\fR(5), \fBstandards\fR(5)
 .SH WARNINGS
-.LP
 The following options are obsolete and will not be supported in future
 releases:
 .sp
@@ -1079,7 +1068,6 @@
 .RE
 
 .SH NOTES
-.LP
 When using \fBfind\fR to determine files modified within a range of time, use
 the \fB-mtime\fR argument \fBbefore\fR the \fB-print\fR argument. Otherwise,
 \fBfind\fR gives all files.
--- old/usr/src/pkg/manifests/system-test-utiltest.mf	Thu Feb 20 06:47:06 2020
+++ new/usr/src/pkg/manifests/system-test-utiltest.mf	Thu Feb 20 06:47:06 2020
@@ -55,6 +55,7 @@
 dir path=opt/util-tests/tests/files/make_a/b
 dir path=opt/util-tests/tests/files/make_a/c
 dir path=opt/util-tests/tests/files/make_l
+dir path=opt/util-tests/tests/find
 dir path=opt/util-tests/tests/libcustr
 dir path=opt/util-tests/tests/libnvpair_json
 dir path=opt/util-tests/tests/libsff
@@ -1421,6 +1422,7 @@
 file path=opt/util-tests/tests/files/test6 mode=0444
 file path=opt/util-tests/tests/files/test7 mode=0444
 file path=opt/util-tests/tests/files/testnl mode=0444
+file path=opt/util-tests/tests/find/findtest mode=0555
 file path=opt/util-tests/tests/grep_test mode=0555
 file path=opt/util-tests/tests/iconv_test mode=0555
 file path=opt/util-tests/tests/libcustr/custr_remove mode=0555
--- old/usr/src/test/util-tests/tests/Makefile	Thu Feb 20 06:47:06 2020
+++ new/usr/src/test/util-tests/tests/Makefile	Thu Feb 20 06:47:06 2020
@@ -20,6 +20,6 @@
 
 SUBDIRS = date dis dladm iconv libnvpair_json libsff printf xargs grep_xpg4
 SUBDIRS += demangle mergeq workq chown ctf smbios libjedec awk make sleep
-SUBDIRS += libcustr
+SUBDIRS += libcustr find
 
 include $(SRC)/test/Makefile.com
--- /dev/null	Thu Feb 20 06:47:06 2020
+++ new/usr/src/test/util-tests/tests/find/Makefile	Thu Feb 20 06:47:06 2020
@@ -0,0 +1,41 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2020 Joyent, Inc.
+#
+
+include $(SRC)/cmd/Makefile.cmd
+include $(SRC)/test/Makefile.com
+
+ROOTOPTPKG = $(ROOT)/opt/util-tests/tests/find
+PROG = findtest
+
+ROOTPROG = $(PROG:%=$(ROOTOPTPKG)/%)
+
+all:
+
+install: $(ROOTPROG)
+
+clobber: clean
+
+clean:
+
+$(CMDS): $(TESTDIR)
+
+$(ROOTOPTPKG):
+	$(INS.dir)
+
+$(ROOTOPTPKG)/%: %.ksh $(ROOTOPTPKG)
+	$(INS.rename)
+
+$(ROOTOPTPKG)/%: % $(ROOTOPTPKG)
+	$(INS.file)
--- /dev/null	Thu Feb 20 06:47:06 2020
+++ new/usr/src/test/util-tests/tests/find/findtest.ksh	Thu Feb 20 06:47:06 2020
@@ -0,0 +1,72 @@
+#!/bin/ksh
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2020 Joyent, Inc.
+#
+
+#
+# Clearly, grossly incomplete.
+#
+
+export LC_ALL=C.UTF-8
+
+set -o pipefail
+unalias -a
+
+find_prog=/usr/bin/find
+find_prog_xpg4=/usr/xpg4/bin/find
+find_dir="$(mktemp -d -p /tmp/)"
+find_exit=0
+
+testfind()
+{
+	exp=$1
+	shift
+	cmd="$@"
+
+	echo "TEST: $cmd"
+
+	out=$(eval $cmd | tr '\n' ',')
+
+	[[ "$exp" = "$out" ]] || {
+		echo "TEST FAILED: $cmd" >&2
+		echo "expected: $exp" >&2
+		echo "got: $out" >&2
+		find_exit=1
+	}
+}
+
+mkdir -p $find_dir/1
+mkdir -p $find_dir/.2
+touch $find_dir/.2/1
+touch $find_dir/.2/c
+
+testfind "$find_dir/1,$find_dir/.2/1," \
+    $find_prog $find_dir -name \"1\"
+testfind "$find_dir/1,$find_dir/.2/1," \
+    $find_prog $find_dir -path \"*1\"
+
+cd $find_dir
+
+testfind "" $find_prog . -name \"*2\"
+testfind "./.2," $find_prog_xpg4 . -name \"*2\"
+testfind "./.2," $find_prog . -name \".*2\"
+testfind "./.2," $find_prog_xpg4 . -name \".*2\"
+testfind "./1,./.2/1," $find_prog . -path \"*1\"
+testfind "./.2," $find_prog . -path \"*2\"
+testfind "./.2,./.2/1,./.2/c," $find_prog . -path \"*2*\"
+
+cd -
+rm -rf $find_dir
+
+exit $find_exit
