Projet

Général

Profil

« Précédent | Suivant » 

Révision e41ab9aa

Ajouté par Renato Botelho il y a presque 10 ans

Escape parameters passed to shell_exec()

Voir les différences:

usr/local/pkg/openntpd.inc
21 21

  
22 22
function openntpd_get_iface_ip($iface) {
23 23
	$iface = convert_friendly_interface_to_real_interface_name($iface);
24
	$line = trim(shell_exec("ifconfig $iface | grep inet | grep -v inet6"));
24
	$line = trim(shell_exec("ifconfig " . escapeshellarg($iface) . " | grep inet | grep -v inet6"));
25 25
	list($dummy, $ip, $dummy2, $dummy3) = explode(' ', $line);
26 26

  
27 27
	return $ip;
usr/local/www/diag_smart.php
85 85
	if(!empty($email))
86 86
	{
87 87
		// Put it in the smartd.conf file
88
		shell_exec("/usr/bin/sed -i old 's/^DEVICESCAN.*/DEVICESCAN -H -m " . $email . "/' /usr/local/etc/smartd.conf");
88
		shell_exec("/usr/bin/sed -i old 's/^DEVICESCAN.*/DEVICESCAN -H -m " . escapeshellarg($email) . "/' /usr/local/etc/smartd.conf");
89 89
	}
90 90
	// Nope
91 91
	else

Formats disponibles : Unified diff