diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 8b5da93e3..c167ca73d 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -3,12 +3,13 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2011 CoolStream International Ltd + Copyright (C) 2011 Stefan Seyfried License: GPL 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 - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -17,8 +18,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifdef HAVE_CONFIG_H #include @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -1415,7 +1416,7 @@ bool CRecordManager::RunStartScript(void) return false; puts("[neutrino.cpp] executing " NEUTRINO_RECORDING_START_SCRIPT "."); - if (system(NEUTRINO_RECORDING_START_SCRIPT) != 0) { + if (safe_system(NEUTRINO_RECORDING_START_SCRIPT) != 0) { perror(NEUTRINO_RECORDING_START_SCRIPT " failed"); return false; } @@ -1429,7 +1430,7 @@ bool CRecordManager::RunStopScript(void) return false; puts("[neutrino.cpp] executing " NEUTRINO_RECORDING_ENDED_SCRIPT "."); - if (system(NEUTRINO_RECORDING_ENDED_SCRIPT) != 0) { + if (safe_system(NEUTRINO_RECORDING_ENDED_SCRIPT) != 0) { perror(NEUTRINO_RECORDING_ENDED_SCRIPT " failed"); return false; } diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 1300d2b6b..6ca7746a2 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -5,6 +5,7 @@ (C) 2002-2008 the tuxbox project contributors (C) 2008 Novell, Inc. Author: Stefan Seyfried + (C) 2011 Stefan Seyfried Homepage: http://dbox.cyberphoria.org/ @@ -20,7 +21,7 @@ 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 - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -29,8 +30,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifdef HAVE_CONFIG_H @@ -68,6 +68,7 @@ #include #include +#include #include #include @@ -315,7 +316,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) g_Sectionsd->setPauseScanning(true); puts("[audioplayer.cpp] executing " AUDIOPLAYER_START_SCRIPT "."); - if (system(AUDIOPLAYER_START_SCRIPT) != 0) + if (safe_system(AUDIOPLAYER_START_SCRIPT) != 0) perror("Datei " AUDIOPLAYER_START_SCRIPT " fehlt.Bitte erstellen, wenn gebraucht.\nFile " AUDIOPLAYER_START_SCRIPT " not found. Please create if needed.\n"); show(); @@ -327,7 +328,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_frameBuffer->paintBackground(); puts("[audioplayer.cpp] executing " AUDIOPLAYER_END_SCRIPT "."); - if (system(AUDIOPLAYER_END_SCRIPT) != 0) + if (safe_system(AUDIOPLAYER_END_SCRIPT) != 0) perror("Datei " AUDIOPLAYER_END_SCRIPT " fehlt. Bitte erstellen, wenn gebraucht.\nFile " AUDIOPLAYER_END_SCRIPT " not found. Please create if needed.\n"); g_Zapit->unlockPlayBack(); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 814238cb4..767b072f5 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -3,6 +3,7 @@ Movieplayer (c) 2003, 2004 by gagga Based on code by Dirch, obi and the Metzler Bros. Thanks. + (C) 2011 Stefan Seyfried Copyright (C) 2011 CoolStream International Ltd @@ -30,6 +31,7 @@ #include #include +#include #include #include #include @@ -175,7 +177,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) startposition = 0; puts("[movieplayer.cpp] executing " MOVIEPLAYER_START_SCRIPT "."); - if (system(MOVIEPLAYER_START_SCRIPT) != 0) + if (safe_system(MOVIEPLAYER_START_SCRIPT) != 0) perror(MOVIEPLAYER_START_SCRIPT " failed"); isMovieBrowser = false; @@ -213,7 +215,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) bookmarkmanager->flush(); puts("[movieplayer.cpp] executing " MOVIEPLAYER_END_SCRIPT "."); - if (system(MOVIEPLAYER_END_SCRIPT) != 0) + if (safe_system(MOVIEPLAYER_END_SCRIPT) != 0) perror(MOVIEPLAYER_END_SCRIPT " failed"); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index ecd983552..70e57c21d 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -2,21 +2,13 @@ Neutrino-GUI - DBoxII-Project Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - + Copyright (C) 2011 Stefan Seyfried License: GPL 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 - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -25,8 +17,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifdef HAVE_CONFIG_H @@ -52,6 +43,7 @@ #include #include +#include #include #include @@ -250,7 +242,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) if(!manual) { g_RCInput->close_click(); - if (system(NEUTRINO_SCAN_START_SCRIPT) != 0) + if (safe_system(NEUTRINO_SCAN_START_SCRIPT) != 0) perror(NEUTRINO_SCAN_START_SCRIPT " failed"); } @@ -321,7 +313,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) g_Zapit->stopScan(); if(!manual) { - if (system(NEUTRINO_SCAN_STOP_SCRIPT) != 0) + if (safe_system(NEUTRINO_SCAN_STOP_SCRIPT) != 0) perror(NEUTRINO_SCAN_STOP_SCRIPT " failed"); g_RCInput->open_click(); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 77097a610..ffcb8d08e 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3,15 +3,16 @@ Copyright (C) 2001 Steffen Hehn 'McClean' and some other guys - Homepage: http://dbox.cyberphoria.org/ + Copyright (C) 2006-2011 Stefan Seyfried + my contributions are GPL3+ only Copyright (C) 2011 CoolStream International Ltd License: GPL 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 - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -20,8 +21,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA + along with this program. If not, see . + */ #ifdef HAVE_CONFIG_H @@ -99,6 +100,7 @@ #include #include #include +#include #include @@ -570,7 +572,7 @@ int CNeutrinoApp::loadSetup(const char * fname) if(strcmp(g_settings.timeshiftdir, g_settings.network_nfs_recordingdir)) { char buf[512]; sprintf(buf, "rm -f %s/*_temp.ts %s/*_temp.xml &", timeshiftDir, timeshiftDir); - system(buf); + safe_system(buf); } } g_settings.record_hours = configfile.getInt32( "record_hours", 4 ); @@ -2689,7 +2691,7 @@ _repeat: return messages_return::handled; } else if( msg == NeutrinoMessages::ANNOUNCE_RECORD) { - system(NEUTRINO_RECORDING_TIMER_SCRIPT); + safe_system(NEUTRINO_RECORDING_TIMER_SCRIPT); if (g_settings.recording_type == RECORDING_FILE) { char * recordingDir = ((CTimerd::RecordingInfo*)data)->recordingDir; for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { @@ -2697,13 +2699,13 @@ _repeat: printf("[neutrino] waking up %s (%s)\n",g_settings.network_nfs_ip[i].c_str(),recordingDir); std::string command = "ether-wake "; command += g_settings.network_nfs_mac[i]; - if(system(command.c_str()) != 0) + if(safe_system(command.c_str()) != 0) perror("ether-wake failed"); break; } } if(has_hdd) { - system("(rm /media/sda1/.wakeup; touch /media/sda1/.wakeup; sync) > /dev/null 2> /dev/null &"); // wakeup hdd + safe_system("(rm /media/sda1/.wakeup; touch /media/sda1/.wakeup; sync) > /dev/null 2> /dev/null &"); // wakeup hdd } } if( g_settings.recording_zap_on_announce ) { @@ -2949,7 +2951,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) if(retcode) { const char *neutrino_enter_deepstandby_script = CONFIGDIR "/deepstandby.on"; printf("[%s] executing %s\n",__FILE__ ,neutrino_enter_deepstandby_script); - if (system(neutrino_enter_deepstandby_script) != 0) + if (safe_system(neutrino_enter_deepstandby_script) != 0) perror(neutrino_enter_deepstandby_script ); printf("entering off state\n"); @@ -3246,7 +3248,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff ) standby_channel_id = CZapit::getInstance()->GetCurrentChannelID(); puts("[neutrino.cpp] executing " NEUTRINO_ENTER_STANDBY_SCRIPT "."); - if (system(NEUTRINO_ENTER_STANDBY_SCRIPT) != 0) + if (safe_system(NEUTRINO_ENTER_STANDBY_SCRIPT) != 0) perror(NEUTRINO_ENTER_STANDBY_SCRIPT " failed"); if(!CRecordManager::getInstance()->RecordingStatus()) @@ -3291,7 +3293,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff ) } puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_STANDBY_SCRIPT "."); - if (system(NEUTRINO_LEAVE_STANDBY_SCRIPT) != 0) + if (safe_system(NEUTRINO_LEAVE_STANDBY_SCRIPT) != 0) perror(NEUTRINO_LEAVE_STANDBY_SCRIPT " failed"); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); diff --git a/src/sectionsd/sectionsd.cpp b/src/sectionsd/sectionsd.cpp index 3ad454c83..c4dfd4e4a 100644 --- a/src/sectionsd/sectionsd.cpp +++ b/src/sectionsd/sectionsd.cpp @@ -8,11 +8,11 @@ // // Homepage: http://dbox2.elxsi.de // -// Copyright (C) 2008, 2009 Stefan Seyfried +// Copyright (C) 2008-2011 Stefan Seyfried // // 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 -// the Free Software Foundation; either version 2 of the License, or +// the Free Software Foundation; either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, @@ -21,9 +21,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// +// along with this program. If not, see . // // @@ -79,6 +77,7 @@ #include #include #include +#include #include "SIutils.hpp" #include "SIservices.hpp" @@ -6962,7 +6961,7 @@ static void *timeThread(void *) } } - else if ( ntpenable && system( ntp_system_cmd.c_str() ) == 0) + else if (ntpenable && safe_system(ntp_system_cmd.c_str()) == 0) { time_t actTime; actTime=time(NULL); diff --git a/src/system/configure_network.cpp b/src/system/configure_network.cpp index 943abeecd..c0cbf2903 100644 --- a/src/system/configure_network.cpp +++ b/src/system/configure_network.cpp @@ -2,10 +2,11 @@ * $port: configure_network.cpp,v 1.7 2009/11/20 22:44:19 tuxbox-cvs Exp $ * * (C) 2003 by thegoodguy + * (C) 2011 Stefan Seyfried * * 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 - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -14,9 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * + * along with this program. If not, see . */ #include #include /* perror... */ @@ -31,6 +30,7 @@ #include #include #include +#include CNetworkConfig::CNetworkConfig() { @@ -240,7 +240,7 @@ void CNetworkConfig::startNetwork(void) #ifdef DEBUG printf("CNetworkConfig::startNetwork: %s\n", cmd.c_str()); #endif - system(cmd.c_str()); + safe_system(cmd.c_str()); if (!inet_static) { init_vars(); @@ -254,7 +254,7 @@ void CNetworkConfig::stopNetwork(void) #ifdef DEBUG printf("CNetworkConfig::stopNetwork: %s\n", cmd.c_str()); #endif - system(cmd.c_str()); + safe_system(cmd.c_str()); }