tiny-slitaz rev 22

more /tmp wipe
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Sep 30 10:59:00 2017 +0200 (2017-09-30)
parents 038499e4d7db
children 94ba265c1763
files helper step1.php
line diff
     1.1 --- a/helper	Fri Aug 18 11:32:08 2017 +0200
     1.2 +++ b/helper	Sat Sep 30 10:59:00 2017 +0200
     1.3 @@ -404,7 +404,6 @@
     1.4  	find -user bellard -exec chown root.root {} \;
     1.5  	find | grep -v ^./boot | cpio -o -H newc | gzip -9 > ../rootfs.gz
     1.6  	which advdef 2> /dev/null && advdef -z4 ../rootfs.gz
     1.7 -  find .. -exec ls -ld {} \; > /tmp/X
     1.8  fi
     1.9  if [ "x$1" == "x--mkiso" ]; then
    1.10  	tmp=$2
     2.1 --- a/step1.php	Fri Aug 18 11:32:08 2017 +0200
     2.2 +++ b/step1.php	Sat Sep 30 10:59:00 2017 +0200
     2.3 @@ -10,13 +10,12 @@
     2.4  	$i = 0;
     2.5  	while (($name = readdir($dir)) !== false) {
     2.6  		if (preg_match('/^tiny_webgen/',$name) == 0) continue;
     2.7 -		if ($i++ > 100) {
     2.8 +		if (filemtime("/tmp/$name") < strtotime("-1 hour"))
     2.9 +			shell_exec("sudo ./helper --remove /tmp/$name"); 
    2.10 +		else if ($i++ > 100) {
    2.11  			echo "<h1>Too many users, retry later</h1>";
    2.12  			exit;
    2.13  		}
    2.14 -		if (filemtime("/tmp/$name") > strtotime("-1 hour")) continue;
    2.15 -		shell_exec("sudo ./helper --remove /tmp/$name"); 
    2.16 -		$i--;
    2.17  	}
    2.18  	closedir($dir);
    2.19  	if (isset($_POST["tmp_dir"])) return;