dragonfly.git
4 years agolibz/savecore: Move the local zopen() from libz to savecore(8).
Sascha Wildner [Wed, 16 Oct 2019 07:41:20 +0000 (09:41 +0200)]
libz/savecore: Move the local zopen() from libz to savecore(8).

It is its only consumer.

Cleanup libz's Versions.def and Symbol.map too. Nothing in dports
should be using that function from the library (else it's a bug).

While here, add a __DECONST() to fix for WARNS=6.

Discussed-with: zrj

4 years agolibusb/libz: Install *.pc files (for dports) using FILES and FILESDIR.
Sascha Wildner [Wed, 16 Oct 2019 07:01:03 +0000 (09:01 +0200)]
libusb/libz: Install *.pc files (for dports) using FILES and FILESDIR.

4 years agosbin/fsck_hammer2: Rollback if second write failed on destroying dirent
Tomohiro Kusumi [Tue, 15 Oct 2019 15:10:47 +0000 (00:10 +0900)]
sbin/fsck_hammer2: Rollback if second write failed on destroying dirent

4 years agoUpdate the pciconf(8) database.
Sascha Wildner [Tue, 15 Oct 2019 07:12:46 +0000 (09:12 +0200)]
Update the pciconf(8) database.

October 12, 2019 snapshot from https://pci-ids.ucw.cz

4 years agosbin/fsck_hammer2: Make destroy.c support embedded dirent name
Tomohiro Kusumi [Mon, 14 Oct 2019 15:30:32 +0000 (00:30 +0900)]
sbin/fsck_hammer2: Make destroy.c support embedded dirent name

and other dirent related fixes and cleanups.

4 years agosbin/fsck_hammer2: Print indirect blockref data on failure if possible
Tomohiro Kusumi [Mon, 14 Oct 2019 15:30:16 +0000 (00:30 +0900)]
sbin/fsck_hammer2: Print indirect blockref data on failure if possible

4 years agotools/toeplitz: Provide NBBY fallback.
zrj [Wed, 9 Oct 2019 11:12:54 +0000 (14:12 +0300)]
tools/toeplitz: Provide NBBY fallback.

4 years ago<sys/types.h>: Move out NBBY definition to <sys/param.h>.
zrj [Wed, 9 Oct 2019 10:38:16 +0000 (13:38 +0300)]
<sys/types.h>: Move out NBBY definition to <sys/param.h>.

 It is a better place for it due to close proximity of macros using it.

4 years agorestore(8): Add include to common header.
zrj [Wed, 9 Oct 2019 10:37:50 +0000 (13:37 +0300)]
restore(8): Add include to common header.

 Just like sbin/dump/dump.h explicitly include <sys/param.h>.

4 years ago<sys/socket.h>: Use double underscore versions for types.
zrj [Wed, 9 Oct 2019 09:27:32 +0000 (12:27 +0300)]
<sys/socket.h>: Use double underscore versions for types.

 Change caddr_t to plain "char *".

 In preparations to remove <sys/types.h> dependency.

4 years agoAdd <machine/alignbytes.h>.
zrj [Wed, 9 Oct 2019 09:08:16 +0000 (12:08 +0300)]
Add <machine/alignbytes.h>.

 Refactor ALIGN* macros to fix issue in <sys/socket.h> after the
 _CMSG_ALIGN() macro was adjusted to use ALIGNBYTES definition.
 * Including <sys/param.h> would introduce major namespace pollution.
 * Use NetBSD variant of namespace friendly double underscore versions.
 * Instead of <machine/cdefs.h> put double underscore versions into self
   contained header to minimize header poisoning.
 * Provide __ALIGNPTR() macro to avoid visibility issues with uintptr_t.
 * Move out single underscore versions from <machine/param.h>.  Keep them
   for OpenBSD compat that declares them in <ARCH/_types.h>.
 * Make non underscored versions user overridable (just like NetBSD).
   This is useful for cases where different alignment is needed.

 Later on this new header can be adjusted to provide other alignment
 macros like: STACKALIGNBYTES, ALIGNED_POINTER etc.

In-discussion-with: swilder

4 years agosbin/fsck_hammer2: Add destroy.c to destroy ondisk inode/dirent
Tomohiro Kusumi [Sun, 13 Oct 2019 21:54:33 +0000 (06:54 +0900)]
sbin/fsck_hammer2: Add destroy.c to destroy ondisk inode/dirent

For testing.
This doesn't get compiled by Makefile.

4 years agosbin/fsck_hammer2: Print blockref data on failure if possible
Tomohiro Kusumi [Sun, 13 Oct 2019 21:54:08 +0000 (06:54 +0900)]
sbin/fsck_hammer2: Print blockref data on failure if possible

4 years agosbin/hammer2: Print dirent name length in "show"
Tomohiro Kusumi [Sun, 13 Oct 2019 21:53:54 +0000 (06:53 +0900)]
sbin/hammer2: Print dirent name length in "show"

4 years agosbin/hammer2: Minor "show"/"freemap" output format fix
Tomohiro Kusumi [Sun, 13 Oct 2019 21:53:34 +0000 (06:53 +0900)]
sbin/hammer2: Minor "show"/"freemap" output format fix

"show"/"freemap" output doesn't use comma, except for after meth=
and in clothing parenthesis of blockref data part.

Remove the first one.

4 years agoClean up the namespace of <mqueue.h> a bit.
Sascha Wildner [Sun, 13 Oct 2019 19:33:37 +0000 (21:33 +0200)]
Clean up the namespace of <mqueue.h> a bit.

Thanks to zrj for testing with a dports bulk build.

4 years agoworld/kernel: Use the powerof2() macro in various places.
Sascha Wildner [Sun, 13 Oct 2019 11:56:13 +0000 (13:56 +0200)]
world/kernel: Use the powerof2() macro in various places.

4 years agofsck(8): Remove useless POWEROF2() macro.
Sascha Wildner [Sun, 13 Oct 2019 11:55:53 +0000 (13:55 +0200)]
fsck(8): Remove useless POWEROF2() macro.

4 years agoworld/kernel: Use the howmany() macro in various places.
Sascha Wildner [Sun, 13 Oct 2019 10:38:50 +0000 (12:38 +0200)]
world/kernel: Use the howmany() macro in various places.

4 years agokernel/libc: Use CTL_SYSCTL_* names instead of magic numbers.
Sascha Wildner [Sun, 13 Oct 2019 07:45:43 +0000 (09:45 +0200)]
kernel/libc: Use CTL_SYSCTL_* names instead of magic numbers.

These are for internal sysctl operations.

Taken-from: FreeBSD

4 years agozic/zdump: Clean up Makefiles (remove unneeded stuff).
Sascha Wildner [Sat, 12 Oct 2019 22:25:22 +0000 (00:25 +0200)]
zic/zdump: Clean up Makefiles (remove unneeded stuff).

4 years agozic(8): Avoid -Wstringop-truncation warning.
Sascha Wildner [Sat, 12 Oct 2019 21:46:50 +0000 (23:46 +0200)]
zic(8): Avoid -Wstringop-truncation warning.

The tzh.tzh_magic holds 4 characters, while TZ_MAGIC == "TZif".
So use memcpy() to avoid the warning.

Originally-submitted-by: zrj
Also committed upstream independently, see
https://sourceware.org/ml/libc-alpha/2017-11/msg00375.html

4 years agousr.sbin/fstyp: Add XXX comments on HAMMER1/2 label
Tomohiro Kusumi [Sat, 12 Oct 2019 18:42:21 +0000 (03:42 +0900)]
usr.sbin/fstyp: Add XXX comments on HAMMER1/2 label

This only matters to -media mount of block devices.
Not sure about other filesystem labels in fstyp.

4 years agosys/vfs/msdosfs: Sync comments on cluster macros with FreeBSD
Tomohiro Kusumi [Sat, 12 Oct 2019 17:45:03 +0000 (02:45 +0900)]
sys/vfs/msdosfs: Sync comments on cluster macros with FreeBSD

Use a terminology "filesystem relative" instead of "device relative".
"device relative" is actually better, but the entire code use
"filesystem relative".

Other descriptions are obvious if one knows FAT ondisk format.
Reduce unneeded diffs against FreeBSD.

4 years agosys/vfs/msdosfs: Style bugs
Tomohiro Kusumi [Sat, 12 Oct 2019 17:20:03 +0000 (02:20 +0900)]
sys/vfs/msdosfs: Style bugs

from freebsd/freebsd@bc5f57144e97b8336002b57d7c7e60a86ba3b0d4

4 years agosys/vfs/msdosfs: Sync a comment on cdev_t with FreeBSD
Tomohiro Kusumi [Sat, 12 Oct 2019 14:19:38 +0000 (23:19 +0900)]
sys/vfs/msdosfs: Sync a comment on cdev_t with FreeBSD

from freebsd/freebsd@c3c76f8185fd7f9995646dc6cb44a1777d80eabb

DragonFly still uses `pmp->pm_dev` and it won't go away either,
but sync a comment anyway. Not important to specifically mention
this when the function also uses other pmp fields.

4 years agolibc/__errno_location: Fix indent.
Sascha Wildner [Sat, 12 Oct 2019 19:29:28 +0000 (21:29 +0200)]
libc/__errno_location: Fix indent.

4 years agosys/vfs/msdosfs: Fix detrunc() twice
Tomohiro Kusumi [Sat, 12 Oct 2019 11:32:54 +0000 (20:32 +0900)]
sys/vfs/msdosfs: Fix detrunc() twice

from freebsd/freebsd@df35e60f9f9e72d96903368cf6c933be6f3ff720
from freebsd/freebsd@36b72954109b4906ef75de661bfbd254fba1c011

Not sure about intention of the first commit (removes bzero for non
directory case), but the second commit basically brought back removed
code after 16 years.

DragonFly already had what FreeBSD has now (with difference in bread()
taking offset, etc) for not having synced for 16 years, so just sync
up other minor diffs.

4 years agosys/vfs/msdosfs: Fix a serious off by 1 for cluster bitmap
Tomohiro Kusumi [Fri, 11 Oct 2019 13:52:10 +0000 (22:52 +0900)]
sys/vfs/msdosfs: Fix a serious off by 1 for cluster bitmap

from freebsd/freebsd@4159786890522d187529c336eb6da4029f04a3e1

    Fixed a serious off by 1 error.  The cluster-in-use bitmap was overrun
    by 1 u_int if the number of clusters was 1 more than a multiple of
    (8 * sizeof(u_int)).  The bitmap is malloced and large (often huge), so
    fatal overrun probably only occurred if the number of clusters was 1
    more than 1 multiple of PAGE_SIZE/8.

4 years agosys/vfs/msdosfs: Use howmany()
Tomohiro Kusumi [Fri, 11 Oct 2019 13:51:47 +0000 (22:51 +0900)]
sys/vfs/msdosfs: Use howmany()

from freebsd/freebsd@fc01419148d065603607b1008d536431465f3bc3

4 years agodhcpcd: Update README.DRAGONFLY
Roy Marples [Fri, 11 Oct 2019 11:57:15 +0000 (12:57 +0100)]
dhcpcd: Update README.DRAGONFLY

4 years agoMerge branch 'vendor/DHCPCD'
Roy Marples [Fri, 11 Oct 2019 11:49:54 +0000 (12:49 +0100)]
Merge branch 'vendor/DHCPCD'

4 years agoImport dhcpcd-8.1.0 to vendor branch with the following changes:
Roy Marples [Fri, 11 Oct 2019 11:42:26 +0000 (12:42 +0100)]
Import dhcpcd-8.1.0 to vendor branch with the following changes:

 * Fix carrier status after a route socket overflow
 * Allow domain spaced options
 * DHCP: Allow not sending Force Renew Nonce or Reconf Accept
 * IPv4LL: Now passes Apple Bonjour test versions 1.4 and 1.5
 * ARP: Fix a typo and remove pragma (thus working with old gcc)
 * DHCP6: Fix a cosmetic issue with infinite leases
 * DHCP6: SLA 0 and Prefix Len 0 will now add a delegatd /64 address
 * Ignore some virtual interfaces such as Tap and Bridge by default
 * BPF: Move validation logic out of BPF and back into dhcpcd

4 years agolibc/utmp{,x}: Add some __unused.
Sascha Wildner [Thu, 10 Oct 2019 19:11:43 +0000 (21:11 +0200)]
libc/utmp{,x}: Add some __unused.

4 years agocorepower(4): Fix comments based on the Intel SDM.
Sascha Wildner [Thu, 10 Oct 2019 18:57:46 +0000 (20:57 +0200)]
corepower(4): Fix comments based on the Intel SDM.

4 years ago<machine/specialreg.h>: Fix whitespace.
Sascha Wildner [Thu, 10 Oct 2019 18:42:17 +0000 (20:42 +0200)]
<machine/specialreg.h>: Fix whitespace.

4 years agosys/vfs/msdosfs: Spelling fixes
Tomohiro Kusumi [Thu, 10 Oct 2019 14:48:48 +0000 (23:48 +0900)]
sys/vfs/msdosfs: Spelling fixes

bits from freebsd/freebsd@9ed8e933a363f67081dec54601b6262db2a57437

4 years agosys/vfs/msdosfs: Rename DOS_FILESIZE_MAX -> MSDOSFS_FILESIZE_MAX
Tomohiro Kusumi [Thu, 10 Oct 2019 14:12:04 +0000 (23:12 +0900)]
sys/vfs/msdosfs: Rename DOS_FILESIZE_MAX -> MSDOSFS_FILESIZE_MAX

from freebsd/freebsd@e6fd69815f99795031e72e899db2cfba63581fc4

4 years agocorepower(4): Add Coffee Lake support (numbers look reasonable at least).
Sascha Wildner [Thu, 10 Oct 2019 07:44:07 +0000 (09:44 +0200)]
corepower(4): Add Coffee Lake support (numbers look reasonable at least).

4 years agocorepower(4): Fix some Intel microarchitecture names in the comments.
Sascha Wildner [Thu, 10 Oct 2019 07:42:19 +0000 (09:42 +0200)]
corepower(4): Fix some Intel microarchitecture names in the comments.

4 years agoopenssh: Adjust README.DRAGONFLY for recent pam_ssh removal.
Sascha Wildner [Wed, 9 Oct 2019 19:57:53 +0000 (21:57 +0200)]
openssh: Adjust README.DRAGONFLY for recent pam_ssh removal.

4 years agodrm/linux: Add vmalloc_to_page()
François Tigeot [Wed, 9 Oct 2019 19:45:37 +0000 (21:45 +0200)]
drm/linux: Add vmalloc_to_page()

Obtained-from: FreeBSD

4 years ago{i915,radeon}kms.4: Really clean up the manual page naming situation.
Sascha Wildner [Wed, 9 Oct 2019 19:45:28 +0000 (21:45 +0200)]
{i915,radeon}kms.4: Really clean up the manual page naming situation.

Leave only i915.4 and radeon.4. The previous naming was a leftover from
when the modules were renamed but the manpage were not taken care of.

Remove *kms.4 and *drm.4 copies.

4 years agodrm: Remove mentions of i915kms and radeonkms
François Tigeot [Wed, 9 Oct 2019 19:19:14 +0000 (21:19 +0200)]
drm: Remove mentions of i915kms and radeonkms

drm(4) drivers are simply named i915 and radeon like on Linux now.

4 years agosys/vfs/msdosfs: Use vop_stdpathconf()
Tomohiro Kusumi [Wed, 9 Oct 2019 13:31:17 +0000 (22:31 +0900)]
sys/vfs/msdosfs: Use vop_stdpathconf()

from freebsd/freebsd@b4c54ab330a8138d19ec8b649b3ded0465f45331

4 years agosys/vfs/msdosfs: Remove unused msdosfs_args::magic
Tomohiro Kusumi [Wed, 9 Oct 2019 13:30:56 +0000 (22:30 +0900)]
sys/vfs/msdosfs: Remove unused msdosfs_args::magic

bits from freebsd/freebsd@89382b6533d2fd694195b6f534563993a4741fa4

Requires FAT userspace rebuild.

4 years agosys/vfs/msdosfs: vrecycle() vnode with SLOT_EMPTY
Tomohiro Kusumi [Wed, 9 Oct 2019 13:30:39 +0000 (22:30 +0900)]
sys/vfs/msdosfs: vrecycle() vnode with SLOT_EMPTY

from freebsd/freebsd@11cf2ecaee883581cf49f4bea644f97d88e289da

Keep the change from e0ab0dda4467a333f1c9f1d382f74e3d830a5ed9.

4 years agosys/vfs/msdosfs: Use vfs_timestamp()
Tomohiro Kusumi [Wed, 9 Oct 2019 13:30:16 +0000 (22:30 +0900)]
sys/vfs/msdosfs: Use vfs_timestamp()

from freebsd/freebsd@68807f21657b87276bee1a8b8e9ddbf03ef26525

4 years agolibc/tls: Remove some code that has been #if 0'd since 2005.
Sascha Wildner [Tue, 8 Oct 2019 20:16:02 +0000 (22:16 +0200)]
libc/tls: Remove some code that has been #if 0'd since 2005.

4 years agokdump/mksubr: Improve a bit.
Sascha Wildner [Tue, 8 Oct 2019 09:05:37 +0000 (11:05 +0200)]
kdump/mksubr: Improve a bit.

* Change auto_or_type() and auto_or_typelong() to better names,
  auto_or_int() and auto_or_long().

* Use bool type for a boolean variable.

* Fix printf format and drop unnecessary casts.

4 years agoprop_bool.3: Don't use defined type names as variable names.
Sascha Wildner [Tue, 8 Oct 2019 07:42:07 +0000 (09:42 +0200)]
prop_bool.3: Don't use defined type names as variable names.

4 years agoppp(8): Remove references to libradius.
zrj [Tue, 8 Oct 2019 06:21:48 +0000 (09:21 +0300)]
ppp(8): Remove references to libradius.

Reported-by: swildner
4 years agosys/vfs/msdosfs: Don't rely on FSInfo for next free cluster#
Tomohiro Kusumi [Mon, 7 Oct 2019 15:07:29 +0000 (00:07 +0900)]
sys/vfs/msdosfs: Don't rely on FSInfo for next free cluster#

from freebsd/freebsd@2e613b81275b754323270ba112f9d73a553d837a

Remove DragonFly's local changes which care about FSI_Nxt_Free.
68cc29492751172e9897a90c303b1c7fbb18112a
371e4713b969224e811cf5831e0c77a82be6a8a1

4 years agosys/vfs/msdosfs: FSInfo size handling is completely wrong
Tomohiro Kusumi [Mon, 7 Oct 2019 15:07:11 +0000 (00:07 +0900)]
sys/vfs/msdosfs: FSInfo size handling is completely wrong

from freebsd/freebsd@01c1ec9b1ae5e546930028126ab6d950d401c786
from freebsd/freebsd@e8377e738c6b5d23fad5f7125437708639bc0253

4 years agosys/vfs/msdosfs: Rename de_bntodoff() to de_bn2doff()
Tomohiro Kusumi [Mon, 7 Oct 2019 15:06:49 +0000 (00:06 +0900)]
sys/vfs/msdosfs: Rename de_bntodoff() to de_bn2doff()

Rename a DragonFly specific macro.
Follow naming convention of macros.

4 years agosys/vfs/msdosfs: Remove redundant macro xcntodoff()
Tomohiro Kusumi [Mon, 7 Oct 2019 15:06:15 +0000 (00:06 +0900)]
sys/vfs/msdosfs: Remove redundant macro xcntodoff()

Remove a DragonFly specific macro that is only used twice.

4 years agosys/vfs/msdosfs: Rename xcntobn() back to cntobn()
Tomohiro Kusumi [Mon, 7 Oct 2019 15:05:54 +0000 (00:05 +0900)]
sys/vfs/msdosfs: Rename xcntobn() back to cntobn()

4afd80f1a2 in 2006 has renamed cntobn() to xcntobn().
Rename it back to reduce unneeded diff against FreeBSD.

4 years agosys/vfs/msdosfs: Add markvoldirty()
Tomohiro Kusumi [Mon, 7 Oct 2019 15:05:13 +0000 (00:05 +0900)]
sys/vfs/msdosfs: Add markvoldirty()

from freebsd/freebsd@7dde93f1df429cf9a818bf7b716962298f489807
from freebsd/freebsd@47701ffd1e3ae03dfc0c65c3e70cfabc99537681

Only import the function, unused yet.
Disable B_INVALONERR part.

4 years ago<string.h>: Put memset_s() prototype inside __{BEGIN,END}_DECLS().
Sascha Wildner [Mon, 7 Oct 2019 08:44:12 +0000 (10:44 +0200)]
<string.h>: Put memset_s() prototype inside __{BEGIN,END}_DECLS().

Reported-by: zrj
4 years agodrm: Rename struct drm_file.master to .is_master
François Tigeot [Sun, 6 Oct 2019 19:51:44 +0000 (21:51 +0200)]
drm: Rename struct drm_file.master to .is_master

Reducing differences with Linux

4 years agosys/vfs/msdosfs: usemap_free() after fatentry()
Tomohiro Kusumi [Sun, 6 Oct 2019 18:31:57 +0000 (03:31 +0900)]
sys/vfs/msdosfs: usemap_free() after fatentry()

bits from freebsd/freebsd@eb2b3c8672da21da1d5b72a0b44f0e8c3271cc1e
"Use pm_fatlock to protect fat bitmap."

4 years agousr.sbin/fstyp: Retry fopen(3) if failed
Tomohiro Kusumi [Sun, 6 Oct 2019 18:43:05 +0000 (03:43 +0900)]
usr.sbin/fstyp: Retry fopen(3) if failed

Try argv[0] if fdpath failed.

4 years agoGenerate a fresh /etc/os-release on each installworld.
Sascha Wildner [Sun, 6 Oct 2019 13:53:44 +0000 (15:53 +0200)]
Generate a fresh /etc/os-release on each installworld.

Reported-by: zrj
4 years agousr.sbin/fstyp: Support HAMMER2 PFS label and @name syntax
Tomohiro Kusumi [Sun, 6 Oct 2019 15:15:05 +0000 (00:15 +0900)]
usr.sbin/fstyp: Support HAMMER2 PFS label and @name syntax

SUPROOT is printed only when @name is invalid.
Affects autofs -media mount.

4 years ago<sys/stat.h>: Rename two unused flags to names that we use elsewhere.
Sascha Wildner [Sun, 6 Oct 2019 13:34:36 +0000 (15:34 +0200)]
<sys/stat.h>: Rename two unused flags to names that we use elsewhere.

Reported-by: zrj
4 years agoFix immutable flag handling in our mtree(8) invocations.
Sascha Wildner [Sun, 6 Oct 2019 13:33:04 +0000 (15:33 +0200)]
Fix immutable flag handling in our mtree(8) invocations.

All of this only affects /var/empty so far.

* If NOSCHG isn't set (which is the default), pass -i to mtree(8) when
  installing the system or building an installer img.

* Pass -i always when we install a system from the installer. This
  installer usage of mtree(8) should not be needed. Expand the comment
  a bit.

Reported-by: zrj
4 years agokernel/isa: Bury the intrmask_t type.
zrj [Sun, 6 Oct 2019 07:30:47 +0000 (10:30 +0300)]
kernel/isa: Bury the intrmask_t type.

 It is neither MI nor MD nor pure PD type, it is ISA placeholder type.
 Also it is unfortunately named and implies bad things.  The only way to
 make it consistent is to split it, since this type usage falls under
 standard/isa options.  The vkernel64 was already wrongly declaring it.

 No differences in generated binary outputs.

4 years agokernel: Make chflags syscalls argument types consistent with userland.
zrj [Sun, 6 Oct 2019 07:30:02 +0000 (10:30 +0300)]
kernel: Make chflags syscalls argument types consistent with userland.

 There was an inconsistency between userland and syscalls argument types
 that was inherited after initial fork.  Adjust prototypes to use u_long
 and add missing const char* too.  Rerun sysent.  Change tmpfs/dirfs to
 use u_int for flags since mask for superuser changeable flags is
 SF_SETTABLE 0xffff0000 (most fs use uint32_t), adjust mksubr script.
 Remove no longer needed (u_long) casts I could find elsewhere.

 While there, adjust unistd.h prototypes to use generic types too.

4 years agoworld: Eliminate custom uintfptr_t/fptrdiff_t types.
zrj [Sun, 6 Oct 2019 07:28:35 +0000 (10:28 +0300)]
world: Eliminate custom uintfptr_t/fptrdiff_t types.

 These were not used consistently and have visibility limitations,
 types.h - #indef _KERNEL while profile.h - publicly.  Use cases like:
  "uintfptr_t selfpcdiff;" and "fptrdiff_t frompci;" only confuse.
 Given that underlying structs uprof, rawarc already use plain u_long
 types, there are plenty (u_long) casts elsewhere in the kernel code,
 follow OpenBSD and use use (u_long) casts that are clear what they do.
 The unused intfptr_t type does not make much sense anyway.

4 years ago<unistd.h>: Fix profil(2) prototype.
zrj [Sun, 6 Oct 2019 07:27:18 +0000 (10:27 +0300)]
<unistd.h>: Fix profil(2) prototype.

 First off the vm_offset_t is somewhat bogus in this context, same could
 be said about size_t variant in sys/sysproto.h.  Just use plain u_long
 type like it is already used in "struct uprof" and fix forth argument
 to take u_int.  In public headers prefer to use generic types.

4 years ago<sys/stdint.h>: Move out two MD types.
zrj [Sun, 6 Oct 2019 07:26:29 +0000 (10:26 +0300)]
<sys/stdint.h>: Move out two MD types.

 The <cpu/types.h> would be a better place for these, however it needs
 proper cleanup first and would only complicate visibility on other
 standard headers at the moment.

4 years ago<sys/types.h>: Eliminate __nl_item type.
zrj [Sun, 6 Oct 2019 07:26:02 +0000 (10:26 +0300)]
<sys/types.h>: Eliminate __nl_item type.

 It is MI type, so just use standard int type as per POSIX.

4 years ago<runetype.h>: Convert __rune_t to internal typedef.
zrj [Sun, 6 Oct 2019 07:25:29 +0000 (10:25 +0300)]
<runetype.h>: Convert __rune_t to internal typedef.

 The __ct_rune_t is a basic type for __rune_t/__wint_t/__wchar_t.
 No functional change.

 While there, remove two trailing white spaces.

4 years agoNuke legacy non standard rune_t type.
zrj [Sun, 6 Oct 2019 07:25:02 +0000 (10:25 +0300)]
Nuke legacy non standard rune_t type.

 Not used anywhere and comments indicate it is meant not to be used
 outside lib/libc/locale anyway.

4 years agosbin/fsck_hammer2: More refactoring
Tomohiro Kusumi [Sun, 6 Oct 2019 01:02:08 +0000 (10:02 +0900)]
sbin/fsck_hammer2: More refactoring

4 years agosbin/fsck_hammer2: Refactor zone/blockref scanning
Tomohiro Kusumi [Sat, 5 Oct 2019 21:52:39 +0000 (06:52 +0900)]
sbin/fsck_hammer2: Refactor zone/blockref scanning

Refactor duplicated code from zone/blockref scanning with support
for multiple options.

4 years agosbin/fsck_hammer2: Add -b to only scan best zone
Tomohiro Kusumi [Sat, 5 Oct 2019 21:20:39 +0000 (06:20 +0900)]
sbin/fsck_hammer2: Add -b to only scan best zone

4 years agolibc: Add __errno_location() for language binding benefits.
zrj [Sat, 5 Oct 2019 10:04:12 +0000 (13:04 +0300)]
libc: Add __errno_location() for language binding benefits.

 Some languages have restrictions when it comes to C style TLS handling
 (thread local might be feature-gated) or simply it is inconvenient to
 add various OS specific binding wrappers just to access C errno values.

 The __errno_location() symbol provides externally callable version of
 __error() inline function.

 While there, add __WANT_NO_INLINED___ERROR guard for few python parsers
 in DPorts that are unable to parse inlined __error() code yet.

4 years agoppp(8): Re-enable RADIUS support.
zrj [Sat, 5 Oct 2019 10:00:16 +0000 (13:00 +0300)]
ppp(8): Re-enable RADIUS support.

 Until it is really decided to remove it from ppp(8).

 While there, add patches from DPorts to use newer
 LibreSSL/OpenSSL v1.1.x API.

4 years agoBump __DragonFly_version for libradius/libtacplus removal.
zrj [Sat, 5 Oct 2019 09:57:50 +0000 (12:57 +0300)]
Bump __DragonFly_version for libradius/libtacplus removal.

 While there, add entry to UPDATING.

4 years agoNuke libradius(3).
zrj [Sat, 5 Oct 2019 09:55:44 +0000 (12:55 +0300)]
Nuke libradius(3).

 It was moved to DPorts.

 For now keep radlib.c code directly in ppp(8). Other BSDs have it atm.

4 years agoppp(8): Disable RADIUS support.
zrj [Sat, 5 Oct 2019 09:54:45 +0000 (12:54 +0300)]
ppp(8): Disable RADIUS support.

 If there are still users making use of RADIUS support in ppp(8),
 then it could be added back directly into ppp(8).

 Add __unused for few arguments to pet WARNS in case of -DNORADIUS.

4 years agoNuke libtacplus(3).
zrj [Sat, 5 Oct 2019 09:54:16 +0000 (12:54 +0300)]
Nuke libtacplus(3).

 It was moved to DPorts.

4 years agoNuke pam_radius(8).
zrj [Sat, 5 Oct 2019 09:53:32 +0000 (12:53 +0300)]
Nuke pam_radius(8).

 It was moved to DPorts.

 While there, remove deps from MINUSPAM (including last dep on crypto).

4 years agoNuke pam_tacplus(8).
zrj [Sat, 5 Oct 2019 09:52:46 +0000 (12:52 +0300)]
Nuke pam_tacplus(8).

 It was moved to DPorts.

 While there, remove deps from MINUSPAM.

4 years agolib: Update dependencies.
zrj [Sat, 5 Oct 2019 09:51:55 +0000 (12:51 +0300)]
lib: Update dependencies.

 No libraries depend on libprivate_ssh, it can be built with rest.
 We could remove libprivate_ssh.so as and link with static version as it
 is done in upstream version, but for now save few bytes.

 While there, remove LIBSSH from MINUSPAM list.

4 years agoNuke pam_ssh(8). It was moved to DPorts.
zrj [Sat, 5 Oct 2019 09:51:26 +0000 (12:51 +0300)]
Nuke pam_ssh(8). It was moved to DPorts.

 Having it as security/pam_ssh solves several issues when using multiple
 LibreSSL/OpenSSL versions. Also this module poses a security risk for
 unsuspecting system admins, because users might create private ssh keys
 using very weak passphrases.

4 years agosys/vfs/msdosfs: Fix panic on corrupted fs in pcbmap()
Tomohiro Kusumi [Sat, 5 Oct 2019 19:44:56 +0000 (04:44 +0900)]
sys/vfs/msdosfs: Fix panic on corrupted fs in pcbmap()

from freebsd/freebsd@1d085394336dc06a0fd195ff4225080701b6fa5f

4 years agosys/vfs/msdosfs: Invalid filesystem might brelse(bp) with NULL
Tomohiro Kusumi [Sat, 5 Oct 2019 19:24:22 +0000 (04:24 +0900)]
sys/vfs/msdosfs: Invalid filesystem might brelse(bp) with NULL

from freebsd/freebsd@3dd6e87cb09dc334c97ca50dd65e567cfe453006

4 years agosys/vfs/msdosfs: Change the return on impossible condition into KASSERT()
Tomohiro Kusumi [Sat, 5 Oct 2019 19:01:33 +0000 (04:01 +0900)]
sys/vfs/msdosfs: Change the return on impossible condition into KASSERT()

from freebsd/freebsd@cc5d11fa86957084473b9eebf17dcdd1f3e7633d

Don't apply vnode lock assertion part yet.

4 years agosys/vfs/msdosfs: Ensure cluster allocation is within volume limits
Tomohiro Kusumi [Sat, 5 Oct 2019 18:07:41 +0000 (03:07 +0900)]
sys/vfs/msdosfs: Ensure cluster allocation is within volume limits

from freebsd/freebsd@097a1d5fbb7990980f8f806c6878537c964adf32

4 years agosys/vfs/msdosfs: Style
Tomohiro Kusumi [Sat, 5 Oct 2019 17:45:43 +0000 (02:45 +0900)]
sys/vfs/msdosfs: Style

from freebsd/freebsd@7721974753e2594dfeba7b2d625f7ea681c82a9b

4 years agosys/vfs/msdosfs: Verify BPB_Media value in FAT[0] in fillinusemap()
Tomohiro Kusumi [Sat, 5 Oct 2019 17:37:07 +0000 (02:37 +0900)]
sys/vfs/msdosfs: Verify BPB_Media value in FAT[0] in fillinusemap()

from freebsd/freebsd@18480c36c8d3d1f6b8996ceebd5b9c7d5daa9273

4 years agosys/vfs/msdosfs: Properly update ClnShutBitMask in FAT[1] in updatefats()
Tomohiro Kusumi [Sat, 5 Oct 2019 16:51:59 +0000 (01:51 +0900)]
sys/vfs/msdosfs: Properly update ClnShutBitMask in FAT[1] in updatefats()

from freebsd/freebsd@35907051bb7af5a3d9532671d959a88be064bce7

4 years agosys/vfs/msdosfs: Clear cluster bitmap on chainalloc() failure
Tomohiro Kusumi [Sat, 5 Oct 2019 15:56:15 +0000 (00:56 +0900)]
sys/vfs/msdosfs: Clear cluster bitmap on chainalloc() failure

from freebsd/freebsd@65a0ccdfc80cbc095717bdbc98bd3d061d9885ef

4 years agosys/vfs/msdosfs: Add clusteralloc1()
Tomohiro Kusumi [Sat, 5 Oct 2019 15:41:44 +0000 (00:41 +0900)]
sys/vfs/msdosfs: Add clusteralloc1()

bits from freebsd/freebsd@eb2b3c8672da21da1d5b72a0b44f0e8c3271cc1e
"Use pm_fatlock to protect fat bitmap."

Reduce diff against FreeBSD.

MP lock part is ignored.
sys/vfs/msdosfs isn't MPSAFE'd yet.

4 years agosys/vfs/msdosfs: ANSIfy sys/fs/msdosfs
Tomohiro Kusumi [Sat, 5 Oct 2019 15:22:04 +0000 (00:22 +0900)]
sys/vfs/msdosfs: ANSIfy sys/fs/msdosfs

bits from freebsd/freebsd@9d6a34744f8b822b0ba909b701876a2dd8f9c987

4 years agosys/vfs/msdosfs: Use struct dirent
Tomohiro Kusumi [Fri, 4 Oct 2019 16:36:39 +0000 (01:36 +0900)]
sys/vfs/msdosfs: Use struct dirent

Fix/sync the code diverged by DragonFly commits from around 2009
with FreeBSD.

Keep mbnambuf_flush() call in VOP_REDDIR() the same for now using
compat version. FreeBSD has other fixes here from recent years.

4 years agosys/vfs/msdosfs: Remove diff noises vs FreeBSD from iconv support
Tomohiro Kusumi [Fri, 4 Oct 2019 15:35:55 +0000 (00:35 +0900)]
sys/vfs/msdosfs: Remove diff noises vs FreeBSD from iconv support

commits in 2009 or so.

4 years agosys/vfs/msdosfs: Long names of files are created incorrectly
Tomohiro Kusumi [Fri, 4 Oct 2019 15:21:49 +0000 (00:21 +0900)]
sys/vfs/msdosfs: Long names of files are created incorrectly

from freebsd/freebsd@1ac70fc5481e16dc0207e50e5d6ec4336cc00162