Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140729191
D3018.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3018.diff
View Options
Index: head/usr.sbin/jail/config.c
===================================================================
--- head/usr.sbin/jail/config.c
+++ head/usr.sbin/jail/config.c
@@ -130,9 +130,8 @@
struct cfjail *j, *tj, *wj;
struct cfparam *p, *vp, *tp;
struct cfstring *s, *vs, *ns;
- struct cfvar *v;
+ struct cfvar *v, *vv;
char *ep;
- size_t varoff;
int did_self, jseq, pgen;
if (!strcmp(cfname, "-")) {
@@ -191,7 +190,6 @@
p->gen = ++pgen;
find_vars:
TAILQ_FOREACH(s, &p->val, tq) {
- varoff = 0;
while ((v = STAILQ_FIRST(&s->vars))) {
TAILQ_FOREACH(vp, &j->params, tq)
if (!strcmp(vp->name, v->name))
@@ -233,11 +231,13 @@
goto bad_var;
}
s->s = erealloc(s->s, s->len + vs->len + 1);
- memmove(s->s + v->pos + varoff + vs->len,
- s->s + v->pos + varoff,
- s->len - (v->pos + varoff) + 1);
- memcpy(s->s + v->pos + varoff, vs->s, vs->len);
- varoff += vs->len;
+ memmove(s->s + v->pos + vs->len,
+ s->s + v->pos,
+ s->len - v->pos + 1);
+ memcpy(s->s + v->pos, vs->s, vs->len);
+ vv = v;
+ while ((vv = STAILQ_NEXT(vv, tq)))
+ vv->pos += vs->len;
s->len += vs->len;
while ((vs = TAILQ_NEXT(vs, tq))) {
ns = emalloc(sizeof(struct cfstring));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 28, 9:22 AM (12 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27328560
Default Alt Text
D3018.diff (1 KB)
Attached To
Mode
D3018: Fix recursive variable substitution in jail.conf
Attached
Detach File
Event Timeline
Log In to Comment