View | Details | Raw Unified | Return to bug 196314 | Differences between
and this patch

Collapse All | Expand All

(-)b/sbin/pfctl/pfctl.c (-13 / +5 lines)
Lines 102-108 int pfctl_show_anchors(int, int, char *); Link Here
102
int	 pfctl_ruleset_trans(struct pfctl *, char *, struct pf_anchor *);
102
int	 pfctl_ruleset_trans(struct pfctl *, char *, struct pf_anchor *);
103
int	 pfctl_load_ruleset(struct pfctl *, char *,
103
int	 pfctl_load_ruleset(struct pfctl *, char *,
104
		struct pf_ruleset *, int, int);
104
		struct pf_ruleset *, int, int);
105
int	 pfctl_load_rule(struct pfctl *, char *, struct pf_rule *, int);
105
int	 pfctl_load_rule(struct pfctl *, const char *, struct pf_rule *, int);
106
const char	*pfctl_lookup_option(char *, const char **);
106
const char	*pfctl_lookup_option(char *, const char **);
107
107
108
struct pf_anchor_global	 pf_anchors;
108
struct pf_anchor_global	 pf_anchors;
Lines 1322-1333 pfctl_load_ruleset(struct pfctl *pf, char *path, struct pf_ruleset *rs, Link Here
1322
}
1322
}
1323
1323
1324
int
1324
int
1325
pfctl_load_rule(struct pfctl *pf, char *path, struct pf_rule *r, int depth)
1325
pfctl_load_rule(struct pfctl *pf, const char *path, struct pf_rule *r, int depth)
1326
{
1326
{
1327
	u_int8_t		rs_num = pf_get_ruleset_number(r->action);
1327
	u_int8_t		rs_num = pf_get_ruleset_number(r->action);
1328
	char			*name;
1328
	char			*name;
1329
	struct pfioc_rule	pr;
1329
	struct pfioc_rule	pr;
1330
	int			len = strlen(path);
1331
1330
1332
	bzero(&pr, sizeof(pr));
1331
	bzero(&pr, sizeof(pr));
1333
	/* set up anchor before adding to path for anchor_call */
1332
	/* set up anchor before adding to path for anchor_call */
Lines 1337-1351 pfctl_load_rule(struct pfctl *pf, char *path, struct pf_rule *r, int depth) Link Here
1337
		errx(1, "pfctl_load_rule: strlcpy");
1336
		errx(1, "pfctl_load_rule: strlcpy");
1338
1337
1339
	if (r->anchor) {
1338
	if (r->anchor) {
1340
		if (r->anchor->match) {
1339
		if (r->anchor->match)
1341
			if (path[0])
1340
			name = r->anchor->name;
1342
				snprintf(&path[len], MAXPATHLEN - len,
1341
		else
1343
				    "/%s", r->anchor->name);
1344
			else
1345
				snprintf(&path[len], MAXPATHLEN - len,
1346
				    "%s", r->anchor->name);
1347
			name = path;
1348
		} else
1349
			name = r->anchor->path;
1342
			name = r->anchor->path;
1350
	} else
1343
	} else
1351
		name = "";
1344
		name = "";
Lines 1368-1374 pfctl_load_rule(struct pfctl *pf, char *path, struct pf_rule *r, int depth) Link Here
1368
		    pf->opts & PF_OPT_VERBOSE2,
1361
		    pf->opts & PF_OPT_VERBOSE2,
1369
		    pf->opts & PF_OPT_NUMERIC);
1362
		    pf->opts & PF_OPT_NUMERIC);
1370
	}
1363
	}
1371
	path[len] = '\0';
1372
	pfctl_clear_pool(&r->rpool);
1364
	pfctl_clear_pool(&r->rpool);
1373
	return (0);
1365
	return (0);
1374
}
1366
}

Return to bug 196314