Openswan patch fuer Fehler im Realsetup
authormaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Tue, 28 Aug 2007 10:47:06 +0000 (10:47 +0000)
committermaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Tue, 28 Aug 2007 10:47:06 +0000 (10:47 +0000)
Remote CGI fuer ssh tempstart fertig
kleine Korrektur der sshctrl und syslogdctrl

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@849 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

html/cgi-bin/remote.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
lfs/openswan
src/misc-progs/sshctrl.c
src/misc-progs/syslogdctrl.c
src/patches/openswan-2.4.9-realsetup-1.patch [new file with mode: 0644]

index c7b44bf7900f8ecef14203d5670ecddb62de84df..a8daf1d2b0c49ac48bc37306b8ac08d65f6a0c4c 100644 (file)
@@ -22,6 +22,7 @@ require "${General::swroot}/header.pl";
 my %remotesettings=();
 my %checked=();
 my $errormessage='';
+my $counter = 0;
 
 &Header::showhttpheaders();
 
@@ -63,13 +64,16 @@ if ( (($remotesettings{'ACTION'} eq $Lang::tr{'save'}) || ($remotesettings{'ACTI
        {
                &General::log($Lang::tr{'ssh1 disabled'});
        }
-if ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart15'} ){
-       system('/usr/local/bin/sshctrl','tempstart','900') == 0
-               or $errormessage = "$Lang::tr{'bad return code'} " . $?/256;
- }
-elsif ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart30'} ){
-       system('/usr/local/bin/sshctrl','tempstart','1800') == 0
-               or $errormessage = "$Lang::tr{'bad return code'} " . $?/256;
+if ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart15'} || $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart30'} ){
+       if ($remotesettings{'ENABLE_SSH'} eq 'off')
+       {
+                       system ('/usr/bin/touch', "${General::swroot}/remote/enablessh");
+                       system('/usr/local/bin/sshctrl');
+       }
+  if ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart15'} ) { $counter = 900;}
+  elsif ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart30'} ) { $counter = 1800;}
+  system("/usr/local/bin/sshctrl tempstart $counter >/dev/null");
  }
 else {
        system('/usr/local/bin/sshctrl') == 0
index 5246737697c075be8fbc757268d350c0368cad86..fe41cc72bcc1ebfeb7abd566c16dcce2c073fb6d 100644 (file)
 'ssh no auth' => 'Sie haben keinerlei Authentifizierungverfahren zugelassen; dies wird Ihre Anmeldung verhindern',
 'ssh passwords' => 'Passwortbasierte Authentifizierung zulassen',
 'ssh portfw' => 'TCP-Weiterleitung zulassen',
-'ssh tempstart15' => 'SSH-Zugriff für 15 Minuten',
-'ssh tempstart30' => 'SSH-Zugriff für 30 Minuten',
+'ssh tempstart15' => 'SSH-Deamon in 15 Minuten beenden',
+'ssh tempstart30' => 'SSH-Deamon in 30 Minuten beenden',
 'ssh1 disabled' => 'SSHv1 ist deaktiviert, ein Client der Version 2 wird benötigt.',
 'ssh1 enabled' => 'SSHv1 ist aktiviert, Clients mit alten Versionen werden unterstützt.',
 'ssh1 support' => 'Unterstützung für Version 1 des SSH-Protokolls (wird nur für alte Clients benötigt)',
index d80330b6626d464b5e97f018fff8e32d298f53e3..4c836c178e17cb2dacbb6659c5aeda2c806193ab 100644 (file)
 'ssh no auth' => 'You have not allowed any authentication methods; this will stop you logging in',
 'ssh passwords' => 'Allow password based authentication',
 'ssh portfw' => 'Allow TCP Forwarding',
-'ssh tempstart15' => 'SSH Access for 15 Minutes',
-'ssh tempstart30' => 'SSH Access for 30 Minutes',
+'ssh tempstart15' => 'Stop SSH deamon in 15 minutes',
+'ssh tempstart30' => 'Stop SSH deamon in 30 minutes',
 'ssh1 disabled' => 'SSHv1 is disabled, a version 2 client will be required.',
 'ssh1 enabled' => 'SSHv1 is enabled, old clients will be supported.',
 'ssh1 support' => 'Support SSH protocol version 1 (required only for old clients)',
index 9b48a88ccbb06b46b38b6478483873aed60ba959..e1f92a56fdcc773ec7841a8ff8e2d757f976a918 100644 (file)
@@ -91,6 +91,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        ln -sf $(CONFIG_ROOT)/crls  /etc/ipsec.d/crls
        
        cd /usr/lib/ipsec && patch -Np0 < $(DIR_SRC)/src/patches/openswan-2.4.9-startklips-1.patch
+       cd /usr/lib/ipsec && patch -Np0 < $(DIR_SRC)/src/patches/openswan-2.4.9-realsetup-1.patch
        
        #@rm -rf $(DIR_APP)
        @$(POSTBUILD)
index d0799730f3d29887e52a5202a93ce21f9cea4dee..52515ea8e1dedd682e173adf6166fd4f8936896d 100644 (file)
@@ -130,6 +130,7 @@ int main(int argc, char *argv[])
                                sleep(5);
                                unlink("/var/ipfire/remote/enablessh");
                                safe_system("cat /var/ipfire/remote/settings | sed 's/ENABLE_SSH=on/ENABLE_SSH=off/' > /var/ipfire/remote/settings2 && mv /var/ipfire/remote/settings2 /var/ipfire/remote/settings");
+        safe_system("chown nobody.nobody /var/ipfire/remote/settings");
                                snprintf(command, BUFFER_SIZE-1, "sleep %s && /usr/local/bin/sshctrl &", argv[2]);
                                safe_system(command);
        }
index da1774b3a01cd683e53b69ee0cf9ce35780ebc84..aee7c7a38ebf41a07d516ca761c987a10b23c8ca 100644 (file)
@@ -112,7 +112,7 @@ int main(void)
    else
       snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@.\\+\\)$/#\\1/' /etc/syslog.conf >&%d", config_fd );
       
-      snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/*.\\/var\\/log\\/messages/%s \\/var\\/log\\/messages/' /etc/syslog.conf >&%d", varmessages, config_fd );
+      snprintf(buffer, STRING_SIZE - 1, "/bin/sed 's/*.\\/var\\/log\\/messages/%s           \\/var\\/log\\/messages/' /etc/syslog.conf >&%d", varmessages, config_fd );
 
    /* if the return code isn't 0 failsafe */
    if ((rc = unpriv_system(buffer,99,99)) != 0)
diff --git a/src/patches/openswan-2.4.9-realsetup-1.patch b/src/patches/openswan-2.4.9-realsetup-1.patch
new file mode 100644 (file)
index 0000000..a5e6314
--- /dev/null
@@ -0,0 +1,10 @@
+--- programs/_realsetup/_realsetup.in
++++ programs/_realsetup/_realsetup.in
+@@ -193,8 +193,8 @@
+       # preliminaries
+       perform rm -f $lock
+-      mkdir -p rundir > /dev/null 2>/dev/null
+-      mkdir -p subsysdir > /dev/null 2>/dev/null
++      mkdir -p $rundir > /dev/null 2>/dev/null
++      mkdir -p $subsysdir > /dev/null 2>/dev/null