svn commit: r304039 - in projects/netbsd-tests-update-12: . bin/ps cddl/usr.sbin/dtrace/tests/common/raise cddl/usr.sbin/dtrace/tests/common/safety cddl/usr.sbin/dtrace/tests/tools etc/rc.d include...
Garrett Cooper
ngie at FreeBSD.org
Sat Aug 13 06:16:41 UTC 2016
Author: ngie
Date: Sat Aug 13 06:16:38 2016
New Revision: 304039
URL: https://svnweb.freebsd.org/changeset/base/304039
Log:
MFhead @ r304038
Added:
projects/netbsd-tests-update-12/lib/libc/gen/dirname_compat.c
- copied unchanged from r304038, head/lib/libc/gen/dirname_compat.c
projects/netbsd-tests-update-12/libexec/rtld-elf/rtld_utrace.h
- copied unchanged from r304038, head/libexec/rtld-elf/rtld_utrace.h
projects/netbsd-tests-update-12/sys/boot/fdt/dts/arm/pcduino3.dts
- copied unchanged from r304038, head/sys/boot/fdt/dts/arm/pcduino3.dts
projects/netbsd-tests-update-12/sys/compat/cloudabi/cloudabi_vdso.c
- copied unchanged from r304038, head/sys/compat/cloudabi/cloudabi_vdso.c
projects/netbsd-tests-update-12/sys/compat/cloudabi64/cloudabi64_vdso.lds.s
- copied unchanged from r304038, head/sys/compat/cloudabi64/cloudabi64_vdso.lds.s
projects/netbsd-tests-update-12/sys/dev/hyperv/include/vmbus_xact.h
- copied unchanged from r304038, head/sys/dev/hyperv/include/vmbus_xact.h
projects/netbsd-tests-update-12/sys/dev/hyperv/netvsc/if_hnreg.h
- copied unchanged from r304038, head/sys/dev/hyperv/netvsc/if_hnreg.h
projects/netbsd-tests-update-12/sys/dev/hyperv/netvsc/if_hnvar.h
- copied unchanged from r304038, head/sys/dev/hyperv/netvsc/if_hnvar.h
projects/netbsd-tests-update-12/sys/dev/hyperv/vmbus/vmbus_xact.c
- copied unchanged from r304038, head/sys/dev/hyperv/vmbus/vmbus_xact.c
projects/netbsd-tests-update-12/sys/kern/subr_gtaskqueue.c
- copied unchanged from r304038, head/sys/kern/subr_gtaskqueue.c
projects/netbsd-tests-update-12/sys/riscv/include/sbi.h
- copied unchanged from r304038, head/sys/riscv/include/sbi.h
projects/netbsd-tests-update-12/sys/riscv/riscv/riscv_console.c
- copied unchanged from r304038, head/sys/riscv/riscv/riscv_console.c
projects/netbsd-tests-update-12/sys/riscv/riscv/sbi.S
- copied unchanged from r304038, head/sys/riscv/riscv/sbi.S
projects/netbsd-tests-update-12/sys/sys/gtaskqueue.h
- copied unchanged from r304038, head/sys/sys/gtaskqueue.h
Deleted:
projects/netbsd-tests-update-12/sys/boot/fdt/dts/arm/pcduino3b.dts
projects/netbsd-tests-update-12/sys/riscv/htif/
projects/netbsd-tests-update-12/usr.bin/kdump/linux32_syscalls.conf
projects/netbsd-tests-update-12/usr.bin/kdump/linux_syscalls.conf
projects/netbsd-tests-update-12/usr.bin/truss/makesyscallsconf.sh
Modified:
projects/netbsd-tests-update-12/Makefile
projects/netbsd-tests-update-12/Makefile.inc1
projects/netbsd-tests-update-12/bin/ps/ps.1
projects/netbsd-tests-update-12/cddl/usr.sbin/dtrace/tests/common/raise/Makefile
projects/netbsd-tests-update-12/cddl/usr.sbin/dtrace/tests/common/safety/Makefile
projects/netbsd-tests-update-12/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
projects/netbsd-tests-update-12/etc/rc.d/jail
projects/netbsd-tests-update-12/include/unistd.h
projects/netbsd-tests-update-12/lib/libc/gen/Makefile.inc
projects/netbsd-tests-update-12/lib/libc/gen/Symbol.map
projects/netbsd-tests-update-12/lib/libc/gen/dirname.3
projects/netbsd-tests-update-12/lib/libc/gen/dirname.c
projects/netbsd-tests-update-12/lib/libc/net/getaddrinfo.c
projects/netbsd-tests-update-12/lib/libc/tests/resolv/resolv_test.c
projects/netbsd-tests-update-12/lib/libcrypt/Makefile
projects/netbsd-tests-update-12/lib/libcrypt/crypt-md5.c
projects/netbsd-tests-update-12/lib/libcrypt/crypt-nthash.c
projects/netbsd-tests-update-12/lib/libcrypt/crypt-sha256.c
projects/netbsd-tests-update-12/lib/libcrypt/crypt-sha512.c
projects/netbsd-tests-update-12/lib/libcrypt/crypt.3
projects/netbsd-tests-update-12/lib/libcrypt/crypt.c
projects/netbsd-tests-update-12/lib/libcrypt/crypt.h
projects/netbsd-tests-update-12/lib/libcrypt/misc.c
projects/netbsd-tests-update-12/lib/libsysdecode/Makefile
projects/netbsd-tests-update-12/lib/libsysdecode/utrace.c
projects/netbsd-tests-update-12/libexec/rtld-elf/rtld.c
projects/netbsd-tests-update-12/sbin/ipfw/ipfw2.c
projects/netbsd-tests-update-12/secure/lib/libcrypt/crypt-blowfish.c
projects/netbsd-tests-update-12/secure/lib/libcrypt/crypt-des.c
projects/netbsd-tests-update-12/share/misc/committers-src.dot
projects/netbsd-tests-update-12/share/mk/bsd.README
projects/netbsd-tests-update-12/share/mk/bsd.progs.mk
projects/netbsd-tests-update-12/sys/amd64/amd64/pmap.c
projects/netbsd-tests-update-12/sys/amd64/amd64/trap.c
projects/netbsd-tests-update-12/sys/amd64/cloudabi64/cloudabi64_sysvec.c
projects/netbsd-tests-update-12/sys/arm64/arm64/pmap.c
projects/netbsd-tests-update-12/sys/arm64/arm64/trap.c
projects/netbsd-tests-update-12/sys/arm64/arm64/vm_machdep.c
projects/netbsd-tests-update-12/sys/arm64/cloudabi64/cloudabi64_sysvec.c
projects/netbsd-tests-update-12/sys/arm64/include/pmap.h
projects/netbsd-tests-update-12/sys/boot/efi/loader/Makefile
projects/netbsd-tests-update-12/sys/boot/fdt/dts/riscv/qemu.dts
projects/netbsd-tests-update-12/sys/boot/fdt/dts/riscv/rocket.dts
projects/netbsd-tests-update-12/sys/boot/fdt/dts/riscv/spike.dts
projects/netbsd-tests-update-12/sys/boot/i386/btx/btxldr/btxldr.S
projects/netbsd-tests-update-12/sys/boot/i386/libi386/smbios.c
projects/netbsd-tests-update-12/sys/cam/scsi/scsi_da.c
projects/netbsd-tests-update-12/sys/compat/cloudabi/cloudabi_util.h
projects/netbsd-tests-update-12/sys/compat/cloudabi64/cloudabi64_module.c
projects/netbsd-tests-update-12/sys/conf/files
projects/netbsd-tests-update-12/sys/conf/files.amd64
projects/netbsd-tests-update-12/sys/conf/files.arm64
projects/netbsd-tests-update-12/sys/conf/files.i386
projects/netbsd-tests-update-12/sys/conf/files.riscv
projects/netbsd-tests-update-12/sys/conf/kern.post.mk
projects/netbsd-tests-update-12/sys/conf/ldscript.riscv
projects/netbsd-tests-update-12/sys/dev/filemon/filemon.c
projects/netbsd-tests-update-12/sys/dev/hyperv/include/vmbus.h
projects/netbsd-tests-update-12/sys/dev/hyperv/netvsc/hv_net_vsc.c
projects/netbsd-tests-update-12/sys/dev/hyperv/netvsc/hv_net_vsc.h
projects/netbsd-tests-update-12/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
projects/netbsd-tests-update-12/sys/dev/hyperv/netvsc/hv_rndis.h
projects/netbsd-tests-update-12/sys/dev/hyperv/netvsc/hv_rndis_filter.c
projects/netbsd-tests-update-12/sys/dev/hyperv/netvsc/hv_rndis_filter.h
projects/netbsd-tests-update-12/sys/dev/hyperv/vmbus/vmbus.c
projects/netbsd-tests-update-12/sys/dev/hyperv/vmbus/vmbus_var.h
projects/netbsd-tests-update-12/sys/dev/virtio/network/if_vtnet.c
projects/netbsd-tests-update-12/sys/dev/virtio/network/if_vtnetvar.h
projects/netbsd-tests-update-12/sys/fs/autofs/autofs_vnops.c
projects/netbsd-tests-update-12/sys/fs/nfs/nfs_commonkrpc.c
projects/netbsd-tests-update-12/sys/fs/nfs/nfs_commonport.c
projects/netbsd-tests-update-12/sys/fs/nfs/nfsport.h
projects/netbsd-tests-update-12/sys/fs/nfs/nfsproto.h
projects/netbsd-tests-update-12/sys/fs/nfsclient/nfs_clbio.c
projects/netbsd-tests-update-12/sys/fs/nfsclient/nfs_clcomsubs.c
projects/netbsd-tests-update-12/sys/fs/nfsclient/nfs_clstate.c
projects/netbsd-tests-update-12/sys/fs/nfsclient/nfs_clsubs.c
projects/netbsd-tests-update-12/sys/fs/nfsclient/nfs_clvfsops.c
projects/netbsd-tests-update-12/sys/fs/nfsclient/nfs_clvnops.c
projects/netbsd-tests-update-12/sys/fs/nfsserver/nfs_nfsdcache.c
projects/netbsd-tests-update-12/sys/fs/nfsserver/nfs_nfsdport.c
projects/netbsd-tests-update-12/sys/fs/nfsserver/nfs_nfsdsocket.c
projects/netbsd-tests-update-12/sys/fs/nfsserver/nfs_nfsdstate.c
projects/netbsd-tests-update-12/sys/fs/smbfs/smbfs_node.c
projects/netbsd-tests-update-12/sys/fs/tmpfs/tmpfs_subr.c
projects/netbsd-tests-update-12/sys/fs/unionfs/union_vnops.c
projects/netbsd-tests-update-12/sys/i386/i386/trap.c
projects/netbsd-tests-update-12/sys/kern/kern_descrip.c
projects/netbsd-tests-update-12/sys/kern/kern_kthread.c
projects/netbsd-tests-update-12/sys/kern/kern_ktrace.c
projects/netbsd-tests-update-12/sys/kern/kern_timeout.c
projects/netbsd-tests-update-12/sys/kern/subr_taskqueue.c
projects/netbsd-tests-update-12/sys/kern/vfs_bio.c
projects/netbsd-tests-update-12/sys/kern/vfs_cluster.c
projects/netbsd-tests-update-12/sys/kern/vfs_default.c
projects/netbsd-tests-update-12/sys/kern/vfs_lookup.c
projects/netbsd-tests-update-12/sys/kern/vfs_mount.c
projects/netbsd-tests-update-12/sys/kern/vfs_subr.c
projects/netbsd-tests-update-12/sys/kern/vnode_if.src
projects/netbsd-tests-update-12/sys/modules/cloudabi/Makefile
projects/netbsd-tests-update-12/sys/modules/cloudabi64/Makefile
projects/netbsd-tests-update-12/sys/modules/dtb/allwinner/Makefile
projects/netbsd-tests-update-12/sys/modules/hyperv/vmbus/Makefile
projects/netbsd-tests-update-12/sys/net/ifdi_if.m
projects/netbsd-tests-update-12/sys/net/iflib.c
projects/netbsd-tests-update-12/sys/net/iflib.h
projects/netbsd-tests-update-12/sys/netinet/ip_fw.h
projects/netbsd-tests-update-12/sys/netinet/sctp_indata.c
projects/netbsd-tests-update-12/sys/netinet/tcp_fastopen.c
projects/netbsd-tests-update-12/sys/netpfil/ipfw/ip_fw2.c
projects/netbsd-tests-update-12/sys/netpfil/ipfw/ip_fw_sockopt.c
projects/netbsd-tests-update-12/sys/powerpc/include/bus_dma.h
projects/netbsd-tests-update-12/sys/riscv/conf/GENERIC
projects/netbsd-tests-update-12/sys/riscv/conf/QEMU
projects/netbsd-tests-update-12/sys/riscv/conf/ROCKET
projects/netbsd-tests-update-12/sys/riscv/conf/SPIKE
projects/netbsd-tests-update-12/sys/riscv/include/cpufunc.h
projects/netbsd-tests-update-12/sys/riscv/include/pcpu.h
projects/netbsd-tests-update-12/sys/riscv/include/riscvreg.h
projects/netbsd-tests-update-12/sys/riscv/include/vmparam.h
projects/netbsd-tests-update-12/sys/riscv/riscv/exception.S
projects/netbsd-tests-update-12/sys/riscv/riscv/genassym.c
projects/netbsd-tests-update-12/sys/riscv/riscv/identcpu.c
projects/netbsd-tests-update-12/sys/riscv/riscv/intr_machdep.c
projects/netbsd-tests-update-12/sys/riscv/riscv/locore.S
projects/netbsd-tests-update-12/sys/riscv/riscv/machdep.c
projects/netbsd-tests-update-12/sys/riscv/riscv/mp_machdep.c
projects/netbsd-tests-update-12/sys/riscv/riscv/pmap.c
projects/netbsd-tests-update-12/sys/riscv/riscv/timer.c
projects/netbsd-tests-update-12/sys/riscv/riscv/vm_machdep.c
projects/netbsd-tests-update-12/sys/sys/_task.h
projects/netbsd-tests-update-12/sys/sys/buf.h
projects/netbsd-tests-update-12/sys/sys/taskqueue.h
projects/netbsd-tests-update-12/sys/sys/vnode.h
projects/netbsd-tests-update-12/sys/tools/embed_mfs.sh
projects/netbsd-tests-update-12/sys/ufs/ffs/ffs_snapshot.c
projects/netbsd-tests-update-12/sys/ufs/ffs/ffs_vnops.c
projects/netbsd-tests-update-12/sys/ufs/ufs/ufs_lookup.c
projects/netbsd-tests-update-12/sys/ufs/ufs/ufs_quota.c
projects/netbsd-tests-update-12/sys/vm/vm_object.c
projects/netbsd-tests-update-12/sys/vm/vm_pageout.c
projects/netbsd-tests-update-12/tools/tools/ath/ath_ee_9300_print/main.c
projects/netbsd-tests-update-12/usr.bin/kdump/kdump.c
projects/netbsd-tests-update-12/usr.bin/truss/syscalls.c
projects/netbsd-tests-update-12/usr.bin/xinstall/xinstall.c
projects/netbsd-tests-update-12/usr.sbin/acpi/acpidump/acpi.c
Directory Properties:
projects/netbsd-tests-update-12/ (props changed)
projects/netbsd-tests-update-12/cddl/ (props changed)
Modified: projects/netbsd-tests-update-12/Makefile
==============================================================================
--- projects/netbsd-tests-update-12/Makefile Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/Makefile Sat Aug 13 06:16:38 2016 (r304039)
@@ -209,7 +209,8 @@ SUB_MAKE= `test -x ${MYMAKE} && echo ${M
SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk
.endif
-_MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH}
+_MAKE= PATH=${PATH} MAKE_CMD=${MAKE} ${SUB_MAKE} -f Makefile.inc1 \
+ TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH}
# Only allow meta mode for the whitelisted targets. See META_TGT_WHITELIST
# above.
Modified: projects/netbsd-tests-update-12/Makefile.inc1
==============================================================================
--- projects/netbsd-tests-update-12/Makefile.inc1 Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/Makefile.inc1 Sat Aug 13 06:16:38 2016 (r304039)
@@ -1013,7 +1013,7 @@ distributeworld installworld stageworld:
${IMAKEENV} rm -rf ${INSTALLTMP}
.if make(distributeworld)
.for dist in ${EXTRA_DISTRIBUTIONS}
- find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -empty -delete
+ find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -type d -empty -delete
.endfor
.if defined(NO_ROOT)
.for dist in base ${EXTRA_DISTRIBUTIONS}
@@ -2378,11 +2378,11 @@ check-old-dirs: .PHONY
done
delete-old: delete-old-files delete-old-dirs .PHONY
- @echo "To remove old libraries run '${MAKE} delete-old-libs'."
+ @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'."
check-old: check-old-files check-old-libs check-old-dirs .PHONY
- @echo "To remove old files and directories run '${MAKE} delete-old'."
- @echo "To remove old libraries run '${MAKE} delete-old-libs'."
+ @echo "To remove old files and directories run '${MAKE_CMD} delete-old'."
+ @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'."
.endif
Modified: projects/netbsd-tests-update-12/bin/ps/ps.1
==============================================================================
--- projects/netbsd-tests-update-12/bin/ps/ps.1 Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/bin/ps/ps.1 Sat Aug 13 06:16:38 2016 (r304039)
@@ -29,7 +29,7 @@
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd July 28, 2016
+.Dd August 12, 2016
.Dt PS 1
.Os
.Sh NAME
@@ -319,7 +319,6 @@ the include file
.It Dv "P_ADVLOCK" Ta No "0x00001" Ta "Process may hold a POSIX advisory lock"
.It Dv "P_CONTROLT" Ta No "0x00002" Ta "Has a controlling terminal"
.It Dv "P_KPROC" Ta No "0x00004" Ta "Kernel process"
-.It Dv "P_FOLLOWFORK" Ta No "0x00008" Ta "Attach debugger to new children"
.It Dv "P_PPWAIT" Ta No "0x00010" Ta "Parent is waiting for child to exec/exit"
.It Dv "P_PROFIL" Ta No "0x00020" Ta "Has started profiling"
.It Dv "P_STOPPROF" Ta No "0x00040" Ta "Has thread in requesting to stop prof"
@@ -768,7 +767,8 @@ operating systems.
The
.Nm
command appeared in
-.At v4 .
+.At v3
+in section 8 of the manual.
.Sh BUGS
Since
.Nm
Modified: projects/netbsd-tests-update-12/cddl/usr.sbin/dtrace/tests/common/raise/Makefile
==============================================================================
--- projects/netbsd-tests-update-12/cddl/usr.sbin/dtrace/tests/common/raise/Makefile Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/cddl/usr.sbin/dtrace/tests/common/raise/Makefile Sat Aug 13 06:16:38 2016 (r304039)
@@ -20,4 +20,6 @@ CFILES= \
tst.raise3.c \
+TEST_METADATA.t_dtrace_contrib+= required_memory="4g"
+
.include "../../dtrace.test.mk"
Modified: projects/netbsd-tests-update-12/cddl/usr.sbin/dtrace/tests/common/safety/Makefile
==============================================================================
--- projects/netbsd-tests-update-12/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Sat Aug 13 06:16:38 2016 (r304039)
@@ -53,4 +53,6 @@ CFILES= \
+TEST_METADATA.t_dtrace_contrib+= required_memory="4g"
+
.include "../../dtrace.test.mk"
Modified: projects/netbsd-tests-update-12/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
==============================================================================
--- projects/netbsd-tests-update-12/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Sat Aug 13 06:16:38 2016 (r304039)
@@ -34,15 +34,28 @@ genmakefile()
# One-off variable definitions.
local special
- if [ "$basedir" = proc ]; then
+ case "$basedir" in
+ proc)
special="
LIBADD.tst.sigwait.exe+= rt
"
- elif [ "$basedir" = uctf ]; then
+ ;;
+ raise)
+ special="
+TEST_METADATA.t_dtrace_contrib+= required_memory=\"4g\"
+"
+ ;;
+ safety)
+ special="
+TEST_METADATA.t_dtrace_contrib+= required_memory=\"4g\"
+"
+ ;;
+ uctf)
special="
WITH_CTF=YES
"
- fi
+ ;;
+ esac
local makefile=$(mktemp)
cat <<__EOF__ > $makefile
Modified: projects/netbsd-tests-update-12/etc/rc.d/jail
==============================================================================
--- projects/netbsd-tests-update-12/etc/rc.d/jail Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/etc/rc.d/jail Sat Aug 13 06:16:38 2016 (r304039)
@@ -260,6 +260,7 @@ parse_options()
extract_var $_jv set_hostname_allow allow.set_hostname YN NO
extract_var $_jv sysvipc_allow allow.sysvipc YN NO
+ extract_var $_jv enforce_statfs enforce_statfs - 2
extract_var $_jv osreldate osreldate
extract_var $_jv osrelease osrelease
for _p in $_parameters; do
Modified: projects/netbsd-tests-update-12/include/unistd.h
==============================================================================
--- projects/netbsd-tests-update-12/include/unistd.h Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/include/unistd.h Sat Aug 13 06:16:38 2016 (r304039)
@@ -484,11 +484,18 @@ pid_t vfork(void) __returns_twice;
#if __BSD_VISIBLE
struct timeval; /* select(2) */
+
+struct crypt_data {
+ int initialized; /* For compatibility with glibc. */
+ char __buf[256]; /* Buffer returned by crypt_r(). */
+};
+
int acct(const char *);
int async_daemon(void);
int check_utility_compat(const char *);
const char *
crypt_get_format(void);
+char *crypt_r(const char *, const char *, struct crypt_data *);
int crypt_set_format(const char *);
int des_cipher(const char *, char *, long, int);
int des_setkey(const char *key);
Modified: projects/netbsd-tests-update-12/lib/libc/gen/Makefile.inc
==============================================================================
--- projects/netbsd-tests-update-12/lib/libc/gen/Makefile.inc Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/lib/libc/gen/Makefile.inc Sat Aug 13 06:16:38 2016 (r304039)
@@ -29,6 +29,7 @@ SRCS+= __getosreldate.c \
devname.c \
dirfd.c \
dirname.c \
+ dirname_compat.c \
disklabel.c \
dlfcn.c \
drand48.c \
Modified: projects/netbsd-tests-update-12/lib/libc/gen/Symbol.map
==============================================================================
--- projects/netbsd-tests-update-12/lib/libc/gen/Symbol.map Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/lib/libc/gen/Symbol.map Sat Aug 13 06:16:38 2016 (r304039)
@@ -82,7 +82,6 @@ FBSD_1.0 {
daemon;
devname;
devname_r;
- dirname;
getdiskbyname;
dladdr;
dlclose;
@@ -418,6 +417,10 @@ FBSD_1.4 {
stravis;
};
+FBSD_1.5 {
+ dirname;
+};
+
FBSDprivate_1.0 {
/* needed by thread libraries */
__thr_jtable;
Modified: projects/netbsd-tests-update-12/lib/libc/gen/dirname.3
==============================================================================
--- projects/netbsd-tests-update-12/lib/libc/gen/dirname.3 Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/lib/libc/gen/dirname.3 Sat Aug 13 06:16:38 2016 (r304039)
@@ -16,7 +16,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 29, 2016
+.Dd August 12, 2016
.Dt DIRNAME 3
.Os
.Sh NAME
@@ -37,6 +37,7 @@ Any trailing
.Sq \&/
characters are not counted as part of the directory
name.
+.Sh RETURN VALUES
If
.Fa path
is a null pointer, the empty string, or contains no
@@ -46,40 +47,24 @@ characters,
returns a pointer to the string
.Qq \&. ,
signifying the current directory.
+Otherwise,
+it returns a pointer to the parent directory of
+.Fa path .
.Sh IMPLEMENTATION NOTES
-The
+This implementation of
.Fn dirname
-function
-returns a pointer to internal storage space allocated on the first call
-that will be overwritten
-by subsequent calls.
+uses the buffer provided by the caller to store the resulting parent
+directory.
+Other vendor implementations may return a pointer to internal storage
+space instead.
+The advantage of the former approach is that it ensures thread-safety,
+while also placing no upper limit on the supported length of the
+pathname.
.Pp
-Other vendor implementations of
-.Fn dirname
-may store their result in the input buffer,
-making it safe to use in multithreaded applications.
-Future versions of
-.Fx
-will follow this approach as well.
-.Sh RETURN VALUES
-On successful completion,
-.Fn dirname
-returns a pointer to the parent directory of
-.Fa path .
-.Pp
-If
-.Fn dirname
-fails, a null pointer is returned and the global variable
-.Va errno
-is set to indicate the error.
-.Sh ERRORS
-The following error codes may be set in
-.Va errno :
-.Bl -tag -width Er
-.It Bq Er ENAMETOOLONG
-The path component to be returned was larger than
-.Dv MAXPATHLEN .
-.El
+The algorithm used by this implementation also discards redundant
+slashes and
+.Qq \&.
+pathname components from the pathname string.
.Sh SEE ALSO
.Xr basename 1 ,
.Xr dirname 1 ,
@@ -96,5 +81,10 @@ function first appeared in
.Ox 2.2
and
.Fx 4.2 .
+.Pp
+In
+.Fx 12.0 ,
+this function was reimplemented to store its result in the provided
+input buffer.
.Sh AUTHORS
-.An "Todd C. Miller"
+.An Nuxi, the Netherlands
Modified: projects/netbsd-tests-update-12/lib/libc/gen/dirname.c
==============================================================================
--- projects/netbsd-tests-update-12/lib/libc/gen/dirname.c Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/lib/libc/gen/dirname.c Sat Aug 13 06:16:38 2016 (r304039)
@@ -1,77 +1,90 @@
-/* $OpenBSD: dirname.c,v 1.13 2005/08/08 08:05:33 espie Exp $ */
-
-/*
- * Copyright (c) 1997, 2004 Todd C. Miller <Todd.Miller at courtesan.com>
+/*-
+ * Copyright (c) 2015-2016 Nuxi, https://nuxi.nl/
*
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
+ * 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.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <errno.h>
#include <libgen.h>
-#include <stdlib.h>
+#include <stdbool.h>
#include <string.h>
-#include <sys/param.h>
char *
dirname(char *path)
{
- static char *dname = NULL;
- size_t len;
- const char *endp;
-
- if (dname == NULL) {
- dname = (char *)malloc(MAXPATHLEN);
- if (dname == NULL)
- return(NULL);
- }
-
- /* Empty or NULL string gets treated as "." */
- if (path == NULL || *path == '\0') {
- dname[0] = '.';
- dname[1] = '\0';
- return (dname);
+ const char *in, *prev, *begin, *end;
+ char *out;
+ size_t prevlen;
+ bool skipslash;
+
+ /*
+ * If path is a null pointer or points to an empty string,
+ * dirname() shall return a pointer to the string ".".
+ */
+ if (path == NULL || *path == '\0')
+ return ((char *)".");
+
+ /* Retain at least one leading slash character. */
+ in = out = *path == '/' ? path + 1 : path;
+
+ skipslash = true;
+ prev = ".";
+ prevlen = 1;
+ for (;;) {
+ /* Extract the next pathname component. */
+ while (*in == '/')
+ ++in;
+ begin = in;
+ while (*in != '/' && *in != '\0')
+ ++in;
+ end = in;
+ if (begin == end)
+ break;
+
+ /*
+ * Copy over the previous pathname component, except if
+ * it's dot. There is no point in retaining those.
+ */
+ if (prevlen != 1 || *prev != '.') {
+ if (!skipslash)
+ *out++ = '/';
+ skipslash = false;
+ memmove(out, prev, prevlen);
+ out += prevlen;
+ }
+
+ /* Preserve the pathname component for the next iteration. */
+ prev = begin;
+ prevlen = end - begin;
}
- /* Strip any trailing slashes */
- endp = path + strlen(path) - 1;
- while (endp > path && *endp == '/')
- endp--;
-
- /* Find the start of the dir */
- while (endp > path && *endp != '/')
- endp--;
-
- /* Either the dir is "/" or there are no slashes */
- if (endp == path) {
- dname[0] = *endp == '/' ? '/' : '.';
- dname[1] = '\0';
- return (dname);
- } else {
- /* Move forward past the separating slashes */
- do {
- endp--;
- } while (endp > path && *endp == '/');
- }
-
- len = endp - path + 1;
- if (len >= MAXPATHLEN) {
- errno = ENAMETOOLONG;
- return (NULL);
- }
- memcpy(dname, path, len);
- dname[len] = '\0';
- return (dname);
+ /*
+ * If path does not contain a '/', then dirname() shall return a
+ * pointer to the string ".".
+ */
+ if (out == path)
+ *out++ = '.';
+ *out = '\0';
+ return (path);
}
Copied: projects/netbsd-tests-update-12/lib/libc/gen/dirname_compat.c (from r304038, head/lib/libc/gen/dirname_compat.c)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/netbsd-tests-update-12/lib/libc/gen/dirname_compat.c Sat Aug 13 06:16:38 2016 (r304039, copy of r304038, head/lib/libc/gen/dirname_compat.c)
@@ -0,0 +1,79 @@
+/* $OpenBSD: dirname.c,v 1.13 2005/08/08 08:05:33 espie Exp $ */
+
+/*
+ * Copyright (c) 1997, 2004 Todd C. Miller <Todd.Miller at courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <errno.h>
+#include <libgen.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/param.h>
+
+char *
+__freebsd11_dirname(char *path)
+{
+ static char *dname = NULL;
+ size_t len;
+ const char *endp;
+
+ if (dname == NULL) {
+ dname = (char *)malloc(MAXPATHLEN);
+ if (dname == NULL)
+ return(NULL);
+ }
+
+ /* Empty or NULL string gets treated as "." */
+ if (path == NULL || *path == '\0') {
+ dname[0] = '.';
+ dname[1] = '\0';
+ return (dname);
+ }
+
+ /* Strip any trailing slashes */
+ endp = path + strlen(path) - 1;
+ while (endp > path && *endp == '/')
+ endp--;
+
+ /* Find the start of the dir */
+ while (endp > path && *endp != '/')
+ endp--;
+
+ /* Either the dir is "/" or there are no slashes */
+ if (endp == path) {
+ dname[0] = *endp == '/' ? '/' : '.';
+ dname[1] = '\0';
+ return (dname);
+ } else {
+ /* Move forward past the separating slashes */
+ do {
+ endp--;
+ } while (endp > path && *endp == '/');
+ }
+
+ len = endp - path + 1;
+ if (len >= MAXPATHLEN) {
+ errno = ENAMETOOLONG;
+ return (NULL);
+ }
+ memcpy(dname, path, len);
+ dname[len] = '\0';
+ return (dname);
+}
+
+__sym_compat(dirname, __freebsd11_dirname, FBSD_1.0);
Modified: projects/netbsd-tests-update-12/lib/libc/net/getaddrinfo.c
==============================================================================
--- projects/netbsd-tests-update-12/lib/libc/net/getaddrinfo.c Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/lib/libc/net/getaddrinfo.c Sat Aug 13 06:16:38 2016 (r304039)
@@ -2249,6 +2249,8 @@ _dns_getaddrinfo(void *rv, void *cb_data
struct res_target q, q2;
res_state res;
+ ai = NULL;
+
hostname = va_arg(ap, char *);
pai = va_arg(ap, const struct addrinfo *);
@@ -2327,16 +2329,16 @@ _dns_getaddrinfo(void *rv, void *cb_data
/* prefer IPv6 */
if (q.next) {
ai = getanswer(buf2, q2.n, q2.name, q2.qtype, pai, res);
- if (ai) {
+ if (ai != NULL) {
cur->ai_next = ai;
while (cur && cur->ai_next)
cur = cur->ai_next;
}
}
- if (!ai || pai->ai_family != AF_UNSPEC ||
+ if (ai == NULL || pai->ai_family != AF_UNSPEC ||
(pai->ai_flags & (AI_ALL | AI_V4MAPPED)) != AI_V4MAPPED) {
ai = getanswer(buf, q.n, q.name, q.qtype, pai, res);
- if (ai)
+ if (ai != NULL)
cur->ai_next = ai;
}
free(buf);
Modified: projects/netbsd-tests-update-12/lib/libc/tests/resolv/resolv_test.c
==============================================================================
--- projects/netbsd-tests-update-12/lib/libc/tests/resolv/resolv_test.c Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/lib/libc/tests/resolv/resolv_test.c Sat Aug 13 06:16:38 2016 (r304039)
@@ -291,7 +291,7 @@ do { \
ATF_TC(getaddrinfo_test);
ATF_TC_HEAD(getaddrinfo_test, tc) {
- atf_tc_set_md_var(tc, "timeout", "450");
+ atf_tc_set_md_var(tc, "timeout", "1200");
}
ATF_TC_BODY(getaddrinfo_test, tc)
{
@@ -301,7 +301,7 @@ ATF_TC_BODY(getaddrinfo_test, tc)
ATF_TC(gethostby_test);
ATF_TC_HEAD(gethostby_test, tc) {
- atf_tc_set_md_var(tc, "timeout", "450");
+ atf_tc_set_md_var(tc, "timeout", "1200");
}
ATF_TC_BODY(gethostby_test, tc)
{
@@ -312,7 +312,7 @@ ATF_TC_BODY(gethostby_test, tc)
ATF_TC(getipnodeby_test);
ATF_TC_HEAD(getipnodeby_test, tc) {
- atf_tc_set_md_var(tc, "timeout", "450");
+ atf_tc_set_md_var(tc, "timeout", "1200");
}
ATF_TC_BODY(getipnodeby_test, tc)
{
Modified: projects/netbsd-tests-update-12/lib/libcrypt/Makefile
==============================================================================
--- projects/netbsd-tests-update-12/lib/libcrypt/Makefile Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/lib/libcrypt/Makefile Sat Aug 13 06:16:38 2016 (r304039)
@@ -17,7 +17,8 @@ SRCS= crypt.c misc.c \
crypt-sha256.c sha256c.c \
crypt-sha512.c sha512c.c
MAN= crypt.3
-MLINKS= crypt.3 crypt_get_format.3 crypt.3 crypt_set_format.3
+MLINKS= crypt.3 crypt_get_format.3 crypt.3 crypt_r.3 \
+ crypt.3 crypt_set_format.3
CFLAGS+= -I${.CURDIR}/../libmd -I${.CURDIR}/../libutil \
-I${.CURDIR}/../../sys/crypto/sha2
Modified: projects/netbsd-tests-update-12/lib/libcrypt/crypt-md5.c
==============================================================================
--- projects/netbsd-tests-update-12/lib/libcrypt/crypt-md5.c Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/lib/libcrypt/crypt-md5.c Sat Aug 13 06:16:38 2016 (r304039)
@@ -41,31 +41,27 @@ __FBSDID("$FreeBSD$");
* UNIX password
*/
-char *
-crypt_md5(const char *pw, const char *salt)
+int
+crypt_md5(const char *pw, const char *salt, char *buffer)
{
MD5_CTX ctx,ctx1;
unsigned long l;
int sl, pl;
u_int i;
u_char final[MD5_SIZE];
- static const char *sp, *ep;
- static char passwd[120], *p;
+ const char *ep;
static const char *magic = "$1$";
- /* Refine the Salt first */
- sp = salt;
-
- /* If it starts with the magic string, then skip that */
- if(!strncmp(sp, magic, strlen(magic)))
- sp += strlen(magic);
+ /* If the salt starts with the magic string, skip that. */
+ if (!strncmp(salt, magic, strlen(magic)))
+ salt += strlen(magic);
/* It stops at the first '$', max 8 chars */
- for(ep = sp; *ep && *ep != '$' && ep < (sp + 8); ep++)
+ for (ep = salt; *ep && *ep != '$' && ep < salt + 8; ep++)
continue;
/* get the length of the true salt */
- sl = ep - sp;
+ sl = ep - salt;
MD5Init(&ctx);
@@ -76,12 +72,12 @@ crypt_md5(const char *pw, const char *sa
MD5Update(&ctx, (const u_char *)magic, strlen(magic));
/* Then the raw salt */
- MD5Update(&ctx, (const u_char *)sp, (u_int)sl);
+ MD5Update(&ctx, (const u_char *)salt, (u_int)sl);
/* Then just as many characters of the MD5(pw,salt,pw) */
MD5Init(&ctx1);
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
- MD5Update(&ctx1, (const u_char *)sp, (u_int)sl);
+ MD5Update(&ctx1, (const u_char *)salt, (u_int)sl);
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
MD5Final(final, &ctx1);
for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE)
@@ -99,9 +95,9 @@ crypt_md5(const char *pw, const char *sa
MD5Update(&ctx, (const u_char *)pw, 1);
/* Now make the output string */
- strcpy(passwd, magic);
- strncat(passwd, sp, (u_int)sl);
- strcat(passwd, "$");
+ buffer = stpcpy(buffer, magic);
+ buffer = stpncpy(buffer, salt, (u_int)sl);
+ *buffer++ = '$';
MD5Final(final, &ctx);
@@ -118,7 +114,7 @@ crypt_md5(const char *pw, const char *sa
MD5Update(&ctx1, (const u_char *)final, MD5_SIZE);
if(i % 3)
- MD5Update(&ctx1, (const u_char *)sp, (u_int)sl);
+ MD5Update(&ctx1, (const u_char *)salt, (u_int)sl);
if(i % 7)
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
@@ -130,24 +126,22 @@ crypt_md5(const char *pw, const char *sa
MD5Final(final, &ctx1);
}
- p = passwd + strlen(passwd);
-
l = (final[ 0]<<16) | (final[ 6]<<8) | final[12];
- _crypt_to64(p, l, 4); p += 4;
+ _crypt_to64(buffer, l, 4); buffer += 4;
l = (final[ 1]<<16) | (final[ 7]<<8) | final[13];
- _crypt_to64(p, l, 4); p += 4;
+ _crypt_to64(buffer, l, 4); buffer += 4;
l = (final[ 2]<<16) | (final[ 8]<<8) | final[14];
- _crypt_to64(p, l, 4); p += 4;
+ _crypt_to64(buffer, l, 4); buffer += 4;
l = (final[ 3]<<16) | (final[ 9]<<8) | final[15];
- _crypt_to64(p, l, 4); p += 4;
+ _crypt_to64(buffer, l, 4); buffer += 4;
l = (final[ 4]<<16) | (final[10]<<8) | final[ 5];
- _crypt_to64(p, l, 4); p += 4;
+ _crypt_to64(buffer, l, 4); buffer += 4;
l = final[11];
- _crypt_to64(p, l, 2); p += 2;
- *p = '\0';
+ _crypt_to64(buffer, l, 2); buffer += 2;
+ *buffer = '\0';
/* Don't leave anything around in vm they could use. */
memset(final, 0, sizeof(final));
- return (passwd);
+ return (0);
}
Modified: projects/netbsd-tests-update-12/lib/libcrypt/crypt-nthash.c
==============================================================================
--- projects/netbsd-tests-update-12/lib/libcrypt/crypt-nthash.c Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/lib/libcrypt/crypt-nthash.c Sat Aug 13 06:16:38 2016 (r304039)
@@ -46,16 +46,14 @@ __FBSDID("$FreeBSD$");
*/
/* ARGSUSED */
-char *
-crypt_nthash(const char *pw, const char *salt __unused)
+int
+crypt_nthash(const char *pw, const char *salt __unused, char *buffer)
{
size_t unipwLen;
- int i, j;
- static char hexconvtab[] = "0123456789abcdef";
+ int i;
+ static const char hexconvtab[] = "0123456789abcdef";
static const char *magic = "$3$";
- static char passwd[120];
u_int16_t unipw[128];
- char final[MD4_SIZE*2 + 1];
u_char hash[MD4_SIZE];
const char *s;
MD4_CTX ctx;
@@ -70,19 +68,14 @@ crypt_nthash(const char *pw, const char
MD4Init(&ctx);
MD4Update(&ctx, (u_char *)unipw, unipwLen*sizeof(u_int16_t));
MD4Final(hash, &ctx);
-
- for (i = j = 0; i < MD4_SIZE; i++) {
- final[j++] = hexconvtab[hash[i] >> 4];
- final[j++] = hexconvtab[hash[i] & 15];
- }
- final[j] = '\0';
-
- strcpy(passwd, magic);
- strcat(passwd, "$");
- strncat(passwd, final, MD4_SIZE*2);
- /* Don't leave anything around in vm they could use. */
- memset(final, 0, sizeof(final));
+ buffer = stpcpy(buffer, magic);
+ *buffer++ = '$';
+ for (i = 0; i < MD4_SIZE; i++) {
+ *buffer++ = hexconvtab[hash[i] >> 4];
+ *buffer++ = hexconvtab[hash[i] & 15];
+ }
+ *buffer = '\0';
- return (passwd);
+ return (0);
}
Modified: projects/netbsd-tests-update-12/lib/libcrypt/crypt-sha256.c
==============================================================================
--- projects/netbsd-tests-update-12/lib/libcrypt/crypt-sha256.c Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/lib/libcrypt/crypt-sha256.c Sat Aug 13 06:16:38 2016 (r304039)
@@ -59,11 +59,10 @@ static const char sha256_rounds_prefix[]
/* Maximum number of rounds. */
#define ROUNDS_MAX 999999999
-static char *
-crypt_sha256_r(const char *key, const char *salt, char *buffer, int buflen)
+int
+crypt_sha256(const char *key, const char *salt, char *buffer)
{
u_long srounds;
- int n;
uint8_t alt_result[32], temp_result[32];
SHA256_CTX ctx, alt_ctx;
size_t salt_len, key_len, cnt, rounds;
@@ -210,42 +209,27 @@ crypt_sha256_r(const char *key, const ch
/* Now we can construct the result string. It consists of three
* parts. */
- cp = stpncpy(buffer, sha256_salt_prefix, MAX(0, buflen));
- buflen -= sizeof(sha256_salt_prefix) - 1;
+ cp = stpcpy(buffer, sha256_salt_prefix);
- if (rounds_custom) {
- n = snprintf(cp, MAX(0, buflen), "%s%zu$",
- sha256_rounds_prefix, rounds);
+ if (rounds_custom)
+ cp += sprintf(cp, "%s%zu$", sha256_rounds_prefix, rounds);
- cp += n;
- buflen -= n;
- }
+ cp = stpncpy(cp, salt, salt_len);
- cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
- buflen -= MIN((size_t)MAX(0, buflen), salt_len);
+ *cp++ = '$';
- if (buflen > 0) {
- *cp++ = '$';
- --buflen;
- }
-
- b64_from_24bit(alt_result[0], alt_result[10], alt_result[20], 4, &buflen, &cp);
- b64_from_24bit(alt_result[21], alt_result[1], alt_result[11], 4, &buflen, &cp);
- b64_from_24bit(alt_result[12], alt_result[22], alt_result[2], 4, &buflen, &cp);
- b64_from_24bit(alt_result[3], alt_result[13], alt_result[23], 4, &buflen, &cp);
- b64_from_24bit(alt_result[24], alt_result[4], alt_result[14], 4, &buflen, &cp);
- b64_from_24bit(alt_result[15], alt_result[25], alt_result[5], 4, &buflen, &cp);
- b64_from_24bit(alt_result[6], alt_result[16], alt_result[26], 4, &buflen, &cp);
- b64_from_24bit(alt_result[27], alt_result[7], alt_result[17], 4, &buflen, &cp);
- b64_from_24bit(alt_result[18], alt_result[28], alt_result[8], 4, &buflen, &cp);
- b64_from_24bit(alt_result[9], alt_result[19], alt_result[29], 4, &buflen, &cp);
- b64_from_24bit(0, alt_result[31], alt_result[30], 3, &buflen, &cp);
- if (buflen <= 0) {
- errno = ERANGE;
- buffer = NULL;
- }
- else
- *cp = '\0'; /* Terminate the string. */
+ b64_from_24bit(alt_result[0], alt_result[10], alt_result[20], 4, &cp);
+ b64_from_24bit(alt_result[21], alt_result[1], alt_result[11], 4, &cp);
+ b64_from_24bit(alt_result[12], alt_result[22], alt_result[2], 4, &cp);
+ b64_from_24bit(alt_result[3], alt_result[13], alt_result[23], 4, &cp);
+ b64_from_24bit(alt_result[24], alt_result[4], alt_result[14], 4, &cp);
+ b64_from_24bit(alt_result[15], alt_result[25], alt_result[5], 4, &cp);
+ b64_from_24bit(alt_result[6], alt_result[16], alt_result[26], 4, &cp);
+ b64_from_24bit(alt_result[27], alt_result[7], alt_result[17], 4, &cp);
+ b64_from_24bit(alt_result[18], alt_result[28], alt_result[8], 4, &cp);
+ b64_from_24bit(alt_result[9], alt_result[19], alt_result[29], 4, &cp);
+ b64_from_24bit(0, alt_result[31], alt_result[30], 3, &cp);
+ *cp = '\0'; /* Terminate the string. */
/* Clear the buffer for the intermediate result so that people
* attaching to processes or reading core dumps cannot get any
@@ -263,37 +247,7 @@ crypt_sha256_r(const char *key, const ch
if (copied_salt != NULL)
memset(copied_salt, '\0', salt_len);
- return buffer;
-}
-
-/* This entry point is equivalent to crypt(3). */
-char *
-crypt_sha256(const char *key, const char *salt)
-{
- /* We don't want to have an arbitrary limit in the size of the
- * password. We can compute an upper bound for the size of the
- * result in advance and so we can prepare the buffer we pass to
- * `crypt_sha256_r'. */
- static char *buffer;
- static int buflen;
- int needed;
- char *new_buffer;
-
- needed = (sizeof(sha256_salt_prefix) - 1
- + sizeof(sha256_rounds_prefix) + 9 + 1
- + strlen(salt) + 1 + 43 + 1);
-
- if (buflen < needed) {
- new_buffer = (char *)realloc(buffer, needed);
-
- if (new_buffer == NULL)
- return NULL;
-
- buffer = new_buffer;
- buflen = needed;
- }
-
- return crypt_sha256_r(key, salt, buffer, buflen);
+ return (0);
}
#ifdef TEST
Modified: projects/netbsd-tests-update-12/lib/libcrypt/crypt-sha512.c
==============================================================================
--- projects/netbsd-tests-update-12/lib/libcrypt/crypt-sha512.c Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/lib/libcrypt/crypt-sha512.c Sat Aug 13 06:16:38 2016 (r304039)
@@ -59,11 +59,10 @@ static const char sha512_rounds_prefix[]
/* Maximum number of rounds. */
#define ROUNDS_MAX 999999999
-static char *
-crypt_sha512_r(const char *key, const char *salt, char *buffer, int buflen)
+int
+crypt_sha512(const char *key, const char *salt, char *buffer)
{
u_long srounds;
- int n;
uint8_t alt_result[64], temp_result[64];
SHA512_CTX ctx, alt_ctx;
size_t salt_len, key_len, cnt, rounds;
@@ -210,54 +209,39 @@ crypt_sha512_r(const char *key, const ch
/* Now we can construct the result string. It consists of three
* parts. */
- cp = stpncpy(buffer, sha512_salt_prefix, MAX(0, buflen));
- buflen -= sizeof(sha512_salt_prefix) - 1;
+ cp = stpcpy(buffer, sha512_salt_prefix);
- if (rounds_custom) {
- n = snprintf(cp, MAX(0, buflen), "%s%zu$",
- sha512_rounds_prefix, rounds);
+ if (rounds_custom)
+ cp += sprintf(cp, "%s%zu$", sha512_rounds_prefix, rounds);
- cp += n;
- buflen -= n;
- }
+ cp = stpncpy(cp, salt, salt_len);
- cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
- buflen -= MIN((size_t)MAX(0, buflen), salt_len);
+ *cp++ = '$';
- if (buflen > 0) {
- *cp++ = '$';
- --buflen;
- }
+ b64_from_24bit(alt_result[0], alt_result[21], alt_result[42], 4, &cp);
+ b64_from_24bit(alt_result[22], alt_result[43], alt_result[1], 4, &cp);
+ b64_from_24bit(alt_result[44], alt_result[2], alt_result[23], 4, &cp);
+ b64_from_24bit(alt_result[3], alt_result[24], alt_result[45], 4, &cp);
+ b64_from_24bit(alt_result[25], alt_result[46], alt_result[4], 4, &cp);
+ b64_from_24bit(alt_result[47], alt_result[5], alt_result[26], 4, &cp);
+ b64_from_24bit(alt_result[6], alt_result[27], alt_result[48], 4, &cp);
+ b64_from_24bit(alt_result[28], alt_result[49], alt_result[7], 4, &cp);
+ b64_from_24bit(alt_result[50], alt_result[8], alt_result[29], 4, &cp);
+ b64_from_24bit(alt_result[9], alt_result[30], alt_result[51], 4, &cp);
+ b64_from_24bit(alt_result[31], alt_result[52], alt_result[10], 4, &cp);
+ b64_from_24bit(alt_result[53], alt_result[11], alt_result[32], 4, &cp);
+ b64_from_24bit(alt_result[12], alt_result[33], alt_result[54], 4, &cp);
+ b64_from_24bit(alt_result[34], alt_result[55], alt_result[13], 4, &cp);
+ b64_from_24bit(alt_result[56], alt_result[14], alt_result[35], 4, &cp);
+ b64_from_24bit(alt_result[15], alt_result[36], alt_result[57], 4, &cp);
+ b64_from_24bit(alt_result[37], alt_result[58], alt_result[16], 4, &cp);
+ b64_from_24bit(alt_result[59], alt_result[17], alt_result[38], 4, &cp);
+ b64_from_24bit(alt_result[18], alt_result[39], alt_result[60], 4, &cp);
+ b64_from_24bit(alt_result[40], alt_result[61], alt_result[19], 4, &cp);
+ b64_from_24bit(alt_result[62], alt_result[20], alt_result[41], 4, &cp);
+ b64_from_24bit(0, 0, alt_result[63], 2, &cp);
- b64_from_24bit(alt_result[0], alt_result[21], alt_result[42], 4, &buflen, &cp);
- b64_from_24bit(alt_result[22], alt_result[43], alt_result[1], 4, &buflen, &cp);
- b64_from_24bit(alt_result[44], alt_result[2], alt_result[23], 4, &buflen, &cp);
- b64_from_24bit(alt_result[3], alt_result[24], alt_result[45], 4, &buflen, &cp);
- b64_from_24bit(alt_result[25], alt_result[46], alt_result[4], 4, &buflen, &cp);
- b64_from_24bit(alt_result[47], alt_result[5], alt_result[26], 4, &buflen, &cp);
- b64_from_24bit(alt_result[6], alt_result[27], alt_result[48], 4, &buflen, &cp);
- b64_from_24bit(alt_result[28], alt_result[49], alt_result[7], 4, &buflen, &cp);
- b64_from_24bit(alt_result[50], alt_result[8], alt_result[29], 4, &buflen, &cp);
- b64_from_24bit(alt_result[9], alt_result[30], alt_result[51], 4, &buflen, &cp);
- b64_from_24bit(alt_result[31], alt_result[52], alt_result[10], 4, &buflen, &cp);
- b64_from_24bit(alt_result[53], alt_result[11], alt_result[32], 4, &buflen, &cp);
- b64_from_24bit(alt_result[12], alt_result[33], alt_result[54], 4, &buflen, &cp);
- b64_from_24bit(alt_result[34], alt_result[55], alt_result[13], 4, &buflen, &cp);
- b64_from_24bit(alt_result[56], alt_result[14], alt_result[35], 4, &buflen, &cp);
- b64_from_24bit(alt_result[15], alt_result[36], alt_result[57], 4, &buflen, &cp);
- b64_from_24bit(alt_result[37], alt_result[58], alt_result[16], 4, &buflen, &cp);
- b64_from_24bit(alt_result[59], alt_result[17], alt_result[38], 4, &buflen, &cp);
- b64_from_24bit(alt_result[18], alt_result[39], alt_result[60], 4, &buflen, &cp);
- b64_from_24bit(alt_result[40], alt_result[61], alt_result[19], 4, &buflen, &cp);
- b64_from_24bit(alt_result[62], alt_result[20], alt_result[41], 4, &buflen, &cp);
- b64_from_24bit(0, 0, alt_result[63], 2, &buflen, &cp);
-
- if (buflen <= 0) {
- errno = ERANGE;
- buffer = NULL;
- }
- else
- *cp = '\0'; /* Terminate the string. */
+ *cp = '\0'; /* Terminate the string. */
/* Clear the buffer for the intermediate result so that people
* attaching to processes or reading core dumps cannot get any
@@ -275,37 +259,7 @@ crypt_sha512_r(const char *key, const ch
if (copied_salt != NULL)
memset(copied_salt, '\0', salt_len);
- return buffer;
-}
-
-/* This entry point is equivalent to crypt(3). */
-char *
-crypt_sha512(const char *key, const char *salt)
-{
- /* We don't want to have an arbitrary limit in the size of the
- * password. We can compute an upper bound for the size of the
- * result in advance and so we can prepare the buffer we pass to
- * `crypt_sha512_r'. */
- static char *buffer;
- static int buflen;
- int needed;
- char *new_buffer;
-
- needed = (sizeof(sha512_salt_prefix) - 1
- + sizeof(sha512_rounds_prefix) + 9 + 1
- + strlen(salt) + 1 + 86 + 1);
-
- if (buflen < needed) {
- new_buffer = (char *)realloc(buffer, needed);
-
- if (new_buffer == NULL)
- return NULL;
-
- buffer = new_buffer;
- buflen = needed;
- }
-
- return crypt_sha512_r(key, salt, buffer, buflen);
+ return (0);
}
#ifdef TEST
Modified: projects/netbsd-tests-update-12/lib/libcrypt/crypt.3
==============================================================================
--- projects/netbsd-tests-update-12/lib/libcrypt/crypt.3 Sat Aug 13 06:11:53 2016 (r304038)
+++ projects/netbsd-tests-update-12/lib/libcrypt/crypt.3 Sat Aug 13 06:16:38 2016 (r304039)
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 9, 2014
+.Dd August 10, 2016
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list