Now --disable-vfs doesn't mean the total disabling of VFS.
With --disable-vfs option, the localfs module is built
to use the change of file panel encoding.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Factored out error checking from ftpfs_initconn into
ftpfs_init_data_socket and fixed the logic of the initialization of DATA
connection. Now initialization of passive connection is retried if
needed after the failure to open the socket.
Got rid of goto statements and divided the code in two parts (passive &
active). Initial state is now properly restored after the function runs.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Miscellaneous refactoring:
* Factored out the active IPV4/IPV6 FTP connection mode setup
routine in a separate function (ftpfs_setup_active) to make the
logic more clear.
* Factored out ftpfs_init_data_socket from ftpfs_initconn in order
to make it possible to fix the logic later on.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
In current implementation few issues were fixed making passive
connection scheme more reliable:
* If it's IPV4, try PASV first, as some servers and ALGs get
confused by EPSV, and only then EPSV as a fallback
* When trying PASV or EPSV, actually try to connect to the provided
port and if the connection fails, still try the next method
* PASV and EPSV response parsing code was factored out in separate
routines for clarity
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
* Fixed endianness issue introduced by IPV6 patch, which prevented
active connections to be established via PORT mechanism.
FTP server always expects to see the port broken down into bytes
in network byte order, so the transformation to host byte order is
only needed when using EPRT.
* Some IPV4 FTP servers and FTP ALGs / NATs with connection tracking
become confused when you try to use EPSV or EPRT instead of PASV or
PORT respectively.
This commit changes current FTP connection scheme: if we deal with
an IPV4 host, instead of first trying to use EPRT, first try to
use PORT and only if it fails try EPRT as a fallback.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Fixed modifiers and removed types recastin in envoronment
variables and messages forming.
Minor code cleanup.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* m4: AC_CONFIG_SUBDIRS() macros should be always called without relation to enable/disable samba support
* vfs/samba: configure.ac: renamed --with-configdir to --with-smb-configdir
* vfs/samba: configure.ac: renamed --with-codepagedir to --with-smb-codepagedir
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Removed mcserver and mcfs support.
Reasons:
(1) no longer builds
(2) no one is willing to support it
(3) possibly contains unfixed security holes
(4) makes no sense in view of the availability of FISH
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Some extfs script modes in the repository differ from the ones they get
when installed. This is annoying for those, who hardlink files to the
installed location instead of copying, because git status will show
these files as modified.
Fixing permissions in the repository will resolve this issue.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Split assignments and conditions. Type accuracy. Minor optimization.
Thanks Vit Rosin for original patch.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Changes into lib directory
* samba: handling result of system() call
* rpc: handling write errors
* ftpfs: ignoring result of fwrite() on logfile (make compiler happy ;-))
* fish: proper handling of file io calls
* ignoring result of fwrite() on logfile (make compiler happy ;-))
* lib/util.c: handling fwrite() call errors in mc_util_write_backup_content()
* lib/utilunix.c:
* handling possible error on dup() in close_error_pipe()
* handling possible error on getcwd() in mc_realpath()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
My system wide .rarrc contains these switches
switches= -m5 -mdG -r -s -t -ol -tl
So whenever you list the contents of any archive or copy a file out of
it, RAR/UNRAR will traverse *all* sub directories (note -r, recursive
switch) in a current directory trying to find *all* archives with the
same name. So, the net result might be that unrar/rar will extract
the wrong file and spend a lot of time trying to find archives with
the same name.
That's why I strongly suggest disabling user/system configuration
for archive list and copyout operations (note the added -cfg switch).
I have contacted Eugene Roshal and he said that he won't disable -r switch
for extract and archive list operations, so, we can only fix this problem
on our side.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Fixed bug introduced in ad9c1daad8 commit:
incorrect handling of "." and ".." directories within atchives.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Applied MC indentation policy to all files modified in this branch
with some simple manual modifications.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
If EXTFS plugin doesn't require a file, that file name must
be finished with '+': for example, rpms+. But trailing '+'
actually is not a part of plugin name, it is an plugin attrubute.
But in the current time trailing '+' must be used in VFS command:
cd #rpms+
instead of
cd #rpms
This commit simplifies the usage of some EXTFS plugins.
Also fixed VFS README.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Thanks Vit Rosin to found memory leak in _vfs_memleak() function.
This function was rewritten to fix two memory leaks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
extfs vfs plugins are read from following places:
1. ~/.mc/extfs.d directory.
2. /usr/libexec/mc/extfs.d direcotry.
Priority of plugins installed in user home directory
is highest. If there are two plugins with same names
exist in user home and system directories, the plugin
from user home is used.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Reimplemented EXTFS VFS to be friendly to package-based
systems. Currently, MC requires to edit extfs.ini file
to add new plugin to MC VFS. After upgrade, all changes
to this files will be lost.
To solve that problem, MC configuration system should
support ".d" pattern.
Initial step: refactoring of current extfs code:
cleanup, type accuracy, indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Comment by Oswald Buddenhagen:
first, you decided to ignore my advice about not
obfuscating the code with nonsense-checks, and on top of that you
broke the string comparison (just see what happens when you try a user
named "ftpmaster").
This commit contain changes for respect this critic.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Look at mcserv.c near 1019
The chroot() call's return value isn't handled - this may a security risk.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
The lslR VFS does not work with ls-lR files created in en_US.UTF-8 locale and with files and directories started with whitespaces.
Followed patch fixes both issues.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Fixed warings: local variable shadows a global declaration.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
* moved src/global.h into lib/global.h
* moved glibcompat.[ch] from ./src/ into ./lib/
* moved fs.h from ./src/ into ./lib/
Signed-off-by: Slava Zanko <slavazanko@gmail.com>