summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato.botelho@bluepex.com>2010-04-29 08:07:25 -0300
committerRenato Botelho <renato.botelho@bluepex.com>2010-04-29 08:07:25 -0300
commit649bc342dd6079a2008d037dac320d028d955733 (patch)
treef58997d2c1d2d51aeac145ecf2201cc675ba9096
parentc3c2fd205b1563976a278bd11396d055d7818d27 (diff)
parent5961c5c6145610580ac2e8fe0a99f57762617c55 (diff)
downloadpfsense-649bc342dd6079a2008d037dac320d028d955733.zip
pfsense-649bc342dd6079a2008d037dac320d028d955733.tar.gz
Merge branch 'master' into gettext
-rw-r--r--etc/inc/filter.inc2
-rw-r--r--etc/inc/pfsense-utils.inc4
-rw-r--r--etc/phpshellsessions/gitsync58
-rwxr-xr-xusr/local/www/firewall_nat_out.php71
4 files changed, 115 insertions, 20 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index b229e7d..cba2ae2 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1101,7 +1101,7 @@ function filter_nat_rules_generate() {
// Open inetd.conf write handle
$inetd_fd = fopen("/var/etc/inetd.conf","w");
/* add tftp protocol helper */
- fwrite($inetd_fd, "tftp-proxy\tdgram\tudp\twait\t\troot\t/usr/local/sbin/tftp-proxy\ttftp-proxy -v\n");
+ fwrite($inetd_fd, "tftp-proxy\tdgram\tudp\twait\t\troot\t/usr/libexec/tftp-proxy\ttftp-proxy -v\n");
if(isset($config['nat']['rule'])) {
if(!isset($config['system']['disablenatreflection'])) {
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index df11107..0995a92 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1096,9 +1096,9 @@ function setup_serial_port() {
foreach($ttys_split as $tty) {
if(stristr($tty, "ttyd0") or stristr($tty, "ttyu0")) {
if(isset($config['system']['enableserial'])) {
- fwrite($fd, "ttyu0 \"/usr/libexec/getty bootupcli\" dialup on secure\n");
+ fwrite($fd, "ttyu0 \"/usr/libexec/getty bootupcli\" cons25 on secure\n");
} else {
- fwrite($fd, "ttyu0 \"/usr/libexec/getty bootupcli\" dialup off secure\n");
+ fwrite($fd, "ttyu0 \"/usr/libexec/getty bootupcli\" cons25 off secure\n");
}
} else {
fwrite($fd, $tty . "\n");
diff --git a/etc/phpshellsessions/gitsync b/etc/phpshellsessions/gitsync
index 6491851..4176dfe 100644
--- a/etc/phpshellsessions/gitsync
+++ b/etc/phpshellsessions/gitsync
@@ -48,10 +48,18 @@ if(file_exists("/root/cvssync_backup.tgz")) {
$branches = array_merge($branches, $tmp);
}
+if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) {
+ exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url", $output_str, $ret);
+ if(is_array($output_str) && !empty($output_str[0]))
+ $GIT_REPO = $output_str[0];
+ unset($output_str);
+}
+
if($command_split[2]) {
$branch = $command_split[2];
} else {
if(!$argv[3]) {
+ echo "\nCurrent repository is $GIT_REPO\n";
echo "\nPlease select which branch you would like to sync against:\n\n";
foreach($branches as $branchname => $branchdesc) {
echo "{$branchname} \t {$branchdesc}\n";
@@ -97,6 +105,21 @@ if(!$found) {
}
}
+$merge_repos = array();
+if(!$command_split[2] && !$argv[3]) {
+ do {
+ echo "\nAdd a custom RCS branch URL (HTTP) to merge in or press enter for none.\n\n";
+ $merge_repo = readline("> ");
+ if(!empty($merge_repo)) {
+ $merge_branch = readline("Merge which branch [master]? ");
+ if($merge_branch == "")
+ $merge_repos[] = array('repo' => $merge_repo, 'branch' => 'master');
+ else if($merge_branch)
+ $merge_repos[] = array('repo' => $merge_repo, 'branch' => $merge_branch);
+ }
+ } while(!empty($merge_repo));
+}
+
if($branch == "RESTORE" && $g['platform'] == "pfSense") {
if(!file_exists("/root/cvssync_backup.tgz")) {
echo "Sorry, we could not find a previous CVSSync backup file.\n";
@@ -125,25 +148,15 @@ exec("mkdir -p /root/pfsense/$branch");
// Git 'er done!
if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) {
echo "===> Fetching updates...\n";
+ exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url $GIT_REPO");
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git fetch");
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git clean -f -f -x -d");
- if($branch == "master") {
- $git_cmd = array(
- "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset HEAD --hard",
- "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git rebase origin"
- );
- run_cmds($git_cmd);
- } else {
- $git_cmd = array(
- "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset HEAD --hard",
- "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout master",
- "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git branch -D $branch",
- "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git fetch",
- "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git rebase origin",
- "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout -b $branch origin/$branch"
- );
- run_cmds($git_cmd);
- }
+ $git_cmd = array(
+ "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git branch $branch origin/$branch 2>/dev/null",
+ "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout -f $branch 2>/dev/null",
+ "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset --hard origin/$branch"
+ );
+ run_cmds($git_cmd);
} else {
exec("mkdir -p $CODIR/pfSenseGITREPO");
echo "Executing cd $CODIR/pfSenseGITREPO && git clone $GIT_REPO pfSenseGITREPO\n";
@@ -159,6 +172,17 @@ if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) {
}
}
+foreach($merge_repos as $merge_repo) {
+ echo "===> Merging branch {$merge_repo['branch']} from {$merge_repo['repo']}\n";
+ exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git pull {$merge_repo['repo']} {$merge_repo['branch']}", $output_str, $ret);
+ unset($output_str);
+ if($ret <> 0) {
+ echo "\nMerge failed. Aborting sync.\n\n";
+ run_cmds($git_cmd);
+ exit;
+ }
+}
+
exec("mkdir -p /tmp/lighttpd/cache/compress/");
// Nuke CVS and pfSense tarballs
diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php
index 90ffe43..07d696e 100755
--- a/usr/local/www/firewall_nat_out.php
+++ b/usr/local/www/firewall_nat_out.php
@@ -136,6 +136,77 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") {
$a_out[] = $natent;
}
}
+ /* PPTP subnet */
+ if($config['pptpd']['mode'] == "server") {
+ if (is_ipaddr($config['pptpd']['localip'])) {
+ if($config['pptpd']['pptp_subnet'] <> "")
+ $ossubnet = $config['pptpd']['pptp_subnet'];
+ else
+ $ossubnet = "32";
+ $osn = gen_subnet($config['pptpd']['localip'], $osn);
+ $natent = array();
+ $natent['source']['network'] = "{$osn}/{$ossubnet}";
+ $natent['sourceport'] = "";
+ $natent['descr'] = "Auto created rule for PPTP server";
+ $natent['target'] = "";
+ $natent['interface'] = "pptp";
+ $natent['destination']['any'] = true;
+ $natent['natport'] = "";
+ $a_out[] = $natent;
+ }
+ }
+ /* PPPoE subnet */
+ if($config['pppoe']['mode'] == "server") {
+ if (is_ipaddr($config['pppoe']['localip'])) {
+ if($config['pppoe']['pppoe_subnet'] <> "")
+ $ossubnet = $config['pppoe']['pptp_subnet'];
+ else
+ $ossubnet = "32";
+ $osn = gen_subnet($config['pppoe']['localip'], $osn);
+ $natent = array();
+ $natent['source']['network'] = "{$osn}/{$ossubnet}";
+ $natent['sourceport'] = "";
+ $natent['descr'] = "Auto created rule for PPPoE server";
+ $natent['target'] = "";
+ $natent['interface'] = "pppoe";
+ $natent['destination']['any'] = true;
+ $natent['natport'] = "";
+ $a_out[] = $natent;
+ }
+ }
+ /* L2TP subnet */
+ if($config['l2tp']['mode'] == "server") {
+ if (is_ipaddr($config['l2tp']['localip'])) {
+ if($config['l2tp']['l2tp_subnet'] <> "")
+ $ossubnet = $config['l2tp']['pptp_subnet'];
+ else
+ $ossubnet = "32";
+ $osn = gen_subnet($config['l2tp']['localip'], $osn);
+ $natent = array();
+ $natent['source']['network'] = "{$osn}/{$ossubnet}";
+ $natent['sourceport'] = "";
+ $natent['descr'] = "Auto created rule for L2TP server";
+ $natent['target'] = "";
+ $natent['interface'] = "l2tp";
+ $natent['destination']['any'] = true;
+ $natent['natport'] = "";
+ $a_out[] = $natent;
+ }
+ }
+ /* add openvpn interfaces */
+ if($config['openvpn']['openvpn-server']) {
+ foreach ($config['openvpn']['openvpn-server'] as $ovpnsrv) {
+ $natent = array();
+ $natent['source']['network'] = $ovpnsrv['tunnel_network'];
+ $natent['sourceport'] = "";
+ $natent['descr'] = "Auto created rule for OpenVPN server";
+ $natent['target'] = "";
+ $natent['interface'] = "openvpn";
+ $natent['destination']['any'] = true;
+ $natent['natport'] = "";
+ $a_out[] = $natent;
+ }
+ }
$savemsg = "Default rules for each interface have been created.";
}
break;
OpenPOWER on IntegriCloud