Samba-Update auf neues Patchlevel. Jaja, die Sicherheitsluecken oder sowas...

Pakfire:
  * Upgrade-Selektion vorbereitet.
  * UUID-Senden ist abstellbar.
  * Nicht-Interaktiver Modus laesst sich jetzt auch mit -y aktivieren (yum).
  * pakfire upgrade liefert schonmal eine Liste der zu aktualisierenden Paketen.
Eine kleine Macke in der red/update gefixxt.
2 MP3-Tools eingebaut.
Clamav-Postinstall-Prozess und noch so ein dummes Rechteproblem gefixxt.


git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@649 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2007-06-27 21:50:38 +00:00
parent 69dcc42551
commit 4b12280054
12 changed files with 307 additions and 51 deletions

View File

@@ -394,3 +394,4 @@ WARNING: untranslated string: OVPN
WARNING: untranslated string: abort
WARNING: untranslated string: aktiv
WARNING: untranslated string: reload
WARNING: untranslated string: upgrade

View File

@@ -398,3 +398,4 @@ WARNING: untranslated string: OVPN
WARNING: untranslated string: abort
WARNING: untranslated string: aktiv
WARNING: untranslated string: reload
WARNING: untranslated string: upgrade

View File

@@ -19,6 +19,8 @@
* Linux-PAM-0.99.4.0
* Locale-Codes-2.07
* MIME-tools-5.420
* MP3-Info-1.22
* MP3-Tag-0.9709
* Mail-SpamAssassin-3.1.3
* MailTools-1.74
* MoBlock-0.8
@@ -212,6 +214,7 @@
* rrdtool-1.2.15
* rsync-2.6.8
* samba-3.0.25a
* samba-3.0.25b
* screen-4.0.2
* sed-4.1.5
* setserial-2.17

View File

@@ -30,6 +30,7 @@ $pakfiresettings{'VALID'} = '';
$pakfiresettings{'INSPAKS'} = '';
$pakfiresettings{'DELPAKS'} = '';
$pakfiresettings{'AUTOUPDATE'} = '';
$pakfiresettings{'UUID'} = '';
&Header::getcgihash(\%pakfiresettings);
@@ -85,6 +86,7 @@ END
} elsif ($pakfiresettings{'ACTION'} eq "$Lang::tr{'save'}") {
&General::writehash("${General::swroot}/pakfire/settings", \%pakfiresettings);
}
&General::readhash("${General::swroot}/pakfire/settings", \%pakfiresettings);
@@ -95,6 +97,9 @@ my %checked=();
$checked{'AUTOUPDATE'}{'off'} = '';
$checked{'AUTOUPDATE'}{'on'} = '';
$checked{'AUTOUPDATE'}{$pakfiresettings{'AUTOUPDATE'}} = "checked='checked'";
$checked{'UUID'}{'off'} = '';
$checked{'UUID'}{'on'} = '';
$checked{'UUID'}{$pakfiresettings{'UUID'}} = "checked='checked'";
# DPC move error message to top so it is seen!
if ($errormessage) {
@@ -163,12 +168,27 @@ print <<END;
</select>
</table></form>
<br /><hr /><br />
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='100%'>
<tr><td colspan='2'>Zur Verfuegung stehende Updates:
<tr><td width='20%'>&nbsp;<td width='60%' align='center'>
<select name="UPDPAKS" size="5" disabled>
END
&Pakfire::dblist("upgrade", "forweb");
print <<END;
</select>
<td width='20%' align='center' valign='middle'><input type='hidden' name='ACTION' value='upgrade' />
<input type='image' alt='$Lang::tr{'upgrade'}' src='/images/document-save.png' />
</table></form>
<br /><hr /><br />
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='100%'>
<tr><td width='40%' align="right">Automatische Updates taeglich ausfuehren:
<td width='10%' align="left"><input type="checkbox" name="AUTOUPDATE" $checked{'AUTOUPDATE'}{'on'} />
<td width='40%' align="right">Test:
<td width='10%' align="left"><input type="checkbox" name="AUTOUPDATE" $checked{'AUTOUPDATE'}{'on'} />
<td width='40%' align="right">Registrierung am Master-Server:
<td width='10%' align="left"><input type="checkbox" name="UUID" $checked{'UUID'}{'on'} />
<tr><td width='100%' colspan="4" align="right"><input type="submit" name="ACTION" value="$Lang::tr{'save'}" />
</table>
</form>

79
lfs/MP3-Info Normal file
View File

@@ -0,0 +1,79 @@
###############################################################################
# This file is part of the IPCop Firewall. #
# #
# IPCop is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# IPCop is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with IPCop; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
# Makefiles are based on LFSMake, which is #
# Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
# #
###############################################################################
###############################################################################
# Definitions
###############################################################################
include Config
VER = 1.22
THISAPP = MP3-Info-$(VER)
DL_FILE = $(THISAPP).tar.gz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
###############################################################################
# Top-level Rules
###############################################################################
objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_MD5 = ed00c6821951d98c00a70bc02e6cb82f
install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
###############################################################################
# Downloading, checking, md5sum
###############################################################################
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
@$(CHECK)
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
$(subst %,%_MD5,$(objects)) :
@$(MD5)
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && perl Makefile.PL
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install
@rm -rf $(DIR_APP)
@$(POSTBUILD)

79
lfs/MP3-Tag Normal file
View File

@@ -0,0 +1,79 @@
###############################################################################
# This file is part of the IPCop Firewall. #
# #
# IPCop is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# IPCop is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with IPCop; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
# Makefiles are based on LFSMake, which is #
# Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
# #
###############################################################################
###############################################################################
# Definitions
###############################################################################
include Config
VER = 0.9709
THISAPP = MP3-Tag-$(VER)
DL_FILE = $(THISAPP).tar.gz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
###############################################################################
# Top-level Rules
###############################################################################
objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_MD5 = 5514a2caecebf5d77faf0cca840974d6
install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
###############################################################################
# Downloading, checking, md5sum
###############################################################################
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
@$(CHECK)
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
$(subst %,%_MD5,$(objects)) :
@$(MD5)
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && perl Makefile.PL
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install
@rm -rf $(DIR_APP)
@$(POSTBUILD)

View File

@@ -26,7 +26,7 @@
include Config
VER = 3.0.25a
VER = 3.0.25b
THISAPP = samba-$(VER)
DL_FILE = $(THISAPP).tar.gz
@@ -48,7 +48,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_MD5 = cbd33bb5d904ccd8a294a4019743745d
$(DL_FILE)_MD5 = e4979a6aa6f18f0e36bacc25cab7b02d
install : $(TARGET)

View File

@@ -445,6 +445,8 @@ buildipfire() {
ipfiremake Text-Tabs+Wrap
ipfiremake Locale-Country
ipfiremake XML-Parser
ipfiremake MP3-Info
ipfiremake MP3-Tag
ipfiremake glib
ipfiremake GeoIP
ipfiremake fwhits

View File

@@ -37,8 +37,8 @@ IFACE=`cat /var/ipfire/red/iface 2>/dev/null | tr -d '\012'`
REMOTE=`cat /var/ipfire/red/remote-ipaddress 2>/dev/null | tr -d '\012'`
### DNS Settings
DNS1=`cat /var/ipfire/red/dns1 > /dev/null 2>&1 | tr -d '\012'`
DNS2=`cat /var/ipfire/red/dns2 > /dev/null 2>&1 | tr -d '\012'`
DNS1=`cat /var/ipfire/red/dns1 2>/dev/null | tr -d '\012' 2>/dev/null`
DNS2=`cat /var/ipfire/red/dns2 2>/dev/null | tr -d '\012' 2>/dev/null`
echo > /var/ipfire/red/resolv.conf #clear it
[ "$DNS1" != "" ] && echo "nameserver $DNS1" > /var/ipfire/red/resolv.conf
[ "$DNS2" != "" ] && echo "nameserver $DNS2" >> /var/ipfire/red/resolv.conf

View File

@@ -1,6 +1,7 @@
#!/usr/bin/perl -w
require "/opt/pakfire/etc/pakfire.conf";
require "/var/ipfire/general-functions.pl";
use File::Basename;
use File::Copy;
@@ -10,6 +11,9 @@ use Net::Ping;
package Pakfire;
my %pakfiresettings = ();
&General::readhash("${General::swroot}/pakfire/settings", \%pakfiresettings);
sub message {
my $message = shift;
print "$message\n";
@@ -72,22 +76,41 @@ sub fetchfile {
my $ua = LWP::UserAgent->new;
$ua->agent("Pakfire/$Conf::version");
$ua->timeout(5);
#$ua->env_proxy;
my %proxysettings=();
&General::readhash("${General::swroot}/proxy/advanced/settings", \%proxysettings);
if ($_=$proxysettings{'UPSTREAM_PROXY'}) {
my ($peer, $peerport) = (/^(?:[a-zA-Z ]+\:\/\/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/.*?)?$/);
if ($proxysettings{'UPSTREAM_USER'}) {
$ua->proxy("http","http://$proxysettings{'UPSTREAM_USER'}:$proxysettings{'UPSTREAM_PASSWORD'}@"."$peer:$peerport/");
} else {
$ua->proxy("http","http://$peer:$peerport/");
}
}
my $response = $ua->get("http://$host/$file");
my $code = $response->code();
my $log = $response->status_line;
logger("HTTP-Status-Code: $code - $log");
if ( $code eq "500" ) {
message("Giving up: There was no chance to get teh file \"$getfile\" from any available server.\nThere was an error on the way. Please fix it.");
return 1;
}
if ($response->is_success) {
logger("$host sends file: $file.");
if (open(FILE, ">$Conf::cachedir/$bfile")) {
print FILE $response->content;
close(FILE);
logger("Download successfully done from $host (file: $file).");
$allok = 1;
return 0;
} else {
logger("Could not open $Conf::cachedir/$bfile for writing.");
}
} else {
my $log = $response->status_line;
logger("Download $file failed from $host ($proto): $log");
}
}
@@ -184,6 +207,12 @@ sub dblist {
# filter may be: all, notinstalled, installed
my $filter = shift;
my $forweb = shift;
my @meta;
my $file;
my $line;
my $prog;
my ($name, $version, $release);
my @templine;
### Make sure that the list is not outdated.
dbgetlist("noforce");
@@ -191,20 +220,56 @@ sub dblist {
open(FILE, "<$Conf::dbdir/lists/packages_list.db");
my @db = <FILE>;
close(FILE);
my $line;
my @templine;
foreach $line (sort @db) {
@templine = split(/\;/,$line);
if ("$filter" eq "notinstalled") {
next if ( -e "$Conf::dbdir/installed/meta-$templine[0]" );
} elsif ("$filter" eq "installed") {
next unless ( -e "$Conf::dbdir/installed/meta-$templine[0]" );
if ("$filter" eq "upgrade") {
opendir(DIR,"$Conf::dbdir/meta");
my @files = readdir(DIR);
closedir(DIR);
foreach $file (@files) {
next if ( $file eq "." );
next if ( $file eq ".." );
open(FILE, "<$Conf::dbdir/meta/$file");
@meta = <FILE>;
close(FILE);
foreach $line (@meta) {
@templine = split(/\: /,$line);
if ("$templine[0]" eq "Name") {
$name = $templine[1];
chomp($name);
} elsif ("$templine[0]" eq "ProgVersion") {
$version = $templine[1];
chomp($version);
} elsif ("$templine[0]" eq "Release") {
$release = $templine[1];
chomp($release);
}
}
foreach $prog (@db) {
@templine = split(/\;/,$prog);
if (("$name" eq "$templine[0]") && ("$release" < "$templine[2]" )) {
if ("$forweb" eq "forweb") {
print "<option value=\"$name\">Update: $name -- Version: $version -> $templine[1] -- Release: $release -> $templine[2]</option>\n";
} else {
print "Update: $name\nVersion: $version -> $templine[1]\nRelease: $release -> $templine[2]\n\n";
}
}
}
}
if ("$forweb" eq "forweb") {
print "<option value=\"$templine[0]\">$templine[0]-$templine[1]-$templine[2]</option>\n";
} else {
print "Name: $templine[0]\nProgVersion: $templine[1]\nRelease: $templine[2]\n\n";
} else {
my $line;
my @templine;
foreach $line (sort @db) {
@templine = split(/\;/,$line);
if ("$filter" eq "notinstalled") {
next if ( -e "$Conf::dbdir/installed/meta-$templine[0]" );
} elsif ("$filter" eq "installed") {
next unless ( -e "$Conf::dbdir/installed/meta-$templine[0]" );
}
if ("$forweb" eq "forweb") {
print "<option value=\"$templine[0]\">$templine[0]-$templine[1]-$templine[2]</option>\n";
} else {
print "Name: $templine[0]\nProgVersion: $templine[1]\nRelease: $templine[2]\n\n";
}
}
}
}
@@ -314,18 +379,7 @@ sub getsize {
return $templine[1];
}
}
}
sub addsizes { ## Still not working
my @paks = shift;
my $paksize;
my $totalsize = 0;
foreach (@paks) {
$paksize = getsize("$_");
$totalsize = ($totalsize + $paksize) ;
}
return $totalsize;
return 0;
}
sub decryptpak {
@@ -476,12 +530,14 @@ sub makeuuid {
}
sub senduuid {
unless("$Conf::uuid") {
$Conf::uuid = `cat $Conf::dbdir/uuid`;
if ($pakfiresettings{'UUID'} eq "on") {
unless("$Conf::uuid") {
$Conf::uuid = `cat $Conf::dbdir/uuid`;
}
logger("Sending my uuid: $Conf::uuid");
fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid", "$Conf::mainserver");
system("rm -f $Conf::cachedir/counter* 2>/dev/null");
}
logger("Sending my uuid: $Conf::uuid");
fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid", "$Conf::mainserver");
system("rm -f $Conf::cachedir/counter* 2>/dev/null");
}
sub lock {

View File

@@ -19,6 +19,13 @@
unless (@ARGV) {
&Pakfire::usage;
}
foreach (@ARGV) {
if ("$_" =~ "^-") {
$interactive = 0 if ("$_" eq "--non-interactive");
$interactive = 0 if ("$_" eq "-y");
}
}
if ("$ARGV[0]" eq "install") {
&Pakfire::lock("on");
@@ -26,24 +33,23 @@
my @deps;
my @paks;
my @temp;
my @all;
foreach (@ARGV) {
if ("$_" =~ "^--") {
$interactive = 0 if ("$_" eq "--non-interactive");
} else {
push(@paks,$_);
unless ("$_" =~ "^-") {
push(@paks,$_) if $_;
}
}
foreach (@paks) {
@temp = &Pakfire::resolvedeps("$_");
foreach (@temp) { push(@deps,$_) if $_; }
}
my @all;
foreach (@paks) {
push(@all,$_);
push(@all,$_) if $_;
}
foreach (@deps) {
push(@all,$_);
push(@all,$_) if $_;
}
&Pakfire::message("\n\n### Packages to install:");
@@ -53,16 +59,19 @@
&Pakfire::message("# $_ \t\t - $size");
}
&Pakfire::message("\n### Packages to install for dependencies:");
&Pakfire::message("\n### Packages to install for dependencies:") if @deps;
foreach (sort @deps) {
my $size = &Pakfire::getsize("$_");
$size = &Pakfire::beautifysize($size);
&Pakfire::message("# $_ \t\t - $size");
}
my $totalsize = &Pakfire::addsizes("@all");
my $totalsize;
foreach (@all) {
$totalsize = ($totalsize + &Pakfire::getsize("$_"));
}
$totalsize = &Pakfire::beautifysize($totalsize);
&Pakfire::message("\n### Download size: \t ~ $totalsize");
&Pakfire::message("\n### Total size: \t ~ $totalsize\n");
if ($interactive) {
&Pakfire::message("Is this okay? [y/N]");
@@ -97,6 +106,10 @@
$force = "force" if ("$ARGV[1]" eq "--force");
&Pakfire::dbgetlist("$force");
} elsif ("$ARGV[0]" eq "upgrade") {
&Pakfire::dblist("upgrade", "noweb");
} elsif ("$ARGV[0]" eq "list") {
&Pakfire::dblist("all", "noweb");

View File

@@ -3,4 +3,6 @@
extract_files
clamavctrl enable
chown clamav:clamav /usr/share/clamav
/usr/local/bin/clamavctrl enable