summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-01-05 23:37:19 (UTC)
committer mickeyl <mickeyl>2004-01-05 23:37:19 (UTC)
commit4b272b07b86e4dce14ab71054a3741fa9ad33572 (patch) (side-by-side diff)
tree381bf51d8e3258cbd15d36815b13dcfcac33845c
parentfa6a2e24a70be69724387355970814c0fb63701d (diff)
downloadopie-4b272b07b86e4dce14ab71054a3741fa9ad33572.zip
opie-4b272b07b86e4dce14ab71054a3741fa9ad33572.tar.gz
opie-4b272b07b86e4dce14ab71054a3741fa9ad33572.tar.bz2
add -nocheck command line option
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/ChangeLog1
-rw-r--r--noncore/net/wellenreiter/gui/main.cpp101
2 files changed, 60 insertions, 42 deletions
diff --git a/noncore/net/wellenreiter/ChangeLog b/noncore/net/wellenreiter/ChangeLog
index 55e13fc..755ed76 100644
--- a/noncore/net/wellenreiter/ChangeLog
+++ b/noncore/net/wellenreiter/ChangeLog
@@ -1,72 +1,73 @@
2004-??-?? Michael Lauer <mickey@Vanille.de>
+ * Added command line option "-nocheck" to skip non-root and dhcp tests
* Improved the speed reading the manufacturer list
* GPS coordinates are now presented in the DMS (as opposed to decimal) format
2003-12-18 Michael Lauer <mickey@Vanille.de>
* Released as Version 1.0.2 (Development Snapshot)
* Added automatic uploading of capture files to "The Capture Dump" site at
http://www.Vanille.de/projects/capturedump.spy
* Initial reading of the manufacturer database happens now in background
* Removed deprecated setMonitorMode() API ==> Use setMode( "monitor" ) now.
The monitor mode now tries to use the standard IW_MODE_MONITOR first. If that
doesn't work, it falls back to using the proprietary iwpriv commands
2003-11-30 Michael Lauer <mickey@Vanille.de>
* Released as Version 1.0.1 (Development Snapshot)
* Fixed ARP decoding for wired networks.
Interestingly, 802.11 encapsulates these in IP packets, while wired ethernet just tags the type_of_protocol.
* Added reading GPS data from a gps daemon.
* Started preparations for utilizing Wellenreiter II in wired networks.
* Implemented persistant configuration interface and retriggerable auto detection.
* Added QCOP interface for talking to opie-networksettings.
* Added parsing of DHCP packets and detecting DHCP servers.
* Overhauled the configuration window and started with the customizable event system.
* Added disabling the screensaver.
* Added automatic opening and scrolling to the network tree if a new station appears.
2003-05-10 Michael Lauer <mickey@Vanille.de>
* Released as Version 1.0 (Stable)
* Added restarting the dhcp client if having killed it before.
* Decouple dump files from live capture to shift control over 'what' is dumped to applications.
2003-05-05 Michael Lauer <mickey@Vanille.de>
* Released as Version 1.0-RC1 (Release Candidate)
* Fixed rare segfaults while sniffing and operating the GUI simultaenously.
* Parse more data packets and detect more participating stations.
* Added live graph window showing the signal strength on all channels.
* Added parsing ARP packets and identifying IP addresses of participating stations.
* Added parsing with optionally enabled PRISM headers (signal strength).
2003-04-12 Michael Lauer <mickey@Vanille.de>
* Released as Version 1.0 (Beta)
* GUI enhancements in the Menubar and the Toolbar.
* Improved keyboard handling.
* Added sanity checks for running Wellenreiter II as non-root or with dhcp clients in the background.
* Add writing and replaying of libpcap compatible capture files.
2003-04-08 Michael Lauer <mickey@Vanille.de>
* Released as Version 0.2 (Alpha)
* Closed memory leak in packet capturer.
* Fixed client stations appearing under essid as access points.
* Fixed false WEP reporting in some cases.
* Started with inspecting data packages.
* Add detecting associated client stations in infrastructural networks (if they transmit data).
* Worked around buggy hostap drivers writing past fixed-length-structures on arm.
* Added dynamic checking of available private ioctls.
* Added a saveable hex window for packet dissection.
2003-03-30 Michael Lauer <mickey@Vanille.de>
* Released as Version 0.1 (Alpha)
2003-03-25 Michael Lauer <mickey@Vanille.de>
* Rewrote Wellenreiter II from scratch - including the sniffing engine.
* Beacon inspection works and finds ad-hoc networks and managed networks.
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp
index 55a5260..dd757b5 100644
--- a/noncore/net/wellenreiter/gui/main.cpp
+++ b/noncore/net/wellenreiter/gui/main.cpp
@@ -1,114 +1,131 @@
/**********************************************************************
** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
**
** This file is part of Opie Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "mainwindow.h"
#ifdef QWS
#include <opie2/oapplication.h>
#else
#include <qapplication.h>
#endif
#include <qmessagebox.h>
#include <qstringlist.h>
// ==> OProcess
#include <qdir.h>
#include <qfileinfo.h>
#include <qregexp.h>
#include <qtextstream.h>
#include <errno.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
int main( int argc, char **argv )
{
#ifdef QWS
OApplication a( argc, argv, "Wellenreiter II" );
#else
QApplication a( argc, argv );
#endif
WellenreiterMainWindow* w = new WellenreiterMainWindow();
#ifdef QWS
a.showMainWidget( w );
#else
a.setMainWidget( w );
w->setCaption( "Wellenreiter II" );
w->show();
#endif
a.processEvents(); // show the window before doing the safety checks
int result = -1;
+ static int killed = false;
- // root check
- if ( getuid() )
+ bool check = true;
+ for ( int i = 1; i < argc; ++i )
{
- qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) );
- result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n"
- "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ),
- QMessageBox::Yes, QMessageBox::No );
- if ( result == QMessageBox::No ) return -1;
+ if ( !strcmp( "-nocheck", argv[i] ) )
+ {
+ qDebug( "-nocheck found" );
+ check = false;
+ break;
+ }
}
- // dhcp check - NOT HERE! This really belongs as a static member to OProcess
- // and I want to call it like that: if ( OProcess::isRunning( QString& ) ) ...
+ if ( check )
+ {
+ // root check
+ if ( getuid() )
+ {
+ qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) );
+ result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n"
+ "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ),
+ QMessageBox::Yes, QMessageBox::No );
+ if ( result == QMessageBox::No ) return -1;
+ }
- static int killed = false;
+ // dhcp check - NOT HERE! This really belongs as a static member to OProcess
+ // and I want to call it like that: if ( OProcess::isRunning( QString& ) ) ...
- QString line;
- QDir d = QDir( "/proc" );
- QStringList dirs = d.entryList( QDir::Dirs );
- QStringList::Iterator it;
- for ( it = dirs.begin(); it != dirs.end(); ++it )
- {
- //qDebug( "next entry: %s", (const char*) *it );
- QFile file( "/proc/"+*it+"/cmdline" );
- file.open( IO_ReadOnly );
- if ( !file.isOpen() ) continue;
- QTextStream t( &file );
- line = t.readLine();
- //qDebug( "cmdline = %s", (const char*) line );
- if ( line.contains( "dhcp" ) ) break;
- }
- if ( line.contains( "dhcp" ) )
- {
- qWarning( "Wellenreiter: found dhcp process #%d", (*it).toInt() );
- result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "You have a dhcp client running.\n"
- "This can severly limit scanning!\nShould I kill it for you?" ),
- QMessageBox::Yes, QMessageBox::No );
- if ( result == QMessageBox::Yes )
+ QString line;
+ QDir d = QDir( "/proc" );
+ QStringList dirs = d.entryList( QDir::Dirs );
+ QStringList::Iterator it;
+ for ( it = dirs.begin(); it != dirs.end(); ++it )
+ {
+ //qDebug( "next entry: %s", (const char*) *it );
+ QFile file( "/proc/"+*it+"/cmdline" );
+ file.open( IO_ReadOnly );
+ if ( !file.isOpen() ) continue;
+ QTextStream t( &file );
+ line = t.readLine();
+ //qDebug( "cmdline = %s", (const char*) line );
+ if ( line.contains( "dhcp" ) ) break;
+ }
+ if ( line.contains( "dhcp" ) )
{
- if ( -1 == ::kill( (*it).toInt(), SIGTERM ) )
- qWarning( "Wellenreiter: can't kill process #%d (%s)", result, strerror( errno ) );
- else
- killed = true;
+ qWarning( "Wellenreiter: found dhcp process #%d", (*it).toInt() );
+ result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "You have a dhcp client running.\n"
+ "This can severly limit scanning!\nShould I kill it for you?" ),
+ QMessageBox::Yes, QMessageBox::No );
+ if ( result == QMessageBox::Yes )
+ {
+ if ( -1 == ::kill( (*it).toInt(), SIGTERM ) )
+ qWarning( "Wellenreiter: can't kill process #%d (%s)", result, strerror( errno ) );
+ else
+ killed = true;
+ }
}
}
a.exec();
- if ( killed )
+ if ( check )
{
- result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "Restart your dhcp client?" ), QMessageBox::Yes, QMessageBox::No );
- if ( result == QMessageBox::Yes )
+
+ if ( killed )
{
- system( QString().sprintf( "dhclient &; udhcpcd &; dhcpcd &" ) );
+ result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "Restart your dhcp client?" ), QMessageBox::Yes, QMessageBox::No );
+ if ( result == QMessageBox::Yes )
+ {
+ system( QString().sprintf( "dhclient &; udhcpcd &; dhcpcd &" ) );
+ }
}
- }
- delete w;
+ delete w;
+ }
return 0;
}