MFC r269859:
Fix for memory leak.

Sponsored by:	Mellanox Technologies


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270167 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Bump __FreeBSD_version after r269789 so ports can use it.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270175 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
vt(4): Add vtbuf_dirty*_locked() to lock vtbuf once, not twice

In several functions, vtbuf_putchar() in particular, the lock on vtbuf
is acquired twice:
    1. once by the said functions;
    2. once in vtbuf_dirty().

Now, vtbuf_dirty_locked() and vtbuf_dirty_cell_locked() allow to
acquire that lock only once.

This improves the input speed of vt(4). To measure the gain, a
50,000-lines file was displayed on the console using cat(1). The time
taken by cat(1) is reported below:
    o  On amd64, with vt_vga:
        - before: 1.0"
        - after:  0.5"
    o  On sparc64, with creator_vt:
        - before: 13.6"
        - after:  10.5"

This is an MFC of r269780.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270184 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r269524:
Preserve the errno value of an ioctl before calling free(3). Previously,
errno was very occasionally being clobbered, resulting in a bogus error from
dt_consume() and thus an error from dtrace(1).


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270213 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r262872: fts: Don't abort if an empty pathname is given.

Make fts_open(3) treat an empty pathname like any other pathname that cannot
be lstatted because of [ENOENT].

It is rather confusing if  rm -rf file1 "" file2  does not remove file1 and
file2.

PR:		187264


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270245 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
vt(4): Colors are indexed against a console palette, not a VGA palette

Rename vt_generate_vga_palette() to vt_generate_cons_palette() and
change it to build a palette where the color index is the same than in
terminal escape codes, not the VGA index. That's what TCHAR_CREATE()
uses and passes to vt(4).

The main differences between both orders are:
    o  Blue and red are swapped (1 <-> 4)
    o  Yellow and cyan are swapped (3 <-> 6)

The problem remained unnoticed, because the RGB bit indexes passed to
vt_generate_vga_palette() were reversed. This inversion was cancelled
by the colors inversions in the generated palette. For instance, red
(0xff0000) and blue (0x0000ff) have bytes in opposite order, but were
swapped in the palette. But after changing the value of blue (see last
paragraph), the modified color was in fact the red one.

While here, tune the palette to better match console colors and improve
the readability (especially the dark blue).

This is an MFC of r269783 and r269791.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270263 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r269525:
Return 0 for the PPID of threads in process 0, as process 0 doesn't have a
parent process.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270295 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
if_carp.ko depends on sha1.c.

This is direct commit to stable/9, since modern carp is
diverged a lot from it. Relevant commit to head was r228576.

Submitted by:	Damir Bikmuhametov <boco ufanet.ru>


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270323 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC bsd-family tree up to r269882 (from the stable/9 creation time),
thus documenting many defferent releases up to date.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270325 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFH (r269074): strip patch level from release name


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270396 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFH (r269115): remove useless getpwnam() call


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270397 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFH (r268888): fix false negative for empty groups
PR:		109416

MFH (r268890): add support for "account" facility
PR:		115164


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270400 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFH (r268877, r268921): use -o instead of a redirect.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270409 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFH (r263160): remove lukemftpd


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270414 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: r268273
The new NFSv3 server did not generate directory postop attributes for
the reply to ReaddirPlus when the server failed within the loop
that calls VFS_VGET(). This failure is most likely an error
return from VFS_VGET() caused by a bogus d_fileno that was
truncated to 32bits.
This patch fixes the server so that it will return directory postop
attributes for the failure. It does not fix the underlying issue caused
by d_fileno being uint32_t when a file system like ZFS generates
a fileno that is greater than 32bits.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270435 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: r268726
Move the "retry:" label so that the calls to m_pullup() are
not done after the call to m_defrag(). This fixes a problem
where m_pullup() would prepend an mbuf to the list created
by m_defrag() making the chain greater than 32 again.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270458 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFH (r270458): print numeric file mode unless -r was specified


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270459 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFH (r267127): don't send User-Agent if HTTP_USER_AGENT is empty


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/9@270461 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f