aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'sbin')
-rw-r--r--sbin/devd/Makefile5
-rw-r--r--sbin/devd/devd.conf.516
-rw-r--r--sbin/devd/snd.conf23
-rw-r--r--sbin/ipf/libipf/printdstl_live.c3
-rw-r--r--sbin/ipf/libipf/printdstlist.c2
-rw-r--r--sbin/ipf/libipf/printdstlistdata.c5
-rw-r--r--sbin/ipf/libipf/printhash_live.c8
-rw-r--r--sbin/ipf/libipf/printhashdata.c19
-rw-r--r--sbin/ipf/libipf/printpooldata.c2
-rwxr-xr-xsbin/ipfw/tests/test_add_rule.py25
-rw-r--r--sbin/pfctl/pfctl.c13
-rw-r--r--sbin/rcorder/rcorder.c8
12 files changed, 105 insertions, 24 deletions
diff --git a/sbin/devd/Makefile b/sbin/devd/Makefile
index 5d5721d16884..553aecf4ee88 100644
--- a/sbin/devd/Makefile
+++ b/sbin/devd/Makefile
@@ -32,6 +32,11 @@ CONSOLEDIR= ${DEVDDIR}
CONSOLE+= moused.conf syscons.conf
CONSOLEPACKAGE= console-tools
+CONFGROUPS+= SND
+SNDDIR= ${DEVDDIR}
+SND= snd.conf
+SNDPACKAGE= sound
+
.if ${MK_BLUETOOTH} != "no"
CONFGROUPS+= BLUETOOTH
BLUETOOTHDIR= ${DEVDDIR}
diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5
index baf4b9d3a183..8df3e910e076 100644
--- a/sbin/devd/devd.conf.5
+++ b/sbin/devd/devd.conf.5
@@ -652,6 +652,22 @@ and
for details.
.El
.Pp
+.Bl -column "System" "Subsystem" "1234567" -compact
+.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
+.It Li SND Ta Ta Ta
+Events related to the
+.Xr sound 4
+driver.
+.It Li SND Ta Li CONN Ta Li IN Ta
+Connected input device specified in
+.Pa cdev
+variable.
+.It Li SND Ta Li CONN Ta Li OUT Ta
+Connected output device specified in
+.Pa cdev
+variable.
+.El
+.Pp
.\"
.\" End of tables
.\"
diff --git a/sbin/devd/snd.conf b/sbin/devd/snd.conf
new file mode 100644
index 000000000000..cf9cd9e94191
--- /dev/null
+++ b/sbin/devd/snd.conf
@@ -0,0 +1,23 @@
+# Audio redirection
+notify 0 {
+ match "system" "SND";
+ match "subsystem" "CONN";
+ match "type" "IN";
+ match "cdev" "dsp[0-9]+";
+
+ # FIXME: We are hardcoding /dev/vdsp.ctl here, simply because it is a
+ # common virtual_oss control device name. Until we find a proper way to
+ # define control devices here, /dev/vdsp.ctl can be changed to the
+ # control device of choice.
+ action "/usr/sbin/virtual_oss_cmd /dev/vdsp.ctl -R /dev/$cdev";
+};
+
+notify 0 {
+ match "system" "SND";
+ match "subsystem" "CONN";
+ match "type" "OUT";
+ match "cdev" "dsp[0-9]+";
+
+ # FIXME: See comment above.
+ action "/usr/sbin/virtual_oss_cmd /dev/vdsp.ctl -P /dev/$cdev";
+};
diff --git a/sbin/ipf/libipf/printdstl_live.c b/sbin/ipf/libipf/printdstl_live.c
index 088448e6656d..72cb75a832c9 100644
--- a/sbin/ipf/libipf/printdstl_live.c
+++ b/sbin/ipf/libipf/printdstl_live.c
@@ -40,6 +40,9 @@ printdstl_live( ippool_dst_t *d, int fd, char *name, int opts,
if ((d->ipld_flags & IPHASH_DELETE) != 0)
PRINTF("# ");
+ if (opts & OPT_SAVEOUT)
+ PRINTF("{\n");
+
if ((opts & OPT_DEBUG) == 0)
PRINTF("\t{");
diff --git a/sbin/ipf/libipf/printdstlist.c b/sbin/ipf/libipf/printdstlist.c
index 2cf41ffe414c..497d7004c94c 100644
--- a/sbin/ipf/libipf/printdstlist.c
+++ b/sbin/ipf/libipf/printdstlist.c
@@ -42,6 +42,8 @@ printdstlist( ippool_dst_t *pp, copyfunc_t copyfunc, char *name, int opts,
return (NULL);
}
+ if (opts & OPT_SAVEOUT)
+ PRINTF("\t");
node = printdstlistnode(n, bcopywrap, opts, fields);
free(n);
diff --git a/sbin/ipf/libipf/printdstlistdata.c b/sbin/ipf/libipf/printdstlistdata.c
index 7940d2ae021b..546bf35cabf6 100644
--- a/sbin/ipf/libipf/printdstlistdata.c
+++ b/sbin/ipf/libipf/printdstlistdata.c
@@ -11,8 +11,7 @@
void
printdstlistdata( ippool_dst_t *pool, int opts)
{
-
- if ((opts & OPT_DEBUG) == 0) {
+ if ((opts & OPT_DEBUG) == 0 || opts & OPT_SAVEOUT) {
if ((pool->ipld_flags & IPDST_DELETE) != 0)
PRINTF("# ");
PRINTF("pool ");
@@ -24,7 +23,7 @@ printdstlistdata( ippool_dst_t *pool, int opts)
printunit(pool->ipld_unit);
- if ((opts & OPT_DEBUG) == 0) {
+ if ((opts & OPT_DEBUG) == 0 || opts & OPT_SAVEOUT) {
PRINTF("/dstlist (name %s;", pool->ipld_name);
if (pool->ipld_policy != IPLDP_NONE) {
PRINTF(" policy ");
diff --git a/sbin/ipf/libipf/printhash_live.c b/sbin/ipf/libipf/printhash_live.c
index b8ee31b27597..427daa18316b 100644
--- a/sbin/ipf/libipf/printhash_live.c
+++ b/sbin/ipf/libipf/printhash_live.c
@@ -26,7 +26,9 @@ printhash_live(iphtable_t *hp, int fd, char *name, int opts, wordtab_t *fields)
if ((hp->iph_flags & IPHASH_DELETE) != 0)
PRINTF("# ");
- if ((opts & OPT_DEBUG) == 0)
+ if (opts & OPT_SAVEOUT)
+ PRINTF("{\n");
+ else if ((opts & OPT_DEBUG) == 0)
PRINTF("\t{");
obj.ipfo_rev = IPFILTER_VERSION;
@@ -50,6 +52,8 @@ printhash_live(iphtable_t *hp, int fd, char *name, int opts, wordtab_t *fields)
last = 1;
if (bcmp(&zero, &entry, sizeof(zero)) == 0)
break;
+ if (opts & OPT_SAVEOUT)
+ PRINTF("\t");
(void) printhashnode(hp, &entry, bcopywrap, opts, fields);
printed++;
}
@@ -59,7 +63,7 @@ printhash_live(iphtable_t *hp, int fd, char *name, int opts, wordtab_t *fields)
if (printed == 0)
putchar(';');
- if ((opts & OPT_DEBUG) == 0)
+ if ((opts & OPT_DEBUG) == 0 || (opts & OPT_SAVEOUT))
PRINTF(" };\n");
(void) ioctl(fd,SIOCIPFDELTOK, &iter.ili_key);
diff --git a/sbin/ipf/libipf/printhashdata.c b/sbin/ipf/libipf/printhashdata.c
index 690243d63f1e..6fa62e67556d 100644
--- a/sbin/ipf/libipf/printhashdata.c
+++ b/sbin/ipf/libipf/printhashdata.c
@@ -12,7 +12,11 @@ void
printhashdata(iphtable_t *hp, int opts)
{
- if ((opts & OPT_DEBUG) == 0) {
+ if (opts & OPT_SAVEOUT) {
+ if ((hp->iph_flags & IPHASH_DELETE) == IPHASH_DELETE)
+ PRINTF("# ");
+ PRINTF("pool ");
+ } else if ((opts & OPT_DEBUG) == 0) {
if ((hp->iph_type & IPHASH_ANON) == IPHASH_ANON)
PRINTF("# 'anonymous' table refs %d\n", hp->iph_ref);
if ((hp->iph_flags & IPHASH_DELETE) == IPHASH_DELETE)
@@ -37,6 +41,8 @@ printhashdata(iphtable_t *hp, int opts)
}
PRINTF(" role=");
} else {
+ if ((hp->iph_flags & IPHASH_DELETE) == IPHASH_DELETE)
+ PRINTF("# ");
PRINTF("Hash Table %s: %s",
ISDIGIT(*hp->iph_name) ? "Number" : "Name",
hp->iph_name);
@@ -48,7 +54,16 @@ printhashdata(iphtable_t *hp, int opts)
printunit(hp->iph_unit);
- if ((opts & OPT_DEBUG) == 0) {
+ if ((opts & OPT_SAVEOUT)) {
+ if ((hp->iph_type & ~IPHASH_ANON) == IPHASH_LOOKUP)
+ PRINTF("/hash");
+ PRINTF("(%s \"%s\"; size %lu;",
+ ISDIGIT(*hp->iph_name) ? "number" : "name",
+ hp->iph_name, (u_long)hp->iph_size);
+ if (hp->iph_seed != 0)
+ PRINTF(" seed %lu;", hp->iph_seed);
+ PRINTF(")\n", hp->iph_seed);
+ } else if ((opts & OPT_DEBUG) == 0) {
if ((hp->iph_type & ~IPHASH_ANON) == IPHASH_LOOKUP)
PRINTF(" type=hash");
PRINTF(" %s=%s size=%lu",
diff --git a/sbin/ipf/libipf/printpooldata.c b/sbin/ipf/libipf/printpooldata.c
index bd5af316eb19..b203522734be 100644
--- a/sbin/ipf/libipf/printpooldata.c
+++ b/sbin/ipf/libipf/printpooldata.c
@@ -13,6 +13,8 @@ printpooldata(ip_pool_t *pool, int opts)
{
if (opts & OPT_SAVEOUT) {
+ if ((pool->ipo_flags & IPOOL_DELETE) != 0)
+ PRINTF("# ");
PRINTF("pool ");
} else if ((opts & OPT_DEBUG) == 0) {
if ((pool->ipo_flags & IPOOL_ANON) != 0)
diff --git a/sbin/ipfw/tests/test_add_rule.py b/sbin/ipfw/tests/test_add_rule.py
index 60c8cebaceaa..c2c4bf0b360c 100755
--- a/sbin/ipfw/tests/test_add_rule.py
+++ b/sbin/ipfw/tests/test_add_rule.py
@@ -36,6 +36,7 @@ from atf_python.sys.netpfil.ipfw.insns import InsnProb
from atf_python.sys.netpfil.ipfw.insns import InsnProto
from atf_python.sys.netpfil.ipfw.insns import InsnReject
from atf_python.sys.netpfil.ipfw.insns import InsnTable
+from atf_python.sys.netpfil.ipfw.insns import InsnU32
from atf_python.sys.netpfil.ipfw.insns import IpFwOpcode
from atf_python.sys.netpfil.ipfw.ioctl import CTlv
from atf_python.sys.netpfil.ipfw.ioctl import CTlvRule
@@ -152,8 +153,8 @@ class TestAddRule(BaseTest):
NTlv(IpFwTlvType.IPFW_TLV_TBL_NAME, idx=2, name="BBB"),
],
"insns": [
- InsnTable(IpFwOpcode.O_IP_SRC_LOOKUP, arg1=1),
- InsnTable(IpFwOpcode.O_IP_DST_LOOKUP, arg1=2),
+ InsnU32(IpFwOpcode.O_IP_SRC_LOOKUP, u32=1),
+ InsnU32(IpFwOpcode.O_IP_DST_LOOKUP, u32=2),
InsnEmpty(IpFwOpcode.O_ACCEPT),
],
},
@@ -182,7 +183,7 @@ class TestAddRule(BaseTest):
],
"insns": [
InsnIp(IpFwOpcode.O_IP_DST, ip="1.2.3.4"),
- Insn(IpFwOpcode.O_EXTERNAL_ACTION, arg1=1),
+ InsnU32(IpFwOpcode.O_EXTERNAL_ACTION, u32=1),
Insn(IpFwOpcode.O_EXTERNAL_DATA, arg1=123),
],
},
@@ -199,8 +200,8 @@ class TestAddRule(BaseTest):
],
"insns": [
InsnIp(IpFwOpcode.O_IP_DST, ip="1.2.3.4"),
- Insn(IpFwOpcode.O_EXTERNAL_ACTION, arg1=1),
- Insn(IpFwOpcode.O_EXTERNAL_INSTANCE, arg1=2),
+ InsnU32(IpFwOpcode.O_EXTERNAL_ACTION, u32=1),
+ InsnU32(IpFwOpcode.O_EXTERNAL_INSTANCE, u32=2),
],
},
},
@@ -227,7 +228,7 @@ class TestAddRule(BaseTest):
],
"insns": [
InsnComment(comment="test comment"),
- Insn(IpFwOpcode.O_CHECK_STATE, arg1=1),
+ InsnU32(IpFwOpcode.O_CHECK_STATE, u32=1),
],
},
},
@@ -241,9 +242,9 @@ class TestAddRule(BaseTest):
NTlv(IpFwTlvType.IPFW_TLV_STATE_NAME, idx=1, name="OUT"),
],
"insns": [
- Insn(IpFwOpcode.O_PROBE_STATE, arg1=1),
+ InsnU32(IpFwOpcode.O_PROBE_STATE, u32=1),
Insn(IpFwOpcode.O_PROTO, arg1=6),
- Insn(IpFwOpcode.O_KEEP_STATE, arg1=1),
+ InsnU32(IpFwOpcode.O_KEEP_STATE, u32=1),
InsnEmpty(IpFwOpcode.O_ACCEPT),
],
},
@@ -259,7 +260,7 @@ class TestAddRule(BaseTest):
],
"insns": [
Insn(IpFwOpcode.O_PROTO, arg1=6),
- Insn(IpFwOpcode.O_KEEP_STATE, arg1=1),
+ InsnU32(IpFwOpcode.O_KEEP_STATE, u32=1),
InsnEmpty(IpFwOpcode.O_ACCEPT),
],
},
@@ -370,7 +371,7 @@ class TestAddRule(BaseTest):
),
pytest.param(("pipe 42", Insn(IpFwOpcode.O_PIPE, arg1=42)), id="pipe_42"),
pytest.param(
- ("skipto 42", Insn(IpFwOpcode.O_SKIPTO, arg1=42)), id="skipto_42"
+ ("skipto 42", InsnU32(IpFwOpcode.O_SKIPTO, u32=42)), id="skipto_42"
),
pytest.param(
("netgraph 42", Insn(IpFwOpcode.O_NETGRAPH, arg1=42)), id="netgraph_42"
@@ -386,7 +387,7 @@ class TestAddRule(BaseTest):
),
pytest.param(("tee 42", Insn(IpFwOpcode.O_TEE, arg1=42)), id="tee_42"),
pytest.param(
- ("call 420", Insn(IpFwOpcode.O_CALLRETURN, arg1=420)), id="call_420"
+ ("call 420", InsnU32(IpFwOpcode.O_CALLRETURN, u32=420)), id="call_420"
),
# TOK_FORWARD
pytest.param(
@@ -400,7 +401,7 @@ class TestAddRule(BaseTest):
),
pytest.param(("reass", InsnEmpty(IpFwOpcode.O_REASS)), id="reass"),
pytest.param(
- ("return", InsnEmpty(IpFwOpcode.O_CALLRETURN, is_not=True)), id="return"
+ ("return", InsnU32(IpFwOpcode.O_CALLRETURN, is_not=True)), id="return"
),
],
)
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 21562fa03e0d..ed317495c2e0 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -2183,6 +2183,7 @@ pfctl_load_rule(struct pfctl *pf, char *path, struct pfctl_rule *r, int depth)
{
u_int8_t rs_num = pf_get_ruleset_number(r->action);
char *name;
+ uint32_t ticket;
char anchor[PF_ANCHOR_NAME_SIZE];
int len = strlen(path);
int error;
@@ -2192,7 +2193,9 @@ pfctl_load_rule(struct pfctl *pf, char *path, struct pfctl_rule *r, int depth)
if ((pf->opts & PF_OPT_NOACTION) == 0) {
if (pf->trans == NULL)
errx(1, "pfctl_load_rule: no transaction");
- pf->anchor->ruleset.tticket = pfctl_get_ticket(pf->trans, rs_num, path);
+ ticket = pfctl_get_ticket(pf->trans, rs_num, path);
+ if (rs_num == PF_RULESET_FILTER)
+ pf->anchor->ruleset.tticket = ticket;
}
if (strlcpy(anchor, path, sizeof(anchor)) >= sizeof(anchor))
errx(1, "pfctl_load_rule: strlcpy");
@@ -2225,7 +2228,7 @@ pfctl_load_rule(struct pfctl *pf, char *path, struct pfctl_rule *r, int depth)
return (1);
if (pfctl_add_pool(pf, &r->route, PF_RT))
return (1);
- error = pfctl_add_rule_h(pf->h, r, anchor, name, pf->anchor->ruleset.tticket,
+ error = pfctl_add_rule_h(pf->h, r, anchor, name, ticket,
pf->paddr.ticket);
switch (error) {
case 0:
@@ -3582,6 +3585,12 @@ main(int argc, char *argv[])
}
if (clearopt != NULL) {
+ int mnr;
+
+ /* Check if anchor exists. */
+ if ((pfctl_get_rulesets(pfh, anchorname, &mnr)) == ENOENT)
+ errx(1, "No such anchor %s", anchorname);
+
switch (*clearopt) {
case 'e':
pfctl_flush_eth_rules(dev, opts, anchorname);
diff --git a/sbin/rcorder/rcorder.c b/sbin/rcorder/rcorder.c
index 87b0e873c7ae..3d2a67c82a5a 100644
--- a/sbin/rcorder/rcorder.c
+++ b/sbin/rcorder/rcorder.c
@@ -980,9 +980,11 @@ do_file(filenode *fnode, strnodelist *stack_ptr)
fnode->last->next = fnode->next;
}
- if (fnode->issues_count)
- warnx("`%s' was seen in circular dependencies for %d times.",
- fnode->filename, fnode->issues_count);
+ if (fnode->issues_count) {
+ warnx("`%s' was seen in circular dependencies %d time%s.",
+ fnode->filename, fnode->issues_count,
+ fnode->issues_count > 1 ? "s" : "");
+ }
DPRINTF((stderr, "nuking %s\n", fnode->filename));
}