[master] 2698789de flexelint: try to address chown(-1) diffrently

Nils Goroll nils.goroll at uplex.de
Wed Nov 18 16:11:07 UTC 2020


commit 2698789de2698ecda0e1b26b58cd075f00544a93
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Nov 18 17:09:19 2020 +0100

    flexelint: try to address chown(-1) diffrently
    
    I do not understand the global -esym does not work, but the warning is
    definitely bogus, the (unisgned)-1 argument is intentional and a
    documented feature.

diff --git a/bin/varnishd/flint.lnt b/bin/varnishd/flint.lnt
index e2af26b69..82e1891e8 100644
--- a/bin/varnishd/flint.lnt
+++ b/bin/varnishd/flint.lnt
@@ -125,7 +125,6 @@
 -e850	// for loop index variable '___' whose type category is '___'
 	// is modified in body of the for loop that began at '___'
 
--esym(570, chown)	   // loss of sign for unchanged argument
 -esym(765, vcc_ProcAction) // could be made static
 -esym(759, vcc_ProcAction) // could be moved to module
 -esym(714, vcc_ProcAction) // not ref.
diff --git a/bin/varnishd/mgt/mgt_jail_unix.c b/bin/varnishd/mgt/mgt_jail_unix.c
index 15aed013a..9d2f2755a 100644
--- a/bin/varnishd/mgt/mgt_jail_unix.c
+++ b/bin/varnishd/mgt/mgt_jail_unix.c
@@ -283,7 +283,9 @@ vju_make_workdir(const char *dname, const char *what, struct vsb *vsb)
 		    dname, vstrerror(errno));
 		return (1);
 	}
+/*lint -save -e570 */
 	AZ(chown(dname, -1, vju_gid));
+/*lint -restore */
 	AZ(seteuid(vju_uid));
 	return (0);
 }


More information about the varnish-commit mailing list