From 5433e2c950a4429da23d18cf49d5da07e1714b5c Mon Sep 17 00:00:00 2001 From: delaco Date: Mon, 10 Jul 2006 16:38:56 +0000 Subject: [PATCH] Hinzugefuegt: * p2protocols-Datei, die vergessen wurde. Geaendert: * Connections.cgi gefixt. * URLFilter - Man kann keinen eigenen Background hochladen, bei der neuen redirect-Seite nichtmehr noetig. * Bootsplash gefixt - Neues Script im Installer. * Installer wieder hergestellt. * Im SSH den Zertifikatslogin per default ausgemacht. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@205 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- config/cfgroot/p2protocols | 9 ++ config/cfgroot/ssh-settings | 2 +- html/cgi-bin/connections.cgi | 92 +++++++++---------- html/cgi-bin/urlfilter.cgi | 23 ----- lfs/installer | 2 +- lfs/squidguard | 3 +- .../install/installbootsplash.sh | 7 ++ src/install+setup/install/main.c | 24 ++--- 8 files changed, 74 insertions(+), 88 deletions(-) create mode 100644 config/cfgroot/p2protocols create mode 100644 src/install+setup/install/installbootsplash.sh diff --git a/config/cfgroot/p2protocols b/config/cfgroot/p2protocols new file mode 100644 index 0000000000..78c610115f --- /dev/null +++ b/config/cfgroot/p2protocols @@ -0,0 +1,9 @@ +Bittorrent;bit;on; +Edonkey;edk;on; +KaZaA;kazaa;on; +Gnutella;gnu;on; +DirectConnect;dc;on; +Applejuice;apple;on; +WinMX;winmx;on; +SoulSeek;soul;on; +Ares;ares;on; \ No newline at end of file diff --git a/config/cfgroot/ssh-settings b/config/cfgroot/ssh-settings index a96c9f712d..6c9ef76650 100644 --- a/config/cfgroot/ssh-settings +++ b/config/cfgroot/ssh-settings @@ -1,4 +1,4 @@ -ENABLE_SSH_KEYS=on +ENABLE_SSH_KEYS=off ENABLE_SSH_PROTOCOL1=off ENABLE_SSH_PASSWORDS=on ENABLE_SSH_PORTFW=off diff --git a/html/cgi-bin/connections.cgi b/html/cgi-bin/connections.cgi index 43927f553a..9c5756939b 100644 --- a/html/cgi-bin/connections.cgi +++ b/html/cgi-bin/connections.cgi @@ -6,10 +6,8 @@ # # (c) 2006 Franck - add sorting+filtering capability # -# $Id: connections.cgi,v 1.6.2.12 2006/02/27 19:48:46 franck78 Exp $ -# -# Setup GREEN, ORANGE, IPCOP, VPN CIDR networks, masklengths and colours only once +# Setup GREEN, ORANGE, IPFIRE, VPN CIDR networks, masklengths and colours only once my @network=(); my @masklen=(); @@ -20,8 +18,8 @@ use Net::IPv4Addr qw( :all ); use strict; # enable only the following on debugging purpose -#use warnings; -#use CGI::Carp 'fatalsToBrowser'; +use warnings; +use CGI::Carp 'fatalsToBrowser'; require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; @@ -74,6 +72,38 @@ push(@network, '127.0.0.1'); push(@masklen, '255.255.255.255' ); push(@colour, ${Header::colourfw} ); +# Add Orange Network +if ($netsettings{'ORANGE_DEV'}) { + push(@network, $netsettings{'ORANGE_NETADDRESS'}); + push(@masklen, $netsettings{'ORANGE_NETMASK'} ); + push(@colour, ${Header::colourorange} ); + # Add Orange Routes to Array + @routes = `/sbin/route -n | /bin/grep $netsettings{'ORANGE_DEV'}`; + foreach my $route (@routes) { + chomp($route); + my @temp = split(/[\t ]+/, $route); + push(@network, $temp[0]); + push(@masklen, $temp[2]); + push(@colour, ${Header::colourorange} ); + } +} + +# Add Blue Network +if ($netsettings{'BLUE_DEV'}) { + push(@network, $netsettings{'BLUE_NETADDRESS'}); + push(@masklen, $netsettings{'BLUE_NETMASK'} ); + push(@colour, ${Header::colourblue} ); + # Add Blue Routes to Array + @routes = `/sbin/route -n | /bin/grep $netsettings{'BLUE_DEV'}`; + foreach my $route (@routes) { + chomp($route); + my @temp = split(/[\t ]+/, $route); + push(@network, $temp[0]); + push(@masklen, $temp[2]); + push(@colour, ${Header::colourblue} ); + } +} + # Add OpenVPN net and RED/BLUE/ORANGE entry (when appropriate) if (-e "${General::swroot}/ovpn/settings") { my %ovpnsettings = (); @@ -108,38 +138,6 @@ if (-e "${General::swroot}/ovpn/settings") { } } -# Add Orange Network -if ($netsettings{'ORANGE_DEV'}) { - push(@network, $netsettings{'ORANGE_NETADDRESS'}); - push(@masklen, $netsettings{'ORANGE_NETMASK'} ); - push(@colour, ${Header::colourorange} ); - # Add Orange Routes to Array - @routes = `/sbin/route -n | /bin/grep $netsettings{'ORANGE_DEV'}`; - foreach my $route (@routes) { - chomp($route); - my @temp = split(/[\t ]+/, $route); - push(@network, $temp[0]); - push(@masklen, $temp[2]); - push(@colour, ${Header::colourorange} ); - } -} - -# Add Blue Network -if ($netsettings{'BLUE_DEV'}) { - push(@network, $netsettings{'BLUE_NETADDRESS'}); - push(@masklen, $netsettings{'BLUE_NETMASK'} ); - push(@colour, ${Header::colourblue} ); - # Add Blue Routes to Array - @routes = `/sbin/route -n | /bin/grep $netsettings{'BLUE_DEV'}`; - foreach my $route (@routes) { - chomp($route); - my @temp = split(/[\t ]+/, $route); - push(@network, $temp[0]); - push(@masklen, $temp[2]); - push(@colour, ${Header::colourblue} ); - } -} - # Add STATIC RED aliases if ($netsettings{'RED_DEV'}) { # We have a RED eth iface @@ -188,12 +186,15 @@ my @list_state = ($Lang::tr{'all'}, 'SYN_SENT', 'SYN_RECV', 'ESTABLISHED', 'FIN_ 'CLOSE_WAIT', 'LAST_ACK', 'TIME_WAIT', 'CLOSE', 'LISTEN'); my @list_mark = ($Lang::tr{'all'}, '[ASSURED]', '[UNREPLIED]'); my @list_sort = ('orgsip','protocol', 'expires', 'status', 'orgdip', 'orgsp', - 'orgdp', 'exsip', 'exdip', 'exsp', 'exdp'); + 'orgdp', 'exsip', 'exdip', 'exsp', 'exdp', 'marked'); # init or silently correct unknown value... if ( ! grep ( /^$cgiparams{'SEE_PROTO'}$/ , @list_proto )) { $cgiparams{'SEE_PROTO'} = $list_proto[0] }; if ( ! grep ( /^$cgiparams{'SEE_STATE'}$/ , @list_state )) { $cgiparams{'SEE_STATE'} = $list_state[0] }; -if ( ! grep ( /^$cgiparams{'SEE_MARK'}$/ , @list_mark )) { $cgiparams{'SEE_MARK'} = $list_mark[0] }; +if ( ($cgiparams{'SEE_MARK'} ne $Lang::tr{'all'}) && # ok the grep should work but it doesn't because of + ($cgiparams{'SEE_MARK'} ne '[ASSURED]') && # the '[' & ']' interpreted as list separator. + ($cgiparams{'SEE_MARK'} ne '[UNREPLIED]') # So, explicitly enumerate items. + ) { $cgiparams{'SEE_MARK'} = $list_mark[0] }; if ( ! grep ( /^$cgiparams{'SEE_SORT'}$/ , @list_sort )) { $cgiparams{'SEE_SORT'} = $list_sort[0] }; # *.*.*.* or a valid IP if ( $cgiparams{'SEE_SRC'} !~ /^(\*\.\*\.\*\.\*\.|\d+\.\d+\.\d+\.\d+)$/) { $cgiparams{'SEE_SRC'} = '*.*.*.*' }; @@ -396,6 +397,7 @@ my $menu_sort = &make_select ('SEE_SORT', $cgiparams{'SEE_SORT'}, @list_sort) &Header::openbox('100%', 'left', $Lang::tr{'connection tracking'}); print < @@ -419,28 +421,26 @@ print <$Lang::tr{'marked'} - + - + - END ; foreach my $entry (sort sort_entries keys %entries) { - - print ""; my $orgsipcolour = &ipcolour( $entries{$entry}->{orgsip} ); my $orgdipcolour = &ipcolour( $entries{$entry}->{orgdip} ); my $exsipcolour = &ipcolour( $entries{$entry}->{exsip} ); my $exdipcolour = &ipcolour( $entries{$entry}->{exdip} ); print < @@ -467,7 +467,7 @@ END ; } -print "$unknownlines
$Lang::tr{'legend'} : $Lang::tr{'lan'}$Lang::tr{'use'}
$menu_proto  $menu_state $menu_src $menu_dest $Lang::tr{'sort ascending'}:$menu_sort $menu_mark
$entries{$entry}->{protocol} $entries{$entry}->{expires} $entries{$entry}->{status}
"; +print "$unknownlines"; &Header::closebox(); &Header::closebigbox(); @@ -500,7 +500,7 @@ sub make_select ($,$,$) { foreach my $value (@_) { my $check = $selected eq $value ? "selected='selected'" : ''; - $select .= ""; } $select .= ""; return $select; diff --git a/html/cgi-bin/urlfilter.cgi b/html/cgi-bin/urlfilter.cgi index 33e52ae13d..3b3b9aac0f 100644 --- a/html/cgi-bin/urlfilter.cgi +++ b/html/cgi-bin/urlfilter.cgi @@ -147,7 +147,6 @@ if (($filtersettings{'ACTION'} eq $Lang::tr{'save'}) || ($filtersettings{'ACTION'} eq $Lang::tr{'urlfilter save and restart'}) || ($filtersettings{'ACTION'} eq $Lang::tr{'urlfilter upload file'}) || ($filtersettings{'ACTION'} eq $Lang::tr{'urlfilter remove file'}) || - ($filtersettings{'ACTION'} eq $Lang::tr{'urlfilter upload background'}) || ($filtersettings{'ACTION'} eq $Lang::tr{'urlfilter upload blacklist'}) || ($filtersettings{'ACTION'} eq $Lang::tr{'urlfilter backup'}) || ($filtersettings{'ACTION'} eq $Lang::tr{'urlfilter restore'})) @@ -187,17 +186,6 @@ if (($filtersettings{'ACTION'} eq $Lang::tr{'save'}) || } - if ($filtersettings{'ACTION'} eq $Lang::tr{'urlfilter upload background'}) - { - &Header::getcgihash(\%filtersettings, {'wantfile' => 1, 'filevar' => 'BACKGROUND'}); - - if (copy($filtersettings{'BACKGROUND'}, "/home/httpd/html/images/urlfilter/background.jpg") != 1) - { - $errormessage = $!; - goto ERROR; - } - } - if ($filtersettings{'ACTION'} eq $Lang::tr{'urlfilter upload blacklist'}) { &Header::getcgihash(\%filtersettings, {'wantfile' => 1, 'filevar' => 'UPDATEFILE'}); @@ -1379,17 +1367,6 @@ print <  - - - - - - - - - - -
$Lang::tr{'urlfilter background image'}

$Lang::tr{'urlfilter background text'}:
 

diff --git a/lfs/installer b/lfs/installer index 077c02ba48..6b34f7f56b 100644 --- a/lfs/installer +++ b/lfs/installer @@ -65,6 +65,6 @@ $(TARGET) : cd $(DIR_APP)/install && make CFLAGS="-Os -fomit-frame-pointer -Wall \ -DNAME='\"$(NAME)\"' -DSNAME='\"$(SNAME)\"' -DVERSION='\"$(VERSION)\"' \ -DSLOGAN='\"$(SLOGAN)\"' -DCONFIG_ROOT='\"$(CONFIG_ROOT)\"' -DKERNEL_VERSION='\"$(KVER)\"'" - cd $(DIR_APP)/install && install -m 0755 install probescsi.sh /install/initrd/bin + cd $(DIR_APP)/install && install -v -m 0755 install probescsi.sh installbootsplash.sh /install/initrd/bin @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/lfs/squidguard b/lfs/squidguard index 9f24478f90..5145ba460c 100644 --- a/lfs/squidguard +++ b/lfs/squidguard @@ -98,7 +98,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) /bin/tar --no-same-owner -xzf $(DIR_CONF)/urlfilter/blacklists.tar.gz -C /var/ipfire/urlfilter /usr/bin/perl $(DIR_CONF)/urlfilter/makeconf.pl chown -R nobody:nobody /var/ipfire/urlfilter - chown -R nobody:nobody /home/httpd/html/images/urlfilter + chmod 755 /home/httpd/html/images/urlfilter + chmod 644 /home/httpd/html/images/urlfilter/* chown -R nobody:nobody /home/httpd/html/repository chown -R squid:squid /var/log/squidGuard diff --git a/src/install+setup/install/installbootsplash.sh b/src/install+setup/install/installbootsplash.sh new file mode 100644 index 0000000000..3ff39b7a5d --- /dev/null +++ b/src/install+setup/install/installbootsplash.sh @@ -0,0 +1,7 @@ +#!/bin/sh +if [ -e /harddisk/boot/ipfirerd.img ]; then + /sbin/chroot /harddisk /sbin/splash -s -f /boot/splash/config/bootsplash-1024x768.cfg >> /harddisk/boot/ipfirerd.img + /sbin/chroot /harddisk /sbin/splash -s -f /boot/splash/config/bootsplash-1024x768.cfg >> /harddisk/boot/ipfirerd-smp.img +else + /sbin/chroot /harddisk /sbin/splash -s -f /boot/splash/config/bootsplash-1024x768.cfg > /harddisk/boot/initrd.splash +fi diff --git a/src/install+setup/install/main.c b/src/install+setup/install/main.c index fab8de3d56..2ca2f07da0 100644 --- a/src/install+setup/install/main.c +++ b/src/install+setup/install/main.c @@ -193,16 +193,13 @@ int main(int argc, char *argv[]) sprintf (title, "%s v%s - %s", NAME, VERSION, SLOGAN); newtWinMessage(title, ctr[TR_OK], message); - /* sprintf(message, ctr[TR_SELECT_INSTALLATION_MEDIA_LONG], NAME); - * rc = newtWinMenu(ctr[TR_SELECT_INSTALLATION_MEDIA], message, - * 50, 5, 5, 6, installtypes, &installtype, ctr[TR_OK], - * ctr[TR_CANCEL], NULL); - * - * if (rc == 2) - * goto EXIT; - * This is for avoiding the question for a network installation. Set to cdrom. - */ - sprintf(installtype, CDROM_INSTALL, NAME); + sprintf(message, ctr[TR_SELECT_INSTALLATION_MEDIA_LONG], NAME); + rc = newtWinMenu(ctr[TR_SELECT_INSTALLATION_MEDIA], message, + 50, 5, 5, 6, installtypes, &installtype, ctr[TR_OK], + ctr[TR_CANCEL], NULL); + + if (rc == 2) + goto EXIT; if (installtype == CDROM_INSTALL) { @@ -963,12 +960,7 @@ RESTORE: goto EXIT; } /* Set Bootsplash */ - if ((handle = fopen("/scsidriver", "r"))) - mysystem("/bin/chroot /harddisk /sbin/splash -s -f /boot/splash/config/bootsplash-1024x768.cgf >> /harddisk/boot/ipfirerd.img"); - else - mysystem("/bin/chroot /harddisk /sbin/splash -s -f /boot/splash/config/bootsplash-1024x768.cgf > /harddisk/boot/initrd.splash"); - if ((handle = fopen("/scsidriver", "r"))) - mysystem("/bin/chroot /harddisk /sbin/splash -s -f /boot/splash/config/bootsplash-1024x768.cgf >> /harddisk/boot/ipfirerd-smp.img"); + mysystem("/bin/installbootsplash.sh"); mysystem("/bin/chroot /harddisk /bin/umount -n /proc"); #endif #ifdef __alpha__ -- 2.39.2