From: ms Date: Wed, 27 Jun 2007 21:50:38 +0000 (+0000) Subject: Samba-Update auf neues Patchlevel. Jaja, die Sicherheitsluecken oder sowas... X-Git-Tag: v2.3-beta1~610 X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=4b122800545ee8864b4dd9d4cfed7f247ba414d5 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 --- diff --git a/doc/language_issues.de b/doc/language_issues.de index 8595591484..38a18322f6 100644 --- a/doc/language_issues.de +++ b/doc/language_issues.de @@ -394,3 +394,4 @@ WARNING: untranslated string: OVPN WARNING: untranslated string: abort WARNING: untranslated string: aktiv WARNING: untranslated string: reload +WARNING: untranslated string: upgrade diff --git a/doc/language_issues.en b/doc/language_issues.en index 6e5db73622..3be8c9dc3b 100644 --- a/doc/language_issues.en +++ b/doc/language_issues.en @@ -398,3 +398,4 @@ WARNING: untranslated string: OVPN WARNING: untranslated string: abort WARNING: untranslated string: aktiv WARNING: untranslated string: reload +WARNING: untranslated string: upgrade diff --git a/doc/packages-list.txt b/doc/packages-list.txt index 5f7bf7b328..8e16f97d17 100644 --- a/doc/packages-list.txt +++ b/doc/packages-list.txt @@ -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 diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index ccde0298c3..b26fb1c060 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -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 <


+
+ +
Zur Verfuegung stehende Updates: +
  + + +
+


Automatische Updates taeglich ausfuehren: - Test: - + Registrierung am Master-Server: +
diff --git a/lfs/MP3-Info b/lfs/MP3-Info new file mode 100644 index 0000000000..4465b3a1f7 --- /dev/null +++ b/lfs/MP3-Info @@ -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 # +# # +############################################################################### + +############################################################################### +# 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) diff --git a/lfs/MP3-Tag b/lfs/MP3-Tag new file mode 100644 index 0000000000..30ccdcfa76 --- /dev/null +++ b/lfs/MP3-Tag @@ -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 # +# # +############################################################################### + +############################################################################### +# 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) diff --git a/lfs/samba b/lfs/samba index 4b23005793..96f6e5d8ce 100644 --- a/lfs/samba +++ b/lfs/samba @@ -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) diff --git a/make.sh b/make.sh index 2487b94abc..bf2bd8e9ce 100755 --- a/make.sh +++ b/make.sh @@ -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 diff --git a/src/initscripts/init.d/net/red/update b/src/initscripts/init.d/net/red/update index 342f6359c7..566bb65ef0 100644 --- a/src/initscripts/init.d/net/red/update +++ b/src/initscripts/init.d/net/red/update @@ -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 diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index 6e416f915c..e453768dba 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -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 = ; 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 = ; + 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 "\n"; + } else { + print "Update: $name\nVersion: $version -> $templine[1]\nRelease: $release -> $templine[2]\n\n"; + } + } + } } - if ("$forweb" eq "forweb") { - print "\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 "\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 { diff --git a/src/pakfire/pakfire b/src/pakfire/pakfire index 0deb6562c7..cdf0b619c3 100644 --- a/src/pakfire/pakfire +++ b/src/pakfire/pakfire @@ -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"); diff --git a/src/paks/clamav/install.sh b/src/paks/clamav/install.sh index f2f4be4f45..cdfc81cd15 100644 --- a/src/paks/clamav/install.sh +++ b/src/paks/clamav/install.sh @@ -3,4 +3,6 @@ extract_files -clamavctrl enable +chown clamav:clamav /usr/share/clamav + +/usr/local/bin/clamavctrl enable