Hello community,

here is the log from the commit of package unrar for openSUSE:Factory:NonFree 
checked in at 2015-09-17 09:22:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory:NonFree/unrar (Old)
 and      /work/SRC/openSUSE:Factory:NonFree/.unrar.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "unrar"

Changes:
--------
--- /work/SRC/openSUSE:Factory:NonFree/unrar/unrar.changes      2015-08-28 
08:27:56.000000000 +0200
+++ /work/SRC/openSUSE:Factory:NonFree/.unrar.new/unrar.changes 2015-09-17 
09:22:03.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Sep 14 13:52:46 UTC 2015 - [email protected]
+
+- Update to 5.3.4
+  * No changelog upstream
+
+-------------------------------------------------------------------

Old:
----
  unrarsrc-5.3.3.tar.gz

New:
----
  unrarsrc-5.3.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ unrar.spec ++++++
--- /var/tmp/diff_new_pack.a6pDFp/_old  2015-09-17 09:22:03.000000000 +0200
+++ /var/tmp/diff_new_pack.a6pDFp/_new  2015-09-17 09:22:03.000000000 +0200
@@ -18,10 +18,10 @@
 
 # majorversion should match the major version number.
 %define majorversion 5
-%define libsuffix 5_3_3
+%define libsuffix 5_3_4
 
 Name:           unrar
-Version:        5.3.3
+Version:        5.3.4
 Release:        0
 Summary:        A program to extract, test, and view RAR archives
 License:        SUSE-NonFree

++++++ unrarsrc-5.3.3.tar.gz -> unrarsrc-5.3.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unrar/dll.rc new/unrar/dll.rc
--- old/unrar/dll.rc    2015-08-27 14:37:41.000000000 +0200
+++ new/unrar/dll.rc    2015-09-13 11:04:13.000000000 +0200
@@ -2,8 +2,8 @@
 #include <commctrl.h>
 
 VS_VERSION_INFO VERSIONINFO
-FILEVERSION 5, 30, 3, 1702
-PRODUCTVERSION 5, 30, 3, 1702
+FILEVERSION 5, 30, 4, 1719
+PRODUCTVERSION 5, 30, 4, 1719
 FILEOS VOS__WINDOWS32
 FILETYPE VFT_APP
 {
@@ -14,8 +14,8 @@
       VALUE "CompanyName", "Alexander Roshal\0"
       VALUE "ProductName", "RAR decompression library\0"
       VALUE "FileDescription", "RAR decompression library\0"
-      VALUE "FileVersion", "5.30.3\0"
-      VALUE "ProductVersion", "5.30.3\0"
+      VALUE "FileVersion", "5.30.4\0"
+      VALUE "ProductVersion", "5.30.4\0"
       VALUE "LegalCopyright", "Copyright � Alexander Roshal 1993-2015\0"
       VALUE "OriginalFilename", "Unrar.dll\0"
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unrar/errhnd.cpp new/unrar/errhnd.cpp
--- old/unrar/errhnd.cpp        2015-08-27 14:40:59.000000000 +0200
+++ new/unrar/errhnd.cpp        2015-09-13 11:12:16.000000000 +0200
@@ -102,7 +102,11 @@
 #ifndef SILENT
   if (!Silent)
   {
+#ifndef _ANDROID
+    // We do not display "repeat write" prompt in Android, so we do not
+    // need the matching system error message.
     SysErrMsg();
+#endif
     bool Repeat=uiAskRepeatWrite(FileName,DiskFull);
     if (!Repeat) // Disable shutdown if user pressed Cancel in error dialog.
       DisableShutdown=true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unrar/extract.cpp new/unrar/extract.cpp
--- old/unrar/extract.cpp       2015-08-27 14:40:59.000000000 +0200
+++ new/unrar/extract.cpp       2015-09-13 11:12:16.000000000 +0200
@@ -429,6 +429,37 @@
 #endif
     }
 
+
+    // Set a password before creating the file, so we can skip creating
+    // in case of wrong password.
+    SecPassword FilePassword=Cmd->Password;
+#if defined(_WIN_ALL) && !defined(SFX_MODULE)
+    ConvertDosPassword(Arc,FilePassword);
+#endif
+
+    byte PswCheck[SIZE_PSWCHECK];
+    DataIO.SetEncryption(false,Arc.FileHead.CryptMethod,&FilePassword,
+           Arc.FileHead.SaltSet ? Arc.FileHead.Salt:NULL,
+           Arc.FileHead.InitV,Arc.FileHead.Lg2Count,
+           Arc.FileHead.HashKey,PswCheck);
+
+    // If header is damaged, we cannot rely on password check value,
+    // because it can be damaged too.
+    if (Arc.FileHead.Encrypted && Arc.FileHead.UsePswCheck &&
+        memcmp(Arc.FileHead.PswCheck,PswCheck,SIZE_PSWCHECK)!=0 &&
+        !Arc.BrokenHeader)
+    {
+      uiMsg(UIERROR_BADPSW,Arc.FileName);
+      ErrHandler.SetErrorCode(RARX_BADPWD);
+      ExtrFile=false;
+#ifdef RARDLL
+      // If we already have ERAR_EOPEN as result of missing volume,
+      // we should not replace it with less precise ERAR_BAD_DATA.
+      if (Cmd->DllError!=ERAR_EOPEN)
+        Cmd->DllError=ERAR_BAD_PASSWORD;
+#endif
+    }
+
     File CurFile;
 
     bool LinkEntry=Arc.FileHead.RedirType!=FSREDIR_NONE;
@@ -513,28 +544,6 @@
         mprintf(L"     ");
 #endif
 
-      SecPassword FilePassword=Cmd->Password;
-#if defined(_WIN_ALL) && !defined(SFX_MODULE)
-      ConvertDosPassword(Arc,FilePassword);
-#endif
-
-      byte PswCheck[SIZE_PSWCHECK];
-      DataIO.SetEncryption(false,Arc.FileHead.CryptMethod,&FilePassword,
-             Arc.FileHead.SaltSet ? Arc.FileHead.Salt:NULL,
-             Arc.FileHead.InitV,Arc.FileHead.Lg2Count,
-             Arc.FileHead.HashKey,PswCheck);
-      bool WrongPassword=false;
-
-      // If header is damaged, we cannot rely on password check value,
-      // because it can be damaged too.
-      if (Arc.FileHead.Encrypted && Arc.FileHead.UsePswCheck &&
-          memcmp(Arc.FileHead.PswCheck,PswCheck,SIZE_PSWCHECK)!=0 &&
-          !Arc.BrokenHeader)
-      {
-        uiMsg(UIERROR_BADPSW,Arc.FileName);
-        ErrHandler.SetErrorCode(RARX_BADPWD);
-        WrongPassword=true;
-      }
       DataIO.CurUnpRead=0;
       DataIO.CurUnpWrite=0;
       DataIO.UnpHash.Init(Arc.FileHead.FileHash.Type,Cmd->Threads);
@@ -545,7 +554,7 @@
       DataIO.SetSkipUnpCRC(SkipSolid);
 
 #if defined(_WIN_ALL) && !defined(SFX_MODULE) && !defined(SILENT)
-      if (!TestMode && !WrongPassword && !Arc.BrokenHeader &&
+      if (!TestMode && !Arc.BrokenHeader &&
           Arc.FileHead.UnpSize>0xffffffff && (Fat32 || !NotFat32))
       {
         if (!Fat32) // Not detected yet.
@@ -555,7 +564,7 @@
       }
 #endif
 
-      if (!TestMode && !WrongPassword && !Arc.BrokenHeader &&
+      if (!TestMode && !Arc.BrokenHeader &&
           (Arc.FileHead.PackSize<<11)>Arc.FileHead.UnpSize &&
           (Arc.FileHead.UnpSize<100000000 || 
Arc.FileLength()>Arc.FileHead.PackSize))
         CurFile.Prealloc(Arc.FileHead.UnpSize);
@@ -604,7 +613,7 @@
           PrevProcessed=FileCreateMode && LinkSuccess;
       }
       else
-        if (!Arc.FileHead.SplitBefore && !WrongPassword)
+        if (!Arc.FileHead.SplitBefore)
           if (Arc.FileHead.Method==0)
             UnstoreFile(DataIO,Arc.FileHead.UnpSize);
           else
@@ -651,7 +660,7 @@
       // Checksum is not calculated in skip solid mode for performance reason.
       if (!SkipSolid && ShowChecksum)
       {
-        if (!WrongPassword && ValidCRC)
+        if (ValidCRC)
         {
 #ifndef GUI
           if (Command!='P' && Command!='I')
@@ -661,19 +670,19 @@
         }
         else
         {
-          if (!WrongPassword)
-            if (Arc.FileHead.Encrypted && (!Arc.FileHead.UsePswCheck || 
-                Arc.BrokenHeader) && !AnySolidDataUnpackedWell)
-              uiMsg(UIERROR_CHECKSUMENC,Arc.FileName,ArcFileName);
-            else
-              uiMsg(UIERROR_CHECKSUM,Arc.FileName,ArcFileName);
+          if (Arc.FileHead.Encrypted && (!Arc.FileHead.UsePswCheck || 
+              Arc.BrokenHeader) && !AnySolidDataUnpackedWell)
+            uiMsg(UIERROR_CHECKSUMENC,Arc.FileName,ArcFileName);
+          else
+            uiMsg(UIERROR_CHECKSUM,Arc.FileName,ArcFileName);
           BrokenFile=true;
           ErrHandler.SetErrorCode(RARX_CRC);
 #ifdef RARDLL
-          // If we already have ERAR_EOPEN as result of missing volume,
+          // If we already have ERAR_EOPEN as result of missing volume
+          // or ERAR_BAD_PASSWORD for RAR5 wrong password,
           // we should not replace it with less precise ERAR_BAD_DATA.
-          if (Cmd->DllError!=ERAR_EOPEN)
-            Cmd->DllError=WrongPassword ? ERAR_BAD_PASSWORD : ERAR_BAD_DATA;
+          if (Cmd->DllError!=ERAR_EOPEN && Cmd->DllError!=ERAR_BAD_PASSWORD)
+            Cmd->DllError=ERAR_BAD_DATA;
 #endif
         }
       }
@@ -682,7 +691,7 @@
         mprintf(L"\b\b\b\b\b     ");
 #endif
 
-      if (!TestMode && !WrongPassword && (Command=='X' || Command=='E') &&
+      if (!TestMode && (Command=='X' || Command=='E') &&
           (!LinkEntry || Arc.FileHead.RedirType==FSREDIR_FILECOPY && 
LinkSuccess) && 
           (!BrokenFile || Cmd->KeepBroken))
       {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unrar/scantree.cpp new/unrar/scantree.cpp
--- old/unrar/scantree.cpp      2015-08-27 14:40:59.000000000 +0200
+++ new/unrar/scantree.cpp      2015-09-13 11:12:17.000000000 +0200
@@ -8,6 +8,7 @@
   ScanTree::GetDirs=GetDirs;
 
   ScanEntireDisk=false;
+  FolderWildcards=false;
 
   SetAllMaskDepth=0;
   *CurMask=0;
@@ -71,17 +72,73 @@
 }
 
 
+// For masks like dir1\dir2*\*.ext in non-recursive mode.
+bool ScanTree::ExpandFolderMask()
+{
+  bool WildcardFound=false;
+  uint SlashPos=0;
+  for (int I=0;CurMask[I]!=0;I++)
+  {
+    if (CurMask[I]=='?' || CurMask[I]=='*')
+      WildcardFound=true;
+    if (WildcardFound && IsPathDiv(CurMask[I]))
+    {
+      // First path separator position after folder wildcard mask.
+      // In case of dir1\dir2*\dir3\name.ext mask it may point not to file
+      // name, so we cannot use PointToName() here.
+      SlashPos=I; 
+      break;
+    }
+  }
+
+  wchar Mask[NM];
+  wcsncpyz(Mask,CurMask,ASIZE(Mask));
+  Mask[SlashPos]=0;
+
+  // Prepare the list of all folders matching the wildcard mask.
+  ExpandedFolderList.Reset();
+  FindFile Find;
+  Find.SetMask(Mask);
+  FindData FD;
+  while (Find.Next(&FD))
+    if (FD.IsDir)
+    {
+      wcsncatz(FD.Name,CurMask+SlashPos,ASIZE(FD.Name));
+
+      // Treat dir*\* or dir*\*.* as dir, so empty 'dir' is also matched
+      // by such mask. Skipping empty dir with dir*\*.* confused some users.
+      wchar *LastMask=PointToName(FD.Name);
+      if (wcscmp(LastMask,L"*")==0 || wcscmp(LastMask,L"*.*")==0)
+        RemoveNameFromPath(FD.Name);
+
+      ExpandedFolderList.AddString(FD.Name);
+    }
+  if (ExpandedFolderList.ItemsCount()==0)
+    return false;
+  // Return the first matching folder name now.
+  ExpandedFolderList.GetString(CurMask,ASIZE(CurMask));
+  return true;
+}
+
+
 // For masks like dir1\dir2*\file.ext this function sets 'dir1' recursive mask
 // and '*\dir2*\file.ext' filter. Masks without folder wildcards are
 // returned as is.
 bool ScanTree::GetFilteredMask()
 {
+  // If we have some matching folders left for non-recursive folder wildcard
+  // mask, we return it here.
+  if (ExpandedFolderList.ItemsCount()>0 && 
ExpandedFolderList.GetString(CurMask,ASIZE(CurMask)))
+    return true;
+
+  FolderWildcards=false;
   FilterList.Reset();
   if (!FileMasks->GetString(CurMask,ASIZE(CurMask)))
     return false;
 
   // Check if folder wildcards present.
-  bool WildcardFound=false,FolderWildcardFound=false;
+  bool WildcardFound=false;
+  uint FolderWildcardCount=0;
   uint SlashPos=0;
   for (int I=0;CurMask[I]!=0;I++)
   {
@@ -91,14 +148,24 @@
     {
       if (WildcardFound)
       {
-        FolderWildcardFound=true;
-        break;
+        // Calculate a number of folder wildcards in current mask.
+        FolderWildcardCount++;
+        WildcardFound=false;
       }
-      SlashPos=I;
+      if (FolderWildcardCount==0)
+        SlashPos=I; // Slash position before first folder wildcard mask.
     }
   }
-  if (!FolderWildcardFound)
+  if (FolderWildcardCount==0)
     return true;
+  FolderWildcards=true; // Global folder wildcards flag.
+
+  // If we have only one folder wildcard component and -r is missing or -r-
+  // is specified, prepare matching folders in non-recursive mode.
+  // We assume -r for masks like dir1*\dir2*\file*, because it is complicated
+  // to fast find them using OS file find API call.
+  if ((Recurse==RECURSE_NONE || Recurse==RECURSE_DISABLE) && 
FolderWildcardCount==1)
+    return ExpandFolderMask();
 
   wchar Filter[NM];
   // Convert path\dir*\ to *\dir filter to search for 'dir' in all 'path' 
subfolders.
@@ -185,9 +252,10 @@
     // SearchAll means that we'll use "*" mask for search, so we'll find
     // subdirectories and will be able to recurse into them.
     // We do not use "*" for directories at any level or for files
-    // at top level in recursion mode.
+    // at top level in recursion mode. We always comrpess the entire directory
+    // if folder wildcard is specified.
     bool SearchAll=!IsDir && (Depth>0 || Recurse==RECURSE_ALWAYS ||
-                   FilterList.ItemsCount()>0 ||
+                   FolderWildcards && Recurse!=RECURSE_DISABLE || 
                    Wildcards && Recurse==RECURSE_WILDCARDS || 
                    ScanEntireDisk && Recurse!=RECURSE_DISABLE);
     if (Depth==0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unrar/scantree.hpp new/unrar/scantree.hpp
--- old/unrar/scantree.hpp      2015-08-27 14:40:59.000000000 +0200
+++ new/unrar/scantree.hpp      2015-09-13 11:12:17.000000000 +0200
@@ -18,6 +18,7 @@
 class ScanTree
 {
   private:
+    bool ExpandFolderMask();
     bool GetFilteredMask();
     bool GetNextMask();
     SCAN_CODE FindProc(FindData *FD);
@@ -34,12 +35,21 @@
     SCAN_DIRS GetDirs;
     int Errors;
 
-    // set when processing paths like c:\ (root directory without wildcards)
+    // Set when processing paths like c:\ (root directory without wildcards).
     bool ScanEntireDisk;
 
     wchar CurMask[NM];
     wchar OrigCurMask[NM];
+
+    // Store all folder masks generated from folder wildcard mask in 
non-recursive mode.
+    StringList ExpandedFolderList;
+
+    // Store a filter string for folder wildcard in recursive mode.
     StringList FilterList;
+
+    // Set if processing a folder wildcard mask.
+    bool FolderWildcards;
+
     bool SearchAllInRoot;
     size_t SpecPathLength;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unrar/version.hpp new/unrar/version.hpp
--- old/unrar/version.hpp       2015-08-27 14:40:59.000000000 +0200
+++ new/unrar/version.hpp       2015-09-13 11:12:17.000000000 +0200
@@ -1,6 +1,6 @@
 #define RARVER_MAJOR     5
 #define RARVER_MINOR    30
-#define RARVER_BETA      3
-#define RARVER_DAY      27
-#define RARVER_MONTH     8
+#define RARVER_BETA      4
+#define RARVER_DAY      13
+#define RARVER_MONTH     9
 #define RARVER_YEAR   2015


Reply via email to