Issue installing updates from Linux samba share

Issue installing updates from Linux samba share

Postby asderferjerkel » 05.11.2015, 09:47

Hi,

I'm having some issues installing updates over a network share, which I've downloaded using DownloadUpdates.sh from version 10.2 on a Debian server.

Everything downloads fine, but when it comes to installing them on clients, I get this error from hashdeep64:

Code: Select all
Checking .NET Framework 4 installation state...
Installing .NET Framework 4.6...
Verifying integrity of ..\dotnet\NDP46-KB3045557-x86-x64-AllOS-ENU.exe...
hashdeep64.exe: Unable to load any matching files.
Try `hashdeep64.exe -h` for more information.
ERROR: File hash does not match stored value (file: ..\dotnet\NDP46-KB3045557-x86-x64-AllOS-ENU.exe).
Warning: Installation of ..\dotnet\NDP46-KB3045557-x86-x64-AllOS-ENU.exe failed (errorlevel: ).

Installation successful. Please reboot your system now and recall Update afterwards.


I've checked the sha1 hashes myself and they all match up as they should. I suspect the issue comes from this findstr line in InstallOSUpdate.cmd:

Code: Select all
%SystemRoot%\System32\findstr.exe /L /I /C:%% /C:## /C:%1 ..\md\hashes-%%i-%%j.txt >"%TEMP%\hash-%%i-%%j.txt"


If I run this manually on the hashes file like so:

Code: Select all
Z:\cmd>%SystemRoot%\System32\findstr.exe /L /I /C:%% /C:## /C:..\dotnet\NDP46-KB3045557-x86-x64-AllOS-ENU.exe ..\md\hashes-dotnet.txt


I get this output:

Code: Select all
%%%% HASHDEEP-1.0
%%%% size,md5,sha1,sha256,filename
## Invoked from: /home/user/wsusoffline/client/md
## $ hashdeep -c md5,sha1,sha256 -l ../dotnet/NDP46-KB3045557-x86-x64-AllOS-DEU.exe ../dotnet/NDP46-KB3045557-x86-x64-AllOS-ENU.exe ../dotnet/NDP46-KB3045557-x86-x64-AllOS-FRA.exe ../dotnet/dotnetfx35.exe
##


So it's missing the line with the actual hash itself on. I think it's because the search string has backslashes, whilst the path in hashes-dotnet.txt has forward slashes:

Code: Select all
65444688,88bc05e20114a4506f40c36911de92fa,3049a85843eaf65e89e2336d5fe6e85e416797be,b21d33135e67e3486b154b11f7961d8e1cfd7a603267fb60febb4a6feab5cf87,../dotnet/NDP46-KB3045557-x86-x64-AllOS-ENU.exe


If I replace the backslashed search strings in DoUpdate.cmd with forward slashes, I get this error:

Code: Select all
Installing ../dotnet/NDP46-KB3045557-x86-x64-AllOS-ENU.exe...
'..' is not recognized as an internal or external command, operable program or batch file.


...as cmd.exe can't handle forward slashes in relative paths.

As Debian's hashdeep64 uses forward slashes in paths, the easiest fix I can think of is using sed to replace them with backslashes before writing the hashes file, so editing each hashdeep line in DownloadUpdates.sh from:

Code: Select all
(cd ../client/md; hashdeep -c md5,sha1,sha256 -l -r ../$Vz > hashes-${Vz}.txt)


to:

Code: Select all
(cd ../client/md; hashdeep -c md5,sha1,sha256 -l -r ../$Vz | sed 's/\//\\/g' > hashes-${Vz}.txt)


I can then delete the integrity database by clearing md/*, recreate it by rerunning DownloadUpdates.sh, and then everything works fine. Would it be possible to have this fix incorporated into the next release of the Linux download script? Thanks!

edit: Just realised the above is already covered by the tr commands just before cleanup. Not sure why it didn't run on some patches (I can only assume I tried installing before it was quite finished) but you can safely ignore this thread!
asderferjerkel
 
Posts: 1
Joined: 05.11.2015, 08:23

Return to Linux

Who is online

Users browsing this forum: Bing [Bot] and 1 guest