devfs_rule.c (216461) | devfs_rule.c (227489) |
---|---|
1/*- 2 * Copyright (c) 2002 Dima Dorfman. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2002 Dima Dorfman. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/fs/devfs/devfs_rule.c 216461 2010-12-15 16:42:44Z jh $ | 26 * $FreeBSD: head/sys/fs/devfs/devfs_rule.c 227489 2011-11-13 17:06:33Z eadler $ |
27 */ 28 29/* 30 * DEVFS ruleset implementation. 31 * 32 * A note on terminology: To "run" a rule on a dirent is to take the 33 * prescribed action; to "apply" a rule is to check whether it matches 34 * a dirent and run if if it does. --- 577 unchanged lines hidden (view full) --- 612 de->de_mode = dr->dr_mode; 613 if (dr->dr_iacts & DRA_INCSET) { 614 /* 615 * XXX: we should tell the user if the depth is exceeded here 616 * XXX: but it is not obvious how to. A return value will 617 * XXX: not work as this is called when devices are created 618 * XXX: long time after the rules were instantiated. 619 * XXX: a printf() would probably give too much noise, or | 27 */ 28 29/* 30 * DEVFS ruleset implementation. 31 * 32 * A note on terminology: To "run" a rule on a dirent is to take the 33 * prescribed action; to "apply" a rule is to check whether it matches 34 * a dirent and run if if it does. --- 577 unchanged lines hidden (view full) --- 612 de->de_mode = dr->dr_mode; 613 if (dr->dr_iacts & DRA_INCSET) { 614 /* 615 * XXX: we should tell the user if the depth is exceeded here 616 * XXX: but it is not obvious how to. A return value will 617 * XXX: not work as this is called when devices are created 618 * XXX: long time after the rules were instantiated. 619 * XXX: a printf() would probably give too much noise, or |
620 * XXX: DoS the machine. I guess a a rate-limited message | 620 * XXX: DoS the machine. I guess a rate-limited message |
621 * XXX: might work. 622 */ 623 if (depth > 0) { 624 ds = devfs_ruleset_bynum(dk->dk_rule.dr_incset); 625 KASSERT(ds != NULL, ("DRA_INCSET but bad dr_incset")); 626 devfs_ruleset_applyde(ds, de, depth - 1); 627 } 628 } --- 145 unchanged lines hidden --- | 621 * XXX: might work. 622 */ 623 if (depth > 0) { 624 ds = devfs_ruleset_bynum(dk->dk_rule.dr_incset); 625 KASSERT(ds != NULL, ("DRA_INCSET but bad dr_incset")); 626 devfs_ruleset_applyde(ds, de, depth - 1); 627 } 628 } --- 145 unchanged lines hidden --- |