| | varnish-cache/bin/varnishd/mgt/mgt_vcc.c |
| 0 |
|
/*- |
| 1 |
|
* Copyright (c) 2006 Verdens Gang AS |
| 2 |
|
* Copyright (c) 2006-2015 Varnish Software AS |
| 3 |
|
* All rights reserved. |
| 4 |
|
* |
| 5 |
|
* Author: Poul-Henning Kamp <phk@phk.freebsd.dk> |
| 6 |
|
* |
| 7 |
|
* SPDX-License-Identifier: BSD-2-Clause |
| 8 |
|
* |
| 9 |
|
* Redistribution and use in source and binary forms, with or without |
| 10 |
|
* modification, are permitted provided that the following conditions |
| 11 |
|
* are met: |
| 12 |
|
* 1. Redistributions of source code must retain the above copyright |
| 13 |
|
* notice, this list of conditions and the following disclaimer. |
| 14 |
|
* 2. Redistributions in binary form must reproduce the above copyright |
| 15 |
|
* notice, this list of conditions and the following disclaimer in the |
| 16 |
|
* documentation and/or other materials provided with the distribution. |
| 17 |
|
* |
| 18 |
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
| 19 |
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 |
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 21 |
|
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE |
| 22 |
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 23 |
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 24 |
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 25 |
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 26 |
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 27 |
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 28 |
|
* SUCH DAMAGE. |
| 29 |
|
* |
| 30 |
|
* VCL compiler stuff |
| 31 |
|
*/ |
| 32 |
|
|
| 33 |
|
#include "config.h" |
| 34 |
|
|
| 35 |
|
#include <limits.h> |
| 36 |
|
#include <fcntl.h> |
| 37 |
|
#include <stdio.h> |
| 38 |
|
#include <stdlib.h> |
| 39 |
|
#include <string.h> |
| 40 |
|
#include <unistd.h> |
| 41 |
|
#include <sys/stat.h> |
| 42 |
|
|
| 43 |
|
#include "mgt/mgt.h" |
| 44 |
|
#include "mgt/mgt_vcl.h" |
| 45 |
|
#include "common/heritage.h" |
| 46 |
|
#include "storage/storage.h" |
| 47 |
|
|
| 48 |
|
#include "libvcc.h" |
| 49 |
|
#include "vcli_serve.h" |
| 50 |
|
#include "vfil.h" |
| 51 |
|
#include "vsub.h" |
| 52 |
|
#include "vtim.h" |
| 53 |
|
|
| 54 |
|
struct vcc_priv { |
| 55 |
|
unsigned magic; |
| 56 |
|
#define VCC_PRIV_MAGIC 0x70080cb8 |
| 57 |
|
const char *vclsrc; |
| 58 |
|
const char *vclsrcfile; |
| 59 |
|
struct vsb *dir; |
| 60 |
|
struct vsb *csrcfile; |
| 61 |
|
struct vsb *libfile; |
| 62 |
|
struct vsb *symfile; |
| 63 |
|
}; |
| 64 |
|
|
| 65 |
|
enum vcc_fini_e { |
| 66 |
|
VCC_SUCCESS, |
| 67 |
|
VCC_FAILED, |
| 68 |
|
}; |
| 69 |
|
|
| 70 |
|
char *mgt_cc_cmd; |
| 71 |
|
char *mgt_cc_cmd_def; |
| 72 |
|
char *mgt_cc_warn; |
| 73 |
|
const char *mgt_vcl_path; |
| 74 |
|
const char *mgt_vmod_path; |
| 75 |
|
|
| 76 |
|
#define VGC_SRC "vgc.c" |
| 77 |
|
#define VGC_LIB "vgc.so" |
| 78 |
|
#define VGC_SYM "vgc.sym" |
| 79 |
|
|
| 80 |
|
/*--------------------------------------------------------------------*/ |
| 81 |
|
|
| 82 |
|
void |
| 83 |
40 |
mgt_DumpBuiltin(void) |
| 84 |
|
{ |
| 85 |
40 |
printf("%s\n", builtin_vcl); |
| 86 |
40 |
} |
| 87 |
|
|
| 88 |
|
/*-------------------------------------------------------------------- |
| 89 |
|
* Invoke system VCC compiler in a sub-process |
| 90 |
|
*/ |
| 91 |
|
|
| 92 |
|
static void |
| 93 |
40 |
vcc_vext_iter_func(const char *filename, void *priv) |
| 94 |
|
{ |
| 95 |
|
struct vsb *sb; |
| 96 |
|
|
| 97 |
|
/* VCC runs in the per-VCL subdir */ |
| 98 |
40 |
sb = VSB_new_auto(); |
| 99 |
40 |
AN(sb); |
| 100 |
40 |
VSB_cat(sb, "../"); |
| 101 |
40 |
VSB_cat(sb, filename); |
| 102 |
40 |
AZ(VSB_finish(sb)); |
| 103 |
40 |
VCC_VEXT(priv, VSB_data(sb)); |
| 104 |
40 |
VSB_destroy(&sb); |
| 105 |
40 |
} |
| 106 |
|
|
| 107 |
|
static void v_noreturn_ v_matchproto_(vsub_func_f) |
| 108 |
61920 |
run_vcc(void *priv) |
| 109 |
|
{ |
| 110 |
61920 |
struct vsb *sb = NULL; |
| 111 |
|
struct vclprog *vpg; |
| 112 |
|
struct vcc_priv *vp; |
| 113 |
|
struct vcc *vcc; |
| 114 |
|
struct stevedore *stv; |
| 115 |
|
int i; |
| 116 |
|
|
| 117 |
61920 |
VJ_subproc(JAIL_SUBPROC_VCC); |
| 118 |
61920 |
CAST_OBJ_NOTNULL(vp, priv, VCC_PRIV_MAGIC); |
| 119 |
|
|
| 120 |
61920 |
AZ(chdir(VSB_data(vp->dir))); |
| 121 |
|
|
| 122 |
61920 |
vcc = VCC_New(); |
| 123 |
61920 |
AN(vcc); |
| 124 |
61920 |
VCC_Builtin_VCL(vcc, builtin_vcl); |
| 125 |
61920 |
VCC_VCL_path(vcc, mgt_vcl_path); |
| 126 |
61920 |
VCC_VMOD_path(vcc, mgt_vmod_path); |
| 127 |
|
|
| 128 |
|
#define VCC_FEATURE_BIT(U, l, d) \ |
| 129 |
|
VCC_Opt_ ## l(vcc, MGT_VCC_FEATURE(VCC_FEATURE_ ## U)); |
| 130 |
|
#include "tbl/vcc_feature_bits.h" |
| 131 |
|
|
| 132 |
|
vext_iter(vcc_vext_iter_func, vcc); |
| 133 |
|
|
| 134 |
185960 |
STV_Foreach(stv) |
| 135 |
124040 |
VCC_Predef(vcc, "VCL_STEVEDORE", stv->ident); |
| 136 |
168960 |
VTAILQ_FOREACH(vpg, &vclhead, list) |
| 137 |
108720 |
if (mcf_is_label(vpg)) |
| 138 |
1680 |
VCC_Predef(vcc, "VCL_VCL", vpg->name); |
| 139 |
|
i = VCC_Compile(vcc, &sb, vp->vclsrc, vp->vclsrcfile, |
| 140 |
|
VGC_SRC, VGC_SYM); |
| 141 |
61920 |
if (VSB_len(sb)) |
| 142 |
12720 |
printf("%s", VSB_data(sb)); |
| 143 |
|
VSB_destroy(&sb); |
| 144 |
|
exit(i == 0 ? 0 : 2); |
| 145 |
|
} |
| 146 |
|
|
| 147 |
|
/*-------------------------------------------------------------------- |
| 148 |
|
* Expand the cc_command argument |
| 149 |
|
*/ |
| 150 |
|
|
| 151 |
|
static const char * |
| 152 |
50240 |
cc_expand(struct vsb *sb, const char *cc_cmd, char exp) |
| 153 |
|
{ |
| 154 |
|
char buf[PATH_MAX]; |
| 155 |
|
const char *p; |
| 156 |
|
int pct; |
| 157 |
|
|
| 158 |
50240 |
AN(sb); |
| 159 |
50240 |
AN(cc_cmd); |
| 160 |
|
|
| 161 |
3617720 |
for (p = cc_cmd, pct = 0; *p; ++p) { |
| 162 |
3567480 |
if (pct) { |
| 163 |
150920 |
switch (*p) { |
| 164 |
|
case 's': |
| 165 |
50200 |
VSB_cat(sb, VGC_SRC); |
| 166 |
50200 |
break; |
| 167 |
|
case 'o': |
| 168 |
50200 |
VSB_cat(sb, VGC_LIB); |
| 169 |
50200 |
break; |
| 170 |
|
case 'w': |
| 171 |
50240 |
VSB_cat(sb, mgt_cc_warn); |
| 172 |
50240 |
break; |
| 173 |
|
case 'd': |
| 174 |
40 |
VSB_cat(sb, mgt_cc_cmd_def); |
| 175 |
40 |
break; |
| 176 |
|
case 'D': |
| 177 |
40 |
if (exp == pct) |
| 178 |
0 |
return ("recursive expansion"); |
| 179 |
40 |
AZ(cc_expand(sb, mgt_cc_cmd_def, pct)); |
| 180 |
40 |
break; |
| 181 |
|
case 'n': |
| 182 |
40 |
AN(getcwd(buf, sizeof buf)); |
| 183 |
40 |
VSB_cat(sb, buf); |
| 184 |
40 |
break; |
| 185 |
|
case '%': |
| 186 |
160 |
VSB_putc(sb, '%'); |
| 187 |
160 |
break; |
| 188 |
|
default: |
| 189 |
0 |
VSB_putc(sb, '%'); |
| 190 |
0 |
VSB_putc(sb, *p); |
| 191 |
0 |
break; |
| 192 |
|
} |
| 193 |
150920 |
pct = 0; |
| 194 |
3567480 |
} else if (*p == '%') { |
| 195 |
150920 |
pct = 1; |
| 196 |
150920 |
} else { |
| 197 |
3265640 |
VSB_putc(sb, *p); |
| 198 |
|
} |
| 199 |
3567480 |
} |
| 200 |
50240 |
if (pct) |
| 201 |
0 |
VSB_putc(sb, '%'); |
| 202 |
50240 |
return (NULL); |
| 203 |
50240 |
} |
| 204 |
|
|
| 205 |
|
/*-------------------------------------------------------------------- |
| 206 |
|
* Invoke system C compiler in a sub-process |
| 207 |
|
*/ |
| 208 |
|
|
| 209 |
|
static void v_matchproto_(vsub_func_f) |
| 210 |
50200 |
run_cc(void *priv) |
| 211 |
|
{ |
| 212 |
|
struct vcc_priv *vp; |
| 213 |
|
struct vsb *sb; |
| 214 |
|
const char *err; |
| 215 |
|
|
| 216 |
50200 |
VJ_subproc(JAIL_SUBPROC_CC); |
| 217 |
50200 |
CAST_OBJ_NOTNULL(vp, priv, VCC_PRIV_MAGIC); |
| 218 |
|
|
| 219 |
50200 |
sb = VSB_new_auto(); |
| 220 |
50200 |
AN(sb); |
| 221 |
50200 |
err = cc_expand(sb, mgt_cc_cmd, '\0'); |
| 222 |
50200 |
if (err != NULL) { |
| 223 |
0 |
VSB_destroy(&sb); |
| 224 |
0 |
fprintf(stderr, "cc_command: %s\n", err); |
| 225 |
0 |
exit(1); |
| 226 |
|
} |
| 227 |
50200 |
AZ(VSB_finish(sb)); |
| 228 |
|
|
| 229 |
50200 |
AZ(chdir(VSB_data(vp->dir))); |
| 230 |
|
|
| 231 |
50200 |
(void)umask(027); |
| 232 |
50200 |
(void)execl("/bin/sh", "/bin/sh", "-c", VSB_data(sb), (char*)0); |
| 233 |
0 |
VSB_destroy(&sb); // For flexelint |
| 234 |
0 |
} |
| 235 |
|
|
| 236 |
|
/*-------------------------------------------------------------------- |
| 237 |
|
* Attempt to open compiled VCL in a sub-process |
| 238 |
|
*/ |
| 239 |
|
|
| 240 |
|
static void v_noreturn_ v_matchproto_(vsub_func_f) |
| 241 |
49640 |
run_dlopen(void *priv) |
| 242 |
|
{ |
| 243 |
|
struct vcc_priv *vp; |
| 244 |
|
|
| 245 |
49640 |
VJ_subproc(JAIL_SUBPROC_VCLLOAD); |
| 246 |
49640 |
CAST_OBJ_NOTNULL(vp, priv, VCC_PRIV_MAGIC); |
| 247 |
49640 |
if (VCL_TestLoad(VSB_data(vp->libfile))) |
| 248 |
80 |
exit(1); |
| 249 |
49560 |
exit(0); |
| 250 |
|
} |
| 251 |
|
|
| 252 |
|
/*-------------------------------------------------------------------- |
| 253 |
|
* Touch a filename and make it available to privsep-privs |
| 254 |
|
*/ |
| 255 |
|
|
| 256 |
|
static int |
| 257 |
123840 |
mgt_vcc_touchfile(const char *fn, struct vsb *sb) |
| 258 |
|
{ |
| 259 |
|
int i; |
| 260 |
|
|
| 261 |
123840 |
i = open(fn, O_WRONLY|O_CREAT|O_TRUNC, 0640); |
| 262 |
123840 |
if (i < 0) { |
| 263 |
0 |
VSB_printf(sb, "Failed to create %s: %s\n", |
| 264 |
0 |
fn, VAS_errtxt(errno)); |
| 265 |
0 |
return (2); |
| 266 |
|
} |
| 267 |
123840 |
closefd(&i); |
| 268 |
123840 |
return (0); |
| 269 |
123840 |
} |
| 270 |
|
|
| 271 |
|
/*-------------------------------------------------------------------- |
| 272 |
|
* Compile a VCL program, return shared object, errors in sb. |
| 273 |
|
*/ |
| 274 |
|
|
| 275 |
|
static unsigned |
| 276 |
61920 |
mgt_vcc_compile(struct vcc_priv *vp, struct vsb *sb, int C_flag) |
| 277 |
|
{ |
| 278 |
|
char *csrc; |
| 279 |
|
unsigned subs; |
| 280 |
|
|
| 281 |
61920 |
AN(sb); |
| 282 |
61920 |
VSB_clear(sb); |
| 283 |
61920 |
if (mgt_vcc_touchfile(VSB_data(vp->csrcfile), sb)) |
| 284 |
0 |
return (2); |
| 285 |
61920 |
if (mgt_vcc_touchfile(VSB_data(vp->libfile), sb)) |
| 286 |
0 |
return (2); |
| 287 |
|
|
| 288 |
61920 |
VJ_master(JAIL_MASTER_SYSTEM); |
| 289 |
61920 |
subs = VSUB_run(sb, run_vcc, vp, "VCC-compiler", -1); |
| 290 |
61920 |
VJ_master(JAIL_MASTER_LOW); |
| 291 |
61920 |
if (subs) |
| 292 |
11720 |
return (subs); |
| 293 |
|
|
| 294 |
50200 |
if (C_flag) { |
| 295 |
160 |
csrc = VFIL_readfile(NULL, VSB_data(vp->csrcfile), NULL); |
| 296 |
160 |
AN(csrc); |
| 297 |
160 |
VSB_cat(sb, csrc); |
| 298 |
160 |
free(csrc); |
| 299 |
|
|
| 300 |
160 |
VSB_cat(sb, "/* EXTERNAL SYMBOL TABLE\n"); |
| 301 |
160 |
csrc = VFIL_readfile(NULL, VSB_data(vp->symfile), NULL); |
| 302 |
160 |
AN(csrc); |
| 303 |
160 |
VSB_cat(sb, csrc); |
| 304 |
160 |
VSB_cat(sb, "*/\n"); |
| 305 |
160 |
free(csrc); |
| 306 |
160 |
} |
| 307 |
|
|
| 308 |
50200 |
VJ_master(JAIL_MASTER_SYSTEM); |
| 309 |
50200 |
subs = VSUB_run(sb, run_cc, vp, "C-compiler", 10); |
| 310 |
50200 |
VJ_master(JAIL_MASTER_LOW); |
| 311 |
50200 |
if (subs) |
| 312 |
0 |
return (subs); |
| 313 |
|
|
| 314 |
50200 |
VJ_master(JAIL_MASTER_SYSTEM); |
| 315 |
50200 |
subs = VSUB_run(sb, run_dlopen, vp, "dlopen", 10); |
| 316 |
50200 |
VJ_master(JAIL_MASTER_LOW); |
| 317 |
50200 |
return (subs); |
| 318 |
61920 |
} |
| 319 |
|
|
| 320 |
|
/*--------------------------------------------------------------------*/ |
| 321 |
|
|
| 322 |
|
static void |
| 323 |
61920 |
mgt_vcc_init_vp(struct vcc_priv *vp) |
| 324 |
|
{ |
| 325 |
61920 |
INIT_OBJ(vp, VCC_PRIV_MAGIC); |
| 326 |
61920 |
vp->csrcfile = VSB_new_auto(); |
| 327 |
61920 |
AN(vp->csrcfile); |
| 328 |
61920 |
vp->libfile = VSB_new_auto(); |
| 329 |
61920 |
AN(vp->libfile); |
| 330 |
61920 |
vp->symfile = VSB_new_auto(); |
| 331 |
61920 |
AN(vp->symfile); |
| 332 |
61920 |
vp->dir = VSB_new_auto(); |
| 333 |
61920 |
AN(vp->dir); |
| 334 |
61920 |
} |
| 335 |
|
|
| 336 |
|
static void |
| 337 |
61920 |
mgt_vcc_fini_vp(struct vcc_priv *vp, enum vcc_fini_e vcc_status) |
| 338 |
|
{ |
| 339 |
61920 |
int ignore_enoent = (vcc_status == VCC_FAILED); |
| 340 |
|
|
| 341 |
61920 |
if (!MGT_DO_DEBUG(DBG_VCL_KEEP)) { |
| 342 |
61720 |
VJ_unlink(VSB_data(vp->csrcfile), ignore_enoent); |
| 343 |
61720 |
VJ_unlink(VSB_data(vp->symfile), ignore_enoent); |
| 344 |
61720 |
if (vcc_status != VCC_SUCCESS) { |
| 345 |
11840 |
VJ_unlink(VSB_data(vp->libfile), ignore_enoent); |
| 346 |
11840 |
VJ_rmdir(VSB_data(vp->dir)); |
| 347 |
11840 |
} |
| 348 |
61720 |
} |
| 349 |
61920 |
VSB_destroy(&vp->csrcfile); |
| 350 |
61920 |
VSB_destroy(&vp->libfile); |
| 351 |
61920 |
VSB_destroy(&vp->symfile); |
| 352 |
61920 |
VSB_destroy(&vp->dir); |
| 353 |
61920 |
} |
| 354 |
|
|
| 355 |
|
char * |
| 356 |
61920 |
mgt_VccCompile(struct cli *cli, struct vclprog *vcl, const char *vclname, |
| 357 |
|
const char *vclsrc, const char *vclsrcfile, int C_flag) |
| 358 |
|
{ |
| 359 |
|
struct vcc_priv vp[1]; |
| 360 |
|
struct vsb *sb; |
| 361 |
|
unsigned status; |
| 362 |
|
char *p; |
| 363 |
|
|
| 364 |
61920 |
AN(cli); |
| 365 |
|
|
| 366 |
61920 |
sb = VSB_new_auto(); |
| 367 |
61920 |
AN(sb); |
| 368 |
|
|
| 369 |
61920 |
mgt_vcc_init_vp(vp); |
| 370 |
61920 |
vp->vclsrc = vclsrc; |
| 371 |
61920 |
vp->vclsrcfile = vclsrcfile; |
| 372 |
|
|
| 373 |
|
/* |
| 374 |
|
* The subdirectory must have a unique name to 100% certain evade |
| 375 |
|
* the refcounting semantics of dlopen(3). |
| 376 |
|
* |
| 377 |
|
* Bad implementations of dlopen(3) think the shlib you are opening |
| 378 |
|
* is the same, if the filename is the same as one already opened. |
| 379 |
|
* |
| 380 |
|
* Sensible implementations do a stat(2) and requires st_ino and |
| 381 |
|
* st_dev to also match. |
| 382 |
|
* |
| 383 |
|
* A correct implementation would run on filesystems which tickle |
| 384 |
|
* st_gen, and also insist that be the identical, before declaring |
| 385 |
|
* a match. |
| 386 |
|
* |
| 387 |
|
* Since no correct implementations are known to exist, we are subject |
| 388 |
|
* to really interesting races if you do something like: |
| 389 |
|
* |
| 390 |
|
* (running on 'boot' vcl) |
| 391 |
|
* vcl.load foo /foo.vcl |
| 392 |
|
* vcl.use foo |
| 393 |
|
* few/slow requests |
| 394 |
|
* vcl.use boot |
| 395 |
|
* vcl.discard foo |
| 396 |
|
* vcl.load foo /foo.vcl // dlopen(3) says "same-same" |
| 397 |
|
* vcl.use foo |
| 398 |
|
* |
| 399 |
|
* Because discard of the first 'foo' lingers on non-zero reference |
| 400 |
|
* count, and when it finally runs, it trashes the second 'foo' because |
| 401 |
|
* dlopen(3) decided they were really the same thing. |
| 402 |
|
* |
| 403 |
|
* The Best way to reproduce this is to have regexps in the VCL. |
| 404 |
|
*/ |
| 405 |
|
|
| 406 |
61920 |
VSB_printf(vp->dir, "vcl_%s.%.6f", vclname, VTIM_real()); |
| 407 |
61920 |
AZ(VSB_finish(vp->dir)); |
| 408 |
|
|
| 409 |
61920 |
VSB_printf(vp->csrcfile, "%s/%s", VSB_data(vp->dir), VGC_SRC); |
| 410 |
61920 |
AZ(VSB_finish(vp->csrcfile)); |
| 411 |
|
|
| 412 |
61920 |
VSB_printf(vp->libfile, "%s/%s", VSB_data(vp->dir), VGC_LIB); |
| 413 |
61920 |
AZ(VSB_finish(vp->libfile)); |
| 414 |
|
|
| 415 |
61920 |
VSB_printf(vp->symfile, "%s/%s", VSB_data(vp->dir), VGC_SYM); |
| 416 |
61920 |
AZ(VSB_finish(vp->symfile)); |
| 417 |
|
|
| 418 |
61920 |
if (VJ_make_subdir(VSB_data(vp->dir), "VCL", cli->sb)) { |
| 419 |
0 |
mgt_vcc_fini_vp(vp, VCC_FAILED); |
| 420 |
0 |
VSB_destroy(&sb); |
| 421 |
0 |
VCLI_Out(cli, "VCL compilation failed"); |
| 422 |
0 |
VCLI_SetResult(cli, CLIS_PARAM); |
| 423 |
0 |
return (NULL); |
| 424 |
|
} |
| 425 |
|
|
| 426 |
61920 |
status = mgt_vcc_compile(vp, sb, C_flag); |
| 427 |
61920 |
AZ(VSB_finish(sb)); |
| 428 |
61920 |
if (VSB_len(sb) > 0) |
| 429 |
13560 |
VCLI_Out(cli, "%s", VSB_data(sb)); |
| 430 |
50120 |
VSB_destroy(&sb); |
| 431 |
|
|
| 432 |
50120 |
if (status || C_flag) { |
| 433 |
11800 |
mgt_vcc_fini_vp(vp, VCC_FAILED); |
| 434 |
11800 |
if (status) { |
| 435 |
11800 |
VCLI_Out(cli, "VCL compilation failed"); |
| 436 |
11800 |
VCLI_SetResult(cli, CLIS_PARAM); |
| 437 |
11800 |
} |
| 438 |
11960 |
return (NULL); |
| 439 |
|
} |
| 440 |
|
|
| 441 |
49960 |
p = VFIL_readfile(NULL, VSB_data(vp->symfile), NULL); |
| 442 |
49960 |
AN(p); |
| 443 |
49960 |
mgt_vcl_symtab(vcl, p); |
| 444 |
|
|
| 445 |
49960 |
REPLACE(p, VSB_data(vp->libfile)); |
| 446 |
49960 |
mgt_vcc_fini_vp(vp, VCC_SUCCESS); |
| 447 |
49960 |
return (p); |
| 448 |
61920 |
} |