Far-NetBox icon indicating copy to clipboard operation
Far-NetBox copied to clipboard

Crash when trying to enter !^! pattern into local custom command

Open martinprikryl opened this issue 9 years ago • 15 comments

NetBox 2.2.1 build 430 FAR 3.0 build 4562 x86

  • Open SFTP session
  • NetBox commands > Apply command (or Ctrl+G)
  • Select Local command
  • Focus back to Enter command to ...
  • Start typing !^!.
  • The moment you type the ^, the FAR crashes with "Access violation"

Exception: Access violation (execute at 0x0342B1C8) Address: 0x0342B1C8 Function: mainImpl Module: C:\Program Files (x86)\Far Manager\Far.exe

martinprikryl avatar Feb 27 '16 08:02 martinprikryl

Probably related, so I'm not posting it as a separate issue:

If you revert the steps, first typing a command that uses the !^! pattern and only then select the Local command, FAR does not crash, but once you submit the command (OK button), nothing happens (the command is not executed).

martinprikryl avatar Feb 27 '16 08:02 martinprikryl

All right, you pass the plugin garbage in the form of special characters Far that he did not know. When we asking them from the menu or associations, the first of their processes Far.exe forming the correct command line for calling external executable, or if this is one of those listed in the Help command opens the specified CMD wildcards in command and executes it. And in your experiment, the team immediately passed to the plug-in without prior treatment and disclosure of metacharacters and this leads to an error in the plugin.

The fact that only the AV occurs it can be considered good, but then you would get something mashine instruction like jb *,-2 and the CPU would povesli looped unconditional jump to itself. I had to press Reset and lost all working data? :)

It incorrectly put experiment, and here I do not see any errors, although I believe that the protection does not prevent invalid input commands ...

VictorVG avatar Feb 27 '16 09:02 VictorVG

@VictorVG Sorry, I do not understand your comment. What garbage? The !^! is a documented pattern:

Local command patterns: !^! - file name from local panel

martinprikryl avatar Feb 27 '16 10:02 martinprikryl

This is Far.exe only metasymbols documented in Help:

Special symbols

    The following special symbols can be used in associated commands,
user menu and the command "Apply command":

    !!       '!' character
    !        Long file name without extension
    !~       Short file name without extension
    !`       Long extension without file name (ext)
    !`~      Short extension without file name (ext)
    !.!      Long file name with extension
    !-!      Short file name with extension
    !+!      Similar to !-! but if a long file name was lost
             after performing the command, Far will restore it
    !@!      Name of file with selected file names list
    !$!      Name of file with selected short file names list
    !&       List of selected files
    !&~      List of selected short file names
    !:       Current drive in the format "C:"
             For remote folders - "\\server\share"
    !\       Current path
    !/       Short name of the current path
    !=\      Current path considering ~symbolic links~@HardSymLink@.
    !=/      Short name of the current path considering
             ~symbolic links~@HardSymLink@.

    !?<title>?<init>!
             This symbol is replaced by user input, when
             executing command. <title> and <init> - title
             and initial text of edit control.

             Several such symbols are allowed in the same line,
             for example:

             grep !?Search for:?! !?In:?*.*!|c:\\far\\Far.exe -v -

             A history name for the <init> string can be supplied
             in the <title>. In such case the command has the
             following format:

             !?$<history>$<title>?<init>!

             for example:

             grep !?$GrepHist$Search for:?! !?In:?*.*!|Far.exe -v -

             Leave the name empty to disable history.

             In <title> and <init> the usage of other meta-symbols is
             allowed by enclosing them in brackets.

             (e.g. grep !?Find in (!.!):?! |Far.exe -v -)

    !#       "!#" modifier specified before a file association
             symbol forces it (and all the following characters)
             to refer to the passive panel (see note 4).
             For example, !#!.! denotes the name of the current
             file on the passive panel.

    !^       "!^" modifier specified before a file association
             symbol forces it (and all the following characters)
             to refer to the active panel (see note 4).
             For example, !^!.! denotes a current file name on
             the active panel, !#!\!^!.! - a file on the passive
             panel with the same name as the name of the current
             file on the active panel.

  Notes:

    1. When handling special characters, Far substitutes only the string
corresponding to the special character. No additional characters (for example,
quotes) are added, and you should add them yourself if it is needed. For
example, if a program used in the associations requires a file name to be
enclosed in quotes, you should specify program.exe "!.!" and not
"program.exe !.!".

    2. The following modifiers may be used with the associations !@@! and !$! :

     'Q' - enclose names containing spaces in quotes;
     'S' - use '/' instead of '\' in pathnames;
     'F' - use full pathnames;
     'A' - use ANSI code page;
     'U' - use UTF-8 code page;
     'W' - use UTF-16 (Little endian) code page.

    For example, the association !@AFQ! means "name of file with the list of
selected file names, in ANSI encoding, include full pathnames, names with
spaces will be in quotes".

    3. When there are multiple associations specified, the meta-characters !@!
and !$! are shown in the menu as is. Those characters are translated when the
command is executed.

    4. The prefixes "!#" and "!^" work as toggles for associations. The effect
of these prefixes continues up to the next similar prefix. For example:

    if exist !#!\!^!.! diff -c -p !#!\!^!.! !\!.!

  "If the same file exists on the passive panel as the file under
   the cursor on the active panel, show the differences between
   the file on the passive panel and the file on the active panel,
   regardless of the name of the current file on the passive panel"

    5. If it is needed to pass to a program a name with an ending
backslash, use quotes, e. g. "!"\.
    For example, to extract a rar archive to a folder with the same name:

    winrar x "!.!" "!"\

and can't directly use for any plug-ins...

VictorVG avatar Feb 27 '16 10:02 VictorVG

My report is not about FAR's Apply command.

It's about Apply command function of NetBox.

applycommand

While that's inspired by the FAR's feature, it does not use any function of FAR to resolve the patterns. It's completely resolved in code of NetBox/WinSCP. Believe me, I wrote the code.


And even though, the !^! works even in FAR. Just read the documentation excerpt you posted yourself carefully:

!^ "!^" modifier specified before a file association symbol forces it (and all the following characters) to refer to the active panel (see note 4). For example, !^!.! denotes a current file name on the active panel, !#!!^!.! - a file on the passive panel with the same name as the name of the current file on the active panel.

martinprikryl avatar Feb 27 '16 13:02 martinprikryl

Yes, and just played to FTP. Far.exe process tries to read at 0x000000000, memory page where there is a failure appears to disassemble the conclusion garbage - he would not be a reason we put the signs ?? in each byte. But failure is not lucky - Process Hacker is well able to do a dump and disturbance ...

Stack:

stack

Far mini dump window:

av_log

debug window:

dbg1 dbg2 dbg3 dbg4 dbg5

log:

AV_log.txt

dump: Far.exe.dmp.7z

We have everything you could have done at this stage, is now only Michael can come up with fixes. Surely he can find some new ideas ...

VictorVG avatar Feb 27 '16 19:02 VictorVG

Interesting cinema - without NetBox.map / NetBox.pdb click YES - crash if they are - work great if they slip after the accident - the stack file names appear where there was a failure, well, that's understandable. Because thrust to the archive itself and test a bunch of x64 to make it easier to find where is still there?

All collected in MS VC ++ 2010.

bug

ftp://ftp.pcbsd.org/pub/system-updates/ - this is not real files - is cascades symlink (это не файлы а какскад симлинков с которыми пока только FileZilla или FTPRush без вопросов разбираются, а иные клиенты на них просто в обморок падают. Нашатыря на них нет.:))

pcbsd

Dump's (no PDB and added PDB) test screensot, test kit - NB432_test.7z.

???????

VictorVG avatar Feb 28 '16 22:02 VictorVG

NetBox 2.2.2.434 явление воспроизводится. Происходит не устранённое пока AV

Исключение: Нарушение доступа (чтение из 0x0000000000000008) Адрес: 0x000007FEE359182F OpenW Функция: ProcessPanelInputW Модуль: \Far\plugins\netbox\NetBox.dll

Стек в момент сбоя:

Исключительная ситуация 0x000007FEE359182F OpenW 0x000007FEE3591895 OpenW 0x000007FEE3593CA3 OpenW 0x000007FEE35A02BA OpenW 0x000007FEE35C9445 OpenW 0x000007FEE35D0EAE OpenW 0x000007FEE35872AD OpenW 0x000007FEE358B2F2 OpenW 0x000007FEE35859FF ProcessPanelInputW 0x000000013FB5BA6A 0x000000013FB56892 0x000000013FB59D00 0x000000013FC340FC 0x000000013FB796D3 0x000000013FB79EB8 0x000000013FB9C04D 0x000000013FBFB699 0x000000013FBFACF3 0x000000013FBFAB5A 0x000000013FBF5468 0x000000013FBF7F29 0x000000013FBF81A5 0x000000013FCF7048 0x00000000776B5A4D BaseThreadInitThunk 0x00000000777EB831 RtlUserThreadStart

Ну а где сидит ошибка мы вроде знаем и надо её устранить - чего эта пакость нам кровь пьёт?

VictorVG avatar Mar 19 '16 03:03 VictorVG

Совсем интересно - взял файлы из ночнушки, проверяю - не воспроизводится. Переписал собранную в vc++ 2015 DLL своей собранной в vc++ 2010, проверяю - не воспроизводится. Возникло предположение что сбой могут провоцировать lng файлы. Буду проверять эту гипотезу.

VictorVG avatar Mar 19 '16 12:03 VictorVG

Та-а-к, кажется я отыскал первопричину сбоя - в LNG файлах у меня сидели ошибки - вот результат хекс сравнения:

source

красным видны четыре точки где файлы различались, в том числе строка 1040:

1040 "Received response %d '%s' from %s"
1040 "Received response %d %s from %s"

похоже она и провоцировала сбой, но явно не в одиночку, т.к. после замены файла на исправленный сбой воспроизводится, значит есть вероятность ошибки в БД плагина. Попробую и её пересоздать с нуля.

VictorVG avatar Mar 19 '16 12:03 VictorVG

Да, сессии экспортировал, базу и default.farconfig удалил, настроил NetBox с нуля, импортировал сессии, перепроверил - в таких условиях AV не возникает, значит дополнительно влияла ошибка в базе. Попробую её отыскать - это уже и мне самому стало интересно выловить все причины приводившие к сбою.

VictorVG avatar Mar 19 '16 13:03 VictorVG

Продолжение банкета - смотрю и формат БД поменялся:

старый вариант:

<?xml version="1.0" encoding="UTF-8"?>
<farconfig version="3.0.4542">
    <pluginsconfig>
        <plugin guid="42E4AEB1-A230-44F4-B33C-F195BB654931">
            <hierarchicalconfig>
                <key name="42E4AEB1-A230-44F4-B33C-F195BB654931" description="NetBox">
                    <key name="Configuration" description="">
                        <value name="Version" type="text" value="2.1.45"/>
                        <key name="Interface" description="">
                            <value name="AutoReadDirectoryAfterOp" type="qword" value="0000000000000001"/>
                            <value name="BeepOnFinish" type="qword" value="0000000000000000"/>
                            <value name="BeepOnFinishAfter" type="hex" value="17,6C,C1,16,6C,C1,36,3F"/>
                            <value name="CacheDirectoryChangesMaxSize" type="qword" value="0000000000000064"/>
                            <value name="ChecksumAlg" type="text" value="md5"/>
                            <value name="CollectUsage" type="qword" value="0000000000000000"/>
                            <value name="ConfirmCommandSession" type="qword" value="0000000000000001"/>
                            <value name="ConfirmOverwriting" type="qword" value="0000000000000001"/>
                            <value name="ConfirmResume" type="qword" value="0000000000000001"/>
                            <value name="ContinueOnError" type="qword" value="0000000000000000"/>
                            <value name="ExternalIpAddress" type="text" value=""/>
                            <value name="IgnoreCancelBeforeFinish" type="hex" value="DF,BC,9A,78,56,34,02,3F"/>
                            <value name="KeepUpToDateChangeDelay" type="qword" value="00000000000001F4"/>
                            <value name="MaxWatchDirectories" type="qword" value="00000000000001F4"/>
                            <value name="PuttyPassword" type="qword" value="0000000000000000"/>
                            <value name="PuttyPath" type="text" value="%25PROGRAMFILES%25%5CPuTTY%5Cputty.exe"/>
                            <value name="PuttyRegistryStorageKey" type="text" value="Software%5CSimonTatham%5CPuTTY"/>
                            <value name="PuttySession" type="text" value="WinSCP%20temporary%20session"/>
                            <value name="QueueAutoPopup" type="qword" value="0000000000000001"/>
                            <value name="QueueKeepDoneItems" type="qword" value="0000000000000001"/>
                            <value name="QueueKeepDoneItemsFor" type="qword" value="000000000000000F"/>
                            <value name="QueueRememberPassword" type="qword" value="0000000000000000"/>
                            <value name="QueueTransfersLimit" type="qword" value="0000000000000002"/>
                            <value name="RandomSeedFile" type="text" value="%25APPDATA%25%5Cwinscp.rnd"/>
                            <value name="SessionReopenAuto" type="qword" value="0000000000001388"/>
                            <value name="SessionReopenAutoIdle" type="qword" value="0000000000002328"/>
                            <value name="SessionReopenAutoMaximumNumberOfRetries" type="qword" value="0000000000000063"/>
                            <value name="SessionReopenAutoStall" type="qword" value="000000000000EA60"/>
                            <value name="SessionReopenBackground" type="qword" value="00000000000007D0"/>
                            <value name="SessionReopenTimeout" type="qword" value="0000000000000000"/>
                            <value name="ShowFtpWelcomeMessage" type="qword" value="0000000000000000"/>
                            <value name="SynchronizeMode" type="qword" value="0000000000000000"/>
                            <value name="SynchronizeModeAuto" type="qword" value="FFFFFFFFFFFFFFFF"/>
                            <value name="SynchronizeOptions" type="qword" value="0000000000000005"/>
                            <value name="SynchronizeParams" type="qword" value="0000000000000042"/>
                            <value name="TelnetForFtpInPutty" type="qword" value="0000000000000001"/>
                            <value name="TryFtpWhenSshFails" type="qword" value="0000000000000001"/>
                            <value name="TunnelLocalPortNumberHigh" type="qword" value="000000000000C3B3"/>
                            <value name="TunnelLocalPortNumberLow" type="qword" value="000000000000C350"/>
                            <key name="Interface" description="">
                                <key name="Bookmarks" description="">
                                    <key name="Local" description=""/>
                                    <key name="Options" description=""/>
                                    <key name="Remote" description=""/>
                                    <key name="ShortCuts" description=""/>
                                </key>
                                <key name="CopyParam" description="">
                                    <value name="AddXToDirectories" type="qword" value="0000000000000001"/>
                                    <value name="CPSLimit" type="qword" value="0000000000000000"/>
                                    <value name="CalculateSize" type="qword" value="0000000000000001"/>
                                    <value name="ClearArchive" type="qword" value="0000000000000000"/>
                                    <value name="CopyParamList" type="qword" value="FFFFFFFFFFFFFFFF"/>
                                    <value name="FileNameCase" type="qword" value="0000000000000000"/>
                                    <value name="IgnorePermErrors" type="qword" value="0000000000000000"/>
                                    <value name="IncludeFileMask" type="text" value=""/>
                                    <value name="LocalInvalidChars" type="text" value="/%5C:%2A%3F&quot;&lt;&gt;|"/>
                                    <value name="Masks" type="text" value="%2A.%2Ahtml;%20%2A.htm;%20%2A.txt;%20%2A.php;%20%2A.php3;%20%2A.cgi;%20%2A.c;%20%2A.cpp;%20%2A.h;%20%2A.pas;%20%2A.bas;%20%2A.tex;%20%2A.pl;%20%2A.js;%20.htaccess;%20%2A.xtml;%20%2A.css;%20%2A.cfg;%20%2A.ini;%20%2A.sh;%20%2A.xml"/>
                                    <value name="NewerOnly" type="qword" value="0000000000000000"/>
                                    <value name="PreserveReadOnly" type="qword" value="0000000000000000"/>
                                    <value name="PreserveRights" type="qword" value="0000000000000000"/>
                                    <value name="PreserveTime" type="qword" value="0000000000000001"/>
                                    <value name="Queue" type="qword" value="0000000000000000"/>
                                    <value name="QueueIndividually" type="qword" value="0000000000000000"/>
                                    <value name="QueueNoConfirmation" type="qword" value="0000000000000001"/>
                                    <value name="RemoveBOM" type="qword" value="0000000000000000"/>
                                    <value name="RemoveCtrlZ" type="qword" value="0000000000000000"/>
                                    <value name="ReplaceInvalidChars" type="qword" value="0000000000000001"/>
                                    <value name="ResumeSupport" type="qword" value="0000000000000001"/>
                                    <value name="ResumeThreshold" type="qword" value="0000000000019000"/>
                                    <value name="Text" type="text" value="rw-r--r--"/>
                                    <value name="TransferMode" type="qword" value="0000000000000000"/>
                                </key>
                                <key name="Far" description="">
                                    <value name="ApplyCommandCommand" type="text" value=""/>
                                    <value name="ApplyCommandParams" type="qword" value="0000000000000000"/>
                                    <value name="ColumnTypesDetailed" type="text" value="N,S,DM,O,G,R"/>
                                    <value name="ColumnWidthsDetailed" type="text" value="0,8,14,0,0,9"/>
                                    <value name="CommandPrefixes" type="text" value="netbox,ftp,scp,sftp,ftps,http,https,webdav"/>
                                    <value name="ConfirmOverwritingOverride" type="qword" value="0000000000000000"/>
                                    <value name="ConfirmSynchronizedBrowsing" type="qword" value="0000000000000001"/>
                                    <value name="CustomPanelModeDetailed" type="qword" value="0000000000000001"/>
                                    <value name="DisksMenu" type="qword" value="0000000000000001"/>
                                    <value name="DisksMenuHotKey" type="qword" value="0000000000000000"/>
                                    <value name="EditorDownloadDefaultMode" type="qword" value="0000000000000001"/>
                                    <value name="EditorMultiple" type="qword" value="0000000000000000"/>
                                    <value name="EditorUploadOnSave" type="qword" value="0000000000000001"/>
                                    <value name="EditorUploadSameOptions" type="qword" value="0000000000000001"/>
                                    <value name="FullScreenDetailed" type="qword" value="0000000000000001"/>
                                    <value name="HostNameInTitle" type="qword" value="0000000000000001"/>
                                    <value name="PageantPath" type="text" value="G:%5Cdev%5Cfar3%5C7%5CFar%5Cplugins%5Cnetbox%5Cputty%5Cpageant.exe"/>
                                    <value name="PluginsMenu" type="qword" value="0000000000000001"/>
                                    <value name="PluginsMenuCommands" type="qword" value="0000000000000001"/>
                                    <value name="PuttygenPath" type="text" value="G:%5Cdev%5Cfar3%5C7%5CFar%5Cplugins%5Cnetbox%5Cputty%5Cputtygen.exe"/>
                                    <value name="QueueBeep" type="qword" value="0000000000000001"/>
                                    <value name="StatusColumnTypesDetailed" type="text" value="NR"/>
                                    <value name="StatusColumnWidthsDetailed" type="text" value="0"/>
                                </key>
                                <key name="Interface" description="">
                                    <key name="NewDirectory" description="">
                                        <value name="Valid" type="hex" value="08,69,76,E5,FE,07,00,00"/>
                                    </key>
                                </key>
                            </key>
                        </key>
                        <key name="Logging" description="">
                            <value name="LogFileAppend" type="qword" value="0000000000000001"/>
                            <value name="LogFileName" type="text" value="%25TEMP%25%5C&amp;S.log"/>
                            <value name="LogWindowLines" type="qword" value="0000000000000064"/>
                            <value name="Logging" type="qword" value="0000000000000000"/>
                            <value name="PermanentActionsLogFileName" type="text" value="%25TEMP%25%5C&amp;S.xml"/>
                            <value name="PermanentLogActions" type="qword" value="0000000000000000"/>
                            <value name="PermanentLogProtocol" type="qword" value="0000000000000000"/>
                            <value name="PermanentLogSensitive" type="qword" value="0000000000000000"/>
                        </key>
                        <key name="Usage" description=""/>
                    </key>
                    <key name="Sessions" description="">
                        <key name="Default%20Settings" description="">
                            <value name="FSProtocol" type="text" value="SFTP%20(SCP)"/>
                            <value name="Version" type="text" value="2.1.44"/>
                        </key>
                        <key name="Far%20sources%20(SVN%20repository)" description="">
                            <value name="CacheDirectories" type="qword" value="0000000000000000"/>
                            <value name="CacheDirectoryChanges" type="qword" value="0000000000000000"/>
                            <value name="Compression" type="qword" value="0000000000000001"/>
                            <value name="FSProtocol" type="text" value="WebDAV"/>
                            <value name="HostName" type="text" value="svn.code.sf.net"/>
                            <value name="PortNumber" type="qword" value="0000000000000050"/>
                            <value name="RemoteDirectory" type="text" value="/p/farmanager/code/trunk"/>
                            <value name="SFTPMaxVersion" type="qword" value="0000000000000000"/>
                            <value name="UpdateDirectories" type="qword" value="0000000000000000"/>
                            <value name="Version" type="text" value="2.1.44"/>
                        </key>
                        <key name="FreeBSD%20(FTP)" description="">
                            <value name="CacheDirectoryChanges" type="qword" value="0000000000000000"/>
                            <value name="FSProtocol" type="text" value="FTP"/>
                            <value name="FtpAllowEmptyPassword" type="qword" value="0000000000000001"/>
                            <value name="HostName" type="text" value="ftp.freebsd.org"/>
                            <value name="PingType" type="qword" value="0000000000000002"/>
                            <value name="PortNumber" type="qword" value="0000000000000015"/>
                            <value name="RemoteDirectory" type="text" value="/pub/FreeBSD/"/>
                            <value name="SFTPMaxVersion" type="qword" value="0000000000000000"/>
                            <value name="Timeout" type="qword" value="000000000000005A"/>
                            <value name="UpdateDirectories" type="qword" value="0000000000000000"/>
                            <value name="Version" type="text" value="2.1.44"/>
                        </key>
                        <key name="LiBO%20(FTP)" description="">
                            <value name="CacheDirectoryChanges" type="qword" value="0000000000000000"/>
                            <value name="FSProtocol" type="text" value="FTP"/>
                            <value name="FtpAllowEmptyPassword" type="qword" value="0000000000000001"/>
                            <value name="HostName" type="text" value="ftp5.gwdg.de"/>
                            <value name="PingType" type="qword" value="0000000000000002"/>
                            <value name="PortNumber" type="qword" value="0000000000000015"/>
                            <value name="RemoteDirectory" type="text" value="/pub/tdf/libreoffice/"/>
                            <value name="SFTPMaxVersion" type="qword" value="0000000000000000"/>
                            <value name="Timeout" type="qword" value="000000000000005A"/>
                            <value name="UpdateDirectories" type="qword" value="0000000000000000"/>
                            <value name="Version" type="text" value="2.1.44"/>
                        </key>
                        <key name="PC-BSD%20(FTP)" description="">
                            <value name="CacheDirectoryChanges" type="qword" value="0000000000000000"/>
                            <value name="FSProtocol" type="text" value="FTP"/>
                            <value name="FtpAllowEmptyPassword" type="qword" value="0000000000000001"/>
                            <value name="HostName" type="text" value="ftp.pcbsd.org"/>
                            <value name="PingType" type="qword" value="0000000000000002"/>
                            <value name="PortNumber" type="qword" value="0000000000000015"/>
                            <value name="RemoteDirectory" type="text" value="/pub/"/>
                            <value name="SFTPMaxVersion" type="qword" value="0000000000000000"/>
                            <value name="Timeout" type="qword" value="000000000000005A"/>
                            <value name="UpdateDirectories" type="qword" value="0000000000000000"/>
                            <value name="Version" type="text" value="2.1.44"/>
                        </key>
                        <key name="RARLabs%20(FTP)" description="">
                            <value name="CacheDirectoryChanges" type="qword" value="0000000000000000"/>
                            <value name="CodePage" type="text" value=""/>
                            <value name="FSProtocol" type="text" value="FTP"/>
                            <value name="FtpAllowEmptyPassword" type="qword" value="0000000000000001"/>
                            <value name="HostName" type="text" value="ftp.rarlabs.com"/>
                            <value name="KEX" type="text" value="dh-gex-sha1,dh-gex-sha1,dh-gex-sha1,dh-gex-sha1,dh-gex-sha1,dh-gex-sha1,dh-gex-sha1,dh-gex-sha1,dh-gex-sha1"/>
                            <value name="LookupUserGroups2" type="qword" value="0000000000000000"/>
                            <value name="PingType" type="qword" value="0000000000000002"/>
                            <value name="PortNumber" type="qword" value="0000000000000015"/>
                            <value name="RemoteDirectory" type="text" value="/rar/"/>
                            <value name="SFTPMaxVersion" type="qword" value="0000000000000000"/>
                            <value name="TimeDifference" type="hex" value="3E,E9,93,3E,E9,93,CA,3F"/>
                            <value name="TimeDifferenceAuto" type="qword" value="0000000000000000"/>
                            <value name="Timeout" type="qword" value="000000000000005A"/>
                            <value name="UpdateDirectories" type="qword" value="0000000000000000"/>
                            <value name="Version" type="text" value="2.1.45"/>
                        </key>
                    </key>
                </key>
            </hierarchicalconfig>
        </plugin>
    </pluginsconfig></farconfig>

и новый вариант:

<?xml version="1.0" encoding="UTF-8"?>
<farconfig version="3.0.4583">
    <pluginsconfig>
        <plugin guid="42E4AEB1-A230-44F4-B33C-F195BB654931">
            <hierarchicalconfig>
                <key name="42E4AEB1-A230-44F4-B33C-F195BB654931" description="NetBox">
                    <key name="Configuration">
                        <key name="Interface">
                            <value name="AutoReadDirectoryAfterOp" type="qword" value="0000000000000001"/>
                            <value name="BeepOnFinish" type="qword" value="0000000000000000"/>
                            <value name="BeepOnFinishAfter" type="hex" value="17,6C,C1,16,6C,C1,36,3F"/>
                            <value name="CacheDirectoryChangesMaxSize" type="qword" value="0000000000000064"/>
                            <value name="ChecksumAlg" type="text" value="md5"/>
                            <value name="CollectUsage" type="qword" value="0000000000000000"/>
                            <value name="ConfirmCommandSession" type="qword" value="0000000000000001"/>
                            <value name="ConfirmOverwriting" type="qword" value="0000000000000001"/>
                            <value name="ConfirmResume" type="qword" value="0000000000000001"/>
                            <value name="ContinueOnError" type="qword" value="0000000000000000"/>
                            <value name="ExternalIpAddress" type="text" value=""/>
                            <value name="IgnoreCancelBeforeFinish" type="hex" value="DF,BC,9A,78,56,34,02,3F"/>
                            <value name="KeepUpToDateChangeDelay" type="qword" value="00000000000001F4"/>
                            <value name="MaxWatchDirectories" type="qword" value="00000000000001F4"/>
                            <value name="PuttyPassword" type="qword" value="0000000000000000"/>
                            <value name="PuttyPath" type="text" value="%25PROGRAMFILES%25%5CPuTTY%5Cputty.exe"/>
                            <value name="PuttyRegistryStorageKey" type="text" value="Software%5CSimonTatham%5CPuTTY"/>
                            <value name="PuttySession" type="text" value="WinSCP%20temporary%20session"/>
                            <value name="QueueAutoPopup" type="qword" value="0000000000000001"/>
                            <value name="QueueKeepDoneItems" type="qword" value="0000000000000001"/>
                            <value name="QueueKeepDoneItemsFor" type="qword" value="000000000000000F"/>
                            <value name="QueueRememberPassword" type="qword" value="0000000000000000"/>
                            <value name="QueueTransfersLimit" type="qword" value="0000000000000002"/>
                            <value name="RandomSeedFile" type="text" value="%25APPDATA%25%5Cwinscp.rnd"/>
                            <value name="SessionReopenAuto" type="qword" value="0000000000001388"/>
                            <value name="SessionReopenAutoIdle" type="qword" value="0000000000002328"/>
                            <value name="SessionReopenAutoMaximumNumberOfRetries" type="qword" value="0000000000000063"/>
                            <value name="SessionReopenAutoStall" type="qword" value="000000000000EA60"/>
                            <value name="SessionReopenBackground" type="qword" value="00000000000007D0"/>
                            <value name="SessionReopenTimeout" type="qword" value="0000000000000000"/>
                            <value name="ShowFtpWelcomeMessage" type="qword" value="0000000000000000"/>
                            <value name="SynchronizeMode" type="qword" value="0000000000000000"/>
                            <value name="SynchronizeModeAuto" type="qword" value="FFFFFFFFFFFFFFFF"/>
                            <value name="SynchronizeOptions" type="qword" value="0000000000000005"/>
                            <value name="SynchronizeParams" type="qword" value="0000000000000042"/>
                            <value name="TelnetForFtpInPutty" type="qword" value="0000000000000001"/>
                            <value name="TryFtpWhenSshFails" type="qword" value="0000000000000001"/>
                            <value name="TunnelLocalPortNumberHigh" type="qword" value="000000000000C3B3"/>
                            <value name="TunnelLocalPortNumberLow" type="qword" value="000000000000C350"/>
                            <key name="Interface">
                                <key name="Bookmarks">
                                    <key name="Local"/>
                                    <key name="Options"/>
                                    <key name="Remote"/>
                                    <key name="ShortCuts"/>
                                </key>
                                <key name="CopyParam">
                                    <value name="AddXToDirectories" type="qword" value="0000000000000001"/>
                                    <value name="CPSLimit" type="qword" value="0000000000000000"/>
                                    <value name="CalculateSize" type="qword" value="0000000000000001"/>
                                    <value name="ClearArchive" type="qword" value="0000000000000000"/>
                                    <value name="CopyParamList" type="qword" value="FFFFFFFFFFFFFFFF"/>
                                    <value name="FileNameCase" type="qword" value="0000000000000000"/>
                                    <value name="IgnorePermErrors" type="qword" value="0000000000000000"/>
                                    <value name="IncludeFileMask" type="text" value=""/>
                                    <value name="LocalInvalidChars" type="text" value="/%5C:%2A%3F&quot;&lt;&gt;|"/>
                                    <value name="Masks" type="text" value="%2A.%2Ahtml;%20%2A.htm;%20%2A.txt;%20%2A.php;%20%2A.php3;%20%2A.cgi;%20%2A.c;%20%2A.cpp;%20%2A.h;%20%2A.pas;%20%2A.bas;%20%2A.tex;%20%2A.pl;%20%2A.js;%20.htaccess;%20%2A.xtml;%20%2A.css;%20%2A.cfg;%20%2A.ini;%20%2A.sh;%20%2A.xml"/>
                                    <value name="NewerOnly" type="qword" value="0000000000000000"/>
                                    <value name="PreserveReadOnly" type="qword" value="0000000000000000"/>
                                    <value name="PreserveRights" type="qword" value="0000000000000000"/>
                                    <value name="PreserveTime" type="qword" value="0000000000000001"/>
                                    <value name="PreserveTimeDirs" type="qword" value="0000000000000000"/>
                                    <value name="Queue" type="qword" value="0000000000000000"/>
                                    <value name="QueueIndividually" type="qword" value="0000000000000000"/>
                                    <value name="QueueNoConfirmation" type="qword" value="0000000000000001"/>
                                    <value name="RemoveBOM" type="qword" value="0000000000000000"/>
                                    <value name="RemoveCtrlZ" type="qword" value="0000000000000000"/>
                                    <value name="ReplaceInvalidChars" type="qword" value="0000000000000001"/>
                                    <value name="ResumeSupport" type="qword" value="0000000000000001"/>
                                    <value name="ResumeThreshold" type="qword" value="0000000000019000"/>
                                    <value name="Text" type="text" value="rw-r--r--"/>
                                    <value name="TransferMode" type="qword" value="0000000000000000"/>
                                </key>
                                <key name="Far">
                                    <value name="ApplyCommandCommand" type="text" value=""/>
                                    <value name="ApplyCommandParams" type="qword" value="0000000000000000"/>
                                    <value name="ColumnTypesDetailed" type="text" value="N,S,DM,O,G,R"/>
                                    <value name="ColumnWidthsDetailed" type="text" value="0,8,14,0,0,9"/>
                                    <value name="CommandPrefixes" type="text" value="netbox,ftp,scp,sftp,ftps,http,https,webdav"/>
                                    <value name="ConfirmOverwritingOverride" type="qword" value="0000000000000000"/>
                                    <value name="ConfirmSynchronizedBrowsing" type="qword" value="0000000000000001"/>
                                    <value name="CustomPanelModeDetailed" type="qword" value="0000000000000001"/>
                                    <value name="DisksMenu" type="qword" value="0000000000000001"/>
                                    <value name="DisksMenuHotKey" type="qword" value="0000000000000000"/>
                                    <value name="EditorDownloadDefaultMode" type="qword" value="0000000000000001"/>
                                    <value name="EditorMultiple" type="qword" value="0000000000000000"/>
                                    <value name="EditorUploadOnSave" type="qword" value="0000000000000001"/>
                                    <value name="EditorUploadSameOptions" type="qword" value="0000000000000001"/>
                                    <value name="FullScreenDetailed" type="qword" value="0000000000000001"/>
                                    <value name="HostNameInTitle" type="qword" value="0000000000000001"/>
                                    <value name="PageantPath" type="text" value="G:%5Cdev%5Cfar3%5C3%5CFar%5Cplugins%5Cnetbox%5Cputty%5Cpageant.exe"/>
                                    <value name="PluginsMenu" type="qword" value="0000000000000001"/>
                                    <value name="PluginsMenuCommands" type="qword" value="0000000000000001"/>
                                    <value name="PuttygenPath" type="text" value="G:%5Cdev%5Cfar3%5C3%5CFar%5Cplugins%5Cnetbox%5Cputty%5Cputtygen.exe"/>
                                    <value name="QueueBeep" type="qword" value="0000000000000001"/>
                                    <value name="StatusColumnTypesDetailed" type="text" value="NR"/>
                                    <value name="StatusColumnWidthsDetailed" type="text" value="0"/>
                                </key>
                                <key name="Interface">
                                    <key name="NewDirectory">
                                        <value name="Valid" type="hex" value="00,00,00,00,00,00,00,00"/>
                                    </key>
                                </key>
                            </key>
                        </key>
                        <key name="Logging">
                            <value name="LogFileAppend" type="qword" value="0000000000000001"/>
                            <value name="LogWindowLines" type="qword" value="0000000000000064"/>
                            <value name="PermanentActionsLogFileName" type="text" value="%25TEMP%25%5C&amp;S.xml"/>
                            <value name="PermanentLogActions" type="qword" value="0000000000000000"/>
                            <value name="PermanentLogFileName" type="text" value="%25TEMP%25%5C&amp;S.log"/>
                            <value name="PermanentLogProtocol" type="qword" value="0000000000000000"/>
                            <value name="PermanentLogSensitive" type="qword" value="0000000000000000"/>
                            <value name="PermanentLogging" type="qword" value="0000000000000000"/>
                        </key>
                        <key name="Usage"/>
                    </key>
                    <key name="Sessions">
                        <key name="Default%20Settings">
                            <value name="FSProtocol" type="text" value="SFTP%20(SCP)"/>
                            <value name="Version" type="text" value="2.2.2"/>
                        </key>
                        <key name="Far%20sources%20(SVN%20repository)">
                            <value name="CacheDirectories" type="qword" value="0000000000000000"/>
                            <value name="CacheDirectoryChanges" type="qword" value="0000000000000000"/>
                            <value name="CodePage" type="text" value=""/>
                            <value name="Compression" type="qword" value="0000000000000001"/>
                            <value name="FSProtocol" type="text" value="WebDAV"/>
                            <value name="HostName" type="text" value="svn.code.sf.net"/>
                            <value name="KEX" type="text" value="ecdh,ecdh,ecdh,ecdh,ecdh,ecdh"/>
                            <value name="LookupUserGroups2" type="qword" value="0000000000000000"/>
                            <value name="PortNumber" type="qword" value="0000000000000050"/>
                            <value name="RemoteDirectory" type="text" value="/p/farmanager/code/trunk"/>
                            <value name="SFTPMaxVersion" type="qword" value="0000000000000000"/>
                            <value name="UpdateDirectories" type="qword" value="0000000000000000"/>
                            <value name="Version" type="text" value="2.2.2"/>
                        </key>
                        <key name="FreeBSD%20(FTP)">
                            <value name="CacheDirectoryChanges" type="qword" value="0000000000000000"/>
                            <value name="FSProtocol" type="text" value="FTP"/>
                            <value name="FtpAllowEmptyPassword" type="qword" value="0000000000000001"/>
                            <value name="HostName" type="text" value="ftp.freebsd.org"/>
                            <value name="PingType" type="qword" value="0000000000000002"/>
                            <value name="PortNumber" type="qword" value="0000000000000015"/>
                            <value name="RemoteDirectory" type="text" value="/pub/FreeBSD/"/>
                            <value name="SFTPMaxVersion" type="qword" value="0000000000000000"/>
                            <value name="Timeout" type="qword" value="000000000000005A"/>
                            <value name="UpdateDirectories" type="qword" value="0000000000000000"/>
                            <value name="Version" type="text" value="2.2.2"/>
                        </key>
                        <key name="LiBO%20(FTP)">
                            <value name="CacheDirectoryChanges" type="qword" value="0000000000000000"/>
                            <value name="FSProtocol" type="text" value="FTP"/>
                            <value name="FtpAllowEmptyPassword" type="qword" value="0000000000000001"/>
                            <value name="HostName" type="text" value="ftp5.gwdg.de"/>
                            <value name="PingType" type="qword" value="0000000000000002"/>
                            <value name="PortNumber" type="qword" value="0000000000000015"/>
                            <value name="RemoteDirectory" type="text" value="/pub/tdf/libreoffice/"/>
                            <value name="SFTPMaxVersion" type="qword" value="0000000000000000"/>
                            <value name="Timeout" type="qword" value="000000000000005A"/>
                            <value name="UpdateDirectories" type="qword" value="0000000000000000"/>
                            <value name="Version" type="text" value="2.2.2"/>
                        </key>
                        <key name="PC-BSD%20(FTP)">
                            <value name="CacheDirectoryChanges" type="qword" value="0000000000000000"/>
                            <value name="FSProtocol" type="text" value="FTP"/>
                            <value name="FtpAllowEmptyPassword" type="qword" value="0000000000000001"/>
                            <value name="HostName" type="text" value="ftp.pcbsd.org"/>
                            <value name="PingType" type="qword" value="0000000000000002"/>
                            <value name="PortNumber" type="qword" value="0000000000000015"/>
                            <value name="RemoteDirectory" type="text" value="/pub/"/>
                            <value name="SFTPMaxVersion" type="qword" value="0000000000000000"/>
                            <value name="Timeout" type="qword" value="000000000000005A"/>
                            <value name="UpdateDirectories" type="qword" value="0000000000000000"/>
                            <value name="Version" type="text" value="2.2.2"/>
                        </key>
                        <key name="RARLabs%20(FTP)">
                            <value name="CacheDirectoryChanges" type="qword" value="0000000000000000"/>
                            <value name="FSProtocol" type="text" value="FTP"/>
                            <value name="FtpAllowEmptyPassword" type="qword" value="0000000000000001"/>
                            <value name="HostName" type="text" value="ftp.rarlabs.com"/>
                            <value name="PingType" type="qword" value="0000000000000002"/>
                            <value name="PortNumber" type="qword" value="0000000000000015"/>
                            <value name="RemoteDirectory" type="text" value="/rar/"/>
                            <value name="SFTPMaxVersion" type="qword" value="0000000000000000"/>
                            <value name="TimeDifference" type="hex" value="4E,B4,AB,90,F2,93,CA,3F"/>
                            <value name="TimeDifferenceAuto" type="qword" value="0000000000000000"/>
                            <value name="Timeout" type="qword" value="000000000000005A"/>
                            <value name="UpdateDirectories" type="qword" value="0000000000000000"/>
                            <value name="Version" type="text" value="2.2.2"/>
                        </key>
                    </key>
                </key>
            </hierarchicalconfig>
        </plugin>
    </pluginsconfig></farconfig>

думаю, что этого достаточно чтобы перепроверить и остальные фрагменты БД default.farconfig - не просто так её экспортируемый вариант до 600 с хвостиком КБ увеличился...

Во всех элементах <key name="<key>" description=""> удалено поле description="" и вероятно что именно оно и вызывало сбой при чтении настроек...

VictorVG avatar Mar 19 '16 14:03 VictorVG

Resolving recomendation (step by step) :

  1. Export all session: go to NetBox panel, select all session, F5 to sected backup folder;
  2. Close Far and delete %FARPROFILE%\PluginsData\42E4AEB1-A230-44F4-B33C-F195BB654931.db and move to any folder default.farconfig if exist.
  3. Run Far, press F9 button, go to Settinga - Plugins Configuration menu, select NetBox and set up default settings;
  4. Press F11 button, select NetBox and press Enter for run NetBox;
  5. Copy to NetBox panel *.netbox files form to backup folder, then press ShiftF9 button;
  6. Restart Far and use it.

ну, понятно дифф к readme_ru.md с меня - тут нужно просто сформулировать текст так, чтобы любой новичок не только его понял, но и ошибок не наделал.

VictorVG avatar Mar 19 '16 14:03 VictorVG

В общем стал разгребаться и обнаружил что в новом формате БД конфигов Far во всех пустой элемент description="" удалён.

В итоге после его чистки (у меня их было 153 записи в default.farconfig) убралось порядка 2Кб мусора, ну и остальные чистки ещё 15Кб из файла убрали. Как-то приятнее видеть в бэкапе 190 вместо 208 Кб. :) Удаление явно в формате конфигов Far а не самой SQLite - её доки я на тему такого поля все прошерстил. Видимо не замеченные вовремя последствия обновления формата БД выстрелили...

Посему идея - если мы видим что в формате БД конфига NB ошибки, читаем её в память, переименовываем старую в 42E4AEB1-A230-44F4-B33C-F195BB654931.db.bad и генерим новую 42E4AEB1-A230-44F4-B33C-F195BB654931.db корректного формата что избавит от подобных "сюрпризов". Этот к примеру сколько нам крови попил?

VictorVG avatar Mar 19 '16 23:03 VictorVG

Пока (думаю в качестве заготовки нам текст сгодится) вот такая выписка из моего FAQ:

Q. NetBox сбоит, обычно выводится ошибка Access Violation (Нарушение доступа) в одной из функций, выгрузить его чаще всего не удаётся т.к. аварийно завершается задача самого Far. Что делать и что это вызвало?

A. Обычно причина в повреждении базы "42E4AEB1-A230-44F4-B33C-F195BB654931.db" конфигурации плагина лежащей в подкаталоге "%FARPROFILE%\PluginsData".

Для восстановления нормальной работы плагина надо выполнить следующие
операции:

1) Вызывать панель NetBox (при её вызове обычно ошибок не бывает), на
   пассивной панели выбрать или создать каталог для временного хранения
   файлов сессий (*.netbox).
2) Выделить нужные вам сессии и скопировать их в этот каталог (F5 или 
   перетащить их мышкой).
3) Нажать F9, Параметры, Параметры плагинов, NetBox и по пунктам
   списать на бумажку значения ваших настроек.
4) Удалить файл базы настроек NetBox: 

   "%FARPROFILE%\PluginsData\42E4AEB1-A230-44F4-B33C-F195BB654931.db"

5) Снова запустить Far, "F9, Параметры, Параметры плагинов, NetBox"
   и последовательно настроить те параметры NetBox которые отличаются
   от записанных вами в п. 3), после чего закрыть диалог настроек 
   NetBox - больше он вам до следующего сбоя или изменения его настроек
   не понадобится, затем нажать "ShiftF9 Enter" для сохранения настроек.
6) Вызываем панель NetBox, там сейчас пусто и мы увидим предложение
   нажать ShiftF4 для создания нового соединения, но пропустим это, а
   открыв на второй панели каталог где мы сохранили сессии выделим их
   и нажмём F5 для импорта, NetBox спросит подтверждение операции, 
   ответим утвердительно и по её завершению на панели NetBox будут
   созданы новые сессии, но нам надо сохранить БД, а потому снова нажимаем
   "ShiftF9, Enter".

Ремонт закончен, но чтобы в другой раз база не повреждалась если у нас есть файл резервной копии настроек Far *.farconfig то, открываем его в редакторе находим там фрагмент:

 <plugin guid="42E4AEB1-A230-44F4-B33C-F195BB654931">
    <hierarchicalconfig>
     <key name="42E4AEB1-A230-44F4-B33C-F195BB654931" description="NetBox">
    ...
      </key>
    </hierarchicalconfig>
  </plugin>

и удаляем включая всё его содержимое - именно этот XML фрагмент содержит настройки NetBox которые повреждаются при экпорте/импорте БД, что и приводит к последующим ошибкам в работа плагина.

дальше её "олитературить" надо и я думаю стоит это добавить в README.RU.md например как пункт 6 "Что делать если при работе плагина возникают ошибки?". Новички не мы им будет проще удалить БД и всё по бумажке заново отстроить...

VictorVG avatar Mar 20 '16 21:03 VictorVG