[master] b7398dbf3 Reset the dir mode to 750 after mkdtemp(3) returns.

Poul-Henning Kamp phk at FreeBSD.org
Mon May 25 09:11:06 UTC 2020


commit b7398dbf360f4ee5a2350dd76a5c0db1db716617
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon May 25 09:09:00 2020 +0000

    Reset the dir mode to 750 after mkdtemp(3) returns.
    
    Mkdtemp(3) creates the directory with mode 0700, and since it
    already exists, we do not change the mode subsequently, which
    causes jailed with uid=vcache to keel over.

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index e2fa37ba4..cd63ed93b 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -750,6 +750,7 @@ main(int argc, char * const *argv)
 			AN(p);
 			VSB_destroy(&vsb);
 			AN(mkdtemp(p));
+			AZ(chmod(p, 0750));
 			n_arg = p;
 		}
 	}


More information about the varnish-commit mailing list