mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 03:33:25 +02:00
Merge remote-tracking branch 'origin/master' into next
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
etc/rc.d/init.d/firewall
|
etc/rc.d/init.d/firewall
|
||||||
etc/ssh/sshd_config
|
etc/ssh/sshd_config
|
||||||
opt/pakfire/lib/functions.pl
|
opt/pakfire/lib/functions.pl
|
||||||
|
opt/pakfire/lib/functions.sh
|
||||||
opt/pakfire/pakfire
|
opt/pakfire/pakfire
|
||||||
usr/lib/firewall/ipsec-policy
|
usr/lib/firewall/ipsec-policy
|
||||||
var/ipfire/backup/bin/backup.pl
|
var/ipfire/backup/bin/backup.pl
|
||||||
|
|||||||
@@ -74,6 +74,9 @@ ldconfig
|
|||||||
# Filesytem cleanup
|
# Filesytem cleanup
|
||||||
/usr/local/bin/filesystem-cleanup
|
/usr/local/bin/filesystem-cleanup
|
||||||
|
|
||||||
|
# Apply local configuration to sshd_config
|
||||||
|
/usr/local/bin/sshctrl
|
||||||
|
|
||||||
# Start services
|
# Start services
|
||||||
/etc/init.d/vnstat restart
|
/etc/init.d/vnstat restart
|
||||||
/etc/init.d/rngd restart
|
/etc/init.d/rngd restart
|
||||||
|
|||||||
@@ -171,20 +171,28 @@ if (($settings{'ACTION'} eq $Lang::tr{'add'}) || ($settings{'ACTION'} eq $Lang::
|
|||||||
$errormessage = $Lang::tr{'invalid domain name'};
|
$errormessage = $Lang::tr{'invalid domain name'};
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check if a username has been sent.
|
# Check if the choosen provider supports token based authentication.
|
||||||
if ($settings{'LOGIN'} eq '') {
|
if ($settings{'SERVICE'} ~~ @token_provider) {
|
||||||
$errormessage = $Lang::tr{'username not set'};
|
# Check if a token has been given.
|
||||||
}
|
unless ($settings{'TOKEN'}) {
|
||||||
|
$errormessage = $Lang::tr{'token not set'};
|
||||||
|
}
|
||||||
|
|
||||||
# Check if a password has been typed in.
|
# Automatically set the username to token.
|
||||||
# freedns.afraid.org does not require this field.
|
$settings{'LOGIN'} = "token";
|
||||||
if (($settings{'PASSWORD'} eq '') && ($settings{'SERVICE'} ne 'freedns.afraid.org') && ($settings{'SERVICE'} ne 'regfish.com')) {
|
|
||||||
$errormessage = $Lang::tr{'password not set'};
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check if a token has been given for provider which support tokens.
|
# A provider without token support has been choosen.
|
||||||
if (($settings{'SERVICE'} ~~ @token_provider) && ($settings{'TOKEN'} eq '')) {
|
} else {
|
||||||
$errormessage = $Lang::tr{'token not set'};
|
# Check if a username has been sent.
|
||||||
|
if ($settings{'LOGIN'} eq '') {
|
||||||
|
$errormessage = $Lang::tr{'username not set'};
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if a password has been typed in.
|
||||||
|
# freedns.afraid.org does not require this field.
|
||||||
|
if (($settings{'PASSWORD'} eq '') && ($settings{'SERVICE'} ne 'freedns.afraid.org') && ($settings{'SERVICE'} ne 'regfish.com')) {
|
||||||
|
$errormessage = $Lang::tr{'password not set'};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Go furter if there was no error.
|
# Go furter if there was no error.
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ my $ipfire_version = <FILE>;
|
|||||||
close(FILE);
|
close(FILE);
|
||||||
|
|
||||||
my $pakfire_version = &Pakfire::make_version();
|
my $pakfire_version = &Pakfire::make_version();
|
||||||
my $kernel_version = &General::system_output("uname", "-a");
|
my @kernel_version = &General::system_output("uname", "-a");
|
||||||
|
|
||||||
&Header::openbox('100%', 'left', $Lang::tr{'fireinfo system version'});
|
&Header::openbox('100%', 'left', $Lang::tr{'fireinfo system version'});
|
||||||
print <<END;
|
print <<END;
|
||||||
@@ -109,7 +109,7 @@ print <<END;
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align='center' bgcolor='#F0F0F0' width='15%'>$Lang::tr{'fireinfo kernel version'}</td>
|
<td align='center' bgcolor='#F0F0F0' width='15%'>$Lang::tr{'fireinfo kernel version'}</td>
|
||||||
<td bgcolor='#F0F0F0'><code>$kernel_version</code></td>
|
<td bgcolor='#F0F0F0'><code>@kernel_version</code></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
END
|
END
|
||||||
|
|||||||
@@ -55,14 +55,15 @@ sub refreshpage{&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' cont
|
|||||||
&Header::openbigbox('100%', 'left', '', $errormessage);
|
&Header::openbigbox('100%', 'left', '', $errormessage);
|
||||||
|
|
||||||
if (($cgiparams{'ACTION'} eq 'install') && (! -e $Pakfire::lockfile)) {
|
if (($cgiparams{'ACTION'} eq 'install') && (! -e $Pakfire::lockfile)) {
|
||||||
$cgiparams{'INSPAKS'} =~ s/\|/\ /g;
|
my @pkgs = split(/\|/, $cgiparams{'INSPAKS'});
|
||||||
if ("$cgiparams{'FORCE'}" eq "on") {
|
if ("$cgiparams{'FORCE'}" eq "on") {
|
||||||
&General::system_background("/usr/local/bin/pakfire", "install", "--non-interactive", "--no-colors", $cgiparams{'INSPAKS'});
|
&General::system_background("/usr/local/bin/pakfire", "install", "--non-interactive", "--no-colors", @pkgs);
|
||||||
|
sleep(2);
|
||||||
} else {
|
} else {
|
||||||
&Header::openbox("100%", "center", $Lang::tr{'request'});
|
&Header::openbox("100%", "center", $Lang::tr{'request'});
|
||||||
my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", $cgiparams{'INSPAKS'});
|
my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs);
|
||||||
print <<END;
|
print <<END;
|
||||||
<table><tr><td colspan='2'>$Lang::tr{'pakfire install package'}.$cgiparams{'INSPAKS'}.$Lang::tr{'pakfire possible dependency'}
|
<table><tr><td colspan='2'>$Lang::tr{'pakfire install package'} @pkgs $Lang::tr{'pakfire possible dependency'}
|
||||||
<pre>
|
<pre>
|
||||||
END
|
END
|
||||||
foreach (@output) {
|
foreach (@output) {
|
||||||
@@ -92,15 +93,15 @@ END
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
} elsif (($cgiparams{'ACTION'} eq 'remove') && (! -e $Pakfire::lockfile)) {
|
} elsif (($cgiparams{'ACTION'} eq 'remove') && (! -e $Pakfire::lockfile)) {
|
||||||
|
my @pkgs = split(/\|/, $cgiparams{'DELPAKS'});
|
||||||
$cgiparams{'DELPAKS'} =~ s/\|/\ /g;
|
|
||||||
if ("$cgiparams{'FORCE'}" eq "on") {
|
if ("$cgiparams{'FORCE'}" eq "on") {
|
||||||
&General::system_background("/usr/local/bin/pakfire", "remove", "--non-interactive", "--no-colors", $cgiparams{'DELPAKS'});
|
&General::system_background("/usr/local/bin/pakfire", "remove", "--non-interactive", "--no-colors", @pkgs);
|
||||||
|
sleep(2);
|
||||||
} else {
|
} else {
|
||||||
&Header::openbox("100%", "center", $Lang::tr{'request'});
|
&Header::openbox("100%", "center", $Lang::tr{'request'});
|
||||||
my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", $cgiparams{'DELPAKS'});
|
my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs);
|
||||||
print <<END;
|
print <<END;
|
||||||
<table><tr><td colspan='2'>$Lang::tr{'pakfire uninstall package'}.$cgiparams{'DELPAKS'}.$Lang::tr{'pakfire possible dependency'}
|
<table><tr><td colspan='2'>$Lang::tr{'pakfire uninstall package'} @pkgs $Lang::tr{'pakfire possible dependency'}
|
||||||
<pre>
|
<pre>
|
||||||
END
|
END
|
||||||
foreach (@output) {
|
foreach (@output) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# #
|
# #
|
||||||
# IPFire.org - A linux based firewall #
|
# IPFire.org - A linux based firewall #
|
||||||
# Copyright (C) 2007-2012 IPFire Team <info@ipfire.org> #
|
# Copyright (C) 2007-2021 IPFire Team <info@ipfire.org> #
|
||||||
# #
|
# #
|
||||||
# This program is free software: you can redistribute it and/or modify #
|
# This program is free software: you can redistribute it and/or modify #
|
||||||
# it under the terms of the GNU General Public License as published by #
|
# it under the terms of the GNU General Public License as published by #
|
||||||
@@ -22,17 +22,28 @@
|
|||||||
. /etc/sysconfig/rc
|
. /etc/sysconfig/rc
|
||||||
. $rc_functions
|
. $rc_functions
|
||||||
|
|
||||||
|
TAR_OPTIONS=(
|
||||||
|
--acls
|
||||||
|
--xattrs
|
||||||
|
--xattrs-include='*'
|
||||||
|
--no-overwrite-dir
|
||||||
|
--no-delay-directory-restore
|
||||||
|
--preserve-permissions
|
||||||
|
--numeric-owner
|
||||||
|
)
|
||||||
|
|
||||||
extract_files() {
|
extract_files() {
|
||||||
echo "Extracting files..."
|
echo "Extracting files..."
|
||||||
tar --acls --xattrs --xattrs-include='*' \
|
tar -xavf /opt/pakfire/tmp/files* "${TAR_OPTIONS[@]}" -C /
|
||||||
-xavf /opt/pakfire/tmp/files* --no-overwrite-dir -p --numeric-owner -C /
|
sync
|
||||||
echo "...Finished."
|
echo "...Finished."
|
||||||
}
|
}
|
||||||
|
|
||||||
extract_backup_includes() {
|
extract_backup_includes() {
|
||||||
echo "Extracting backup includes..."
|
echo "Extracting backup includes..."
|
||||||
tar xavf /opt/pakfire/tmp/files* --no-overwrite-dir -p --numeric-owner -C / \
|
tar xavf /opt/pakfire/tmp/files* "${TAR_OPTIONS[@]}" -C / \
|
||||||
var/ipfire/backup/addons/includes
|
var/ipfire/backup/addons/includes
|
||||||
|
sync
|
||||||
echo "...Finished."
|
echo "...Finished."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ function _strip() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Fetch any capabilities
|
||||||
|
local capabilities="$(getfattr --no-dereference --name="security.capability" \
|
||||||
|
--absolute-names --dump "${file}")"
|
||||||
|
|
||||||
local cmd=( "${strip}" )
|
local cmd=( "${strip}" )
|
||||||
|
|
||||||
case "$(file -bi ${file})" in
|
case "$(file -bi ${file})" in
|
||||||
@@ -40,6 +44,11 @@ function _strip() {
|
|||||||
|
|
||||||
echo "Stripping ${file}..."
|
echo "Stripping ${file}..."
|
||||||
${cmd[*]} ${file}
|
${cmd[*]} ${file}
|
||||||
|
|
||||||
|
# Restore capabilities
|
||||||
|
if [ -n "${capabilities}" ]; then
|
||||||
|
setfattr --no-dereference --restore=<(echo "${capabilities}")
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
for dir in ${dirs}; do
|
for dir in ${dirs}; do
|
||||||
|
|||||||
Reference in New Issue
Block a user