It is a bit unfortunate that the example to delete broken symlinks now uses
rm(1), but allowing this with -delete would require fixing fts(3) to not
imply FTS_NOCHDIR if FTS_LOGICAL is given (or hacks in the -delete option).
PR: bin/90687
MFC after: 2 weeks
"The escape sequence '\n' shall match a <newline> embedded in
the pattern space."
It is unclear whether this also applies to a \n embedded in a
character class. Disable the existing handling of \n in a character
class following Mac OS X, GNU sed version 4.1.5 with --posix, and
SunOS 5.10 /usr/bin/sed.
Pointed by: Marius Strobl
Obtained from: Mac OS X
of the y (translate) command.
"If a backslash character is immediately followed by a backslash
character in string1 or string2, the two backslash characters shall
be counted as a single literal backslash character"
Pointed by: Marius Strobl
Obtained from: Mac OS X
feature when you have a seemingly stuck socket and want to figure
out why it has not been closed yet.
No plans to MFC this, as it changes the netstat sysctl ABI.
Reviewed by: andre, rwatson, Eric Van Gyzen
New counters now exist for:
requests sent
replies sent
requests received
replies received
packets received
total packets dropped due to no ARP entry
entrys timed out
Duplicate IPs seen
The new statistics are seen in the netstat command
when it is given the -s command line switch.
MFC after: 2 weeks
In collaboration with: bz
prior to r195693, since historical behaviour of mmap(2) was to silently
ignore length-zero mmap requests; but mmap now returns EINVAL, which caused
look(1) to emit an error message and fail.
Among other things, this makes `freebsd-update fetch` on a newly installed
8.0-BETA3 system print bogus warning messages.
MFC after: 3 days
This affects only fstat on zfs and devfs, only on 64-bit systems
and only when fsid is greater than 2^31 - 1.
When fstat examines a file via stat(2) it takes uint32_t st_dev
and assigns to (signed) (64-bit) long fsid, this results in
a positive value.
When fstat examines opened files it takes int32_t f_fsid.val[0]
and assigns to (signed) (64-bit) long fsid, this results in
a negative value.
So, while initially st_dev and f_fsid.val[0] have the same bit
values they get promoted to different 64-bit values because
of the signed-vs-unsigned difference.
A fix is to use "more natural" positive numbers by introducing
intermediate unsigned cast for f_fsid.val[0].
Reviewed by: jhb, lulf
Approved by: re (kib)
MFC after: 1 week (to stable/7)
- Limit suffix to be no more than 30 bytes long. This matches GNU
behavior.
- Correct usage of memcpy().
Note that this commit only corrects the stack underflow issue, we
still need some other fixes to cover other edges. [1]
Reported by: Ron Jude <ronj wytheville org>
Discussed with: Matthew Green (original NetBSD gzip author),
Eygene Ryabinkin <rea-fbsd codelabs ru> [1]
Approved by: re (kib)
Major changes from v429:
* Don't pass "-" to non-pipe LESSOPEN unless it starts with "-".
* Allow a fraction as the argument to the -# (--shift) option.
* Fix highlight bug when underlined/overstruck text matches at end of line.
* Fix non-regex searches with ctrl-R.
Approved by: re (kensmith, kib)
ability to retrieve the group list of each process.
Modify procstat's -s option to query this mib when the kinfo_proc
reports that the field has been truncated. If the mib does not exist,
fall back to the truncated list.
Reviewed by: rwatson
Approved by: re (kib)
MFC after: 2 weeks
a device pager (OBJT_DEVICE) object in that it uses fictitious pages to
provide aliases to other memory addresses. The primary difference is that
it uses an sglist(9) to determine the physical addresses for a given offset
into the object instead of invoking the d_mmap() method in a device driver.
Reviewed by: alc
Approved by: re (kensmith)
MFC after: 2 weeks
when using mmap() before invoking mmap(). This avoids a confusing error
message when locate is invoked against a zero-size database after the
recent change to make mmap() fail requests to map 0 bytes.
Submitted by: Jaakko Heinonen jh of saunalahti dot fi
Approved by: re (kensmith)
MFC after: 1 week
were pointed out by Brooks Davis and Alexey Dokuchaev:
* It now tries to lookup arguments as names first, then tries
to parse them as numbers. In particular, this makes the
behavior consistent with POSIX conventions when usernames
consist entirely of digits.
* It now uses strtoul() for the numeric parsing.
Finally, I've included an update to the test harness
to exercise the new numeric cases for -R.
Approved by: re (kib)
user or group Ids as well as user or group names.
In particular, this fixes freesbie2, which uses
-R 0:0 to copy a bunch of files so that the result
will be owned by root.
Also fixes a related bug that mixed-up the uid
and gid specified by -R when in passthrough mode.
Thanks to Dominique Goncalves for reporting this
regression.
Approved by: re (kib)
insisting on privileged port access.
Include /var/yp/Makefile.local if it exists and suggest using
it to override /var/yp/Makefile behaviour.
Approved by: re (kib)
MFC after: 3 weeks
- gzip -n does not store timestamp; [1]
- Reduce diff against NetBSD by moving some casts in our local
versions.
PR: bin/134955
Obtained from: NetBSD
MFC after: 1 month
- The uid/cuid members of struct ipc_perm are now uid_t instead of unsigned
short.
- The gid/cgid members of struct ipc_perm are now gid_t instead of unsigned
short.
- The mode member of struct ipc_perm is now mode_t instead of unsigned short
(this is merely a style bug).
- The rather dubious padding fields for ABI compat with SV/I386 have been
removed from struct msqid_ds and struct semid_ds.
- The shm_segsz member of struct shmid_ds is now a size_t instead of an
int. This removes the need for the shm_bsegsz member in struct
shmid_kernel and should allow for complete support of SYSV SHM regions
>= 2GB.
- The shm_nattch member of struct shmid_ds is now an int instead of a
short.
- The shm_internal member of struct shmid_ds is now gone. The internal
VM object pointer for SHM regions has been moved into struct
shmid_kernel.
- The existing __semctl(), msgctl(), and shmctl() system call entries are
now marked COMPAT7 and new versions of those system calls which support
the new ABI are now present.
- The new system calls are assigned to the FBSD-1.1 version in libc. The
FBSD-1.0 symbols in libc now refer to the old COMPAT7 system calls.
- A simplistic framework for tagging system calls with compatibility
symbol versions has been added to libc. Version tags are added to
system calls by adding an appropriate __sym_compat() entry to
src/lib/libc/incldue/compat.h. [1]
PR: kern/16195 kern/113218 bin/129855
Reviewed by: arch@, rwatson
Discussed with: kan, kib [1]
- update for getrlimit(2) manpage;
- support for setting RLIMIT_SWAP in login class;
- addition to the limits(1) and sh and csh limit-setting builtins;
- tuning(7) documentation on the sysctls controlling overcommit.
In collaboration with: pho
Reviewed by: alc
Approved by: re (kensmith)
in some commercial Unix systems, which utilizes Huffman minimum redundancy
code tree to compress files. This implementation supports the "new" pack
format only, just like GNU gzip did.
Thanks for oliver@'s archive set which I can test against, and Mingyan Guo
for providing helpful review of my code.
PR: bin/109567
MFC after: 1 month
Add necessary changes to the kernel for this (basically introduce a
bpf_zero_counters() function). As well, update the man page.
MFC after: 1 month
Discussed with: rwatson
- Reduce scope where return value can be referenced.
- Add a dummy access to timestamp to silence warning.
Submitted by: Mingyan Guo <guomingyan gmail com>
system callers of getgroups(), getgrouplist(), and setgroups() to
allocate buffers dynamically. Specifically, allocate a buffer of size
sysconf(_SC_NGROUPS_MAX)+1 (+2 in a few cases to allow for overflow).
This (or similar gymnastics) is required for the code to actually follow
the POSIX.1-2008 specification where {NGROUPS_MAX} may differ at runtime
and where getgroups may return {NGROUPS_MAX}+1 results on systems like
FreeBSD which include the primary group.
In id(1), don't pointlessly add the primary group to the list of all
groups, it is always the first result from getgroups(). In principle
the old code was more portable, but this was only done in one of the two
places where getgroups() was called to the overall effect was pointless.
Document the actual POSIX requirements in the getgroups(2) and
setgroups(2) manpages. We do not yet support a dynamic NGROUPS, but we
may in the future.
MFC after: 2 weeks
While hacking on TTY code, I often miss a small utility to revoke my own
(pseudo-)terminals. This small utility is just a small wrapper around
the revoke(2) call, so you can destroy your very own login sessions.
Approved by: re
The chpass Makefile tried to set the fschg flag on the binaries, even if
NO_FSCHG was passed to the installworld. This meant that if I installed
FreeBSD into a Jail, I couldn't installworld from within the Jail
anymore.
Now that it listens to NO_FSCHG, we can just make it bail out when it
fails, just like PRECIOUSPROG does.
trying to open files rather than giving up when it encounters an
error. ENOENT errors are not reported.
As a result, files that are moved away then recreated are not at
risk of being 'lost' to tail. Files that are recreated and
temporarily have unreadable permissions will be shown when they
are fixed.
This behaviour is consistent with the GNU version of tail but
without the verbiage that goes with the GNU version.
This change also fixes error messages accompanying -f and -F.
They no longer report problems with (null)!
MFC after: 3 weeks
Some time ago Tom Rhodes sent me an email that he was willing to perform
various cleanups to the window(1) source code. After some discussion, we
both decided the best thing to do, was to move window(1) to the ports
tree. The application isn't used a lot nowadays, mainly because it has
been superseeded by screen, tmux, etc.
A couple of hours ago Tom committed window(1) to ports (misc/window), so
I'm removing it from the tree. I don't think people will really miss it,
but I'm describing the change in UPDATING anyway.
Discussed with: trhodes, pav, kib
Approved by: re
an accessor function to get the correct rnh pointer back.
Update netstat to get the correct pointer using kvm_read()
as well.
This not only fixes the ABI problem depending on the kernel
option but also permits the tunable to overwrite the kernel
option at boot time up to MAXFIBS, enlarging the number of
FIBs without having to recompile. So people could just use
GENERIC now.
Reviewed by: julian, rwatson, zec
X-MFC: not possible
Formerly, this tried to clear the flags on the symlink's target
instead of the symlink itself.
As before, this only happens for root or for the unlink(1) variant of rm.
PR: bin/111226 (part of)
Submitted by: Martin Kammerhofer
Approved by: ed (mentor)
MFC after: 3 weeks
This version is now licensed under a 2-clause BSD license, instead of
the Artistic license. I've reverted a lot of local modifications we made
to ee, because they have been integrated upstream as well.
Only local modifications include:
- $FreeBSD$ ID.
- Pathname to init.ee.
- catopen() call, to honor LC_MESSAGES instead of LANG.
To keep SVN happy, I'm putting an application/octet-stream mime type on
the KOI8 translations.
Reviewed by: current@
and jail_get(2). Jail(8) can now create jails using a "name=value"
format instead of just specifying a limited set of fixed parameters; it
can also modify parameters of existing jails. Jls(8) can display all
parameters of jails, or a specified set of parameters. The available
parameters are gathered from the kernel, and not hard-coded into these
programs.
Small patches on killall(1) and jexec(8) to support jail names with
jail_get(2).
Approved by: bz (mentor)
The source file, manual page and English translation are now directly
obtained from the contrib/ directory. This makes it a lot easier to
merge a newer version of ee(1) into the tree.
Thanks to: des and jhb
I don't entirely like this approach, but it will only be temporarily,
namely until we get rid of COMPAT_43TTY. I do want <sys/ioctl_compat.h>
to cause a compiler error when included, because it's just there for
binary compatibility.
Reported by: Andrzej Tobola <ato iem pw edu pl>
First of all, current behavior is not documented and confusing,
and it can be very dangerous in the following sequence:
find -L . -type l
find -L . -type l -delete
(the second line is even suggested by find(1)).
Instead simply refuse to proceed when -L and -delete are both used.
A descriptive error message is provided.
The following command can be safely used to remove broken links:
find -L . -type l -print0 | xargs rm -0
To do: update find(1)
PR: bin/90687
Obtained from: Anatoli Klassen <anatoli@aksoft.net>
Approved by: jhb (mentor)
At first I allowed ioctl_compat.h to be included, but it just returned
an empty file. I had to do this, to keep kdump happy. I really want to
raise a compiler error when including this header, so now it will just
throw an error if you don't set COMPAT_43TTY.
SIGINFO). Provides some progress report for the impatient. This
won't report that we're blocking in our walk due to disk/network
problems, however. There's no really good way to report that
condition that I'm aware of...
o Change mr/me to so/se [1].
o Introduce a -h option to disable highlighting. [2]
o Spell STDOUT_FILENO as such and pass NULL to tgetent()
to handle the case of unset TERM. [3]
Suggested by: naddy mips.inka.de (Christian Weisgerber) [1]
Requested by: danfe, deischen [2]
Suggested by: jmallett [3]
Approved by: ed (mentor)
Match the bracketing in netstat.
Since the cleanup of MROUTING, ports have broken because they
expect to include <netinet/ip_mroute.h> without including
<sys/queue.h>. Fix breakage at source.
The real fix, of course, is to fix the MROUTING APIs by blowing them
away and replacing them with something else...
gnu cal does. This is currently disabled for year view because of hard
coded padding in that case. This will hopefully be fixed soon.
Reviewed by: Simon 'corecode' Schubert <corecode fs.ei.tum.de>
Approved by: ed
arguments. This change should be MFC'd with OpenBSM 1.1 since they
are interdependent.
MFC after: 2 weeks
Obtained from: TrustedBSD Project
Sponsored by: Apple, Inc.
more selective about what libarchive features we pull in:
* No compression support
* Only cpio and ustar writing
* Only cpio and tar/pax readers
This reduces a statically linked, stripped binary from 900k to 680k
and completely eliminates the dependency on libcrypto.
* Lots of new tests.
* New -n / --numeric-uid-gid option
* More sanity-checking of arguments
* Various Windows portability improvements
* Sync up version number to 2.7.0
* Add xz and lzma compression options
* Rename --format-options to simply --options
* Add --same-owner for GNU tar compat
* Add -lmd and -lcrypto to fix link
* Documentation
We've seen this bug in other applications before: we have some
applications that use strrchr(tty, '/') on the TTY device name. This
isn't valid when using pts(4), because the device name will be stripped
to "0" instead of "pts/0".
This fixes issues with login(1) ignoring /etc/ttys and missing utmp
records.
Reported by: Barney Cordoba <barney_cordoba yahoo com>
Reviewed by: rwatson
This is purely a forwarding plane cleanup; no control plane
code is involved.
Summary:
* Split IPv4 and IPv6 MROUTING support. The static compile-time
kernel option remains the same, however, the modules may now
be built for IPv4 and IPv6 separately as ip_mroute_mod and
ip6_mroute_mod.
* Clean up the IPv4 multicast forwarding code to use BSD queue
and hash table constructs. Don't build our own timer abstractions
when ratecheck() and timevalclear() etc will do.
* Expose the multicast forwarding cache (MFC) and virtual interface
table (VIF) as sysctls, to reduce netstat's dependence on libkvm
for this information for running kernels.
* bandwidth meters however still require libkvm.
* Make the MFC hash table size a boot/load-time tunable ULONG,
net.inet.ip.mfchashsize (defaults to 256).
* Remove unused members from struct vif and struct mfc.
* Kill RSVP support, as no current RSVP implementation uses it.
These stubs could be moved to raw_ip.c.
* Don't share locks or initialization between IPv4 and IPv6.
* Don't use a static struct route_in6 in ip6_mroute.c.
The v6 code is still using a cached struct route_in6, this is
moved to mif6 for the time being.
* More cleanup remains to be merged from ip_mroute.c to ip6_mroute.c.
v4 path tested using ports/net/mcast-tools.
v6 changes are mostly mechanical locking and *have not* been tested.
As these changes partially break some kernel ABIs, they will not
be MFCed. There is a lot more work to be done here.
Reviewed by: Pavlin Radoslavov
certain flags that should have been in inp_flags ended up in inp_vflag,
meaning that they were inconsistently locked, and in one case,
interpreted. Move the following flags from inp_vflag to gaps in the
inp_flags space (and clean up the inp_flags constants to make gaps
more obvious to future takers):
INP_TIMEWAIT
INP_SOCKREF
INP_ONESBCAST
INP_DROPPED
Some aspects of this change have no effect on kernel ABI at all, as these
are UDP/TCP/IP-internal uses; however, netstat and sockstat detect
INP_TIMEWAIT when listing TCP sockets, so any MFC will need to take this
into account.
MFC after: 1 week (or after dependencies are MFC'd)
Reviewed by: bz
internal sysctl_sysctl_name() handler to map the MIB array to a string
name and logs this name in the trace log. This can be useful to see
exactly which sysctls a thread is invoking.
MFC after: 1 month
in6p_ip6_nxt
in6p_vflag
in6p_flags
in6p_socket
in6p_lport
in6p_fport
in6p_ppcb
Remove unused v6 macro aliases for inpcb flags:
IN6P_HIGHPORT
IN6P_LOWPORT
IN6P_ANONPORT
IN6P_RECVIF
IN6P_MTUDISC
IN6P_FAITH
IN6P_CONTROLOPTS
References to in6p_lport and in6_fport in sockstat are also replaced with
normal inp_lport and inp_fport references.
MFC after: 3 days
Reviewed by: bz
IPv4 stack.
Diffs are minimized against p4.
PCS has been used for some protocol verification, more widespread
testing of recorded sources in Group-and-Source queries is needed.
sizeof(struct igmpstat) has changed.
__FreeBSD_version is bumped to 800070.
Translate getdate.y into C for portability. Make the get_date()
function easier to test as well:
* Have it accept a time_t "now" to use as a reference so that test
code can verify relative time specifications against known starting
points.
* Set up default date after parsing the string so that we
can use the specified timezone (if any) instead of the local
default. Otherwise, local DST makes it almost impossible to
reliably test time specifications such as "sunday UTC"
archive_read_disk API to pull metadata off of disk. This
removes a lot of platform-specific knowledge of things like
ACLs, file flags, and extended attributes from bsdtar.
memory from int to size_t. Implement a workaround for current ABI not
allowing to properly save size for and report more then 2Gb sized segment
of shared memory.
This makes it possible to use > 2 Gb shared memory segments on 64bit
architectures. Please note the new BUGS section in shmctl(2) and
UPDATING note for limitations of this temporal solution.
Reviewed by: csjp
Tested by: Nikolay Dzham <i levsha org ua>
MFC after: 2 weeks
Increasing WARNS seems to have broken compilation of this utility.
Instead of lowering WARNS, just fix to code to compile properly.
Submitted by: <bf2006a yahoo com>
Tested by: bms
arbitrarily long lines and embedded NULs. The new functionality is
nugatory, but adding it is a simple way to improve the exposure of
getline() in -CURRENT.
The function pow() in libmp(3) clashes with pow(3) in libm. We could
rename this single function, but we can just take the same approach as
the Solaris folks did, which is to prefix all function names with mp_.
libmp(3) isn't really popular nowadays. I suspect not a single
application in ports depends on it. There's still a chance, so I've
increased the SHLIB_MAJOR and __FreeBSD_version.
Reviewed by: deischen, rdivacky
been extensively tested. And the ELF64 stuff likely is not quite
right...
# There's a lot of cut-n-paste code here that could easily be
# refactored, at least for FreeBSD syscalls.
Because we now have a reliable library function that converts file
descriptors to character device names, let stat(1) use this. This means
it can now do the following:
$ stat -f %N
/dev/pts/0
I've changed main() to set file properly, so output() is never called
with file set to NULL.
Approved by: dougb (older version, still used devname)
than was read. This seems to have only affected the shar
writer, since other formats proactively truncate output
to the originally-advertised size.
PR: bin/131244
MFC after: 7 days
src/usr.bin/usbhidctl/usbhid.c
src/sys/dev/usb2/include/usb2_hid.h
src/sys/dev/usb2/input/uhid2.c
src/lib/libusbhid/Makefile
src/lib/libusbhid/descr.c
src/lib/libusbhid/descr_compat.c
src/lib/libusbhid/usbhid.3
src/lib/libusbhid/usbhid.h
src/lib/libusbhid/usbvar.h
Patches to make libusbhid and HID userland utilities compatible with
the new USB stack. All HID ioctls should go through the libusbhid
library to ensure compatibility. I have found at least one piece of
software in /usr/ports which needs to get updated before USB HID
devices will work. This is the X joystick input driver.
Reported and tested by:
Daichi GOTO and Masanori OZAWA.
src/sys/dev/usb2/core/usb2_process.c
Correct USB process names.
Reported by:
Andre Guibert de Bruet
src/sys/dev/usb2/serial/uftdi2.c
Integrate changes from old USB stack.
Submitted by: hps
from the inet6 stack along with statistics and make sure we
properly free the rt in all cases.
While the current situation is not better performance wise it
prevents panics seen more often these days.
After more inet6 and ipsec cleanup we should be able to improve
the situation again passing the rt to ip6_forward directly.
Leave the ip6_forward_rt entry in struct vinet6 but mark it
for removal.
PR: kern/128247, kern/131038
MFC after: 25 days
Committed from: Bugathon #6
Tested by: Denis Ahrens <denis@h3q.com> (different initial version)
that are much larger than expected (given the default size).
Change "smaller files" to "split files" which is more in line
with what "-b" actually does.
PR: 119329
Submitted by: Julian Stacey <jhs@berklix.org>
This gets rid of gnu89 style inlining. Also silence gcc by assigning two
variables NULL. This lets use to remove NO_WERROR.
Approved by: kib (mentor)
Approved by: harti
T_secs already had a non-zero default. Unbreak by moving the default to
ftp_timeout / http_timeout.
Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
MFC after: 2 weeks
The name `aux' is reserved on Windows file systems. aux.c in the mail(1)
directory contains some random utility functions. I'm renaming this file
to util.c to make it possible to check out this directory on Windows.
MFC after: 1 month
argument. Before this fix, after searching the currently-running kernel,
we would still search the a.out argument - completely override the in-kernel
list, essentially defeating the K flag's purpose.
PR: 47387
Submitted by: Ryan Beasley <ryanb@goddamnbastard.org>
fetch a complete CVS repository. Support for rsync update of regular files are
also included, but are not yet enabled. The change should not have an impact on
existing csup usage, as little of the existing code has changed.
E.g., .MAKE.JOB.PREFIX=${.newline}---[${.MAKE.PID}]
would produce
---[1234] target ---
2. Added ${.newline} as a simple means of being able to include '\n' in the
assignment of .MAKE.JOB.PREFIX
Obtained from: NetBSD
In particular, point out that string comparison can only use != and ==
(how weird, given that the underlying call to strcmp returns more
information), that floating point values are correctly interpreted
as numbers, and that the left-hand side must be a variable expansion.
MFC after: 3 weeks