[Forensics-changes] [SCM] debian-forensics/guymager branch, debian, updated. debian/0.4.2-2-11-g7087b21

Michael Prokop mika at debian.org
Mon Jun 14 16:02:31 UTC 2010


The following commit has been merged in the debian branch:
commit 5c80cd2c5feef38789b97ad4106e1ef2d3d0d623
Author: Michael Prokop <mika at debian.org>
Date:   Mon Jun 14 16:49:36 2010 +0200

    Merging upstream version 0.5.3beta1.

diff --git a/common.h b/common.h
index 650464f..1e19a66 100644
--- a/common.h
+++ b/common.h
@@ -35,8 +35,8 @@
 #endif
 
 #include "toolglobalid.h"
-#include "error/toolerror.h"
-#include "log/toollog.h"
+#include "toolerror.h"
+#include "toollog.h"
 #include "tooltypes.h"
 
 #include "modules.h"
diff --git a/config.cpp b/config.cpp
index f5ecfb0..dd9cf33 100644
--- a/config.cpp
+++ b/config.cpp
@@ -19,8 +19,8 @@
 
 #include "libewf.h"
 
-#include "cfg/toolcfg.h"
-#include "sysinfo/toolsysinfo.h"
+#include "toolcfg.h"
+#include "toolsysinfo.h"
 #include "file.h"
 
 #include "qtutil.h"
@@ -269,6 +269,8 @@ static t_ToolCfgSet SetArrDeviceScanMethod[] =
    { "HAL",        SCANMETHOD_DBUSHAL   },
    { "DBusDevKit", SCANMETHOD_DBUSDEVKIT},
    { "DevKit",     SCANMETHOD_DBUSDEVKIT},
+   { "DBusUDisks", SCANMETHOD_DBUSDEVKIT},
+   { "UDisks",     SCANMETHOD_DBUSDEVKIT},
    {  NULL,        0                    }
 };
 
@@ -925,6 +927,7 @@ static APIRET CfgInitializeDlgAcquireFieldNames (void)
 {
    if (CfgLocal.DlgAcquireFieldNames.count() == 0)
    {
+      CfgLocal.DlgAcquireFieldNames += CFG_DLGACQUIRE_SPLITFILESIZE;
       CfgLocal.DlgAcquireFieldNames += CFG_DLGACQUIRE_EWF_CASENUMBER;
       CfgLocal.DlgAcquireFieldNames += CFG_DLGACQUIRE_EWF_EVIDENCENUMBER;
       CfgLocal.DlgAcquireFieldNames += CFG_DLGACQUIRE_EWF_EXAMINER;
diff --git a/config.h b/config.h
index c6a4b6f..015d43a 100644
--- a/config.h
+++ b/config.h
@@ -178,6 +178,7 @@ typedef struct
 #define CFG_DLGACQUIRE_DST_FIELDID        "Dest"
 #define CFG_DLGACQUIRE_DIR_FIELDID        "Directory"
 
+#define CFG_DLGACQUIRE_SPLITFILESIZE           QT_TRANSLATE_NOOP("t_DlgAcquire", "SplitFileSize"     )
 #define CFG_DLGACQUIRE_EWF_CASENUMBER          QT_TRANSLATE_NOOP("t_DlgAcquire", "EwfCaseNumber"     )
 #define CFG_DLGACQUIRE_EWF_EVIDENCENUMBER      QT_TRANSLATE_NOOP("t_DlgAcquire", "EwfEvidenceNumber" )
 #define CFG_DLGACQUIRE_EWF_EXAMINER            QT_TRANSLATE_NOOP("t_DlgAcquire", "EwfExaminer"       )
diff --git a/dlgacquire.cpp b/dlgacquire.cpp
index a2b70c8..d8d4f58 100644
--- a/dlgacquire.cpp
+++ b/dlgacquire.cpp
@@ -41,6 +41,8 @@ class t_DlgAcquireLocal
       QRadioButton    *pRadioButtonFormatEWF;
       QRadioButton    *pRadioButtonFormatAFF;
 
+      QCheckBox       *pCheckBoxSplit;
+
       QList<QWidget*>   EwfWidgetsList;                  // Used to comfortably enable / disable EWF related entry fields and labels
 
       QTableWidget    *pDeviceTable;                     // Only created and displayed when cloning a device
@@ -387,7 +389,8 @@ APIRET t_DlgAcquire::CreateDeviceTable (t_pDeviceList pDeviceList, t_pDevice pDe
 
    ScreenWidth = QApplication::desktop()->availableGeometry().width();
    Width = GETMIN ((int)(0.8 * ScreenWidth), ColWidth - ExtraWidth);   // Do not use more than 80% of the screen width
-   pTable->setMinimumWidth (Width);
+   pTable->setMinimumWidth  (Width);
+   pTable->setMinimumHeight (130);
 
    CHK_QT (connect (pTable, SIGNAL(itemSelectionChanged ()), this, SLOT(SlotDeviceTableSelectionChanged())))
 
@@ -510,12 +513,19 @@ t_DlgAcquire::t_DlgAcquire (t_pDevice pDevice, bool Clone, t_pDeviceList pDevice
    {
       // Format box (with EWF fields)
       // ----------------------------
-      QGroupBox   *pGroupBoxFormat = new QGroupBox (tr("File format"), this);
-      QVBoxLayout *pLayoutFormat   = new QVBoxLayout;
-      QGridLayout *pLayoutEwf      = new QGridLayout ();
-
-      pGroupBoxFormat->setLayout (pLayoutFormat);
-      pLayout->addWidget       (pGroupBoxFormat);
+      QGroupBox   *pGroupBoxFormat    = new QGroupBox (tr("File format"), this);
+      QVBoxLayout *pLayoutGroupBox    = new QVBoxLayout;
+      QHBoxLayout *pLayoutFormatSplit = new QHBoxLayout;
+      QVBoxLayout *pLayoutFormat      = new QVBoxLayout;
+      QVBoxLayout *pLayoutSplit       = new QVBoxLayout;
+      QGridLayout *pLayoutEwf         = new QGridLayout;
+
+      pLayout           ->addWidget (pGroupBoxFormat);
+      pGroupBoxFormat   ->setLayout (pLayoutGroupBox);
+      pLayoutGroupBox   ->addLayout (pLayoutFormatSplit);
+      pLayoutFormatSplit->addLayout (pLayoutFormat);
+      pLayoutFormatSplit->addLayout (pLayoutSplit );
+      pLayoutGroupBox   ->addLayout (pLayoutEwf);
 
       CHK_EXIT (t_File::GetFormatDescription (t_File::DD , false, Str))            ButtonTextDD  = "&" + Str;
       CHK_EXIT (t_File::GetFormatDescription (t_File::EWF, false, Str))            ButtonTextEWF = "&" + Str;
@@ -531,7 +541,10 @@ t_DlgAcquire::t_DlgAcquire (t_pDevice pDevice, bool Clone, t_pDeviceList pDevice
       pLayoutFormat->addWidget  (pOwn->pRadioButtonFormatDD );
       pLayoutFormat->addWidget  (pOwn->pRadioButtonFormatEWF);
       pLayoutFormat->addWidget  (pOwn->pRadioButtonFormatAFF);
-      pLayoutFormat->addLayout  (pLayoutEwf);
+
+//      pOwn->pCheckBoxSplit  = new QCheckBox (tr("Split image"), this);
+//      pOwn->pEntrySplitSize = new
+//      pLayoutSplit->addWidget(pOwn->pCheckBoxSplit);
 
       Row = Col = 0;
       for (i=0; i<pDlgAcquireFields->count(); i++)
@@ -560,8 +573,8 @@ t_DlgAcquire::t_DlgAcquire (t_pDevice pDevice, bool Clone, t_pDeviceList pDevice
 
    if (CONFIG(WriteToDevNull))
    {
-      pLabel = new QLabel(tr("Configuration flag WriteToDevNull is set!"), this);
-      pLayoutDest->addWidget (pLabel, Row++, 0);
+      pLabel = new QLabel(QString("<font color='red'>") + tr("Configuration flag WriteToDevNull is set!") + "</font>", this);
+      pLayoutDest->addWidget (pLabel, Row++, 0, 1, 3);
    }
    //lint -restore
 
diff --git a/guymager.cfg b/guymager.cfg
index c53b01f..7262499 100644
--- a/guymager.cfg
+++ b/guymager.cfg
@@ -286,6 +286,7 @@ TABLE DlgAcquireField NoName
    REM Field                Entry mode  Entry mode  Default
    REM name                 image       clone       value
    REM ------------------------------------------------------------------------------------
+       'SplitFileSize'      ShowLast    Hide        '-2047'
        'EwfCaseNumber'      ShowLast    Hide        ''
        'EwfEvidenceNumber'  ShowDefault Hide        ''
        'EwfExaminer'        ShowLast    Hide        ''
@@ -377,17 +378,18 @@ REM DeviceScanMethod        Guymager knows 3 methods for getting the list of the
 REM                         that uses libparted, the new one that uses DBUS/HAL and the even newer one that uses
 REM                         DeviceKit-Disks. Select your method by setting this parameter to:
 REM
-REM                            DBusDevKit   Use the newest method. You need a Linux supporting DeviceKit-Disks for
-REM                                         this setting (for example Ubuntu 9.10).
+REM                            DBusDevKit or UDisks   Use the newest method. You need a Linux supporting UDisks for
+REM                                                   this setting (for example Ubuntu 10.04). In older versions, UDisks
+REM                                                   was named DeviceKit (in Ubuntu 9.10 for instance). Both are the same.
 REM
-REM                            DBusHAL      Use the new method (recommended).
+REM                            DBusHAL                Use the new method (recommended).
 REM
-REM                            libparted    Use the old method. It was observed that the internal scan function hung
-REM                                         while an acquisition was running. This leads to the problem that the devices
-REM                                         shown in guymager possibly cannot be updated while an acquisition is running.
-REM                                         When using this method, the command specified in configuration parameter
-REM                                         CommandGetSerialNumber (see below) is used for finding the serial number of
-REM                                         each device (not really elegant). Again, DBusHAL is the recommended setting.
+REM                            libparted              Use the old method. It was observed that the internal scan function hung
+REM                                                   while an acquisition was running. This leads to the problem that the devices
+REM                                                   shown in guymager possibly cannot be updated while an acquisition is running.
+REM                                                   When using this method, the command specified in configuration parameter
+REM                                                   CommandGetSerialNumber (see below) is used for finding the serial number of
+REM                                                   each device (not really elegant). Again, DBusHAL is the recommended setting.
 REM                         When chossing an unsupported scan method, Guymager shows the user a dialog asking to fall back
 REM                         to a supported one.
 REM
@@ -401,9 +403,9 @@ REM ScanInterval            [s] Speficies how often an automatic device scan (fo
 REM                         should launched. Keep in mind, that the device scan can be launched as well manually.
 REM
 
-DeviceScanMethod        = DBusDevKit
-CommandGetSerialNumber  = 'bash -c "smartctl -i %dev | grep -i serial | awk ''{print $3 $4 $5 $6 $7 $8 $9}'' "'
-ScanInterval            = 6000
+DeviceScanMethod       = UDisks
+CommandGetSerialNumber = 'bash -c "smartctl -i %dev | grep -i serial | awk ''{print $3 $4 $5 $6 $7 $8 $9}'' "'
+ScanInterval           = 6000
 
 
 REM Other settings
@@ -423,10 +425,10 @@ REM
 REM FifoBlockSizeAFF        The block size for dd images (in bytes). Recommended value: 10485760 (10MB).
 REM
 REM FifoMaxMem              The amount of memory used for the internal FIFO queues of an acquisition. The value is indicated in
-REM                         Megabytes. If you set it to 0, Guymager uses 1/8 of the available RAM. Keep in mind, that the amount
-REM                         amount of memory used by Guymager may be much higher. With a value of 256 and 4 acquisitions running
-REM                         in parallel, a total of 1GB RAM would be used by Guymager - only for the FIFOs, not counting the
-REM                         overhead required by Guymager and the libs it uses (Qt, libewf, ...).
+REM                         Megabytes. If you set it to 0, Guymager uses 1/8 of the available RAM, maximally 64MB per acquisition.
+REM                         Keep in mind, that the total amount of memory used by Guymager may be much higher: With a value of
+REM                         256 and 4 acquisitions running in parallel, a total of 1GB RAM would be used by Guymager - only for
+REM                         the FIFOs, not counting the overhead required by Guymager and the libs it uses (Qt, libewf, ...).
 REM                         The recommended value is 0 (automatic memory usage calculation).
 REM
 REM FifoMemoryManager       Set to on to use the internal FIFO memory manager. if set to off, the classical C functions mallox and
diff --git a/guymager.pro b/guymager.pro
index 394427e..1f1b18f 100644
--- a/guymager.pro
+++ b/guymager.pro
@@ -36,7 +36,7 @@ CONFIG   = qt debug warn_on qdbus
 TARGET   = guymager
 MOC_DIR  = ./moc
 
-INCLUDEPATH += /usr/include/libguytools1
+INCLUDEPATH += /usr/include/libguytools2
 
 # LIBEWF_VERSION only must be defined for compiling with libewf before 20080309
 # Newer libewf version already include this macro in file definitions.h.
@@ -138,16 +138,13 @@ fastasm.output = ${QMAKE_FILE_BASE}.o
 fastasm.commands = g++ -c $$FAST_ASM_CXXFLAGS ${QMAKE_FILE_IN} -o  ${QMAKE_FILE_BASE}.o 2>&1 | grep -vE \"matching constraint does not allow a register|In function |At global scope:\"  | cat
 QMAKE_EXTRA_COMPILERS += fastasm
 
-
-LIBS += -lguytoollog
-LIBS += -lguytoolerror
-LIBS += -lguytoolcfg
-LIBS += -lguytoolsignal
-LIBS += -lguytoolsysinfo
 LIBS += -lproc
-LIBS += -lewf
-LIBS += -ldl
+#LIBS += -lewf
+#LIBS += -lguytools
+LIBS += /usr/lib/libewf.a
+LIBS += /usr/lib/libguytools.a
 LIBS += -lz
+LIBS += -ldl
 
 TRANSLATIONS  = guymager_en.ts
 TRANSLATIONS += guymager_de.ts
diff --git a/main.cpp b/main.cpp
index 9ca1aaa..d065f75 100644
--- a/main.cpp
+++ b/main.cpp
@@ -29,9 +29,9 @@
 #undef free     // in order to be able to access std::malloc and std::free
 
 #include "toolconstants.h"
-#include "signal/toolsignal.h"
-#include "sysinfo/toolsysinfo.h"
-#include "cfg/toolcfg.h"
+#include "toolsignal.h"
+#include "toolsysinfo.h"
+#include "toolcfg.h"
 
 #include "libewf.h"
 
@@ -178,6 +178,28 @@ static APIRET MainWindowAdjustSize (t_MainWindow *pMainWindow)
    return NO_ERROR;
 }
 
+
+// ------------------------------------
+//          Configuration log
+// ------------------------------------
+
+static void MainCfgLog (t_pcchar pFileName, t_pcchar pFunction, t_int LineNr, t_pcchar pFormat, va_list pArguments)
+{
+   static bool ConsoleLog = false;
+
+   if (!ConsoleLog)
+        ConsoleLog = (strstr (pFormat, "Configuration error"       ) != NULL);
+   else ConsoleLog = (strstr (pFormat, "TOOLCFG_ERROR_CONFIG_ERROR") == NULL);
+
+   if (ConsoleLog)
+   {
+      printf ("\n");
+      vprintf (pFormat, pArguments);
+   }
+
+   t_Log::vEntryInfo (pFileName, pFunction, LineNr, pFormat, pArguments);
+}
+
 // ------------------------------------
 //           Main program
 // ------------------------------------
@@ -263,7 +285,7 @@ static APIRET MainGo (int argc, char *argv[])
    // --------------
 //   CHK (ToolCfgUseAdjustedCommandLine (MainLocal.pApp->argc(), MainLocal.pApp->argv()))
    CHK (ToolCfgUseAdjustedCommandLine (QApplication::argc(), QApplication::argv()))
-   CHK (ToolCfgSetLogFn (&t_Log::vEntryInfo))
+   CHK (ToolCfgSetLogFn (&MainCfgLog))
    CHK (CfgInit())
    rc = CfgGetCfgFileName (&pCfgFileName, &DefaultUsed);
    if (rc == ERROR_CFG_ONLY_TEMPLATE_GENERATED)
diff --git a/threadscan.cpp b/threadscan.cpp
index ba248c2..af2c2bd 100644
--- a/threadscan.cpp
+++ b/threadscan.cpp
@@ -31,7 +31,7 @@ const int THREADSCAN_WAIT_MAX         = 5000;
 const int THREADSCAN_WAIT_GRANULARITY = 100;
 
 const QString ThreadScanLibPartedSearchDirs    = "/lib,/usr/lib,/usr/local/lib";       // Separate directories by commas
-const QString ThreadScanLibPartedSearchPattern = "libparted-*.so*";
+const QString ThreadScanLibPartedSearchPattern = "libparted*.so*";
 
 // -----------------------------------
 //  Utility functions used by workers
@@ -127,7 +127,7 @@ static APIRET ThreadScanFindLibparted (QStringList &Files)
       }
    }
    if (Files.empty())
-      LOG_INFO ("\nNo libparted could be found")
+      LOG_INFO ("No libparted could be found")
 
    return NO_ERROR;
 }
@@ -478,13 +478,30 @@ void t_ThreadScanWorkerHAL::SlotRescan (void)
 //  t_ThreadScanWorkerDevKit
 // --------------------------
 
-// Scan the devices using DBUS/DeviceKit-Disks
+// Scan the devices using DBus/UDisks, or, if not available, using DBUS/DeviceKit-Disks
+
+typedef struct
+{
+   const char *pService;
+   const char *pDisksIf;
+   const char *pDisksPath;
+   const char *pDeviceIf;
+   const char *pPropertiesIf;
+} t_Paths, *t_pPaths;
+
+const t_Paths DevKitPaths = { "org.freedesktop.DeviceKit.Disks",
+                              "org.freedesktop.DeviceKit.Disks",
+                             "/org/freedesktop/DeviceKit/Disks",
+                              "org.freedesktop.DeviceKit.Disks.Device",
+                              "org.freedesktop.DBus.Properties"};
+
+const t_Paths UDisksPaths = { "org.freedesktop.UDisks",
+                              "org.freedesktop.UDisks",
+                             "/org/freedesktop/UDisks",
+                              "org.freedesktop.UDisks.Device",
+                              "org.freedesktop.DBus.Properties"};
+
 
-#define DEVKIT_SERVICE       "org.freedesktop.DeviceKit.Disks"
-#define DEVKIT_DISKS_IF      "org.freedesktop.DeviceKit.Disks"
-#define DEVKIT_DISKS_PATH    "/org/freedesktop/DeviceKit/Disks"
-#define DEVKIT_DEVICE_IF     "org.freedesktop.DeviceKit.Disks.Device"
-#define DEVKIT_PROPERTIES_IF "org.freedesktop.DBus.Properties"
 class t_ThreadScanWorkerDevKitLocal
 {
    public:
@@ -503,6 +520,7 @@ class t_ThreadScanWorkerDevKitLocal
       }
 
    public:
+      const t_Paths            *pPaths;
       QDBusConnection          *pDBusConnection;
       QDBusConnectionInterface *pDBusInterface;
 };
@@ -519,12 +537,19 @@ t_ThreadScanWorkerDevKit::t_ThreadScanWorkerDevKit (APIRET &rc)
    }
 
    pOwn->pDBusInterface = pOwn->pDBusConnection->interface();
-   if (!pOwn->pDBusInterface->isServiceRegistered (DEVKIT_SERVICE))
+   pOwn->pPaths = &UDisksPaths;
+   if (!pOwn->pDBusInterface->isServiceRegistered (pOwn->pPaths->pService))
    {
-      LOG_INFO ("DeviceKit-Disks not registered")
-      rc = ERROR_THREADSCAN_DBUSDEVKIT_NOTWORKING;
-      return;
+      LOG_INFO ("%s not registered", pOwn->pPaths->pService)
+      pOwn->pPaths = &DevKitPaths;
+      if (!pOwn->pDBusInterface->isServiceRegistered (pOwn->pPaths->pService))
+      {
+         LOG_INFO ("%s not registered", pOwn->pPaths->pService)
+         rc = ERROR_THREADSCAN_DBUSDEVKIT_NOTWORKING;
+         return;
+      }
    }
+   LOG_INFO ("Using %s", pOwn->pPaths->pService)
    rc = NO_ERROR;
 }
 
@@ -536,7 +561,7 @@ t_ThreadScanWorkerDevKit::~t_ThreadScanWorkerDevKit (void)
 QList<QVariant> t_ThreadScanWorkerDevKit::CallMethod (const QString &Device, const QString &Method, const QString &Argument)
 {
    QList<QVariant> Args;
-   QDBusMessage    Message = QDBusMessage::createMethodCall (DEVKIT_SERVICE, Device, DEVKIT_DEVICE_IF, Method);
+   QDBusMessage    Message = QDBusMessage::createMethodCall (pOwn->pPaths->pService, Device, pOwn->pPaths->pDeviceIf, Method);
    QDBusMessage    Reply;
 
    Args += Argument;
@@ -556,7 +581,7 @@ QList<QVariant> t_ThreadScanWorkerDevKit::CallMethod (const QString &Device, con
 
 APIRET t_ThreadScanWorkerDevKit::GetProperty (const QString &Device, const QString &Property, QVariant &Var)
 {
-   QDBusMessage             Message = QDBusMessage::createMethodCall (DEVKIT_SERVICE, Device, DEVKIT_PROPERTIES_IF, "Get");  // Query DBUS object properties
+   QDBusMessage             Message = QDBusMessage::createMethodCall (pOwn->pPaths->pService, Device, pOwn->pPaths->pPropertiesIf, "Get");  // Query DBUS object properties
    QList     <QVariant>     Args;
    QDBusReply<QDBusVariant> Reply;
 
@@ -607,7 +632,7 @@ void t_ThreadScanWorkerDevKit::SlotRescan (void)
    emit (SignalScanStarted ());
    LOG_INFO ("Device scan started")
 
-   Message = QDBusMessage::createMethodCall (DEVKIT_SERVICE, DEVKIT_DISKS_PATH, DEVKIT_DISKS_IF, "EnumerateDevices");
+   Message = QDBusMessage::createMethodCall (pOwn->pPaths->pService, pOwn->pPaths->pDisksPath, pOwn->pPaths->pDisksIf, "EnumerateDevices");
    QDBusReply<QDBusArgument> Reply = pOwn->pDBusConnection->call(Message);
    if (!Reply.isValid())
    {
diff --git a/threadwrite.cpp b/threadwrite.cpp
index 82bbd0d..11a64b2 100644
--- a/threadwrite.cpp
+++ b/threadwrite.cpp
@@ -19,7 +19,7 @@
 #include <QtCore>
 
 #include "toolconstants.h"
-#include "sysinfo/toolsysinfo.h"
+#include "toolsysinfo.h"
 
 #include "util.h"
 #include "config.h"

-- 
debian-forensics/guymager



More information about the forensics-changes mailing list