OSDN Git Service

セキュリティ関連の危険性を示すuDangerをTPI_FILEINFOに追加。
authorsirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Sat, 3 Oct 2009 07:10:41 +0000 (07:10 +0000)
committersirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Sat, 3 Oct 2009 07:10:41 +0000 (07:10 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@15 9df91469-1e22-0410-86e7-ea8537beb833

src/common/handle/TPIHandle.cpp
src/common/header/plugin.h
src/frontend/cls_listctrl.cpp
src/frontend/frm_main.cpp

index f426073..4ee34ad 100644 (file)
@@ -163,6 +163,7 @@ int TPIHandle::GetFileInformation(void * _hArchive, TPI_FILEINFO * _fiInfo, bool
        _fiInfo->tmAccess       = 0;\r
        _fiInfo->tmCreate       = 0;\r
        _fiInfo->tmModified     = 0;\r
+       _fiInfo->uDanger        = 0;\r
        _fiInfo->uOSType        = 0;\r
        _fiInfo->llPackedSize   = 0;\r
        _fiInfo->llUnpackedSize = 0;\r
index 01c1ccd..e4c3e41 100644 (file)
@@ -239,6 +239,7 @@ typedef struct _TPI_tagFILEINFO
        wxDateTime      tmAccess;       /**< 最終参照日時 */\r
        wxDateTime      tmCreate;       /**< 作成日時 */\r
        wxDateTime      tmModified;     /**< 最終更新日時 */\r
+       unsigned int    uDanger;        /**< セキュリティ警告 */\r
        unsigned int    uOSType;        /**< 作成元OS */\r
        wxULongLong     llPackedSize;   /**< 格納後のサイズ */\r
        wxULongLong     llUnpackedSize; /**< 格納前のサイズ */\r
index 3c3d84f..66fb953 100644 (file)
@@ -98,7 +98,7 @@ int myListCtrl::OnGetItemImage(long i) const
 \r
 wxListItemAttr * myListCtrl::OnGetItemAttr(long i) const\r
 {\r
-       return (wxListItemAttr *) this->showFileInfo[i].pCustomInfo;\r
+       return this->showFileInfo[i].uDanger ? (wxListItemAttr *) & this->atDangerItem : NULL;\r
 }\r
 \r
 void myListCtrl::OnColClick(wxListEvent& e)\r
index 7038b51..161f00c 100644 (file)
@@ -743,13 +743,13 @@ void MainFrame::LoadArc(wxString szFileName)
                        // DTV\8c\9f\8d¸\81B
                        if (piInfo.fiInfo.fnFileName.GetPathWithSep().Find(wxT("..")) != wxNOT_FOUND)
                        {
-                               piInfo.fiInfo.pCustomInfo = & this->list_ctrl->atDangerItem;
+                               piInfo.fiInfo.uDanger = TRUE;
                                ::wxMessageBox(wxT("This archive may have Directory Traversal Vulnerability(DTV) problem, and some danger files may be extracted to the unexpected system directory! You should use the \"Ignore file pathes\" option when extracting this archive.\nDanger file is:\n" + piInfo.fiInfo.szStoredName), wxMessageBoxCaptionStr, wxICON_EXCLAMATION);
                        }
                        // \8bó\94\92\82Ì\98A\91±\82É\82æ\82é\8ag\92£\8eq\8bU\91\95\82ð\8c\9f\8d¸\81B
                        if (piInfo.fiInfo.fnFileName.GetFullName().Find(wxT("        ")) != wxNOT_FOUND)
                        {
-                               piInfo.fiInfo.pCustomInfo = & this->list_ctrl->atDangerItem;
+                               piInfo.fiInfo.uDanger = TRUE;
                                ::wxMessageBox(wxT("This archive may contain extension-disguised files whose real extension is hidden by using many blank charactor and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n" + piInfo.fiInfo.szStoredName), wxMessageBoxCaptionStr, wxICON_EXCLAMATION);
                        }
                        // Unicode\90§\8cä\95\8e\9a\82ð\8c\9f\8d¸\81B
@@ -757,7 +757,7 @@ void MainFrame::LoadArc(wxString szFileName)
                        {
                                if (piInfo.fiInfo.fnFileName.GetFullName().Find(c) != wxNOT_FOUND)
                                {
-                                       piInfo.fiInfo.pCustomInfo = & this->list_ctrl->atDangerItem;
+                                       piInfo.fiInfo.uDanger = TRUE;
                                        ::wxMessageBox(wxT("This archive may contain extension-disguised files whose real extension is hidden by using Unicode control character and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n" + piInfo.fiInfo.szStoredName), wxMessageBoxCaptionStr, wxICON_EXCLAMATION);
                                }
                                switch (c)