After calling the cap_init(3) function Casper will fork from it's original
process, using pdfork(2). Forking from a process has a lot of advantages:
1. We have the same cwd as the original process.
2. The same uid, gid and groups.
3. The same MAC labels.
4. The same descriptor table.
5. The same routing table.
6. The same umask.
7. The same cpuset(1).
From now services are also in form of libraries.
We also removed libcapsicum at all and converts existing program using Casper
to new architecture.
Discussed with: pjd, jonathan, ed, drysdale@google.com, emaste
Partially reviewed by: drysdale@google.com, bdrewery
Approved by: pjd (mentor)
Differential Revision: https://reviews.freebsd.org/D4277
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.
Sponsored by: EMC / Isilon Storage Division
Renamed some local variables for compatibility with -Wshadow
Reported by: Andrew Turner
Tested by: ken
MFC after: 4 weeks
X-MFC-with: 295768
Sponsored by: Spectra Logic Corp
Some invalid PCI device selectors could cause read access to an initialized
variable next to the array (local loop index variable).
While here, the parser has been made more strict with regard to the syntax
of PCI device selectors as documented in the man-page. E.g. "pci:" used to
be interpreted as "pci0:0".
MFC after: 3 days
Raise WARNS from 1 to 6 (the default)
Fix warnings:
* Use C99 designated initializers for structs, and initialize all fields
* Mark global variables as static
* Mark unused function arguments
* Be careful about signed/unsigned comparisons
Reviewed by: eadler
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D5328
This builds fine with FAST_DEPEND but the mkdep method requires that
include/ generates the headers during 'make depend' so the subsequent
directories can find them when running mkdep.
Sponsored by: EMC / Isilon Storage Division
This fixes connection errors for some initiators not starting CmdSN
from zero.
While there, fix wrong status details reported for couple errors.
MFC after: 3 days
The services db is created as a temporary file that is moved over the
existing file after completion. Thus there is no need to immediately
flush all created db records to the temporary file.
This speeds up creation of the services db by a factor of 500 on my
ZFS based /var/db filesytem (from 110 seconds to 0.235 seconds).
MFC after: 1 week
This makes runnig f_substr() faster than it was when running under bash,
but both sh and dash are still faster when using the non-bash recipe which
features dynamically unrolled loops.
sysrc(8) supports key+=value and key-=value, but can be told what the
delimiter is by being passed as char1 (e.g., "sysrc key+=",value" to use a
comma as the delimiter instead of space). For convenience, if the first char
is alpha-numeric, it is assumed you wanted whitespace as the delimiter.
However, if you naively (as I just did) execute:
sysrc rc_conf_files+=/etc/rc.conf.other
the result is unexpected.
This commit makes `.' and `/' in-addition to alpha-numeric first-characters
to cause the default of whitespace to be used as the delimiter. This also
means that you can no longer use these as a delimiter.
When using col(1) piped to vim(1) as pager for man(1), the former sequence
of (Qo \ Qc) renders as "" without the space. Replace with (Qo (space) Qc)
which renders properly in more (all?) pagers.
bash lacks the ksh93 optimization that makes sub-shells fast if they do
not alter io. bash 3.1-alpha1 introduced printf -v var_to_set which is not
as fast but is still significantly faster than var_to_set=$( printf ) when
using any version of bash. If we find our interpreter to somehow be bash
by invocation or inclusion, use the feature that provides fastest results.
Enable repeated line compression for lines of any length, instead of only
short lines. AFAICT repeated line compression was limited to short lines as
a RAM optimization, which made sense when karels added it in 1988, but no
longer. The penalty is a paltry 904B of RAM per file logged.
Reviewed by: rpaulo
MFC after: 32 days
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D4475
In some cases the test system might not have mount_cd9660(8). Don't
implicitly rely on it while testing cd9660 support; explicitly rely
on it
MFC after: 1 week
Reported by: mjohnston
Sponsored by: EMC / Isilon Storage Division