diff options
author | Renato Botelho <renato@netgate.com> | 2017-07-05 13:21:56 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-07-05 13:22:10 -0300 |
commit | 48600bc6d41e1d3f9adc526221b393ac54060145 (patch) | |
tree | 9988f3cc47e566854734e51b6370941d61ca2e8d | |
parent | 7928e41968431c130d65d469f9c1a00768729cf4 (diff) | |
download | pfsense-48600bc6d41e1d3f9adc526221b393ac54060145.zip pfsense-48600bc6d41e1d3f9adc526221b393ac54060145.tar.gz |
Send uniqueid instead of UUID on user-agent
-rw-r--r-- | src/etc/inc/pfsense-utils.inc | 8 | ||||
-rw-r--r-- | src/etc/inc/pkg-utils.inc | 4 | ||||
-rw-r--r-- | src/usr/local/www/crash_reporter.php | 10 | ||||
-rw-r--r-- | src/usr/local/www/system_advanced_misc.php | 18 |
4 files changed, 23 insertions, 17 deletions
diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index 580c328..f08b249 100644 --- a/src/etc/inc/pfsense-utils.inc +++ b/src/etc/inc/pfsense-utils.inc @@ -1974,8 +1974,8 @@ function download_file($url, $destination, $verify_ssl = true, $connect_timeout curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - if (!isset($config['system']['do_not_send_host_uuid'])) { - curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version'] . ' : ' . get_single_sysctl('kern.hostuuid')); + if (!isset($config['system']['do_not_send_uniqueid'])) { + curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version'] . ' : ' . system_get_uniqueid()); } else { curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version']); } @@ -2029,8 +2029,8 @@ function download_file_with_progress_bar($url, $destination, $verify_ssl = true, curl_setopt($ch, CURLOPT_NOPROGRESS, '1'); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connect_timeout); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); - if (!isset($config['system']['do_not_send_host_uuid'])) { - curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version'] . ' : ' . get_single_sysctl('kern.hostuuid')); + if (!isset($config['system']['do_not_send_uniqueid'])) { + curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version'] . ' : ' . system_get_uniqueid()); } else { curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version']); } diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc index 2fa58d1..1e0dae3 100644 --- a/src/etc/inc/pkg-utils.inc +++ b/src/etc/inc/pkg-utils.inc @@ -110,8 +110,8 @@ function pkg_env($extra_env = array()) { global $config, $g; $user_agent = $g['product_name'] . '/' . $g['product_version']; - if (!isset($config['system']['do_not_send_host_uuid'])) { - $user_agent .= ' : ' . get_single_sysctl('kern.hostuuid'); + if (!isset($config['system']['do_not_send_uniqueid'])) { + $user_agent .= ' : ' . system_get_uniqueid(); } $pkg_env_vars = array( diff --git a/src/usr/local/www/crash_reporter.php b/src/usr/local/www/crash_reporter.php index d674440..74af74e 100644 --- a/src/usr/local/www/crash_reporter.php +++ b/src/usr/local/www/crash_reporter.php @@ -61,11 +61,13 @@ require_once("guiconfig.inc"); require_once("functions.inc"); require_once("captiveportal.inc"); +require_once("system.inc"); define("FILE_SIZE", 450000); function upload_crash_report($files) { - global $g; + global $g, $config; + $post = array(); $counter = 0; foreach ($files as $file) { @@ -77,7 +79,11 @@ function upload_crash_report($files) { curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version']); + if (!isset($config['system']['do_not_send_uniqueid'])) { + curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version'] . ' : ' . system_get_uniqueid()); + } else { + curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version']); + } curl_setopt($ch, CURLOPT_URL, $g['crashreporterurl']); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); diff --git a/src/usr/local/www/system_advanced_misc.php b/src/usr/local/www/system_advanced_misc.php index 79ca581..8c370ba 100644 --- a/src/usr/local/www/system_advanced_misc.php +++ b/src/usr/local/www/system_advanced_misc.php @@ -87,7 +87,7 @@ $pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']); $pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']); $pconfig['use_mfs_tmp_size'] = $config['system']['use_mfs_tmp_size']; $pconfig['use_mfs_var_size'] = $config['system']['use_mfs_var_size']; -$pconfig['do_not_send_host_uuid'] = isset($config['system']['do_not_send_host_uuid']); +$pconfig['do_not_send_uniqueid'] = isset($config['system']['do_not_send_uniqueid']); $pconfig['powerd_ac_mode'] = "hadp"; if (!empty($config['system']['powerd_ac_mode'])) { @@ -215,10 +215,10 @@ if ($_POST) { unset($config['system']['pkg_nochecksig']); } - if ($_POST['do_not_send_host_uuid'] == "yes") { - $config['system']['do_not_send_host_uuid'] = true; + if ($_POST['do_not_send_uniqueid'] == "yes") { + $config['system']['do_not_send_uniqueid'] = true; } else { - unset($config['system']['do_not_send_host_uuid']); + unset($config['system']['do_not_send_uniqueid']); } if ($_POST['powerd_enable'] == "yes") { @@ -597,11 +597,11 @@ if ($g['platform'] == "pfSense") { $section = new Form_Section('Installation Feedback'); $section->addInput(new Form_Checkbox( - 'do_not_send_host_uuid', - 'Host UUID', - 'Do NOT send HOST UUID with user agent', - $pconfig['do_not_send_host_uuid'] -))->setHelp('Enable this option to not send HOST UUID to pfSense as part of User-Agent header.'); + 'do_not_send_uniqueid', + 'Netgate Device ID', + 'Do NOT send Netgate Device ID with user agent', + $pconfig['do_not_send_uniqueid'] +))->setHelp('Enable this option to not send Netgate Device ID to pfSense as part of User-Agent header.'); $form->add($section); |