summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorRenato Botelho <renato.botelho@bluepex.com>2010-08-30 20:36:30 -0300
committerRenato Botelho <renato.botelho@bluepex.com>2010-08-30 20:36:30 -0300
commit47f12397b3ec7f6fa860d21136a7deca9f6573e8 (patch)
tree2f63de6cc3229518d8704d641ab085d63bfd12da /etc/inc
parent701a250b6ede4936d1dd677b8e1813a440e90c71 (diff)
downloadpfsense-47f12397b3ec7f6fa860d21136a7deca9f6573e8.zip
pfsense-47f12397b3ec7f6fa860d21136a7deca9f6573e8.tar.gz
Fix gettext calls with printf to permit change strings order
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/authgui.inc2
-rw-r--r--etc/inc/cmd_chain.inc6
-rw-r--r--etc/inc/config.lib.inc8
-rw-r--r--etc/inc/filter.inc12
-rw-r--r--etc/inc/filter_log.inc2
-rw-r--r--etc/inc/gwlb.inc4
-rw-r--r--etc/inc/interfaces.inc8
-rw-r--r--etc/inc/meta.inc8
-rw-r--r--etc/inc/notices.inc4
-rw-r--r--etc/inc/pfsense-utils.inc12
-rw-r--r--etc/inc/pkg-utils.inc4
-rw-r--r--etc/inc/rrd.inc10
-rw-r--r--etc/inc/services.inc2
-rw-r--r--etc/inc/smtp.inc6
-rw-r--r--etc/inc/system.inc2
-rw-r--r--etc/inc/util.inc2
-rw-r--r--etc/inc/voucher.inc12
-rw-r--r--etc/inc/vpn.inc8
-rw-r--r--etc/inc/xmlparse.inc4
-rw-r--r--etc/inc/xmlparse_attr.inc4
-rw-r--r--etc/inc/xmlrpc_client.inc2
21 files changed, 61 insertions, 61 deletions
diff --git a/etc/inc/authgui.inc b/etc/inc/authgui.inc
index 97b2899..143e4a2 100644
--- a/etc/inc/authgui.inc
+++ b/etc/inc/authgui.inc
@@ -88,7 +88,7 @@ function display_error_form($http_code, $desc) {
global $config, $g;
$g['theme'] = $config['theme'];
if(isAjax()) {
- printf(gettext("Error: %s Description: %s"), $http_code, $desc);
+ printf(gettext("Error: %1$s Description: %2$s"), $http_code, $desc);
return;
}
diff --git a/etc/inc/cmd_chain.inc b/etc/inc/cmd_chain.inc
index ea295cd..399210e 100644
--- a/etc/inc/cmd_chain.inc
+++ b/etc/inc/cmd_chain.inc
@@ -98,7 +98,7 @@ Class CmdCHAIN {
$ignore_return_text = $cmd['ignore_return_text'];
// Should we perform verbose debugging?
if($this->is_debugging == true) {
- log_error(sprintf(gettext("CmdCHAIN is executing -> %s - %s"), $cmd_title, $command));
+ log_error(sprintf(gettext("CmdCHAIN is executing -> %1$s - %2$s"), $cmd_title, $command));
usleep(100); // give network stack time to deliver network syslog message
}
// Execute command
@@ -106,9 +106,9 @@ Class CmdCHAIN {
if($this->ignore_return_text == true)
continue;
if(intval($status) <> 0) {
- log_error(sprintf(gettext("%s failed with return code -> %s. The command was %s"), $cmd_title, $status, $command));
+ log_error(sprintf(gettext("%s failed with return code -> %1$s. The command was %2$s"), $cmd_title, $status, $command));
if($this->halt_on_errors == true)
- return(sprintf(gettext("%s failed with return code -> %s. The command was %s"), $cmd_title, $status, $command));
+ return(sprintf(gettext("%s failed with return code -> %1$s. The command was %2$s"), $cmd_title, $status, $command));
}
}
return;
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc
index f38cfd9..29576cb 100644
--- a/etc/inc/config.lib.inc
+++ b/etc/inc/config.lib.inc
@@ -201,8 +201,8 @@ function restore_backup($file) {
conf_mount_rw();
unlink_if_exists("{$g['tmp_path']}/config.cache");
copy("$file","/cf/conf/config.xml");
- log_error(sprintf(gettext("%s is restoring the configuration %s"), $g['product_name'], $file));
- file_notice("config.xml", sprintf(gettext("%s is restoring the configuration %s"), $g['product_name'], $file), "pfSenseConfigurator", "");
+ log_error(sprintf(gettext("%1$s is restoring the configuration %2$s"), $g['product_name'], $file));
+ file_notice("config.xml", sprintf(gettext("%1$s is restoring the configuration %2$s"), $g['product_name'], $file), "pfSenseConfigurator", "");
conf_mount_ro();
}
}
@@ -404,7 +404,7 @@ function convert_config() {
log_error(sprintf(gettext("Ended Configuration upgrade at %s"), $now));
if ($prev_version != $config['version'])
- write_config(sprintf(gettext("Upgraded config version level from %s to %s"), $prev_version, $config['version']));
+ write_config(sprintf(gettext("Upgraded config version level from %1$s to %2$s"), $prev_version, $config['version']));
if($g['booting'])
echo gettext("Loading new configuration...");
@@ -640,7 +640,7 @@ function config_validate($conffile) {
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
- $xmlerr = sprintf(gettext("%s at line %d"),
+ $xmlerr = sprintf(gettext("%1$s at line %2$d"),
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser));
return false;
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index ec11bf0..8e7757a 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -319,9 +319,9 @@ function filter_configure_sync() {
$line_number = $line_error[1];
$line_split = file("{$g['tmp_path']}/rules.debug");
if(is_array($line_split))
- $line_error = sprintf(gettext("The line in question reads [%d]: %s"), $line_number, $line_split[$line_number-1]);
+ $line_error = sprintf(gettext("The line in question reads [%1$d]: %2$s"), $line_number, $line_split[$line_number-1]);
if($line_error and $line_number) {
- $error_msg = sprintf(gettext("There were error(s) loading the rules: %s - %s"), $rules_error, $line_error);
+ $error_msg = sprintf(gettext("There were error(s) loading the rules: %1$s - %2$s"), $rules_error, $line_error);
file_notice("filter_load", $error_msg, "Filter Reload", "");
log_error($error_msg);
update_filter_reload_status($error_msg);
@@ -608,7 +608,7 @@ function filter_generate_gateways() {
$gatewayip = $member['gwip'];
if (($int <> "") && is_ipaddr($gatewayip)) {
if ($g['debug'])
- log_error(sprintf(gettext("Setting up route with %s on %s"), $gatewayip, $int));
+ log_error(sprintf(gettext("Setting up route with %1$s on %2$s"), $gatewayip, $int));
if ($member['weight'] > 1) {
$routeto .= str_repeat("( {$int} {$gatewayip} ) ", $member['weight']);
} else
@@ -1254,7 +1254,7 @@ function filter_nat_rules_generate() {
}
if($numberofnathosts > 0):
foreach ($FilterIflist as $if => $ifcfg) {
- update_filter_reload_status(sprintf(gettext("Creating outbound rules %s - (%s)"), $if, $ifcfg['descr']));
+ update_filter_reload_status(sprintf(gettext("Creating outbound rules %1$s - (%2$s)"), $if, $ifcfg['descr']));
if(interface_has_gateway($if)) {
$target = $ifcfg['ip'];
/* create outbound nat entries for all local networks */
@@ -2653,12 +2653,12 @@ function discover_pkg_rules($ruletype) {
foreach($files as $pkg_inc) {
if($pkg_inc == "ls: No match.")
continue;
- update_filter_reload_status(sprintf(gettext("Checking for %s PF hooks in package %s"), $ruletype, $pkg_inc));
+ update_filter_reload_status(sprintf(gettext("Checking for %1$s PF hooks in package %2$s"), $ruletype, $pkg_inc));
require_once($pkg_inc);
$pkg = basename($pkg_inc, ".inc");
$pkg_generate_rules = "{$pkg}_generate_rules";
if(function_exists($pkg_generate_rules)) {
- update_filter_reload_status(sprintf(gettext("Processing early %s rules for package %s"), $ruletype, $pkg_inc));
+ update_filter_reload_status(sprintf(gettext("Processing early %1$s rules for package %2$s"), $ruletype, $pkg_inc));
$tmprules = $pkg_generate_rules("$ruletype");
file_put_contents("{$g['tmp_path']}/rules.test.packages", $tmprules);
$status = mwexec("/sbin/pfctl -nf {$g['tmp_path']}/rules.test.packages");
diff --git a/etc/inc/filter_log.inc b/etc/inc/filter_log.inc
index e78bc0c..b027f6e 100644
--- a/etc/inc/filter_log.inc
+++ b/etc/inc/filter_log.inc
@@ -203,7 +203,7 @@ function get_port_with_service($port, $proto) {
$service = getservbyport($port, $proto);
$portstr = "";
if ($service) {
- $portstr = sprintf(gettext("<span title=\"Service %s/%s: %s\">%s</span>"), $port, $proto, $service, htmlspecialchars($port));
+ $portstr = sprintf(gettext("<span title=\"Service %1$s/%2$s: %3$s\">%4$s</span>"), $port, $proto, $service, htmlspecialchars($port));
} else {
$portstr = htmlspecialchars($port);
}
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 637d9ac..0e40341 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -230,7 +230,7 @@ EOD;
mwexec("/sbin/route delete -host " . escapeshellarg($gateway['monitor']));
mwexec("/sbin/route add -host " . escapeshellarg($gateway['monitor']) .
" " . escapeshellarg($gateway['gateway']));
- log_error(sprintf(gettext("Removing static route for monitor %s and adding a new route through %s"), $gateway['monitor'], $gateway['gateway']));
+ log_error(sprintf(gettext("Removing static route for monitor %1$s and adding a new route through %2$s"), $gateway['monitor'], $gateway['gateway']));
}
}
}
@@ -469,7 +469,7 @@ function dhclient_update_gateway_groups_defaultroute($interface = "wan") {
}
}
if($changed && $current_gw)
- write_config(sprintf(gettext("Updating gateway group gateway for %s - new gateway is %s"), $interfac, $current_gw));
+ write_config(sprintf(gettext("Updating gateway group gateway for %1$s - new gateway is %2$s"), $interfac, $current_gw));
}
function lookup_gateway_ip_by_name($name) {
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 11e8321..5366ebc 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -1109,7 +1109,7 @@ function interface_ppps_configure($interface) {
*/
}
if(!is_ipaddr($gateways[$pid])){
- log_error(sprintf(gettext("Could not get a PPTP/L2TP Remote IP address from %s for %s in interfaces_ppps_configure."), $dhcp_gateway, $gway));
+ log_error(sprintf(gettext("Could not get a PPTP/L2TP Remote IP address from %1$s for %2$s in interfaces_ppps_configure."), $dhcp_gateway, $gway));
return 0;
}
break;
@@ -1725,7 +1725,7 @@ function interface_carpdev_configure(&$vip) {
if($vip['password'] != "")
$password = " pass \"" . $vip_password . "\"";
- log_error(sprintf(gettext("Found carpdev interface %s on top of interface %s"), $vip['interface'], $interface));
+ log_error(sprintf(gettext("Found carpdev interface %1$s on top of interface %2$s"), $vip['interface'], $interface));
if (empty($vip['interface']))
return;
@@ -1841,7 +1841,7 @@ function interface_wireless_clone($realif, $wlcfg) {
// example: wlan2
exec("/sbin/ifconfig wlan create wlandev {$baseif} {$mode} bssid 2>&1", $out, $ret);
if($ret <> 0) {
- log_error(sprintf(gettext("Failed to clone interface %s with error code %s, output %s"), $baseif, $ret, $out[0]));
+ log_error(sprintf(gettext("Failed to clone interface %1$s with error code %2$s, output %3$s"), $baseif, $ret, $out[0]));
return false;
}
$newif = trim($out[0]);
@@ -2358,7 +2358,7 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven
" link " . escapeshellarg($random_mac));
$wancfg['spoofmac'] = $random_mac;
write_config();
- file_notice("MAC Address altered", sprintf(gettext("The INVALID MAC address (ff:ff:ff:ff:ff:ff) on interface %s has been automatically replaced with %s"), $realif, $random_mac), "Interfaces");
+ file_notice("MAC Address altered", sprintf(gettext("The INVALID MAC address (ff:ff:ff:ff:ff:ff) on interface %1$s has been automatically replaced with %2$s"), $realif, $random_mac), "Interfaces");
}
}
diff --git a/etc/inc/meta.inc b/etc/inc/meta.inc
index 63c9391..4216185 100644
--- a/etc/inc/meta.inc
+++ b/etc/inc/meta.inc
@@ -129,7 +129,7 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) {
$tagend = substr($fdata, $tagend_off + 4, $tagend_len - 4);
if ($tagbeg != $tagend) {
- printf(gettext("error: tag mismatch ( %s != %s ) in '%s'%s"), $tagbeg, $tagend, $fpath, "\n");
+ printf(gettext("error: tag mismatch ( %1$s != %2$s ) in '%3$s'%4$s"), $tagbeg, $tagend, $fpath, "\n");
break;
}
@@ -140,7 +140,7 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) {
$mdata = substr($fdata, $mdata_off, $mdata_len);
if (!strlen($mdata)) {
- printf(gettext("warning: tag %s has no data in '%s'%s"), $tagbeg, $fpath, "\n");
+ printf(gettext("warning: tag %1$s has no data in '%2$s'%3$s"), $tagbeg, $fpath, "\n");
break;
}
@@ -160,7 +160,7 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) {
$valtag = stripos($line, "##|*");
if ($valtag === false || $valtag) {
- printf(gettext("warning: tag %s has malformed data in '%s'%s"), $tagbeg, $fpath, "\n");
+ printf(gettext("warning: tag %1$s has malformed data in '%2$s'%3$s"), $tagbeg, $fpath, "\n");
continue;
}
@@ -182,7 +182,7 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) {
}
if (!isset($vname) || !isset($vdata)) {
- printf(gettext("warning: tag %s has invalid data in '%s'%s"), $tagbeg, $fpath, "\n");
+ printf(gettext("warning: tag %1$s has invalid data in '%2$s'%3$s"), $tagbeg, $fpath, "\n");
continue;
}
diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc
index 6d4ed1e..224e680 100644
--- a/etc/inc/notices.inc
+++ b/etc/inc/notices.inc
@@ -326,8 +326,8 @@ function notify_via_smtp($message) {
log_error(sprintf(gettext("Message sent to %s OK"), $to));
return;
} else {
- log_error(sprintf(gettext("Could not send the message to %s -- Error: %s"), $to, $smtp->error));
- return(sprintf(gettext("Could not send the message to %s -- Error: %s"), $to, $smtp->error));
+ log_error(sprintf(gettext("Could not send the message to %1$s -- Error: %2$s"), $to, $smtp->error));
+ return(sprintf(gettext("Could not send the message to %1$s -- Error: %2$s"), $to, $smtp->error));
}
}
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 37cb340..833c802 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -483,7 +483,7 @@ function WakeOnLan($addr, $mac)
$s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
if ($s == false) {
log_error(gettext("Error creating socket!"));
- log_error(sprintf(gettext("Error code is '%s' - %s"), socket_last_error($s), socket_strerror(socket_last_error($s))));
+ log_error(sprintf(gettext("Error code is '%1$s' - %2$s"), socket_last_error($s), socket_strerror(socket_last_error($s))));
} else {
// setting a broadcast option to socket:
$opt_ret = socket_set_option($s, 1, 6, TRUE);
@@ -491,7 +491,7 @@ function WakeOnLan($addr, $mac)
log_error(sprintf(gettext("setsockopt() failed, error: %s"), strerror($opt_ret)));
$e = socket_sendto($s, $msg, strlen($msg), 0, $addr, 2050);
socket_close($s);
- log_error(sprintf(gettext("Magic Packet sent (%s) to {%s} MAC=%s"), $e, $addr, $mac));
+ log_error(sprintf(gettext("Magic Packet sent (%1$s) to {%2$s} MAC=%3$s"), $e, $addr, $mac));
return true;
}
@@ -737,7 +737,7 @@ function call_pfsense_method($method, $params, $timeout = 0) {
log_error(sprintf(gettext("XMLRPC communication error: %s"), $cli->errstr));
return false;
} elseif($resp->faultCode()) {
- log_error(sprintf(gettext("XMLRPC request failed with error %s: %s"), $resp->faultCode(), $resp->faultString()));
+ log_error(sprintf(gettext("XMLRPC request failed with error %1$s: %2$s"), $resp->faultCode(), $resp->faultString()));
return false;
} else {
return XML_RPC_Decode($resp->value());
@@ -1402,7 +1402,7 @@ function compare_hostname_to_dnscache($hostname) {
if(trim($oldcontents) != trim($contents)) {
if($g['debug']) {
- log_error(sprintf(gettext("DNSCACHE: Found old IP %s and new IP %s"), $oldcontents, $contents));
+ log_error(sprintf(gettext("DNSCACHE: Found old IP %1$s and new IP %2$s"), $oldcontents, $contents));
}
return ($oldcontents);
} else {
@@ -1573,7 +1573,7 @@ function update_alias_names_upon_change($section, $subsection, $fielda, $fieldb,
for ($i = 0; isset($config["$section"]["$subsection"][$i]["$fielda"]); $i++) {
if($debug) fwrite($fd, "$i\n");
if($config["$section"]["$subsection"][$i]["$fielda"]["$fieldb"] == $origname) {
- if($debug) fwrite($fd, sprintf(gettext("Setting old alias value %s to %s%s"), $origname, $new_alias_name, "\n"));
+ if($debug) fwrite($fd, sprintf(gettext("Setting old alias value %1$s to %2$s%3$s"), $origname, $new_alias_name, "\n"));
$config["$section"]["$subsection"][$i]["$fielda"]["$fieldb"] = $new_alias_name;
}
}
@@ -1582,7 +1582,7 @@ function update_alias_names_upon_change($section, $subsection, $fielda, $fieldb,
for ($i = 0; isset($config["$section"]["$subsection"][$i]["$fielda"]); $i++) {
if($config["$section"]["$subsection"][$i]["$fielda"] == $origname) {
$config["$section"]["$subsection"][$i]["$fielda"] = $new_alias_name;
- if($debug) fwrite($fd, sprintf(gettext("Setting old alias value %s to %s%s"), $origname, $new_alias_name, "\n"));
+ if($debug) fwrite($fd, sprintf(gettext("Setting old alias value %1$s to %2$s%3$s"), $origname, $new_alias_name, "\n"));
}
}
}
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index d3d0e48..3766350 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -224,7 +224,7 @@ function get_pkg_depends($pkg_name, $filetype = ".xml", $format = "files", $retu
}
$package = $config['installedpackages']['package'][$pkg_id];
if(!file_exists("/usr/local/pkg/" . $package['configurationfile'])) {
- log_error(sprintf(gettext("The %s package is missing required dependencies and must be reinstalled. %s"), $package['name'], $package['configurationfile']));
+ log_error(sprintf(gettext("The %1$s package is missing required dependencies and must be reinstalled. %2$s"), $package['name'], $package['configurationfile']));
install_package($package['name']);
uninstall_package_from_name($package['name']);
install_package($package['name']);
@@ -641,7 +641,7 @@ function install_package_xml($pkg) {
fwrite($fd_log, print_r($tarout, true) . "\n");
}
if($pkg_chmod <> "") {
- fwrite($fd_log, sprintf(gettext("Changing file mode to %s for %s%s%s"), $pkg_chmod, $prefix, $filename, "\n"));
+ fwrite($fd_log, sprintf(gettext("Changing file mode to %1$s for %2$s%3$s%4$s"), $pkg_chmod, $prefix, $filename, "\n"));
@chmod($prefix . $filename, $pkg_chmod);
system("/bin/chmod {$pkg_chmod} {$prefix}{$filename}");
}
diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc
index 574c6a6..34ed887 100644
--- a/etc/inc/rrd.inc
+++ b/etc/inc/rrd.inc
@@ -42,7 +42,7 @@ function dump_rrd_to_xml($rrddatabase, $xmldumpfile) {
exec("$rrdtool dump {$rrddatabase} {$xmldumpfile} 2>&1", $dumpout, $dumpret);
if ($dumpret <> 0) {
$dumpout = implode(" ", $dumpout);
- log_error(sprintf(gettext("RRD dump failed exited with %s, the error is: %s"), $dumpret, $dumpout));
+ log_error(sprintf(gettext("RRD dump failed exited with %1$s, the error is: %2$s"), $dumpret, $dumpout));
}
return($dumpret);
}
@@ -53,7 +53,7 @@ function create_new_rrd($rrdcreatecmd) {
exec("$rrdcreatecmd 2>&1", $rrdcreateoutput, $rrdcreatereturn);
if ($rrdcreatereturn <> 0) {
$rrdcreateoutput = implode(" ", $rrdcreateoutput);
- log_error(sprintf(gettext("RRD create failed exited with %s, the error is: %s"), $rrdcreatereturn, $rrdcreateoutput));
+ log_error(sprintf(gettext("RRD create failed exited with %1$s, the error is: %2$s"), $rrdcreatereturn, $rrdcreateoutput));
}
return $rrdcreatereturn;
}
@@ -67,7 +67,7 @@ function migrate_rrd_format($rrdoldxml, $rrdnewxml) {
$numdsold = count($rrdoldxml['ds']);
$numrranew = count($rrdnewxml['rra']);
$numdsnew = count($rrdnewxml['ds']);
- log_error(sprintf(gettext("Import RRD has %s DS values and %s RRA databases, new format RRD has %s DS values and %s RRA databases"), $numdsold, $numrraold, $numdsnew ,$numrranew));
+ log_error(sprintf(gettext("Import RRD has %1$s DS values and %2$s RRA databases, new format RRD has %3$s DS values and %4$s RRA databases"), $numdsold, $numrraold, $numdsnew ,$numrranew));
/* add data sources not found in the old array from the new array */
$i = 0;
@@ -151,7 +151,7 @@ function migrate_rrd_format($rrdoldxml, $rrdnewxml) {
$numrranew = count($rrdoldxml['rra']);
$numdsnew = count($rrdoldxml['ds']);
- log_error(sprintf(gettext("The new RRD now has %s DS values and %s RRA databases"), $numdsnew, $numrranew));
+ log_error(sprintf(gettext("The new RRD now has %1$s DS values and %2$s RRA databases"), $numdsnew, $numrranew));
return $rrdoldxml;
}
@@ -238,7 +238,7 @@ function enable_rrd_graphing() {
exec("cd /;LANG=C /usr/bin/tar -xzf {$g['cf_conf_path']}/rrd.tgz 2>&1", $rrdrestore, $rrdreturn);
$rrdrestore = implode(" ", $rrdrestore);
if($rrdreturn <> 0) {
- log_error(sprintf(gettext("RRD restore failed exited with %s, the error is: %s%s"), $rrdreturn, $rrdrestore, "\n"));
+ log_error(sprintf(gettext("RRD restore failed exited with %1$s, the error is: %2$s%3$s"), $rrdreturn, $rrdrestore, "\n"));
}
}
}
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 682472a..1c1f1fd 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -94,7 +94,7 @@ function services_dhcpd_configure() {
exec("cd /;LANG=C /usr/bin/tar -xzf {$g['cf_conf_path']}/dhcpleases.tgz 2>&1", $dhcprestore, $dhcpreturn);
$dhcprestore = implode(" ", $dhcprestore);
if($dhcpreturn <> 0) {
- log_error(sprintf(gettext("DHCP leases restore failed exited with %s, the error is: %s%s"), $dhcpreturn, $dhcprestore, "\n"));
+ log_error(sprintf(gettext("DHCP leases restore failed exited with %1$s, the error is: %2$s%3$s"), $dhcpreturn, $dhcprestore, "\n"));
}
}
}
diff --git a/etc/inc/smtp.inc b/etc/inc/smtp.inc
index 7276ed8..c33978d 100644
--- a/etc/inc/smtp.inc
+++ b/etc/inc/smtp.inc
@@ -236,7 +236,7 @@ class smtp_class
&& !strcmp(@gethostbyname($this->exclude_address),$ip))
return(sprintf(gettext("domain \"%s\" resolved to an address excluded to be valid"), $domain));
if($this->debug)
- $this->OutputDebug(sprintf(gettext("Connecting to host address \"%s\" port %s..."), $ip, $port));
+ $this->OutputDebug(sprintf(gettext("Connecting to host address \"%1$s\" port %2$s..."), $ip, $port));
if(($this->connection=($this->timeout ? @fsockopen(($this->ssl ? "ssl://" : "").$ip,$port,$errno,$error,$this->timeout) : @fsockopen(($this->ssl ? "ssl://" : "").$ip,$port))))
return("");
$error=($this->timeout ? strval($error) : "??");
@@ -253,7 +253,7 @@ class smtp_class
case "-7":
return(gettext("-7 setvbuf() call failed"));
}
- return(sprintf(gettext("could not connect to the host \"%s\": %s"), $domain, $error));
+ return(sprintf(gettext("could not connect to the host \"%1$s\": %2$s"), $domain, $error));
}
Function SASLAuthenticate($mechanisms, $credentials, &$authenticated, &$mechanism)
@@ -286,7 +286,7 @@ class smtp_class
case SASL_NOMECH:
if(strlen($this->authentication_mechanism))
{
- $this->error=printf(gettext("authenticated mechanism %s may not be used: %s"), $this->authentication_mechanism, $sasl->error);
+ $this->error=printf(gettext("authenticated mechanism %1$s may not be used: %2$s"), $this->authentication_mechanism, $sasl->error);
return(0);
}
break;
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index bcc0e0e..c21be19 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -338,7 +338,7 @@ function system_routing_configure($interface = "") {
if(isset($route_arr['default'])) {
$action = "change";
}
- log_error(sprintf(gettext("ROUTING: %s default route to %s"), $action, $gatewayip));
+ log_error(sprintf(gettext("ROUTING: %1$s default route to %2$s"), $action, $gatewayip));
mwexec("/sbin/route {$action} default " . escapeshellarg($gatewayip));
} else if (is_ipaddr($config['interfaces']['wan']['gateway'])) {
/* Adding gateway for 1.2-style configs without the new
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 77af86d..8a9db4f 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -785,7 +785,7 @@ function mwexec($command, $mute = false) {
$mute = false;
if(($retval <> 0) && ($mute === false)) {
$output = implode(" ", $oarr);
- log_error(sprintf(gettext("The command '%s' returned exit code '%d', the output was '%s' "), $command, $retval, $output));
+ log_error(sprintf(gettext("The command '%1$s' returned exit code '%2$d', the output was '%3$s' "), $command, $retval, $output));
}
return $retval;
}
diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc
index 978b1d2..e746d8a 100644
--- a/etc/inc/voucher.inc
+++ b/etc/inc/voucher.inc
@@ -89,7 +89,7 @@ function voucher_auth($voucher_received, $test = 0) {
list($timestamp,$minutes) = explode(",", $line);
// we have an already active voucher here.
$remaining = intval((($timestamp + 60*$minutes) - time())/60);
- $test_result[] = sprintf(gettext("%s (%s/%s) active and good for %d Minutes"), $voucher, $roll, $nr, $remaining);
+ $test_result[] = sprintf(gettext("%1$s (%2$s/%3$s) active and good for %4$d Minutes"), $voucher, $roll, $nr, $remaining);
$total_minutes += $remaining;
} else {
// voucher not used. Check if ticket Id is on the roll (not too high)
@@ -100,18 +100,18 @@ function voucher_auth($voucher_received, $test = 0) {
$pos = $nr >> 3; // divide by 8 -> octet
$mask = 1 << ($nr % 8);
if (ord($bitstring[$roll][$pos]) & $mask) {
- $test_result[] = sprintf(gettext("%s (%s/%s) already used and expired"), $voucher, $roll, $nr);
+ $test_result[] = sprintf(gettext("%1$s (%2$s/%3$s) already used and expired"), $voucher, $roll, $nr);
$total_minutes = -1; // voucher expired
$error++;
} else {
// mark bit for this voucher as used
$bitstring[$roll][$pos] = chr(ord($bitstring[$roll][$pos]) | $mask);
- $test_result[] = sprintf(gettext("%s (%s/%s) good for %d Minutes"), $voucher, $roll, $nr, $minutes_per_roll[$roll]);
+ $test_result[] = sprintf(gettext("%1$s (%2$s/%3$) good for %4$d Minutes"), $voucher, $roll, $nr, $minutes_per_roll[$roll]);
$total_minutes += $minutes_per_roll[$roll];
}
}
} else {
- $test_result[] = sprintf(gettext("%s (%s/%s): not found on any registererd Roll"), $voucher, $roll, $nr);
+ $test_result[] = sprintf(gettext("%1$s (%2$s/%3$s): not found on any registererd Roll"), $voucher, $roll, $nr);
}
} else {
// hmm, thats weird ... not what I expected
@@ -330,7 +330,7 @@ function voucher_write_used_db($roll, $vdb) {
fwrite($fd, $vdb . "\n");
fclose($fd);
} else {
- voucher_log(LOG_ERR, sprintf(gettext("cant write %s/voucher_used_%s.db"), $g['vardb_path'], $roll));
+ voucher_log(LOG_ERR, sprintf(gettext("cant write %1$s/voucher_used_%2$s.db"), $g['vardb_path'], $roll));
}
}
@@ -409,7 +409,7 @@ function voucher_read_used_db($roll) {
$vdb = trim(fgets($fd));
fclose($fd);
} else {
- voucher_log(LOG_ERR, sprintf(gettext("cant read %s/voucher_used_%s.db"), $g['vardb_path'], $roll));
+ voucher_log(LOG_ERR, sprintf(gettext("cant read %1$s/voucher_used_%2$s.db"), $g['vardb_path'], $roll));
}
}
return base64_decode($vdb);
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc
index ab8d474..ce7d501 100644
--- a/etc/inc/vpn.inc
+++ b/etc/inc/vpn.inc
@@ -840,7 +840,7 @@ EOD;
if(is_ipaddr($gatewayip)) {
/* FIXME: does adding route-to and reply-to on the in/outbound
* rules fix this? smos@ 13-01-2009 */
- log_error(sprintf(gettext("IPSEC interface is not WAN but %s, adding static route for VPN endpoint %s via %s"), $parentinterface, $rgip, $gatewayip));
+ log_error(sprintf(gettext("IPSEC interface is not WAN but %1$s, adding static route for VPN endpoint %2$s via %3$s"), $parentinterface, $rgip, $gatewayip));
mwexec("/sbin/route delete -host {$rgip}");
mwexec("/sbin/route add -host {$rgip} {$gatewayip}");
}
@@ -1648,10 +1648,10 @@ function reload_tunnel_spd_policy($phase1, $phase2, $old_phase1, $old_phase2) {
}
if((!is_ipaddr($old_ep)) || (! is_ipaddr($ep))) {
- log_error(sprintf(gettext("IPSEC: ERROR: One of the endpoints is not a IP address. Old EP '%s' new EP '%s'"), $old_ep, $ep));
+ log_error(sprintf(gettext("IPSEC: ERROR: One of the endpoints is not a IP address. Old EP '%1$s' new EP '%2$s'"), $old_ep, $ep));
}
if((! is_ipaddr($rgip)) || (! is_ipaddr($old_gw))) {
- log_error(sprintf(gettext("IPSEC: ERROR: One of the remote endpoints is not a IP address. Old RG '%s' new RG '%s'"), $old_gw, $rgip));
+ log_error(sprintf(gettext("IPSEC: ERROR: One of the remote endpoints is not a IP address. Old RG '%1$s' new RG '%2$s'"), $old_gw, $rgip));
}
$spdconf = "";
@@ -1697,7 +1697,7 @@ function reload_tunnel_spd_policy($phase1, $phase2, $old_phase1, $old_phase2) {
"{$phase2['protocol']}/tunnel/{$rgip}-" .
"{$ep}/unique;\n";
- log_error(sprintf(gettext("Reloading IPsec tunnel '%s'. Previous IP '%s', current IP '%s'. Reloading policy"), $phase1['descr'], $old_gw, $rgip));
+ log_error(sprintf(gettext("Reloading IPsec tunnel '%1$s'. Previous IP '%2$s', current IP '%3$s'. Reloading policy"), $phase1['descr'], $old_gw, $rgip));
$now = time();
$spdfile = tempnam("{$g['tmp_path']}", "spd.conf.reload.{$now}.");
diff --git a/etc/inc/xmlparse.inc b/etc/inc/xmlparse.inc
index aa4d7e4..013f81d 100644
--- a/etc/inc/xmlparse.inc
+++ b/etc/inc/xmlparse.inc
@@ -82,7 +82,7 @@ function startElement($parser, $name, $attrs) {
} else if (isset($ptr)) {
/* multiple entries not allowed for this element, bail out */
- die(sprintf(gettext("XML error: %s at line %d cannot occur more than once") . "\n",
+ die(sprintf(gettext("XML error: %1$s at line %2$d cannot occur more than once") . "\n",
$name,
xml_get_current_line_number($parser)));
}
@@ -179,7 +179,7 @@ function parse_xml_config_raw($cffile, $rootobj, $isstring = "false") {
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
- log_error(sprintf(gettext("XML error: %s at line %d") . "\n",
+ log_error(sprintf(gettext("XML error: %1$s at line %2$d") . "\n",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
return -1;
diff --git a/etc/inc/xmlparse_attr.inc b/etc/inc/xmlparse_attr.inc
index 04428cc..534ffb5 100644
--- a/etc/inc/xmlparse_attr.inc
+++ b/etc/inc/xmlparse_attr.inc
@@ -75,7 +75,7 @@ function startElement_attr($parser, $name, $attrs) {
} else if (isset($ptr)) {
/* multiple entries not allowed for this element, bail out */
- die(sprintf(gettext("XML error: %s at line %d cannot occur more than once") . "\n",
+ die(sprintf(gettext("XML error: %1$s at line %2$d cannot occur more than once") . "\n",
$name,
xml_get_current_line_number($parser)));
} else if (isset($writeattrs)) {
@@ -194,7 +194,7 @@ function parse_xml_config_raw_attr($cffile, $rootobj, &$parsed_attributes, $isst
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
- log_error(sprintf(gettext("XML error: %s at line %d") . "\n",
+ log_error(sprintf(gettext("XML error: %1$s at line %2$d") . "\n",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
if (isset($parsed_attributes)) {
diff --git a/etc/inc/xmlrpc_client.inc b/etc/inc/xmlrpc_client.inc
index 59a9678..bd0f1bd 100644
--- a/etc/inc/xmlrpc_client.inc
+++ b/etc/inc/xmlrpc_client.inc
@@ -303,7 +303,7 @@ function XML_RPC_se($parser_resource, $name, $attrs)
if (!in_array($XML_RPC_xh[$parser]['stack'][0], $XML_RPC_valid_parents[$name])) {
$name = $GLOBALS['XML_RPC_func_ereg_replace']('[^a-zA-Z0-9._-]', '', $name);
$XML_RPC_xh[$parser]['isf'] = 2;
- $XML_RPC_xh[$parser]['isf_reason'] = sprintf(gettext("xmlrpc element %s cannot be child of %s"), $name, $XML_RPC_xh[$parser]['stack'][0]);
+ $XML_RPC_xh[$parser]['isf_reason'] = sprintf(gettext("xmlrpc element %1$s cannot be child of %2$s"), $name, $XML_RPC_xh[$parser]['stack'][0]);
return;
}
}
OpenPOWER on IntegriCloud