Fix worker_tmpdir when the unix jail is active

I misread the code and did not try running varnishtest as root :|
parent 77110d7b
......@@ -131,6 +131,7 @@ enum jail_fixfd_e {
JAIL_FIXFD_FILE,
JAIL_FIXFD_VSMMGT,
JAIL_FIXFD_VSMWRK,
JAIL_FIXFD_WRKTMP,
};
typedef int jail_init_f(char **);
......
......@@ -304,6 +304,7 @@ vju_fixfd(int fd, enum jail_fixfd_e what)
AZ(fchown(fd, vju_uid, vju_gid));
break;
case JAIL_FIXFD_VSMWRK:
case JAIL_FIXFD_WRKTMP:
AZ(fchmod(fd, 0750));
AZ(fchown(fd, vju_wrkuid, vju_wrkgid));
break;
......
......@@ -889,6 +889,12 @@ main(int argc, char * const *argv)
workdir, VAS_errtxt(errno));
}
o = open("worker_tmpdir", O_RDONLY);
VJ_master(JAIL_MASTER_SYSTEM);
VJ_fix_fd(o, JAIL_FIXFD_WRKTMP);
VJ_master(JAIL_MASTER_LOW);
closefd(&o);
if (C_flag)
AZ(atexit(mgt_Cflag_atexit));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment