diff --git a/configure.ac b/configure.ac index c1a146041..5cf1f2f74 100644 --- a/configure.ac +++ b/configure.ac @@ -654,8 +654,8 @@ src/vfs/extfs/helpers/uwim src/vfs/extfs/helpers/uzip src/vfs/extfs/helpers/uzoo -src/vfs/fish/Makefile -src/vfs/fish/helpers/Makefile +src/vfs/shell/Makefile +src/vfs/shell/helpers/Makefile src/vfs/ftpfs/Makefile diff --git a/doc/INSTALL b/doc/INSTALL index 3881c523b..f92a0c0f4 100644 --- a/doc/INSTALL +++ b/doc/INSTALL @@ -171,9 +171,9 @@ VFS options: (on by default) Support for FTP vfs -`--enable-vfs-fish' +`--enable-vfs-shell' (on by default) - Support for FISH vfs + Support for SHELL vfs `--enable-vfs-sftp' (auto) diff --git a/doc/README b/doc/README index 71d69d8ce..c2718ae4d 100644 --- a/doc/README +++ b/doc/README @@ -128,7 +128,7 @@ These are hints for the text mode edition: * The Virtual File System is a cute addition to the project, you may browse in tar and compressed tar files as well as browsing remote - machines with the fish file system. + machines with the shell file system. * Please read the manual page. diff --git a/doc/TODO b/doc/TODO index e6253fdb2..d29eda78c 100644 --- a/doc/TODO +++ b/doc/TODO @@ -73,7 +73,7 @@ window title. Better date parser - don't allow seconds and year in ftp listings on the same line. -Report errors in fish operations and recover from them. +Report errors in shell operations and recover from them. Allow colors to be defined in the mc.lib file. Make it possible to avoid using a super-long line to redefine all colors. @@ -82,7 +82,7 @@ Filters in the editor should operate on the open file - don't close and reopen the file. They don't work on VFS now. For example, a gzipped files on FTP cannot be edited. -ftp and fish with home != '/' - readjust directory to the home. +ftp and shell with home != '/' - readjust directory to the home. Make "Find File" dialog more responsive. Keep state in a structure and preserve it when the search is suspended. diff --git a/doc/man/mc.1.in b/doc/man/mc.1.in index 3b5c180ea..be3b823dd 100644 --- a/doc/man/mc.1.in +++ b/doc/man/mc.1.in @@ -3138,7 +3138,7 @@ used to manipulate tar and compressed tar files; the .IR undelfs , used to recover deleted files on ext2 file systems (the default file system for Linux systems), -.I fish +.I shell (for manipulating files over shell connections such as rsh and ssh). If the code was compiled with .I sftpfs @@ -3225,7 +3225,7 @@ Examples: The latter specifies the full path of the tar archive. .\"NODE " FIle transfer over SHell filesystem" .SH " FIle transfer over SHell filesystem" -The fish file system is a network based file system that allows you to +The shell file system is a network based file system that allows you to manipulate the files in a remote machine as if they were local. To use this, the other side has to have bash\-compatible shell. .PP @@ -4094,7 +4094,7 @@ If this variable is on (default is off) when you browse the file system on a Tree panel, it will automatically reload the other panel with the contents of the selected directory. .TP -.I fish_directory_timeout +.I shell_directory_timeout This variable holds the lifetime of a directory cache entry in seconds. The default value is 900 seconds. .TP diff --git a/doc/man/ru/mc.1.in b/doc/man/ru/mc.1.in index c395054a4..53ad6a574 100644 --- a/doc/man/ru/mc.1.in +++ b/doc/man/ru/mc.1.in @@ -3588,7 +3588,7 @@ tar\-файлов; файлов в файловой системе ext2 (файловая система, используемая в Linux по умолчанию); .br -\- файловой системы fish (для манипулирования файлами при работе с +\- файловой системы shell (для манипулирования файлами при работе с оболочкой через такие программы как rsh и ssh); .br \- и, наконец, сетевой файловой системы nfs. @@ -3607,7 +3607,7 @@ tar\-файлов; .\"Tar File System" .br .\"LINK2" -Файловая система FISH (FIle transfer over SHell) +Файловая система SHELL (FIle transfer over SHell) .\"FIle transfer over SHell filesystem" .br .\"LINK2" @@ -3726,8 +3726,8 @@ tar\-файлов, то есть обычно для получения спис .PP В последнем примере указан полный путь к tar\-архиву. .\"NODE " FIle transfer over SHell filesystem" -.SH " Файловая система FISH (FIle transfer over SHell)" -Файловая система fish \- это сетевая файловая система, которая позволяет +.SH " Файловая система SHELL (FIle transfer over SHell)" +Файловая система shell \- это сетевая файловая система, которая позволяет работать с файлами на удалённом компьютере так, как если бы они были расположены на вашем диске. Для того чтобы это было возможно, на удалённом компьютере должна быть запущена bash\-совместимая оболочка shell. diff --git a/lib/fileloc.h b/lib/fileloc.h index ebcfe9d13..a075d030f 100644 --- a/lib/fileloc.h +++ b/lib/fileloc.h @@ -30,23 +30,23 @@ #define CHARSETS_LIST "mc.charsets" #define MC_MACRO_FILE "mc.macros" -#define FISH_PREFIX "fish" +#define VFS_SHELL_PREFIX "shell" -#define FISH_LS_FILE "ls" -#define FISH_EXISTS_FILE "fexists" -#define FISH_MKDIR_FILE "mkdir" -#define FISH_UNLINK_FILE "unlink" -#define FISH_CHOWN_FILE "chown" -#define FISH_CHMOD_FILE "chmod" -#define FISH_UTIME_FILE "utime" -#define FISH_RMDIR_FILE "rmdir" -#define FISH_LN_FILE "ln" -#define FISH_MV_FILE "mv" -#define FISH_HARDLINK_FILE "hardlink" -#define FISH_GET_FILE "get" -#define FISH_SEND_FILE "send" -#define FISH_APPEND_FILE "append" -#define FISH_INFO_FILE "info" +#define VFS_SHELL_LS_FILE "ls" +#define VFS_SHELL_EXISTS_FILE "fexists" +#define VFS_SHELL_MKDIR_FILE "mkdir" +#define VFS_SHELL_UNLINK_FILE "unlink" +#define VFS_SHELL_CHOWN_FILE "chown" +#define VFS_SHELL_CHMOD_FILE "chmod" +#define VFS_SHELL_UTIME_FILE "utime" +#define VFS_SHELL_RMDIR_FILE "rmdir" +#define VFS_SHELL_LN_FILE "ln" +#define VFS_SHELL_MV_FILE "mv" +#define VFS_SHELL_HARDLINK_FILE "hardlink" +#define VFS_SHELL_GET_FILE "get" +#define VFS_SHELL_SEND_FILE "send" +#define VFS_SHELL_APPEND_FILE "append" +#define VFS_SHELL_INFO_FILE "info" #define MC_EXTFS_DIR "extfs.d" diff --git a/lib/keybind.c b/lib/keybind.c index ebbc82eed..ee498a26b 100644 --- a/lib/keybind.c +++ b/lib/keybind.c @@ -174,8 +174,8 @@ static name_keymap_t command_names[] = { ADD_KEYMAP_NAME (LinkSymbolicEdit), ADD_KEYMAP_NAME (ExternalPanelize), ADD_KEYMAP_NAME (Filter), -#ifdef ENABLE_VFS_FISH - ADD_KEYMAP_NAME (ConnectFish), +#ifdef ENABLE_VFS_SHELL + ADD_KEYMAP_NAME (ConnectShell), #endif #ifdef ENABLE_VFS_FTP ADD_KEYMAP_NAME (ConnectFtp), diff --git a/lib/keybind.h b/lib/keybind.h index 9c0fe98a1..4c01f589c 100644 --- a/lib/keybind.h +++ b/lib/keybind.h @@ -151,7 +151,7 @@ enum CK_LinkSymbolicEdit, CK_ExternalPanelize, CK_Filter, - CK_ConnectFish, + CK_ConnectShell, CK_ConnectFtp, CK_ConnectSftp, CK_PanelInfo, diff --git a/lib/mcconfig/paths.c b/lib/mcconfig/paths.c index 46ec14d12..0aaf190c3 100644 --- a/lib/mcconfig/paths.c +++ b/lib/mcconfig/paths.c @@ -74,7 +74,7 @@ static const struct /* data */ { &mc_data_str, MC_SKINS_DIR }, - { &mc_data_str, FISH_PREFIX }, + { &mc_data_str, VFS_SHELL_PREFIX }, { &mc_data_str, MC_ASHRC_FILE }, { &mc_data_str, MC_BASHRC_FILE }, { &mc_data_str, MC_INPUTRC_FILE }, diff --git a/lib/vfs/parse_ls_vga.c b/lib/vfs/parse_ls_vga.c index 779792f57..10a8f3f6b 100644 --- a/lib/vfs/parse_ls_vga.c +++ b/lib/vfs/parse_ls_vga.c @@ -49,7 +49,7 @@ /*** file scope macro definitions ****************************************************************/ -/* Parsing code is used by ftpfs, fish and extfs */ +/* Parsing code is used by ftpfs, shell and extfs */ #define MAXCOLS 30 /*** file scope type declarations ****************************************************************/ diff --git a/lib/vfs/vfs.h b/lib/vfs/vfs.h index ee78ff51f..260e8f337 100644 --- a/lib/vfs/vfs.h +++ b/lib/vfs/vfs.h @@ -68,7 +68,7 @@ #endif #ifdef EREMOTEIO -#define E_REMOTE EREMOTEIO /* if other side of ftp/fish reports error */ +#define E_REMOTE EREMOTEIO /* if other side of ftp/shell reports error */ #else #define E_REMOTE ENETUNREACH /* :-( there's no EREMOTEIO on some systems */ #endif @@ -133,7 +133,7 @@ typedef struct vfs_class { const char *name; /* "FIles over SHell" */ vfs_flags_t flags; - const char *prefix; /* "fish:" */ + const char *prefix; /* "shell:" */ int verrno; /* can't use errno because glibc2 might define errno as function */ gboolean flush; /* if set to TRUE, invalidate directory cache */ FILE *logfile; diff --git a/lib/vfs/xdirentry.h b/lib/vfs/xdirentry.h index e1244cbe5..94246581e 100644 --- a/lib/vfs/xdirentry.h +++ b/lib/vfs/xdirentry.h @@ -109,7 +109,7 @@ typedef struct } vfs_file_handler_t; /* - * One of our subclasses (tar, cpio, fish, ftpfs) with data and methods. + * One of our subclasses (tar, cpio, shell, ftpfs) with data and methods. * Extends vfs_class. */ struct vfs_s_subclass diff --git a/m4.include/mc-vfs.m4 b/m4.include/mc-vfs.m4 index f14fcfeec..82567bda3 100644 --- a/m4.include/mc-vfs.m4 +++ b/m4.include/mc-vfs.m4 @@ -13,7 +13,7 @@ m4_include([m4.include/vfs/mc-vfs-extfs.m4]) m4_include([m4.include/vfs/mc-vfs-sfs.m4]) m4_include([m4.include/vfs/mc-vfs-ftp.m4]) m4_include([m4.include/vfs/mc-vfs-sftp.m4]) -m4_include([m4.include/vfs/mc-vfs-fish.m4]) +m4_include([m4.include/vfs/mc-vfs-shell.m4]) m4_include([m4.include/vfs/mc-vfs-undelfs.m4]) m4_include([m4.include/vfs/mc-vfs-tarfs.m4]) m4_include([m4.include/vfs/mc-vfs-cpiofs.m4]) @@ -71,7 +71,7 @@ AC_DEFUN([mc_VFS_CHECKS], mc_VFS_CPIOFS mc_VFS_EXTFS - mc_VFS_FISH + mc_VFS_SHELL mc_VFS_FTP mc_VFS_SFS mc_VFS_SFTP @@ -80,7 +80,7 @@ AC_DEFUN([mc_VFS_CHECKS], AM_CONDITIONAL(ENABLE_VFS, [test x"$enable_vfs" = x"yes"]) - if test x"$enable_vfs_ftp" = x"yes" -o x"$enable_vfs_fish" = x"yes" -o x"$enable_vfs_sftp" = x"yes"; then + if test x"$enable_vfs_ftp" = x"yes" -o x"$enable_vfs_shell" = x"yes" -o x"$enable_vfs_sftp" = x"yes"; then mc_ENABLE_VFS_NET fi diff --git a/m4.include/vfs/mc-vfs-fish.m4 b/m4.include/vfs/mc-vfs-fish.m4 deleted file mode 100644 index d3463eef5..000000000 --- a/m4.include/vfs/mc-vfs-fish.m4 +++ /dev/null @@ -1,12 +0,0 @@ -dnl Enable FISH protocol (classic) -AC_DEFUN([mc_VFS_FISH], -[ - AC_ARG_ENABLE([vfs-fish], - AS_HELP_STRING([--enable-vfs-fish], [Support for FISH filesystem @<:@yes@:>@])) - if test "$enable_vfs" = "yes" -a "x$enable_vfs_fish" != xno; then - enable_vfs_fish="yes" - mc_VFS_ADDNAME([fish]) - AC_DEFINE([ENABLE_VFS_FISH], [1], [Support for FISH vfs]) - fi - AM_CONDITIONAL(ENABLE_VFS_FISH, [test "$enable_vfs" = "yes" -a x"$enable_vfs_fish" = x"yes"]) -]) diff --git a/m4.include/vfs/mc-vfs-shell.m4 b/m4.include/vfs/mc-vfs-shell.m4 new file mode 100644 index 000000000..b07b22b30 --- /dev/null +++ b/m4.include/vfs/mc-vfs-shell.m4 @@ -0,0 +1,12 @@ +dnl Enable SHELL protocol +AC_DEFUN([mc_VFS_SHELL], +[ + AC_ARG_ENABLE([vfs-shell], + AS_HELP_STRING([--enable-vfs-shell], [Support for SHELL filesystem @<:@yes@:>@])) + if test "$enable_vfs" = "yes" -a "x$enable_vfs_shell" != xno; then + enable_vfs_shell="yes" + mc_VFS_ADDNAME([shell]) + AC_DEFINE([ENABLE_VFS_SHELL], [1], [Support for SHELL vfs]) + fi + AM_CONDITIONAL(ENABLE_VFS_SHELL, [test "$enable_vfs" = "yes" -a x"$enable_vfs_shell" = x"yes"]) +]) diff --git a/misc/mc.default.keymap b/misc/mc.default.keymap index 34df586f2..6e7e8bd48 100644 --- a/misc/mc.default.keymap +++ b/misc/mc.default.keymap @@ -50,7 +50,7 @@ ScreenList = alt-prime # EditExtensionsFile = # EditFileHighlightFile = # Filter = -# ConnectFish = +# ConnectShell = # ConnectFtp = # Undelete = EditorViewerHistory = alt-shift-e diff --git a/misc/mc.emacs.keymap b/misc/mc.emacs.keymap index d5071ab61..53c47494f 100644 --- a/misc/mc.emacs.keymap +++ b/misc/mc.emacs.keymap @@ -50,7 +50,7 @@ ScreenList = alt-prime # EditExtensionsFile = # EditFileHighlightFile = # Filter = -# ConnectFish = +# ConnectShell = # ConnectFtp = # Undelete = EditorViewerHistory = alt-shift-e diff --git a/src/filemanager/cmd.c b/src/filemanager/cmd.c index 8c33fd89d..76f21acdb 100644 --- a/src/filemanager/cmd.c +++ b/src/filemanager/cmd.c @@ -1199,15 +1199,15 @@ sftplink_cmd (void) /* --------------------------------------------------------------------------------------------- */ -#ifdef ENABLE_VFS_FISH +#ifdef ENABLE_VFS_SHELL void -fishlink_cmd (void) +shelllink_cmd (void) { nice_cd (_("Shell link to machine"), _(machine_str), "[FIle transfer over SHell filesystem]", ":fishlink_cmd: Shell link to machine ", "sh://", 1, TRUE); } -#endif /* ENABLE_VFS_FISH */ +#endif /* ENABLE_VFS_SHELL */ /* --------------------------------------------------------------------------------------------- */ diff --git a/src/filemanager/cmd.h b/src/filemanager/cmd.h index 26bfdb7d3..30b309c2f 100644 --- a/src/filemanager/cmd.h +++ b/src/filemanager/cmd.h @@ -35,8 +35,8 @@ void ftplink_cmd (void); #ifdef ENABLE_VFS_SFTP void sftplink_cmd (void); #endif -#ifdef ENABLE_VFS_FISH -void fishlink_cmd (void); +#ifdef ENABLE_VFS_SHELL +void shelllink_cmd (void); #endif void undelete_cmd (void); void help_cmd (void); diff --git a/src/filemanager/file.c b/src/filemanager/file.c index 9b32124c0..7bb5bff70 100644 --- a/src/filemanager/file.c +++ b/src/filemanager/file.c @@ -1521,7 +1521,7 @@ recursive_erase (file_op_total_context_t * tctx, file_op_context_t * ctx, const * * ATTENTION! Be careful when modifying this function (like commit 25e419ba0886f)! * Some implementations of readdir() in MC VFS (for example, vfs_s_readdir(), which is used - * in FISH) don't return "." and ".." entries. + * in SHELL) don't return "." and ".." entries. */ static int check_dir_is_empty (const vfs_path_t * vpath) diff --git a/src/filemanager/filemanager.c b/src/filemanager/filemanager.c index b99502494..01a19e9fe 100644 --- a/src/filemanager/filemanager.c +++ b/src/filemanager/filemanager.c @@ -210,8 +210,8 @@ create_panel_menu (void) #ifdef ENABLE_VFS_FTP entries = g_list_prepend (entries, menu_entry_new (_("FT&P link..."), CK_ConnectFtp)); #endif -#ifdef ENABLE_VFS_FISH - entries = g_list_prepend (entries, menu_entry_new (_("S&hell link..."), CK_ConnectFish)); +#ifdef ENABLE_VFS_SHELL + entries = g_list_prepend (entries, menu_entry_new (_("S&hell link..."), CK_ConnectShell)); #endif #ifdef ENABLE_VFS_SFTP entries = g_list_prepend (entries, menu_entry_new (_("SFTP li&nk..."), CK_ConnectSftp)); @@ -1240,9 +1240,9 @@ midnight_execute_cmd (Widget * sender, long command) case CK_Find: find_cmd (current_panel); break; -#ifdef ENABLE_VFS_FISH - case CK_ConnectFish: - fishlink_cmd (); +#ifdef ENABLE_VFS_SHELL + case CK_ConnectShell: + shelllink_cmd (); break; #endif #ifdef ENABLE_VFS_FTP diff --git a/src/setup.c b/src/setup.c index 68e6f37c1..e86164720 100644 --- a/src/setup.c +++ b/src/setup.c @@ -44,8 +44,8 @@ #ifdef ENABLE_VFS_FTP #include "src/vfs/ftpfs/ftpfs.h" #endif -#ifdef ENABLE_VFS_FISH -#include "src/vfs/fish/fish.h" +#ifdef ENABLE_VFS_SHELL +#include "src/vfs/shell/shell.h" #endif #ifdef HAVE_CHARSET @@ -386,9 +386,9 @@ static const struct { "ftpfs_directory_timeout", &ftpfs_directory_timeout }, { "ftpfs_retry_seconds", &ftpfs_retry_seconds }, #endif /* ENABLE_VFS_FTP */ -#ifdef ENABLE_VFS_FISH - { "fish_directory_timeout", &fish_directory_timeout }, -#endif /* ENABLE_VFS_FISH */ +#ifdef ENABLE_VFS_SHELL + { "shell_directory_timeout", &shell_directory_timeout }, +#endif /* ENABLE_VFS_SHELL */ #endif /* ENABLE_VFS */ /* option_tab_spacing is used in internal viewer */ { "editor_tab_spacing", &option_tab_spacing }, diff --git a/src/textconf.c b/src/textconf.c index e8accd9e8..3fcd9341a 100644 --- a/src/textconf.c +++ b/src/textconf.c @@ -75,8 +75,8 @@ static const char *const vfs_supported[] = { #ifdef ENABLE_VFS_SFTP "sftpfs", #endif -#ifdef ENABLE_VFS_FISH - "fish", +#ifdef ENABLE_VFS_SHELL + "shell", #endif NULL }; @@ -218,15 +218,15 @@ show_datadirs_extended (void) PRINTF_SECTION (_("File extension handlers:"), EXTHELPERSDIR); -#if defined ENABLE_VFS_EXTFS || defined ENABLE_VFS_FISH +#if defined ENABLE_VFS_EXTFS || defined ENABLE_VFS_SHELL PRINTF_SECTION (_("VFS plugins and scripts:"), LIBEXECDIR); #ifdef ENABLE_VFS_EXTFS PRINTF2 ("extfs.d:", LIBEXECDIR, MC_EXTFS_DIR PATH_SEP_STR); #endif -#ifdef ENABLE_VFS_FISH - PRINTF2 ("fish:", LIBEXECDIR, FISH_PREFIX PATH_SEP_STR); +#ifdef ENABLE_VFS_SHELL + PRINTF2 ("shell:", LIBEXECDIR, VFS_SHELL_PREFIX PATH_SEP_STR); #endif -#endif /* ENABLE_VFS_EXTFS || defiined ENABLE_VFS_FISH */ +#endif /* ENABLE_VFS_EXTFS || defiined ENABLE_VFS_SHELL */ (void) puts (""); PRINTF_GROUP (_("User data")); @@ -237,8 +237,8 @@ show_datadirs_extended (void) #ifdef ENABLE_VFS_EXTFS PRINTF ("extfs.d:", mc_config_get_data_path (), MC_EXTFS_DIR PATH_SEP_STR); #endif -#ifdef ENABLE_VFS_FISH - PRINTF ("fish:", mc_config_get_data_path (), FISH_PREFIX PATH_SEP_STR); +#ifdef ENABLE_VFS_SHELL + PRINTF ("shell:", mc_config_get_data_path (), VFS_SHELL_PREFIX PATH_SEP_STR); #endif #ifdef USE_INTERNAL_EDIT PRINTF ("mcedit macros:", mc_config_get_data_path (), MC_MACRO_FILE); diff --git a/src/vfs/Makefile.am b/src/vfs/Makefile.am index 1441953bb..4adde8e4e 100644 --- a/src/vfs/Makefile.am +++ b/src/vfs/Makefile.am @@ -16,9 +16,9 @@ SUBDIRS += extfs libmc_vfs_la_LIBADD += extfs/libvfs-extfs.la endif -if ENABLE_VFS_FISH -SUBDIRS += fish -libmc_vfs_la_LIBADD += fish/libvfs-fish.la +if ENABLE_VFS_SHELL +SUBDIRS += shell +libmc_vfs_la_LIBADD += shell/libvfs-shell.la endif if ENABLE_VFS_FTP diff --git a/src/vfs/fish/helpers/Makefile.am b/src/vfs/fish/helpers/Makefile.am deleted file mode 100644 index e3ba15dbc..000000000 --- a/src/vfs/fish/helpers/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -fishdir = $(libexecdir)/@PACKAGE@/fish - -# Files to install and distribute other than fish scripts -FISH_MISC = README.fish - -# Install and distribute FISH helper scripts w/o shebang & executable bit as data -fish_DATA = $(FISH_MISC) ls mkdir fexists unlink chown chmod rmdir ln mv hardlink get send append info utime -fishconfdir = $(sysconfdir)/@PACKAGE@ - -EXTRA_DIST = $(fish_DATA) diff --git a/src/vfs/fish/helpers/append b/src/vfs/fish/helpers/append deleted file mode 100644 index 21ac4a549..000000000 --- a/src/vfs/fish/helpers/append +++ /dev/null @@ -1,15 +0,0 @@ -FILENAME="/${FISH_FILENAME}" -echo "### 001" -{ - bss=4096 - bsl=4095 - if [ $FISH_FILESIZE -lt $bss ]; then - bss=1; - bsl=0; - fi - while [ $FISH_FILESIZE -gt 0 ]; do - cnt=`expr \\( $FISH_FILESIZE + $bsl \\) / $bss` - n=`dd bs=$bss count=$cnt | tee -a "${FILENAME}" | wc -c` - FISH_FILESIZE=`expr $FISH_FILESIZE - $n` - done -}; echo "### 200" diff --git a/src/vfs/fish/helpers/chmod b/src/vfs/fish/helpers/chmod deleted file mode 100644 index 20cc35807..000000000 --- a/src/vfs/fish/helpers/chmod +++ /dev/null @@ -1,5 +0,0 @@ -if chmod ${FISH_FILEMODE} "/${FISH_FILENAME}" 2>/dev/null; then - echo "### 000" -else - echo "### 500" -fi diff --git a/src/vfs/fish/helpers/chown b/src/vfs/fish/helpers/chown deleted file mode 100644 index 11b1aa463..000000000 --- a/src/vfs/fish/helpers/chown +++ /dev/null @@ -1,5 +0,0 @@ -if chown ${FISH_FILEOWNER}:${FISH_FILEGROUP} "/${FISH_FILENAME}" ; then - echo "### 000" -else - echo "### 500" -fi diff --git a/src/vfs/fish/helpers/fexists b/src/vfs/fish/helpers/fexists deleted file mode 100644 index 0ad4679d8..000000000 --- a/src/vfs/fish/helpers/fexists +++ /dev/null @@ -1,2 +0,0 @@ -ls -l "/${FISH_FILENAME}" >/dev/null 2>/dev/null -echo '### '$? diff --git a/src/vfs/fish/helpers/mv b/src/vfs/fish/helpers/mv deleted file mode 100644 index 7190ad51f..000000000 --- a/src/vfs/fish/helpers/mv +++ /dev/null @@ -1,5 +0,0 @@ -if mv "/${FISH_FILEFROM}" "/${FISH_FILETO}" 2>/dev/null; then - echo "### 000" -else - echo "### 500" -fi diff --git a/src/vfs/fish/helpers/rmdir b/src/vfs/fish/helpers/rmdir deleted file mode 100644 index de56d3143..000000000 --- a/src/vfs/fish/helpers/rmdir +++ /dev/null @@ -1,5 +0,0 @@ -if rmdir "/${FISH_FILENAME}" 2>/dev/null; then - echo "### 000" -else - echo "### 500" -fi diff --git a/src/vfs/fish/helpers/send b/src/vfs/fish/helpers/send deleted file mode 100644 index 45942649e..000000000 --- a/src/vfs/fish/helpers/send +++ /dev/null @@ -1,16 +0,0 @@ -FILENAME="/${FISH_FILENAME}" -echo "### 001" -{ - > "${FILENAME}" - bss=4096 - bsl=4095 - if [ $FISH_FILESIZE -lt $bss ]; then - bss=1; - bsl=0; - fi - while [ $FISH_FILESIZE -gt 0 ]; do - cnt=`expr \\( $FISH_FILESIZE + $bsl \\) / $bss` - n=`dd bs=$bss count=$cnt | tee -a "${FILENAME}" | wc -c` - FISH_FILESIZE=`expr $FISH_FILESIZE - $n` - done -}; echo "### 200" diff --git a/src/vfs/fish/helpers/unlink b/src/vfs/fish/helpers/unlink deleted file mode 100644 index 954386023..000000000 --- a/src/vfs/fish/helpers/unlink +++ /dev/null @@ -1,5 +0,0 @@ -if rm -f "/${FISH_FILENAME}" 2>/dev/null; then - echo "### 000" -else - echo "### 500" -fi diff --git a/src/vfs/fish/helpers/utime b/src/vfs/fish/helpers/utime deleted file mode 100644 index c7a25a828..000000000 --- a/src/vfs/fish/helpers/utime +++ /dev/null @@ -1,12 +0,0 @@ -if TZ=UTC touch -h -m -d "$FISH_TOUCHMTIME_W_NSEC" "/${FISH_FILENAME}" 2>/dev/null && \ - TZ=UTC touch -h -a -d "$FISH_TOUCHATIME_W_NSEC" "/${FISH_FILENAME}" 2>/dev/null; then - echo "### 000" -elif TZ=UTC touch -h -m -t $FISH_TOUCHMTIME "/${FISH_FILENAME}" 2>/dev/null && \ - TZ=UTC touch -h -a -t $FISH_TOUCHATIME "/${FISH_FILENAME}" 2>/dev/null; then - echo "### 000" -elif [ -n "$FISH_HAVE_PERL" ] && - perl -e 'utime '$FISH_FILEATIME','$FISH_FILEMTIME',@ARGV;' "/${FISH_FILENAME}" 2>/dev/null; then - echo "### 000" -else - echo "### 500" -fi diff --git a/src/vfs/plugins_init.c b/src/vfs/plugins_init.c index 767e28433..84280205c 100644 --- a/src/vfs/plugins_init.c +++ b/src/vfs/plugins_init.c @@ -46,8 +46,8 @@ #include "extfs/extfs.h" #endif -#ifdef ENABLE_VFS_FISH -#include "fish/fish.h" +#ifdef ENABLE_VFS_SHELL +#include "shell/shell.h" #endif #ifdef ENABLE_VFS_FTP @@ -115,9 +115,9 @@ vfs_plugins_init (void) #ifdef ENABLE_VFS_SFTP vfs_init_sftpfs (); #endif /* ENABLE_VFS_SFTP */ -#ifdef ENABLE_VFS_FISH - vfs_init_fish (); -#endif /* ENABLE_VFS_FISH */ +#ifdef ENABLE_VFS_SHELL + vfs_init_shell (); +#endif /* ENABLE_VFS_SHELL */ } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/vfs/fish/Makefile.am b/src/vfs/shell/Makefile.am similarity index 59% rename from src/vfs/fish/Makefile.am rename to src/vfs/shell/Makefile.am index 4f3ca874c..a4cb725d6 100644 --- a/src/vfs/fish/Makefile.am +++ b/src/vfs/shell/Makefile.am @@ -6,8 +6,8 @@ AM_CPPFLAGS = \ $(GLIB_CFLAGS) \ -I$(top_srcdir) -noinst_LTLIBRARIES = libvfs-fish.la +noinst_LTLIBRARIES = libvfs-shell.la -libvfs_fish_la_SOURCES = \ - fish.c fish.h \ - fishdef.h +libvfs_shell_la_SOURCES = \ + shell.c shell.h \ + shelldef.h diff --git a/src/vfs/shell/helpers/Makefile.am b/src/vfs/shell/helpers/Makefile.am new file mode 100644 index 000000000..aa0db2581 --- /dev/null +++ b/src/vfs/shell/helpers/Makefile.am @@ -0,0 +1,10 @@ +shelldir = $(libexecdir)/@PACKAGE@/shell + +# Files to install and distribute other than shell scripts +SHELL_MISC = README.shell + +# Install and distribute SHELL helper scripts w/o shebang & executable bit as data +shell_DATA = $(SHELL_MISC) ls mkdir fexists unlink chown chmod rmdir ln mv hardlink get send append info utime +shellconfdir = $(sysconfdir)/@PACKAGE@ + +EXTRA_DIST = $(shell_DATA) diff --git a/src/vfs/fish/helpers/README.fish b/src/vfs/shell/helpers/README.shell similarity index 90% rename from src/vfs/fish/helpers/README.fish rename to src/vfs/shell/helpers/README.shell index b3778fced..8cc534749 100644 --- a/src/vfs/fish/helpers/README.fish +++ b/src/vfs/shell/helpers/README.shell @@ -17,8 +17,8 @@ current user has host-specific overrides in his per-user MC configuration directory. User-defined overrides take priority over sytem-wide scripts if they exist. The order in which the directories are traversed is as follows: - /usr/libexec/mc/fish - ~/.local/share/mc/fish// + /usr/libexec/mc/shell + ~/.local/share/mc/shell// Server's reply is multiline, but always ends with @@ -37,7 +37,7 @@ PRELIMinary success, if they were, it marks failure Connecting ~~~~~~~~~~ -MC uses "echo FISH:;/bin/sh" as command executed on remote machine. +MC uses "echo SHELL:;/bin/sh" as command executed on remote machine. Actions ~~~~~~~ @@ -201,26 +201,26 @@ Script: ln -------------------------------------------------------------------------------- You can use following parameters: -FISH_FILESIZE -FISH_FILENAME -FISH_FILEMODE -FISH_FILEOWNER -FISH_FILEGROUPE -FISH_FILEFROM -FISH_FILETO +SHELL_FILESIZE +SHELL_FILENAME +SHELL_FILEMODE +SHELL_FILEOWNER +SHELL_FILEGROUPE +SHELL_FILEFROM +SHELL_FILETO NB: -'FISH_FILESIZE' is used if we operate with single file name in 'unlink', 'rmdir', 'chmod', etc... -'FISH_FILEFROM','FISH_FILETO' are used if we operate with two files in 'ln', 'hardlink', 'mv' etc... -'FISH_FILEOWNER', 'FISH_FILEGROUPE' are a new user/group in chown +'SHELL_FILESIZE' is used if we operate with single file name in 'unlink', 'rmdir', 'chmod', etc... +'SHELL_FILEFROM','SHELL_FILETO' are used if we operate with two files in 'ln', 'hardlink', 'mv' etc... +'SHELL_FILEOWNER', 'SHELL_FILEGROUPE' are a new user/group in chown and flags: -FISH_HAVE_HEAD -FISH_HAVE_SED -FISH_HAVE_AWK -FISH_HAVE_PERL -FISH_HAVE_LSQ -FISH_HAVE_DATE_MDYT +SHELL_HAVE_HEAD +SHELL_HAVE_SED +SHELL_HAVE_AWK +SHELL_HAVE_PERL +SHELL_HAVE_LSQ +SHELL_HAVE_DATE_MDYT That's all, folks! pavel@ucw.cz diff --git a/src/vfs/shell/helpers/append b/src/vfs/shell/helpers/append new file mode 100644 index 000000000..a73d2cd3f --- /dev/null +++ b/src/vfs/shell/helpers/append @@ -0,0 +1,15 @@ +FILENAME="/${SHELL_FILENAME}" +echo "### 001" +{ + bss=4096 + bsl=4095 + if [ $SHELL_FILESIZE -lt $bss ]; then + bss=1; + bsl=0; + fi + while [ $SHELL_FILESIZE -gt 0 ]; do + cnt=`expr \\( $SHELL_FILESIZE + $bsl \\) / $bss` + n=`dd bs=$bss count=$cnt | tee -a "${FILENAME}" | wc -c` + SHELL_FILESIZE=`expr $SHELL_FILESIZE - $n` + done +}; echo "### 200" diff --git a/src/vfs/shell/helpers/chmod b/src/vfs/shell/helpers/chmod new file mode 100644 index 000000000..75ea02419 --- /dev/null +++ b/src/vfs/shell/helpers/chmod @@ -0,0 +1,5 @@ +if chmod ${SHELL_FILEMODE} "/${SHELL_FILENAME}" 2>/dev/null; then + echo "### 000" +else + echo "### 500" +fi diff --git a/src/vfs/shell/helpers/chown b/src/vfs/shell/helpers/chown new file mode 100644 index 000000000..c2fc2b1d8 --- /dev/null +++ b/src/vfs/shell/helpers/chown @@ -0,0 +1,5 @@ +if chown ${SHELL_FILEOWNER}:${SHELL_FILEGROUP} "/${SHELL_FILENAME}" ; then + echo "### 000" +else + echo "### 500" +fi diff --git a/src/vfs/shell/helpers/fexists b/src/vfs/shell/helpers/fexists new file mode 100644 index 000000000..3d115743b --- /dev/null +++ b/src/vfs/shell/helpers/fexists @@ -0,0 +1,2 @@ +ls -l "/${SHELL_FILENAME}" >/dev/null 2>/dev/null +echo '### '$? diff --git a/src/vfs/fish/helpers/get b/src/vfs/shell/helpers/get similarity index 85% rename from src/vfs/fish/helpers/get rename to src/vfs/shell/helpers/get index 7d2f5fe20..b633a4517 100644 --- a/src/vfs/fish/helpers/get +++ b/src/vfs/shell/helpers/get @@ -1,6 +1,6 @@ LC_TIME=C export LC_TIME -fish_get_perl () +shell_get_perl () { FILENAME=$1 OFFSET=$2 @@ -34,7 +34,7 @@ exit 0 ' "${FILENAME}" $OFFSET } -fish_get_tail () +shell_get_tail () { FILENAME=$1 OFFSET=$2 @@ -66,7 +66,7 @@ else fi } -fish_get_dd () +shell_get_dd () { FILENAME=$1 OFFSET=$2 @@ -95,10 +95,10 @@ else fi } -if [ -n "${FISH_HAVE_PERL}" ]; then - fish_get_perl "/${FISH_FILENAME}" ${FISH_START_OFFSET} -elif [ -n "${FISH_HAVE_TAIL}" ]; then - fish_get_tail "/${FISH_FILENAME}" ${FISH_START_OFFSET} +if [ -n "${SHELL_HAVE_PERL}" ]; then + shell_get_perl "/${SHELL_FILENAME}" ${SHELL_START_OFFSET} +elif [ -n "${SHELL_HAVE_TAIL}" ]; then + shell_get_tail "/${SHELL_FILENAME}" ${SHELL_START_OFFSET} else - fish_get_dd "/${FISH_FILENAME}" ${FISH_START_OFFSET} + shell_get_dd "/${SHELL_FILENAME}" ${SHELL_START_OFFSET} fi diff --git a/src/vfs/fish/helpers/hardlink b/src/vfs/shell/helpers/hardlink similarity index 62% rename from src/vfs/fish/helpers/hardlink rename to src/vfs/shell/helpers/hardlink index c267b5420..f92b332cc 100644 --- a/src/vfs/fish/helpers/hardlink +++ b/src/vfs/shell/helpers/hardlink @@ -1,5 +1,5 @@ -FILEFROM="/${FISH_FILEFROM}" -FILETO="/${FISH_FILETO}" +FILEFROM="/${SHELL_FILEFROM}" +FILETO="/${SHELL_FILETO}" if ln "${FILEFROM}" "${FILETO}" 2>/dev/null; then echo "### 000" else diff --git a/src/vfs/fish/helpers/info b/src/vfs/shell/helpers/info similarity index 80% rename from src/vfs/fish/helpers/info rename to src/vfs/shell/helpers/info index b85b0a7fd..053423af4 100644 --- a/src/vfs/fish/helpers/info +++ b/src/vfs/shell/helpers/info @@ -1,12 +1,12 @@ LC_TIME=C export LC_TIME -#FISH_HAVE_HEAD 1 -#FISH_HAVE_SED 2 -#FISH_HAVE_AWK 4 -#FISH_HAVE_PERL 8 -#FISH_HAVE_LSQ 16 -#FISH_HAVE_DATE_MDYT 32 -#FISH_HAVE_TAIL 64 +#SHELL_HAVE_HEAD 1 +#SHELL_HAVE_SED 2 +#SHELL_HAVE_AWK 4 +#SHELL_HAVE_PERL 8 +#SHELL_HAVE_LSQ 16 +#SHELL_HAVE_DATE_MDYT 32 +#SHELL_HAVE_TAIL 64 res=0 if `echo yes| head -c 1 > /dev/null 2>&1` ; then res=`expr $res + 1` diff --git a/src/vfs/fish/helpers/ln b/src/vfs/shell/helpers/ln similarity index 63% rename from src/vfs/fish/helpers/ln rename to src/vfs/shell/helpers/ln index 315235549..15a20cd99 100644 --- a/src/vfs/fish/helpers/ln +++ b/src/vfs/shell/helpers/ln @@ -1,5 +1,5 @@ -FILEFROM="${FISH_FILEFROM}" -FILETO="/${FISH_FILETO}" +FILEFROM="${SHELL_FILEFROM}" +FILETO="/${SHELL_FILETO}" if ln -s "${FILEFROM}" "${FILETO}" 2>/dev/null; then echo "### 000" else diff --git a/src/vfs/fish/helpers/ls b/src/vfs/shell/helpers/ls similarity index 79% rename from src/vfs/fish/helpers/ls rename to src/vfs/shell/helpers/ls index b60450d98..4c8ca2113 100644 --- a/src/vfs/fish/helpers/ls +++ b/src/vfs/shell/helpers/ls @@ -1,10 +1,10 @@ LC_TIME=C export LC_TIME perl_res="1" -fish_list_lsq () +shell_list_lsq () { -FISH_DIR="$1" -ls -Qlan "${FISH_DIR}" 2>/dev/null | grep '^[^cbt]' | ( +SHELL_DIR="$1" +ls -Qlan "${SHELL_DIR}" 2>/dev/null | grep '^[^cbt]' | ( while read p l u g s m d y n; do echo "P$p $u.$g" echo "S$s" @@ -14,7 +14,7 @@ while read p l u g s m d y n; do done ) -ls -Qlan "${FISH_DIR}" 2>/dev/null | grep '^[cb]' | ( +ls -Qlan "${SHELL_DIR}" 2>/dev/null | grep '^[cb]' | ( while read p l u g a i m d y n; do echo "P$p $u.$g" echo "E$a$i" @@ -26,13 +26,13 @@ done echo '### 200' } -fish_list_sed () +shell_list_sed () { -FISH_DIR="$1" -ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[^cbt]' | ( +SHELL_DIR="$1" +ls -lan "${SHELL_DIR}" 2>/dev/null | grep '^[^cbt]' | ( while read p l u g s rec; do if [ -n "$g" ]; then - if [ -n "$FISH_HAVE_DATE_MDYT" ]; then + if [ -n "$SHELL_HAVE_DATE_MDYT" ]; then filename=`echo "$rec"| sed 's/[^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+ //'` filedate=`echo "$rec"| sed 's/\([^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+\) .*/\1/'` else @@ -42,7 +42,7 @@ while read p l u g s rec; do pfile=\"`echo "$filename" | sed -e 's#^\(.*\) -> \(.*\)#\1" -> "\2#'`\" echo "P$p $u.$g" echo "S$s" - if [ -n "$FISH_HAVE_DATE_MDYT" ]; then + if [ -n "$SHELL_HAVE_DATE_MDYT" ]; then echo "d$filedate" else echo "D$filedate" @@ -52,10 +52,10 @@ while read p l u g s rec; do fi done ) -ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[cb]' | ( +ls -lan "${SHELL_DIR}" 2>/dev/null | grep '^[cb]' | ( while read p l u g a i rec; do if [ -n "$g" ]; then - if [ -n "$FISH_HAVE_DATE_MDYT" ]; then + if [ -n "$SHELL_HAVE_DATE_MDYT" ]; then filename=`echo "$rec"| sed 's/[^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+ //'` filedate=`echo "$rec"| sed 's/\([^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+\) .*/\1/'` else @@ -65,7 +65,7 @@ while read p l u g a i rec; do pfile=\"`echo "$filename" | sed -e 's#^\(.*\) -> \(.*\)#\1" -> "\2#'`\" echo "P$p $u.$g" echo "E$a$i" - if [ -n "$FISH_HAVE_DATE_MDYT" ]; then + if [ -n "$SHELL_HAVE_DATE_MDYT" ]; then echo "d$filedate" else echo "D$filedate" @@ -78,10 +78,10 @@ done echo '### 200' } -fish_list_poor_ls () +shell_list_poor_ls () { -FISH_DIR="$1" -ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[^cbt]' | ( +SHELL_DIR="$1" +ls -lan "${SHELL_DIR}" 2>/dev/null | grep '^[^cbt]' | ( while read p l u g s m d y n n2 n3; do if [ -n "$g" ]; then if [ "$m" = "0" ]; then @@ -97,7 +97,7 @@ while read p l u g s m d y n n2 n3; do fi done ) -ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[cb]' | ( +ls -lan "${SHELL_DIR}" 2>/dev/null | grep '^[cb]' | ( while read p l u g a i m d y n n2 n3; do if [ -n "$g" ]; then if [ "$a" = "0" ]; then @@ -116,9 +116,9 @@ done echo '### 200' } -fish_list_perl () +shell_list_perl () { -FISH_DIR=$1 +SHELL_DIR=$1 perl -e ' use strict; use POSIX; @@ -151,19 +151,19 @@ while((my $filename = readdir (DIR))){ printf("### 500\n"); } exit 0 -' "/${FISH_DIR}" +' "/${SHELL_DIR}" perl_res=$? } -if [ -n "${FISH_HAVE_PERL}" ]; then - fish_list_perl "/${FISH_FILENAME}" +if [ -n "${SHELL_HAVE_PERL}" ]; then + shell_list_perl "/${SHELL_FILENAME}" fi if [ "${perl_res}" != "0" ]; then - if [ -n "${FISH_HAVE_LSQ}" ]; then - fish_list_lsq "/${FISH_FILENAME}" - elif [ -n "${FISH_HAVE_SED}" ]; then - fish_list_sed "/${FISH_FILENAME}" + if [ -n "${SHELL_HAVE_LSQ}" ]; then + shell_list_lsq "/${SHELL_FILENAME}" + elif [ -n "${SHELL_HAVE_SED}" ]; then + shell_list_sed "/${SHELL_FILENAME}" else - fish_list_poor_ls "/${FISH_FILENAME}" + shell_list_poor_ls "/${SHELL_FILENAME}" fi fi diff --git a/src/vfs/fish/helpers/mkdir b/src/vfs/shell/helpers/mkdir similarity index 50% rename from src/vfs/fish/helpers/mkdir rename to src/vfs/shell/helpers/mkdir index 8d03691e0..b05f12558 100644 --- a/src/vfs/fish/helpers/mkdir +++ b/src/vfs/shell/helpers/mkdir @@ -1,4 +1,4 @@ -if mkdir "/$FISH_FILENAME" 2>/dev/null; then +if mkdir "/$SHELL_FILENAME" 2>/dev/null; then echo "### 000" else echo "### 500" diff --git a/src/vfs/shell/helpers/mv b/src/vfs/shell/helpers/mv new file mode 100644 index 000000000..1fd2327d3 --- /dev/null +++ b/src/vfs/shell/helpers/mv @@ -0,0 +1,5 @@ +if mv "/${SHELL_FILEFROM}" "/${SHELL_FILETO}" 2>/dev/null; then + echo "### 000" +else + echo "### 500" +fi diff --git a/src/vfs/shell/helpers/rmdir b/src/vfs/shell/helpers/rmdir new file mode 100644 index 000000000..88172c4dc --- /dev/null +++ b/src/vfs/shell/helpers/rmdir @@ -0,0 +1,5 @@ +if rmdir "/${SHELL_FILENAME}" 2>/dev/null; then + echo "### 000" +else + echo "### 500" +fi diff --git a/src/vfs/shell/helpers/send b/src/vfs/shell/helpers/send new file mode 100644 index 000000000..66c2a1c7b --- /dev/null +++ b/src/vfs/shell/helpers/send @@ -0,0 +1,16 @@ +FILENAME="/${SHELL_FILENAME}" +echo "### 001" +{ + > "${FILENAME}" + bss=4096 + bsl=4095 + if [ $SHELL_FILESIZE -lt $bss ]; then + bss=1; + bsl=0; + fi + while [ $SHELL_FILESIZE -gt 0 ]; do + cnt=`expr \\( $SHELL_FILESIZE + $bsl \\) / $bss` + n=`dd bs=$bss count=$cnt | tee -a "${FILENAME}" | wc -c` + SHELL_FILESIZE=`expr $SHELL_FILESIZE - $n` + done +}; echo "### 200" diff --git a/src/vfs/shell/helpers/unlink b/src/vfs/shell/helpers/unlink new file mode 100644 index 000000000..f02f4d358 --- /dev/null +++ b/src/vfs/shell/helpers/unlink @@ -0,0 +1,5 @@ +if rm -f "/${SHELL_FILENAME}" 2>/dev/null; then + echo "### 000" +else + echo "### 500" +fi diff --git a/src/vfs/shell/helpers/utime b/src/vfs/shell/helpers/utime new file mode 100644 index 000000000..a56343193 --- /dev/null +++ b/src/vfs/shell/helpers/utime @@ -0,0 +1,12 @@ +if TZ=UTC touch -h -m -d "$SHELL_TOUCHMTIME_W_NSEC" "/${SHELL_FILENAME}" 2>/dev/null && \ + TZ=UTC touch -h -a -d "$SHELL_TOUCHATIME_W_NSEC" "/${SHELL_FILENAME}" 2>/dev/null; then + echo "### 000" +elif TZ=UTC touch -h -m -t $SHELL_TOUCHMTIME "/${SHELL_FILENAME}" 2>/dev/null && \ + TZ=UTC touch -h -a -t $SHELL_TOUCHATIME "/${SHELL_FILENAME}" 2>/dev/null; then + echo "### 000" +elif [ -n "$SHELL_HAVE_PERL" ] && + perl -e 'utime '$SHELL_FILEATIME','$SHELL_FILEMTIME',@ARGV;' "/${SHELL_FILENAME}" 2>/dev/null; then + echo "### 000" +else + echo "### 500" +fi diff --git a/src/vfs/fish/fish.c b/src/vfs/shell/shell.c similarity index 66% rename from src/vfs/fish/fish.c rename to src/vfs/shell/shell.c index ec813eaf3..760bc464c 100644 --- a/src/vfs/fish/fish.c +++ b/src/vfs/shell/shell.c @@ -1,5 +1,5 @@ /* - Virtual File System: FISH implementation for transferring files over + Virtual File System: SHELL implementation for transferring files over shell connections. Copyright (C) 1998-2023 @@ -32,20 +32,20 @@ /** * \file - * \brief Source: Virtual File System: FISH implementation for transferring files over + * \brief Source: Virtual File System: SHELL implementation for transferring files over * shell connections * \author Pavel Machek * \author Michal Svec * \date 1998, 2000 * * Derived from ftpfs.c - * Read README.fish for protocol specification. + * Read README.shell for protocol specification. * * Syntax of path is: \verbatim sh://user@host[:Cr]/path \endverbatim * where C means you want compressed connection, * and r means you want to use rsh * - * Namespace: fish_vfs_ops exported. + * Namespace: shell_vfs_ops exported. */ /* Define this if your ssh can take -I option */ @@ -74,12 +74,12 @@ #include "lib/vfs/xdirentry.h" #include "lib/vfs/gc.h" /* vfs_stamp_create */ -#include "fish.h" -#include "fishdef.h" +#include "shell.h" +#include "shelldef.h" /*** global variables ****************************************************************************/ -int fish_directory_timeout = 900; +int shell_directory_timeout = 900; /*** file scope macro definitions ****************************************************************/ @@ -87,8 +87,8 @@ int fish_directory_timeout = 900; #define DO_OPEN 2 #define DO_FREE_RESOURCE 4 -#define FISH_FLAG_COMPRESSED 1 -#define FISH_FLAG_RSH 2 +#define SHELL_FLAG_COMPRESSED 1 +#define SHELL_FLAG_RSH 2 #define OPT_FLUSH 1 #define OPT_IGNORE_ERROR 2 @@ -108,16 +108,16 @@ int fish_directory_timeout = 900; #define WANT_STRING 0x02 /* environment flags */ -#define FISH_HAVE_HEAD 1 -#define FISH_HAVE_SED 2 -#define FISH_HAVE_AWK 4 -#define FISH_HAVE_PERL 8 -#define FISH_HAVE_LSQ 16 -#define FISH_HAVE_DATE_MDYT 32 -#define FISH_HAVE_TAIL 64 +#define SHELL_HAVE_HEAD 1 +#define SHELL_HAVE_SED 2 +#define SHELL_HAVE_AWK 4 +#define SHELL_HAVE_PERL 8 +#define SHELL_HAVE_LSQ 16 +#define SHELL_HAVE_DATE_MDYT 32 +#define SHELL_HAVE_TAIL 64 -#define FISH_SUPER(super) ((fish_super_t *) (super)) -#define FISH_FILE_HANDLER(fh) ((fish_file_handler_t *) fh) +#define SHELL_SUPER(super) ((shell_super_t *) (super)) +#define SHELL_FILE_HANDLER(fh) ((shell_file_handler_t *) fh) /*** file scope type declarations ****************************************************************/ @@ -144,7 +144,7 @@ typedef struct char *scr_info; int host_flags; GString *scr_env; -} fish_super_t; +} shell_super_t; typedef struct { @@ -153,7 +153,7 @@ typedef struct off_t got; off_t total; gboolean append; -} fish_file_handler_t; +} shell_file_handler_t; /*** forward declarations (file scope functions) *************************************************/ @@ -161,15 +161,15 @@ typedef struct static char reply_str[80]; -static struct vfs_s_subclass fish_subclass; -static struct vfs_class *vfs_fish_ops = VFS_CLASS (&fish_subclass); +static struct vfs_s_subclass shell_subclass; +static struct vfs_class *vfs_shell_ops = VFS_CLASS (&shell_subclass); /* --------------------------------------------------------------------------------------------- */ /*** file scope functions ************************************************************************/ /* --------------------------------------------------------------------------------------------- */ static void -fish_set_blksize (struct stat *s) +shell_set_blksize (struct stat *s) { #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE /* redefine block size */ @@ -180,12 +180,12 @@ fish_set_blksize (struct stat *s) /* --------------------------------------------------------------------------------------------- */ static struct stat * -fish_default_stat (struct vfs_class *me) +shell_default_stat (struct vfs_class *me) { struct stat *s; s = vfs_s_default_stat (me, S_IFDIR | 0755); - fish_set_blksize (s); + shell_set_blksize (s); vfs_adjust_stat (s); return s; @@ -194,15 +194,16 @@ fish_default_stat (struct vfs_class *me) /* --------------------------------------------------------------------------------------------- */ static char * -fish_load_script_from_file (const char *hostname, const char *script_name, const char *def_content) +shell_load_script_from_file (const char *hostname, const char *script_name, const char *def_content) { char *scr_filename = NULL; char *scr_content; gsize scr_len = 0; /* 1st: scan user directory */ - scr_filename = g_build_path (PATH_SEP_STR, mc_config_get_data_path (), FISH_PREFIX, hostname, - script_name, (char *) NULL); + scr_filename = + g_build_path (PATH_SEP_STR, mc_config_get_data_path (), VFS_SHELL_PREFIX, hostname, + script_name, (char *) NULL); /* silent about user dir */ g_file_get_contents (scr_filename, &scr_content, &scr_len, NULL); g_free (scr_filename); @@ -210,7 +211,7 @@ fish_load_script_from_file (const char *hostname, const char *script_name, const if (scr_content == NULL) { scr_filename = - g_build_path (PATH_SEP_STR, LIBEXECDIR, FISH_PREFIX, script_name, (char *) NULL); + g_build_path (PATH_SEP_STR, LIBEXECDIR, VFS_SHELL_PREFIX, script_name, (char *) NULL); g_file_get_contents (scr_filename, &scr_content, &scr_len, NULL); g_free (scr_filename); } @@ -224,7 +225,7 @@ fish_load_script_from_file (const char *hostname, const char *script_name, const /* --------------------------------------------------------------------------------------------- */ static int -fish_decode_reply (char *s, gboolean was_garbage) +shell_decode_reply (char *s, gboolean was_garbage) { int code; @@ -243,7 +244,7 @@ fish_decode_reply (char *s, gboolean was_garbage) /* Returns a reply code, check /usr/include/arpa/ftp.h for possible values */ static int -fish_get_reply (struct vfs_class *me, int sock, char *string_buf, int string_len) +shell_get_reply (struct vfs_class *me, int sock, char *string_buf, int string_len) { char answer[BUF_1K]; gboolean was_garbage = FALSE; @@ -258,7 +259,7 @@ fish_get_reply (struct vfs_class *me, int sock, char *string_buf, int string_len } if (strncmp (answer, "### ", 4) == 0) - return fish_decode_reply (answer + 4, was_garbage ? 1 : 0); + return shell_decode_reply (answer + 4, was_garbage ? 1 : 0); was_garbage = TRUE; if (string_buf != NULL) @@ -269,8 +270,8 @@ fish_get_reply (struct vfs_class *me, int sock, char *string_buf, int string_len /* --------------------------------------------------------------------------------------------- */ static int -fish_command (struct vfs_class *me, struct vfs_s_super *super, int wait_reply, const char *cmd, - size_t cmd_len) +shell_command (struct vfs_class *me, struct vfs_s_super *super, int wait_reply, const char *cmd, + size_t cmd_len) { ssize_t status; FILE *logfile = me->logfile; @@ -288,16 +289,16 @@ fish_command (struct vfs_class *me, struct vfs_s_super *super, int wait_reply, c } tty_enable_interrupt_key (); - status = write (FISH_SUPER (super)->sockw, cmd, cmd_len); + status = write (SHELL_SUPER (super)->sockw, cmd, cmd_len); tty_disable_interrupt_key (); if (status < 0) return TRANSIENT; if (wait_reply) - return fish_get_reply (me, FISH_SUPER (super)->sockr, - (wait_reply & WANT_STRING) != 0 ? reply_str : - NULL, sizeof (reply_str) - 1); + return shell_get_reply (me, SHELL_SUPER (super)->sockr, + (wait_reply & WANT_STRING) != 0 ? reply_str : NULL, + sizeof (reply_str) - 1); return COMPLETE; } @@ -305,16 +306,16 @@ fish_command (struct vfs_class *me, struct vfs_s_super *super, int wait_reply, c static int G_GNUC_PRINTF (5, 0) -fish_command_va (struct vfs_class *me, struct vfs_s_super *super, int wait_reply, const char *scr, - const char *vars, va_list ap) +shell_command_va (struct vfs_class *me, struct vfs_s_super *super, int wait_reply, const char *scr, + const char *vars, va_list ap) { int r; GString *command; - command = mc_g_string_dup (FISH_SUPER (super)->scr_env); + command = mc_g_string_dup (SHELL_SUPER (super)->scr_env); g_string_append_vprintf (command, vars, ap); g_string_append (command, scr); - r = fish_command (me, super, wait_reply, command->str, command->len); + r = shell_command (me, super, wait_reply, command->str, command->len); g_string_free (command, TRUE); return r; @@ -324,14 +325,14 @@ fish_command_va (struct vfs_class *me, struct vfs_s_super *super, int wait_reply static int G_GNUC_PRINTF (5, 6) -fish_command_v (struct vfs_class *me, struct vfs_s_super *super, int wait_reply, const char *scr, - const char *vars, ...) +shell_command_v (struct vfs_class *me, struct vfs_s_super *super, int wait_reply, const char *scr, + const char *vars, ...) { int r; va_list ap; va_start (ap, vars); - r = fish_command_va (me, super, wait_reply, scr, vars, ap); + r = shell_command_va (me, super, wait_reply, scr, vars, ap); va_end (ap); return r; @@ -341,16 +342,16 @@ fish_command_v (struct vfs_class *me, struct vfs_s_super *super, int wait_reply, static int G_GNUC_PRINTF (5, 6) -fish_send_command (struct vfs_class *me, struct vfs_s_super *super, int flags, const char *scr, - const char *vars, ...) +shell_send_command (struct vfs_class *me, struct vfs_s_super *super, int flags, const char *scr, + const char *vars, ...) { int r; va_list ap; va_start (ap, vars); - r = fish_command_va (me, super, WAIT_REPLY, scr, vars, ap); + r = shell_command_va (me, super, WAIT_REPLY, scr, vars, ap); va_end (ap); - vfs_stamp_create (vfs_fish_ops, super); + vfs_stamp_create (vfs_shell_ops, super); if (r != COMPLETE) ERRNOR (E_REMOTE, -1); @@ -363,11 +364,11 @@ fish_send_command (struct vfs_class *me, struct vfs_s_super *super, int flags, c /* --------------------------------------------------------------------------------------------- */ static struct vfs_s_super * -fish_new_archive (struct vfs_class *me) +shell_new_archive (struct vfs_class *me) { - fish_super_t *arch; + shell_super_t *arch; - arch = g_new0 (fish_super_t, 1); + arch = g_new0 (shell_super_t, 1); arch->base.me = me; return VFS_SUPER (arch); @@ -376,48 +377,48 @@ fish_new_archive (struct vfs_class *me) /* --------------------------------------------------------------------------------------------- */ static void -fish_free_archive (struct vfs_class *me, struct vfs_s_super *super) +shell_free_archive (struct vfs_class *me, struct vfs_s_super *super) { - fish_super_t *fish_super = FISH_SUPER (super); + shell_super_t *shell_super = SHELL_SUPER (super); - if ((fish_super->sockw != -1) || (fish_super->sockr != -1)) - vfs_print_message (_("fish: Disconnecting from %s"), super->name ? super->name : "???"); + if ((shell_super->sockw != -1) || (shell_super->sockr != -1)) + vfs_print_message (_("shell: Disconnecting from %s"), super->name ? super->name : "???"); - if (fish_super->sockw != -1) + if (shell_super->sockw != -1) { - fish_command (me, super, NONE, "exit\n", -1); - close (fish_super->sockw); - fish_super->sockw = -1; + shell_command (me, super, NONE, "exit\n", -1); + close (shell_super->sockw); + shell_super->sockw = -1; } - if (fish_super->sockr != -1) + if (shell_super->sockr != -1) { - close (fish_super->sockr); - fish_super->sockr = -1; + close (shell_super->sockr); + shell_super->sockr = -1; } - g_free (fish_super->scr_ls); - g_free (fish_super->scr_exists); - g_free (fish_super->scr_mkdir); - g_free (fish_super->scr_unlink); - g_free (fish_super->scr_chown); - g_free (fish_super->scr_chmod); - g_free (fish_super->scr_utime); - g_free (fish_super->scr_rmdir); - g_free (fish_super->scr_ln); - g_free (fish_super->scr_mv); - g_free (fish_super->scr_hardlink); - g_free (fish_super->scr_get); - g_free (fish_super->scr_send); - g_free (fish_super->scr_append); - g_free (fish_super->scr_info); - g_string_free (fish_super->scr_env, TRUE); + g_free (shell_super->scr_ls); + g_free (shell_super->scr_exists); + g_free (shell_super->scr_mkdir); + g_free (shell_super->scr_unlink); + g_free (shell_super->scr_chown); + g_free (shell_super->scr_chmod); + g_free (shell_super->scr_utime); + g_free (shell_super->scr_rmdir); + g_free (shell_super->scr_ln); + g_free (shell_super->scr_mv); + g_free (shell_super->scr_hardlink); + g_free (shell_super->scr_get); + g_free (shell_super->scr_send); + g_free (shell_super->scr_append); + g_free (shell_super->scr_info); + g_string_free (shell_super->scr_env, TRUE); } /* --------------------------------------------------------------------------------------------- */ static void -fish_pipeopen (struct vfs_s_super *super, const char *path, const char *argv[]) +shell_pipeopen (struct vfs_s_super *super, const char *path, const char *argv[]) { int fileset1[2], fileset2[2]; int res; @@ -433,9 +434,9 @@ fish_pipeopen (struct vfs_s_super *super, const char *path, const char *argv[]) vfs_die ("Cannot fork(): %m."); /* We are the parent */ close (fileset1[0]); - FISH_SUPER (super)->sockw = fileset1[1]; + SHELL_SUPER (super)->sockw = fileset1[1]; close (fileset2[1]); - FISH_SUPER (super)->sockr = fileset2[0]; + SHELL_SUPER (super)->sockr = fileset2[0]; } else { @@ -456,32 +457,32 @@ fish_pipeopen (struct vfs_s_super *super, const char *path, const char *argv[]) /* --------------------------------------------------------------------------------------------- */ static GString * -fish_set_env (int flags) +shell_set_env (int flags) { GString *ret; ret = g_string_sized_new (256); - if ((flags & FISH_HAVE_HEAD) != 0) - g_string_append (ret, "FISH_HAVE_HEAD=1 export FISH_HAVE_HEAD; "); + if ((flags & SHELL_HAVE_HEAD) != 0) + g_string_append (ret, "SHELL_HAVE_HEAD=1 export SHELL_HAVE_HEAD; "); - if ((flags & FISH_HAVE_SED) != 0) - g_string_append (ret, "FISH_HAVE_SED=1 export FISH_HAVE_SED; "); + if ((flags & SHELL_HAVE_SED) != 0) + g_string_append (ret, "SHELL_HAVE_SED=1 export SHELL_HAVE_SED; "); - if ((flags & FISH_HAVE_AWK) != 0) - g_string_append (ret, "FISH_HAVE_AWK=1 export FISH_HAVE_AWK; "); + if ((flags & SHELL_HAVE_AWK) != 0) + g_string_append (ret, "SHELL_HAVE_AWK=1 export SHELL_HAVE_AWK; "); - if ((flags & FISH_HAVE_PERL) != 0) - g_string_append (ret, "FISH_HAVE_PERL=1 export FISH_HAVE_PERL; "); + if ((flags & SHELL_HAVE_PERL) != 0) + g_string_append (ret, "SHELL_HAVE_PERL=1 export SHELL_HAVE_PERL; "); - if ((flags & FISH_HAVE_LSQ) != 0) - g_string_append (ret, "FISH_HAVE_LSQ=1 export FISH_HAVE_LSQ; "); + if ((flags & SHELL_HAVE_LSQ) != 0) + g_string_append (ret, "SHELL_HAVE_LSQ=1 export SHELL_HAVE_LSQ; "); - if ((flags & FISH_HAVE_DATE_MDYT) != 0) - g_string_append (ret, "FISH_HAVE_DATE_MDYT=1 export FISH_HAVE_DATE_MDYT; "); + if ((flags & SHELL_HAVE_DATE_MDYT) != 0) + g_string_append (ret, "SHELL_HAVE_DATE_MDYT=1 export SHELL_HAVE_DATE_MDYT; "); - if ((flags & FISH_HAVE_TAIL) != 0) - g_string_append (ret, "FISH_HAVE_TAIL=1 export FISH_HAVE_TAIL; "); + if ((flags & SHELL_HAVE_TAIL) != 0) + g_string_append (ret, "SHELL_HAVE_TAIL=1 export SHELL_HAVE_TAIL; "); return ret; } @@ -489,23 +490,23 @@ fish_set_env (int flags) /* --------------------------------------------------------------------------------------------- */ static gboolean -fish_info (struct vfs_class *me, struct vfs_s_super *super) +shell_info (struct vfs_class *me, struct vfs_s_super *super) { - fish_super_t *fish_super = FISH_SUPER (super); + shell_super_t *shell_super = SHELL_SUPER (super); - if (fish_command (me, super, NONE, fish_super->scr_info, -1) == COMPLETE) + if (shell_command (me, super, NONE, shell_super->scr_info, -1) == COMPLETE) { while (TRUE) { int res; char buffer[BUF_8K] = ""; - res = vfs_s_get_line_interruptible (me, buffer, sizeof (buffer), fish_super->sockr); + res = vfs_s_get_line_interruptible (me, buffer, sizeof (buffer), shell_super->sockr); if ((res == 0) || (res == EINTR)) ERRNOR (ECONNRESET, FALSE); if (strncmp (buffer, "### ", 4) == 0) break; - fish_super->host_flags = atol (buffer); + shell_super->host_flags = atol (buffer); } return TRUE; } @@ -515,18 +516,18 @@ fish_info (struct vfs_class *me, struct vfs_s_super *super) /* --------------------------------------------------------------------------------------------- */ static void -fish_open_archive_pipeopen (struct vfs_s_super *super) +shell_open_archive_pipeopen (struct vfs_s_super *super) { char gbuf[10]; const char *argv[10]; /* All of 10 is used now */ - const char *xsh = (super->path_element->port == FISH_FLAG_RSH ? "rsh" : "ssh"); + const char *xsh = (super->path_element->port == SHELL_FLAG_RSH ? "rsh" : "ssh"); int i = 0; argv[i++] = xsh; - if (super->path_element->port == FISH_FLAG_COMPRESSED) + if (super->path_element->port == SHELL_FLAG_COMPRESSED) argv[i++] = "-C"; - if (super->path_element->port > FISH_FLAG_RSH) + if (super->path_element->port > SHELL_FLAG_RSH) { argv[i++] = "-p"; g_snprintf (gbuf, sizeof (gbuf), "%d", super->path_element->port); @@ -552,23 +553,23 @@ fish_open_archive_pipeopen (struct vfs_s_super *super) } argv[i++] = super->path_element->host; - argv[i++] = "echo FISH:; /bin/sh"; + argv[i++] = "echo SHELL:; /bin/sh"; argv[i++] = NULL; - fish_pipeopen (super, xsh, argv); + shell_pipeopen (super, xsh, argv); } /* --------------------------------------------------------------------------------------------- */ static gboolean -fish_open_archive_talk (struct vfs_class *me, struct vfs_s_super *super) +shell_open_archive_talk (struct vfs_class *me, struct vfs_s_super *super) { - fish_super_t *fish_super = FISH_SUPER (super); + shell_super_t *shell_super = SHELL_SUPER (super); char answer[2048]; - printf ("\n%s\n", _("fish: Waiting for initial line...")); + printf ("\n%s\n", _("shell: Waiting for initial line...")); - if (vfs_s_get_line (me, fish_super->sockr, answer, sizeof (answer), ':') == 0) + if (vfs_s_get_line (me, shell_super->sockr, answer, sizeof (answer), ':') == 0) return FALSE; if (strstr (answer, "assword") != NULL) @@ -584,7 +585,8 @@ fish_open_archive_talk (struct vfs_class *me, struct vfs_s_super *super) { char *p, *op; - p = g_strdup_printf (_("fish: Password is required for %s"), super->path_element->user); + p = g_strdup_printf (_("shell: Password is required for %s"), + super->path_element->user); op = vfs_get_password (p); g_free (p); if (op == NULL) @@ -592,14 +594,14 @@ fish_open_archive_talk (struct vfs_class *me, struct vfs_s_super *super) super->path_element->password = op; } - printf ("\n%s\n", _("fish: Sending password...")); + printf ("\n%s\n", _("shell: Sending password...")); { size_t str_len; str_len = strlen (super->path_element->password); - if ((write (fish_super.sockw, super->path_element->password, str_len) != - (ssize_t) str_len) || (write (fish_super->sockw, "\n", 1) != 1)) + if ((write (shell_super.sockw, super->path_element->password, str_len) != + (ssize_t) str_len) || (write (shell_super->sockw, "\n", 1) != 1)) return FALSE; } #endif @@ -610,7 +612,7 @@ fish_open_archive_talk (struct vfs_class *me, struct vfs_s_super *super) /* --------------------------------------------------------------------------------------------- */ static int -fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super) +shell_open_archive_int (struct vfs_class *me, struct vfs_s_super *super) { gboolean ftalk; @@ -618,10 +620,10 @@ fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super) pre_exec (); /* open pipe */ - fish_open_archive_pipeopen (super); + shell_open_archive_pipeopen (super); /* Start talk with ssh-server (password prompt, etc ) */ - ftalk = fish_open_archive_talk (me, super); + ftalk = shell_open_archive_talk (me, super); /* show panels */ post_exec (); @@ -629,18 +631,18 @@ fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super) if (!ftalk) ERRNOR (E_PROTO, -1); - vfs_print_message ("%s", _("fish: Sending initial line...")); + vfs_print_message ("%s", _("shell: Sending initial line...")); /* Set up remote locale to C, otherwise dates cannot be recognized */ - if (fish_command + if (shell_command (me, super, WAIT_REPLY, "LANG=C LC_ALL=C LC_TIME=C; export LANG LC_ALL LC_TIME;\n" "echo '### 200'\n", -1) != COMPLETE) ERRNOR (E_PROTO, -1); - vfs_print_message ("%s", _("fish: Getting host info...")); - if (fish_info (me, super)) - FISH_SUPER (super)->scr_env = fish_set_env (FISH_SUPER (super)->host_flags); + vfs_print_message ("%s", _("shell: Getting host info...")); + if (shell_info (me, super)) + SHELL_SUPER (super)->scr_env = shell_set_env (SHELL_SUPER (super)->host_flags); #if 0 super->name = @@ -650,7 +652,7 @@ fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super) super->name = g_strdup (PATH_SEP_STR); #endif - super->root = vfs_s_new_inode (me, super, fish_default_stat (me)); + super->root = vfs_s_new_inode (me, super, shell_default_stat (me)); return 0; } @@ -658,68 +660,72 @@ fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super) /* --------------------------------------------------------------------------------------------- */ static int -fish_open_archive (struct vfs_s_super *super, - const vfs_path_t * vpath, const vfs_path_element_t * vpath_element) +shell_open_archive (struct vfs_s_super *super, + const vfs_path_t * vpath, const vfs_path_element_t * vpath_element) { - fish_super_t *fish_super = FISH_SUPER (super); + shell_super_t *shell_super = SHELL_SUPER (super); (void) vpath; super->path_element = vfs_path_element_clone (vpath_element); if (strncmp (vpath_element->vfs_prefix, "rsh", 3) == 0) - super->path_element->port = FISH_FLAG_RSH; + super->path_element->port = SHELL_FLAG_RSH; - fish_super->scr_ls = - fish_load_script_from_file (super->path_element->host, FISH_LS_FILE, FISH_LS_DEF_CONTENT); - fish_super->scr_exists = - fish_load_script_from_file (super->path_element->host, FISH_EXISTS_FILE, - FISH_EXISTS_DEF_CONTENT); - fish_super->scr_mkdir = - fish_load_script_from_file (super->path_element->host, FISH_MKDIR_FILE, - FISH_MKDIR_DEF_CONTENT); - fish_super->scr_unlink = - fish_load_script_from_file (super->path_element->host, FISH_UNLINK_FILE, - FISH_UNLINK_DEF_CONTENT); - fish_super->scr_chown = - fish_load_script_from_file (super->path_element->host, FISH_CHOWN_FILE, - FISH_CHOWN_DEF_CONTENT); - fish_super->scr_chmod = - fish_load_script_from_file (super->path_element->host, FISH_CHMOD_FILE, - FISH_CHMOD_DEF_CONTENT); - fish_super->scr_utime = - fish_load_script_from_file (super->path_element->host, FISH_UTIME_FILE, - FISH_UTIME_DEF_CONTENT); - fish_super->scr_rmdir = - fish_load_script_from_file (super->path_element->host, FISH_RMDIR_FILE, - FISH_RMDIR_DEF_CONTENT); - fish_super->scr_ln = - fish_load_script_from_file (super->path_element->host, FISH_LN_FILE, FISH_LN_DEF_CONTENT); - fish_super->scr_mv = - fish_load_script_from_file (super->path_element->host, FISH_MV_FILE, FISH_MV_DEF_CONTENT); - fish_super->scr_hardlink = - fish_load_script_from_file (super->path_element->host, FISH_HARDLINK_FILE, - FISH_HARDLINK_DEF_CONTENT); - fish_super->scr_get = - fish_load_script_from_file (super->path_element->host, FISH_GET_FILE, FISH_GET_DEF_CONTENT); - fish_super->scr_send = - fish_load_script_from_file (super->path_element->host, FISH_SEND_FILE, - FISH_SEND_DEF_CONTENT); - fish_super->scr_append = - fish_load_script_from_file (super->path_element->host, FISH_APPEND_FILE, - FISH_APPEND_DEF_CONTENT); - fish_super->scr_info = - fish_load_script_from_file (super->path_element->host, FISH_INFO_FILE, - FISH_INFO_DEF_CONTENT); + shell_super->scr_ls = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_LS_FILE, + VFS_SHELL_LS_DEF_CONTENT); + shell_super->scr_exists = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_EXISTS_FILE, + VFS_SHELL_EXISTS_DEF_CONTENT); + shell_super->scr_mkdir = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_MKDIR_FILE, + VFS_SHELL_MKDIR_DEF_CONTENT); + shell_super->scr_unlink = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_UNLINK_FILE, + VFS_SHELL_UNLINK_DEF_CONTENT); + shell_super->scr_chown = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_CHOWN_FILE, + VFS_SHELL_CHOWN_DEF_CONTENT); + shell_super->scr_chmod = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_CHMOD_FILE, + VFS_SHELL_CHMOD_DEF_CONTENT); + shell_super->scr_utime = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_UTIME_FILE, + VFS_SHELL_UTIME_DEF_CONTENT); + shell_super->scr_rmdir = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_RMDIR_FILE, + VFS_SHELL_RMDIR_DEF_CONTENT); + shell_super->scr_ln = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_LN_FILE, + VFS_SHELL_LN_DEF_CONTENT); + shell_super->scr_mv = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_MV_FILE, + VFS_SHELL_MV_DEF_CONTENT); + shell_super->scr_hardlink = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_HARDLINK_FILE, + VFS_SHELL_HARDLINK_DEF_CONTENT); + shell_super->scr_get = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_GET_FILE, + VFS_SHELL_GET_DEF_CONTENT); + shell_super->scr_send = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_SEND_FILE, + VFS_SHELL_SEND_DEF_CONTENT); + shell_super->scr_append = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_APPEND_FILE, + VFS_SHELL_APPEND_DEF_CONTENT); + shell_super->scr_info = + shell_load_script_from_file (super->path_element->host, VFS_SHELL_INFO_FILE, + VFS_SHELL_INFO_DEF_CONTENT); - return fish_open_archive_int (vpath_element->class, super); + return shell_open_archive_int (vpath_element->class, super); } /* --------------------------------------------------------------------------------------------- */ static int -fish_archive_same (const vfs_path_element_t * vpath_element, struct vfs_s_super *super, - const vfs_path_t * vpath, void *cookie) +shell_archive_same (const vfs_path_element_t * vpath_element, struct vfs_s_super *super, + const vfs_path_t * vpath, void *cookie) { vfs_path_element_t *path_element; int result; @@ -744,7 +750,7 @@ fish_archive_same (const vfs_path_element_t * vpath_element, struct vfs_s_super /* --------------------------------------------------------------------------------------------- */ static void -fish_parse_ls (char *buffer, struct vfs_s_entry *ent) +shell_parse_ls (char *buffer, struct vfs_s_entry *ent) { #define ST ent->ino->st @@ -901,7 +907,7 @@ fish_parse_ls (char *buffer, struct vfs_s_entry *ent) /* --------------------------------------------------------------------------------------------- */ static int -fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, const char *remote_path) +shell_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, const char *remote_path) { struct vfs_s_super *super = dir->super; char buffer[BUF_8K] = "\0"; @@ -910,20 +916,20 @@ fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, const char *remote int reply_code; /* - * Simple FISH debug interface :] + * Simple SHELL debug interface :] */ #if 0 if (me->logfile == NULL) - me->logfile = fopen ("/tmp/mc-FISH.sh", "w"); + me->logfile = fopen ("/tmp/mc-SHELL.sh", "w"); #endif - vfs_print_message (_("fish: Reading directory %s..."), remote_path); + vfs_print_message (_("shell: Reading directory %s..."), remote_path); - dir->timestamp = g_get_monotonic_time () + fish_directory_timeout * G_USEC_PER_SEC; + dir->timestamp = g_get_monotonic_time () + shell_directory_timeout * G_USEC_PER_SEC; quoted_path = strutils_shell_escape (remote_path); - (void) fish_command_v (me, super, NONE, FISH_SUPER (super)->scr_ls, "FISH_FILENAME=%s;\n", - quoted_path); + (void) shell_command_v (me, super, NONE, SHELL_SUPER (super)->scr_ls, "SHELL_FILENAME=%s;\n", + quoted_path); g_free (quoted_path); ent = vfs_s_generate_entry (me, NULL, dir, 0); @@ -932,7 +938,8 @@ fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, const char *remote { int res; - res = vfs_s_get_line_interruptible (me, buffer, sizeof (buffer), FISH_SUPER (super)->sockr); + res = + vfs_s_get_line_interruptible (me, buffer, sizeof (buffer), SHELL_SUPER (super)->sockr); if ((res == 0) || (res == EINTR)) { @@ -950,7 +957,7 @@ fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, const char *remote break; if (buffer[0] != '\0') - fish_parse_ls (buffer, ent); + shell_parse_ls (buffer, ent); else if (ent->name != NULL) { vfs_s_insert_entry (me, dir, ent); @@ -959,7 +966,7 @@ fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, const char *remote } vfs_s_free_entry (me, ent); - reply_code = fish_decode_reply (buffer + 4, 0); + reply_code = shell_decode_reply (buffer + 4, 0); if (reply_code == COMPLETE) { vfs_print_message (_("%s: done."), me->name); @@ -976,11 +983,11 @@ fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, const char *remote /* --------------------------------------------------------------------------------------------- */ static int -fish_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, char *localname) +shell_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, char *localname) { - fish_file_handler_t *fish = FISH_FILE_HANDLER (fh); + shell_file_handler_t *shell = SHELL_FILE_HANDLER (fh); struct vfs_s_super *super = VFS_FILE_HANDLER_SUPER (fh); - fish_super_t *fish_super = FISH_SUPER (super); + shell_super_t *shell_super = SHELL_SUPER (super); int code; off_t total = 0; char buffer[BUF_8K]; @@ -1027,14 +1034,14 @@ fish_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, char */ quoted_name = strutils_shell_escape (name); - vfs_print_message (_("fish: store %s: sending command..."), quoted_name); + vfs_print_message (_("shell: store %s: sending command..."), quoted_name); /* FIXME: File size is limited to ULONG_MAX */ code = - fish_command_v (me, super, WAIT_REPLY, - fish->append ? fish_super->scr_append : fish_super->scr_send, - "FISH_FILENAME=%s FISH_FILESIZE=%" PRIuMAX ";\n", quoted_name, - (uintmax_t) s.st_size); + shell_command_v (me, super, WAIT_REPLY, + shell->append ? shell_super->scr_append : shell_super->scr_send, + "SHELL_FILENAME=%s SHELL_FILESIZE=%" PRIuMAX ";\n", quoted_name, + (uintmax_t) s.st_size); g_free (quoted_name); if (code != PRELIM) @@ -1051,7 +1058,7 @@ fish_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, char { if ((errno == EINTR) && tty_got_interrupt ()) continue; - vfs_print_message ("%s", _("fish: Local read failed, sending zeros")); + vfs_print_message ("%s", _("shell: Local read failed, sending zeros")); close (h); h = open ("/dev/zero", O_RDONLY); } @@ -1059,7 +1066,7 @@ fish_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, char if (n == 0) break; - t = write (fish_super->sockw, buffer, n); + t = write (shell_super->sockw, buffer, n); if (t != n) { if (t == -1) @@ -1070,27 +1077,27 @@ fish_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, char } tty_disable_interrupt_key (); total += n; - vfs_print_message ("%s: %" PRIuMAX "/%" PRIuMAX, _("fish: storing file"), + vfs_print_message ("%s: %" PRIuMAX "/%" PRIuMAX, _("shell: storing file"), (uintmax_t) total, (uintmax_t) s.st_size); } close (h); - if (fish_get_reply (me, fish_super->sockr, NULL, 0) != COMPLETE) + if (shell_get_reply (me, shell_super->sockr, NULL, 0) != COMPLETE) ERRNOR (E_REMOTE, -1); return 0; error_return: close (h); - fish_get_reply (me, fish_super->sockr, NULL, 0); + shell_get_reply (me, shell_super->sockr, NULL, 0); return -1; } /* --------------------------------------------------------------------------------------------- */ static int -fish_linear_start (struct vfs_class *me, vfs_file_handler_t * fh, off_t offset) +shell_linear_start (struct vfs_class *me, vfs_file_handler_t * fh, off_t offset) { - fish_file_handler_t *fish = FISH_FILE_HANDLER (fh); + shell_file_handler_t *shell = SHELL_FILE_HANDLER (fh); struct vfs_s_super *super = VFS_FILE_HANDLER_SUPER (fh); char *name; char *quoted_name; @@ -1100,7 +1107,7 @@ fish_linear_start (struct vfs_class *me, vfs_file_handler_t * fh, off_t offset) return 0; quoted_name = strutils_shell_escape (name); g_free (name); - fish->append = FALSE; + shell->append = FALSE; /* * Check whether the remote file is readable by using 'dd' to copy @@ -1110,20 +1117,20 @@ fish_linear_start (struct vfs_class *me, vfs_file_handler_t * fh, off_t offset) */ offset = - fish_command_v (me, super, WANT_STRING, FISH_SUPER (super)->scr_get, - "FISH_FILENAME=%s FISH_START_OFFSET=%" PRIuMAX ";\n", quoted_name, - (uintmax_t) offset); + shell_command_v (me, super, WANT_STRING, SHELL_SUPER (super)->scr_get, + "SHELL_FILENAME=%s SHELL_START_OFFSET=%" PRIuMAX ";\n", quoted_name, + (uintmax_t) offset); g_free (quoted_name); if (offset != PRELIM) ERRNOR (E_REMOTE, 0); fh->linear = LS_LINEAR_OPEN; - fish->got = 0; + shell->got = 0; errno = 0; #if SIZEOF_OFF_T == SIZEOF_LONG - fish->total = (off_t) strtol (reply_str, NULL, 10); + shell->total = (off_t) strtol (reply_str, NULL, 10); #else - fish->total = (off_t) g_ascii_strtoll (reply_str, NULL, 10); + shell->total = (off_t) g_ascii_strtoll (reply_str, NULL, 10); #endif if (errno != 0) ERRNOR (E_REMOTE, 0); @@ -1133,9 +1140,9 @@ fish_linear_start (struct vfs_class *me, vfs_file_handler_t * fh, off_t offset) /* --------------------------------------------------------------------------------------------- */ static void -fish_linear_abort (struct vfs_class *me, vfs_file_handler_t * fh) +shell_linear_abort (struct vfs_class *me, vfs_file_handler_t * fh) { - fish_file_handler_t *fish = FISH_FILE_HANDLER (fh); + shell_file_handler_t *shell = SHELL_FILE_HANDLER (fh); struct vfs_s_super *super = VFS_FILE_HANDLER_SUPER (fh); char buffer[BUF_8K]; ssize_t n; @@ -1144,18 +1151,18 @@ fish_linear_abort (struct vfs_class *me, vfs_file_handler_t * fh) do { - n = MIN ((off_t) sizeof (buffer), (fish->total - fish->got)); + n = MIN ((off_t) sizeof (buffer), (shell->total - shell->got)); if (n != 0) { - n = read (FISH_SUPER (super)->sockr, buffer, n); + n = read (SHELL_SUPER (super)->sockr, buffer, n); if (n < 0) return; - fish->got += n; + shell->got += n; } } while (n != 0); - if (fish_get_reply (me, FISH_SUPER (super)->sockr, NULL, 0) != COMPLETE) + if (shell_get_reply (me, SHELL_SUPER (super)->sockr, NULL, 0) != COMPLETE) vfs_print_message ("%s", _("Error reported after abort.")); else vfs_print_message ("%s", _("Aborted transfer would be successful.")); @@ -1164,15 +1171,15 @@ fish_linear_abort (struct vfs_class *me, vfs_file_handler_t * fh) /* --------------------------------------------------------------------------------------------- */ static ssize_t -fish_linear_read (struct vfs_class *me, vfs_file_handler_t * fh, void *buf, size_t len) +shell_linear_read (struct vfs_class *me, vfs_file_handler_t * fh, void *buf, size_t len) { - fish_file_handler_t *fish = FISH_FILE_HANDLER (fh); + shell_file_handler_t *shell = SHELL_FILE_HANDLER (fh); struct vfs_s_super *super = VFS_FILE_HANDLER_SUPER (fh); ssize_t n = 0; - len = MIN ((size_t) (fish->total - fish->got), len); + len = MIN ((size_t) (shell->total - shell->got), len); tty_disable_interrupt_key (); - while (len != 0 && ((n = read (FISH_SUPER (super)->sockr, buf, len)) < 0)) + while (len != 0 && ((n = read (SHELL_SUPER (super)->sockr, buf, len)) < 0)) { if ((errno == EINTR) && !tty_got_interrupt ()) continue; @@ -1181,10 +1188,10 @@ fish_linear_read (struct vfs_class *me, vfs_file_handler_t * fh, void *buf, size tty_enable_interrupt_key (); if (n > 0) - fish->got += n; + shell->got += n; else if (n < 0) - fish_linear_abort (me, fh); - else if (fish_get_reply (me, FISH_SUPER (super)->sockr, NULL, 0) != COMPLETE) + shell_linear_abort (me, fh); + else if (shell_get_reply (me, SHELL_SUPER (super)->sockr, NULL, 0) != COMPLETE) ERRNOR (E_REMOTE, -1); ERRNOR (errno, n); } @@ -1192,18 +1199,18 @@ fish_linear_read (struct vfs_class *me, vfs_file_handler_t * fh, void *buf, size /* --------------------------------------------------------------------------------------------- */ static void -fish_linear_close (struct vfs_class *me, vfs_file_handler_t * fh) +shell_linear_close (struct vfs_class *me, vfs_file_handler_t * fh) { - fish_file_handler_t *fish = FISH_FILE_HANDLER (fh); + shell_file_handler_t *shell = SHELL_FILE_HANDLER (fh); - if (fish->total != fish->got) - fish_linear_abort (me, fh); + if (shell->total != shell->got) + shell_linear_abort (me, fh); } /* --------------------------------------------------------------------------------------------- */ static int -fish_ctl (void *fh, int ctlop, void *arg) +shell_ctl (void *fh, int ctlop, void *arg) { (void) arg; (void) fh; @@ -1224,7 +1231,7 @@ fish_ctl (void *fh, int ctlop, void *arg) if (file->linear == LS_LINEAR_CLOSED || file->linear == LS_LINEAR_PREOPEN) return 0; - v = vfs_s_select_on_two (VFS_FILE_HANDLER_SUPER (fh)->u.fish.sockr, 0); + v = vfs_s_select_on_two (VFS_FILE_HANDLER_SUPER (fh)->u.shell.sockr, 0); return (((v < 0) && (errno == EINTR)) || v == 0) ? 1 : 0; } @@ -1237,7 +1244,7 @@ fish_ctl (void *fh, int ctlop, void *arg) /* --------------------------------------------------------------------------------------------- */ static int -fish_rename (const vfs_path_t * vpath1, const vfs_path_t * vpath2) +shell_rename (const vfs_path_t * vpath1, const vfs_path_t * vpath2) { const char *crpath1, *crpath2; char *rpath1, *rpath2; @@ -1259,8 +1266,8 @@ fish_rename (const vfs_path_t * vpath1, const vfs_path_t * vpath2) me = VFS_CLASS (vfs_path_get_last_path_vfs (vpath1)); ret = - fish_send_command (me, super2, OPT_FLUSH, FISH_SUPER (super)->scr_mv, - "FISH_FILEFROM=%s FISH_FILETO=%s;\n", rpath1, rpath2); + shell_send_command (me, super2, OPT_FLUSH, SHELL_SUPER (super)->scr_mv, + "SHELL_FILEFROM=%s SHELL_FILETO=%s;\n", rpath1, rpath2); g_free (rpath1); g_free (rpath2); @@ -1271,7 +1278,7 @@ fish_rename (const vfs_path_t * vpath1, const vfs_path_t * vpath2) /* --------------------------------------------------------------------------------------------- */ static int -fish_link (const vfs_path_t * vpath1, const vfs_path_t * vpath2) +shell_link (const vfs_path_t * vpath1, const vfs_path_t * vpath2) { const char *crpath1, *crpath2; char *rpath1, *rpath2; @@ -1293,8 +1300,8 @@ fish_link (const vfs_path_t * vpath1, const vfs_path_t * vpath2) me = VFS_CLASS (vfs_path_get_last_path_vfs (vpath1)); ret = - fish_send_command (me, super2, OPT_FLUSH, FISH_SUPER (super)->scr_hardlink, - "FISH_FILEFROM=%s FISH_FILETO=%s;\n", rpath1, rpath2); + shell_send_command (me, super2, OPT_FLUSH, SHELL_SUPER (super)->scr_hardlink, + "SHELL_FILEFROM=%s SHELL_FILETO=%s;\n", rpath1, rpath2); g_free (rpath1); g_free (rpath2); @@ -1305,7 +1312,7 @@ fish_link (const vfs_path_t * vpath1, const vfs_path_t * vpath2) /* --------------------------------------------------------------------------------------------- */ static int -fish_symlink (const vfs_path_t * vpath1, const vfs_path_t * vpath2) +shell_symlink (const vfs_path_t * vpath1, const vfs_path_t * vpath2) { char *qsetto; const char *crpath; @@ -1324,8 +1331,8 @@ fish_symlink (const vfs_path_t * vpath1, const vfs_path_t * vpath2) me = VFS_CLASS (vfs_path_get_last_path_vfs (vpath2)); ret = - fish_send_command (me, super, OPT_FLUSH, FISH_SUPER (super)->scr_ln, - "FISH_FILEFROM=%s FISH_FILETO=%s;\n", qsetto, rpath); + shell_send_command (me, super, OPT_FLUSH, SHELL_SUPER (super)->scr_ln, + "SHELL_FILEFROM=%s SHELL_FILETO=%s;\n", qsetto, rpath); g_free (qsetto); g_free (rpath); @@ -1336,43 +1343,43 @@ fish_symlink (const vfs_path_t * vpath1, const vfs_path_t * vpath2) /* --------------------------------------------------------------------------------------------- */ static int -fish_stat (const vfs_path_t * vpath, struct stat *buf) +shell_stat (const vfs_path_t * vpath, struct stat *buf) { int ret; ret = vfs_s_stat (vpath, buf); - fish_set_blksize (buf); + shell_set_blksize (buf); return ret; } /* --------------------------------------------------------------------------------------------- */ static int -fish_lstat (const vfs_path_t * vpath, struct stat *buf) +shell_lstat (const vfs_path_t * vpath, struct stat *buf) { int ret; ret = vfs_s_lstat (vpath, buf); - fish_set_blksize (buf); + shell_set_blksize (buf); return ret; } /* --------------------------------------------------------------------------------------------- */ static int -fish_fstat (void *vfs_info, struct stat *buf) +shell_fstat (void *vfs_info, struct stat *buf) { int ret; ret = vfs_s_fstat (vfs_info, buf); - fish_set_blksize (buf); + shell_set_blksize (buf); return ret; } /* --------------------------------------------------------------------------------------------- */ static int -fish_chmod (const vfs_path_t * vpath, mode_t mode) +shell_chmod (const vfs_path_t * vpath, mode_t mode) { const char *crpath; char *rpath; @@ -1389,9 +1396,9 @@ fish_chmod (const vfs_path_t * vpath, mode_t mode) me = VFS_CLASS (vfs_path_get_last_path_vfs (vpath)); ret = - fish_send_command (me, super, OPT_FLUSH, FISH_SUPER (super)->scr_chmod, - "FISH_FILENAME=%s FISH_FILEMODE=%4.4o;\n", rpath, - (unsigned int) (mode & 07777)); + shell_send_command (me, super, OPT_FLUSH, SHELL_SUPER (super)->scr_chmod, + "SHELL_FILENAME=%s SHELL_FILEMODE=%4.4o;\n", rpath, + (unsigned int) (mode & 07777)); g_free (rpath); @@ -1401,7 +1408,7 @@ fish_chmod (const vfs_path_t * vpath, mode_t mode) /* --------------------------------------------------------------------------------------------- */ static int -fish_chown (const vfs_path_t * vpath, uid_t owner, gid_t group) +shell_chown (const vfs_path_t * vpath, uid_t owner, gid_t group) { char *sowner, *sgroup; struct passwd *pw; @@ -1433,9 +1440,9 @@ fish_chown (const vfs_path_t * vpath, uid_t owner, gid_t group) /* FIXME: what should we report if chgrp succeeds but chown fails? */ ret = - fish_send_command (me, super, OPT_FLUSH, FISH_SUPER (super)->scr_chown, - "FISH_FILENAME=%s FISH_FILEOWNER=%s FISH_FILEGROUP=%s;\n", rpath, sowner, - sgroup); + shell_send_command (me, super, OPT_FLUSH, SHELL_SUPER (super)->scr_chown, + "SHELL_FILENAME=%s SHELL_FILEOWNER=%s SHELL_FILEGROUP=%s;\n", rpath, + sowner, sgroup); g_free (rpath); @@ -1445,7 +1452,7 @@ fish_chown (const vfs_path_t * vpath, uid_t owner, gid_t group) /* --------------------------------------------------------------------------------------------- */ static void -fish_get_atime (mc_timesbuf_t * times, time_t * sec, long *nsec) +shell_get_atime (mc_timesbuf_t * times, time_t * sec, long *nsec) { #ifdef HAVE_UTIMENSAT *sec = (*times)[0].tv_sec; @@ -1459,7 +1466,7 @@ fish_get_atime (mc_timesbuf_t * times, time_t * sec, long *nsec) /* --------------------------------------------------------------------------------------------- */ static void -fish_get_mtime (mc_timesbuf_t * times, time_t * sec, long *nsec) +shell_get_mtime (mc_timesbuf_t * times, time_t * sec, long *nsec) { #ifdef HAVE_UTIMENSAT *sec = (*times)[1].tv_sec; @@ -1473,7 +1480,7 @@ fish_get_mtime (mc_timesbuf_t * times, time_t * sec, long *nsec) /* --------------------------------------------------------------------------------------------- */ static int -fish_utime (const vfs_path_t * vpath, mc_timesbuf_t * times) +shell_utime (const vfs_path_t * vpath, mc_timesbuf_t * times) { char utcatime[16], utcmtime[16]; char utcatime_w_nsec[30], utcmtime_w_nsec[30]; @@ -1492,7 +1499,7 @@ fish_utime (const vfs_path_t * vpath, mc_timesbuf_t * times) rpath = strutils_shell_escape (crpath); - fish_get_atime (times, &atime, &atime_nsec); + shell_get_atime (times, &atime, &atime_nsec); gmt = gmtime (&atime); g_snprintf (utcatime, sizeof (utcatime), "%04d%02d%02d%02d%02d.%02d", gmt->tm_year + 1900, gmt->tm_mon + 1, gmt->tm_mday, @@ -1501,7 +1508,7 @@ fish_utime (const vfs_path_t * vpath, mc_timesbuf_t * times) gmt->tm_year + 1900, gmt->tm_mon + 1, gmt->tm_mday, gmt->tm_hour, gmt->tm_min, gmt->tm_sec, atime_nsec); - fish_get_mtime (times, &mtime, &mtime_nsec); + shell_get_mtime (times, &mtime, &mtime_nsec); gmt = gmtime (&mtime); g_snprintf (utcmtime, sizeof (utcmtime), "%04d%02d%02d%02d%02d.%02d", gmt->tm_year + 1900, gmt->tm_mon + 1, gmt->tm_mday, @@ -1512,11 +1519,11 @@ fish_utime (const vfs_path_t * vpath, mc_timesbuf_t * times) me = VFS_CLASS (vfs_path_get_last_path_vfs (vpath)); - ret = fish_send_command (me, super, OPT_FLUSH, FISH_SUPER (super)->scr_utime, - "FISH_FILENAME=%s FISH_FILEATIME=%ld FISH_FILEMTIME=%ld " - "FISH_TOUCHATIME=%s FISH_TOUCHMTIME=%s FISH_TOUCHATIME_W_NSEC=\"%s\" " - "FISH_TOUCHMTIME_W_NSEC=\"%s\";\n", rpath, (long) atime, (long) mtime, - utcatime, utcmtime, utcatime_w_nsec, utcmtime_w_nsec); + ret = shell_send_command (me, super, OPT_FLUSH, SHELL_SUPER (super)->scr_utime, + "SHELL_FILENAME=%s SHELL_FILEATIME=%ld SHELL_FILEMTIME=%ld " + "SHELL_TOUCHATIME=%s SHELL_TOUCHMTIME=%s SHELL_TOUCHATIME_W_NSEC=\"%s\" " + "SHELL_TOUCHMTIME_W_NSEC=\"%s\";\n", rpath, (long) atime, + (long) mtime, utcatime, utcmtime, utcatime_w_nsec, utcmtime_w_nsec); g_free (rpath); @@ -1526,7 +1533,7 @@ fish_utime (const vfs_path_t * vpath, mc_timesbuf_t * times) /* --------------------------------------------------------------------------------------------- */ static int -fish_unlink (const vfs_path_t * vpath) +shell_unlink (const vfs_path_t * vpath) { const char *crpath; char *rpath; @@ -1543,8 +1550,8 @@ fish_unlink (const vfs_path_t * vpath) me = VFS_CLASS (vfs_path_get_last_path_vfs (vpath)); ret = - fish_send_command (me, super, OPT_FLUSH, FISH_SUPER (super)->scr_unlink, - "FISH_FILENAME=%s;\n", rpath); + shell_send_command (me, super, OPT_FLUSH, SHELL_SUPER (super)->scr_unlink, + "SHELL_FILENAME=%s;\n", rpath); g_free (rpath); @@ -1554,7 +1561,7 @@ fish_unlink (const vfs_path_t * vpath) /* --------------------------------------------------------------------------------------------- */ static int -fish_exists (const vfs_path_t * vpath) +shell_exists (const vfs_path_t * vpath) { const char *crpath; char *rpath; @@ -1571,8 +1578,8 @@ fish_exists (const vfs_path_t * vpath) me = VFS_CLASS (vfs_path_get_last_path_vfs (vpath)); ret = - fish_send_command (me, super, OPT_FLUSH, FISH_SUPER (super)->scr_exists, - "FISH_FILENAME=%s;\n", rpath); + shell_send_command (me, super, OPT_FLUSH, SHELL_SUPER (super)->scr_exists, + "SHELL_FILENAME=%s;\n", rpath); g_free (rpath); @@ -1582,7 +1589,7 @@ fish_exists (const vfs_path_t * vpath) /* --------------------------------------------------------------------------------------------- */ static int -fish_mkdir (const vfs_path_t * vpath, mode_t mode) +shell_mkdir (const vfs_path_t * vpath, mode_t mode) { const char *crpath; char *rpath; @@ -1601,14 +1608,14 @@ fish_mkdir (const vfs_path_t * vpath, mode_t mode) me = VFS_CLASS (vfs_path_get_last_path_vfs (vpath)); ret = - fish_send_command (me, super, OPT_FLUSH, FISH_SUPER (super)->scr_mkdir, - "FISH_FILENAME=%s;\n", rpath); + shell_send_command (me, super, OPT_FLUSH, SHELL_SUPER (super)->scr_mkdir, + "SHELL_FILENAME=%s;\n", rpath); g_free (rpath); if (ret != 0) return ret; - if (fish_exists (vpath) == 0) + if (shell_exists (vpath) == 0) { me->verrno = EACCES; return -1; @@ -1619,7 +1626,7 @@ fish_mkdir (const vfs_path_t * vpath, mode_t mode) /* --------------------------------------------------------------------------------------------- */ static int -fish_rmdir (const vfs_path_t * vpath) +shell_rmdir (const vfs_path_t * vpath) { const char *crpath; char *rpath; @@ -1636,8 +1643,8 @@ fish_rmdir (const vfs_path_t * vpath) me = VFS_CLASS (vfs_path_get_last_path_vfs (vpath)); ret = - fish_send_command (me, super, OPT_FLUSH, FISH_SUPER (super)->scr_rmdir, - "FISH_FILENAME=%s;\n", rpath); + shell_send_command (me, super, OPT_FLUSH, SHELL_SUPER (super)->scr_rmdir, + "SHELL_FILENAME=%s;\n", rpath); g_free (rpath); @@ -1647,11 +1654,11 @@ fish_rmdir (const vfs_path_t * vpath) /* --------------------------------------------------------------------------------------------- */ static vfs_file_handler_t * -fish_fh_new (struct vfs_s_inode *ino, gboolean changed) +shell_fh_new (struct vfs_s_inode *ino, gboolean changed) { - fish_file_handler_t *fh; + shell_file_handler_t *fh; - fh = g_new0 (fish_file_handler_t, 1); + fh = g_new0 (shell_file_handler_t, 1); vfs_s_init_fh (VFS_FILE_HANDLER (fh), ino, changed); return VFS_FILE_HANDLER (fh); @@ -1660,9 +1667,9 @@ fish_fh_new (struct vfs_s_inode *ino, gboolean changed) /* --------------------------------------------------------------------------------------------- */ static int -fish_fh_open (struct vfs_class *me, vfs_file_handler_t * fh, int flags, mode_t mode) +shell_fh_open (struct vfs_class *me, vfs_file_handler_t * fh, int flags, mode_t mode) { - fish_file_handler_t *fish = FISH_FILE_HANDLER (fh); + shell_file_handler_t *shell = SHELL_FILE_HANDLER (fh); (void) mode; @@ -1671,7 +1678,7 @@ fish_fh_open (struct vfs_class *me, vfs_file_handler_t * fh, int flags, mode_t m { /* user pressed the button [ Append ] in the "Copy" dialog */ if ((flags & O_APPEND) != 0) - fish->append = TRUE; + shell->append = TRUE; if (fh->ino->localname == NULL) { @@ -1699,7 +1706,7 @@ fish_fh_open (struct vfs_class *me, vfs_file_handler_t * fh, int flags, mode_t m /* --------------------------------------------------------------------------------------------- */ static void -fish_fill_names (struct vfs_class *me, fill_names_f func) +shell_fill_names (struct vfs_class *me, fill_names_f func) { GList *iter; @@ -1713,14 +1720,14 @@ fish_fill_names (struct vfs_class *me, fill_names_f func) switch (super->path_element->port) { - case FISH_FLAG_RSH: + case SHELL_FLAG_RSH: flags = ":r"; break; - case FISH_FLAG_COMPRESSED: + case SHELL_FLAG_COMPRESSED: flags = ":C"; break; default: - if (super->path_element->port > FISH_FLAG_RSH) + if (super->path_element->port > SHELL_FLAG_RSH) { g_snprintf (gbuf, sizeof (gbuf), ":%d", super->path_element->port); flags = gbuf; @@ -1729,7 +1736,7 @@ fish_fill_names (struct vfs_class *me, fill_names_f func) } name = - g_strconcat (vfs_fish_ops->prefix, VFS_PATH_URL_DELIMITER, + g_strconcat (vfs_shell_ops->prefix, VFS_PATH_URL_DELIMITER, super->path_element->user, "@", super->path_element->host, flags, PATH_SEP_STR, super->path_element->path, (char *) NULL); func (name); @@ -1740,11 +1747,11 @@ fish_fill_names (struct vfs_class *me, fill_names_f func) /* --------------------------------------------------------------------------------------------- */ static void * -fish_open (const vfs_path_t * vpath, int flags, mode_t mode) +shell_open (const vfs_path_t * vpath, int flags, mode_t mode) { /* sorry, i've places hack here - cause fish don't able to open files with O_EXCL flag + cause shell don't able to open files with O_EXCL flag */ flags &= ~O_EXCL; return vfs_s_open (vpath, flags, mode); @@ -1755,38 +1762,38 @@ fish_open (const vfs_path_t * vpath, int flags, mode_t mode) /* --------------------------------------------------------------------------------------------- */ void -vfs_init_fish (void) +vfs_init_shell (void) { tcp_init (); - vfs_init_subclass (&fish_subclass, "fish", VFSF_REMOTE | VFSF_USETMP, "sh"); - vfs_fish_ops->fill_names = fish_fill_names; - vfs_fish_ops->stat = fish_stat; - vfs_fish_ops->lstat = fish_lstat; - vfs_fish_ops->fstat = fish_fstat; - vfs_fish_ops->chmod = fish_chmod; - vfs_fish_ops->chown = fish_chown; - vfs_fish_ops->utime = fish_utime; - vfs_fish_ops->open = fish_open; - vfs_fish_ops->symlink = fish_symlink; - vfs_fish_ops->link = fish_link; - vfs_fish_ops->unlink = fish_unlink; - vfs_fish_ops->rename = fish_rename; - vfs_fish_ops->mkdir = fish_mkdir; - vfs_fish_ops->rmdir = fish_rmdir; - vfs_fish_ops->ctl = fish_ctl; - fish_subclass.archive_same = fish_archive_same; - fish_subclass.new_archive = fish_new_archive; - fish_subclass.open_archive = fish_open_archive; - fish_subclass.free_archive = fish_free_archive; - fish_subclass.fh_new = fish_fh_new; - fish_subclass.fh_open = fish_fh_open; - fish_subclass.dir_load = fish_dir_load; - fish_subclass.file_store = fish_file_store; - fish_subclass.linear_start = fish_linear_start; - fish_subclass.linear_read = fish_linear_read; - fish_subclass.linear_close = fish_linear_close; - vfs_register_class (vfs_fish_ops); + vfs_init_subclass (&shell_subclass, "shell", VFSF_REMOTE | VFSF_USETMP, "sh"); + vfs_shell_ops->fill_names = shell_fill_names; + vfs_shell_ops->stat = shell_stat; + vfs_shell_ops->lstat = shell_lstat; + vfs_shell_ops->fstat = shell_fstat; + vfs_shell_ops->chmod = shell_chmod; + vfs_shell_ops->chown = shell_chown; + vfs_shell_ops->utime = shell_utime; + vfs_shell_ops->open = shell_open; + vfs_shell_ops->symlink = shell_symlink; + vfs_shell_ops->link = shell_link; + vfs_shell_ops->unlink = shell_unlink; + vfs_shell_ops->rename = shell_rename; + vfs_shell_ops->mkdir = shell_mkdir; + vfs_shell_ops->rmdir = shell_rmdir; + vfs_shell_ops->ctl = shell_ctl; + shell_subclass.archive_same = shell_archive_same; + shell_subclass.new_archive = shell_new_archive; + shell_subclass.open_archive = shell_open_archive; + shell_subclass.free_archive = shell_free_archive; + shell_subclass.fh_new = shell_fh_new; + shell_subclass.fh_open = shell_fh_open; + shell_subclass.dir_load = shell_dir_load; + shell_subclass.file_store = shell_file_store; + shell_subclass.linear_start = shell_linear_start; + shell_subclass.linear_read = shell_linear_read; + shell_subclass.linear_close = shell_linear_close; + vfs_register_class (vfs_shell_ops); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/vfs/fish/fish.h b/src/vfs/shell/shell.h similarity index 73% rename from src/vfs/fish/fish.h rename to src/vfs/shell/shell.h index 3c1fa0601..e485d69e2 100644 --- a/src/vfs/fish/fish.h +++ b/src/vfs/shell/shell.h @@ -1,13 +1,13 @@ /** * \file - * \brief Header: Virtual File System: FISH implementation for transferring files over + * \brief Header: Virtual File System: SHELL implementation for transferring files over * shell connections */ -#ifndef MC__VFS_FISH_H -#define MC__VFS_FISH_H +#ifndef MC__VFS_SHELL_H +#define MC__VFS_SHELL_H /*** typedefs(not structures) and defined constants **********************************************/ @@ -17,12 +17,12 @@ /*** global variables defined in .c file *********************************************************/ -extern int fish_directory_timeout; +extern int shell_directory_timeout; /*** declarations of public functions ************************************************************/ -void vfs_init_fish (void); +void vfs_init_shell (void); /*** inline functions ****************************************************************************/ -#endif +#endif /* MC__VFS_SHELL_H */ diff --git a/src/vfs/fish/fishdef.h b/src/vfs/shell/shelldef.h similarity index 70% rename from src/vfs/fish/fishdef.h rename to src/vfs/shell/shelldef.h index 84028e655..37244d980 100644 --- a/src/vfs/fish/fishdef.h +++ b/src/vfs/shell/shelldef.h @@ -1,18 +1,18 @@ /** * \file - * \brief Header: FISH script defaults + * \brief Header: SHELL script defaults */ -#ifndef MC__FISH_DEF_H -#define MC__FISH_DEF_H +#ifndef MC__VFS_SHELL_DEF_H +#define MC__VFS_SHELL_DEF_H /*** typedefs(not structures) and defined constants **********************************************/ /* default 'ls' script */ -#define FISH_LS_DEF_CONTENT "" \ +#define VFS_SHELL_LS_DEF_CONTENT "" \ "export LC_TIME=C\n" \ -"ls -Qlan \"/${FISH_FILENAME}\" 2>/dev/null | grep '^[^cbt]' | (\n" \ +"ls -Qlan \"/${SHELL_FILENAME}\" 2>/dev/null | grep '^[^cbt]' | (\n" \ "while read p l u g s m d y n; do\n" \ " echo \"P$p $u.$g\"\n" \ " echo \"S$s\"\n" \ @@ -21,7 +21,7 @@ " echo\n" \ "done\n" \ ")\n" \ -"ls -Qlan \"/${FISH_FILENAME}\" 2>/dev/null | grep '^[cb]' | (\n" \ +"ls -Qlan \"/${SHELL_FILENAME}\" 2>/dev/null | grep '^[cb]' | (\n" \ "while read p l u g a i m d y n; do\n" \ " echo \"P$p $u.$g\"\n" \ " echo \"E$a$i\"\n" \ @@ -33,110 +33,109 @@ "echo \"### 200\"\n" /* default file exists script */ -#define FISH_EXISTS_DEF_CONTENT "" \ -"ls -l \"/${FISH_FILENAME}\" >/dev/null 2>/dev/null\n" \ +#define VFS_SHELL_EXISTS_DEF_CONTENT "" \ +"ls -l \"/${SHELL_FILENAME}\" >/dev/null 2>/dev/null\n" \ "echo '### '$?\n" /* default 'mkdir' script */ -#define FISH_MKDIR_DEF_CONTENT "" \ -"if mkdir \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \ +#define VFS_SHELL_MKDIR_DEF_CONTENT "" \ +"if mkdir \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \ " echo \"### 000\"\n" \ "else\n" \ " echo \"### 500\"\n" \ "fi\n" /* default 'unlink' script */ -#define FISH_UNLINK_DEF_CONTENT "" \ -"if rm -f \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \ +#define VFS_SHELL_UNLINK_DEF_CONTENT "" \ +"if rm -f \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \ " echo \"### 000\"\n" \ "else\n" \ " echo \"### 500\"\n" \ "fi\n" /* default 'chown' script */ -#define FISH_CHOWN_DEF_CONTENT "" \ -"if chown ${FISH_FILEOWNER}:${FISH_FILEGROUP} \"/${FISH_FILENAME}\"; then\n"\ -" echo \"### 000\"\n" \ -"else\n" \ -" echo \"### 500\"\n" \ +#define VFS_SHELL_CHOWN_DEF_CONTENT "" \ +"if chown ${SHELL_FILEOWNER}:${SHELL_FILEGROUP} \"/${SHELL_FILENAME}\"; then\n" \ +" echo \"### 000\"\n" \ +"else\n" \ +" echo \"### 500\"\n" \ "fi\n" /* default 'chmod' script */ -#define FISH_CHMOD_DEF_CONTENT "" \ -"if chmod ${FISH_FILEMODE} \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \ +#define VFS_SHELL_CHMOD_DEF_CONTENT "" \ +"if chmod ${SHELL_FILEMODE} \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \ " echo \"### 000\"\n" \ "else\n" \ " echo \"### 500\"\n" \ "fi\n" /* default 'utime' script */ -#define FISH_UTIME_DEF_CONTENT "" \ -"#UTIME \"$FISH_TOUCHATIME_W_NSEC\" \"$FISH_TOUCHMTIME_W_NSEC\" $FISH_FILENAME\n" \ -"if TZ=UTC touch -h -m -d \"$FISH_TOUCHMTIME_W_NSEC\" \"/${FISH_FILENAME}\" 2>/dev/null && \\\n" \ -" TZ=UTC touch -h -a -d \"$FISH_TOUCHATIME_W_NSEC\" \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \ -" echo \"### 000\"\n" \ -"elif TZ=UTC touch -h -m -t $FISH_TOUCHMTIME \"/${FISH_FILENAME}\" 2>/dev/null && \\\n" \ -" TZ=UTC touch -h -a -t $FISH_TOUCHATIME \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \ -" echo \"### 000\"\n" \ -"elif [ -n \"$FISH_HAVE_PERL\" ] && \\\n" \ -" perl -e 'utime '$FISH_FILEATIME','$FISH_FILEMTIME',@ARGV;' \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \ -" echo \"### 000\"\n" \ -"else\n" \ -" echo \"### 500\"\n" \ +#define VFS_SHELL_UTIME_DEF_CONTENT "" \ +"#UTIME \"$SHELL_TOUCHATIME_W_NSEC\" \"$SHELL_TOUCHMTIME_W_NSEC\" $SHELL_FILENAME\n" \ +"if TZ=UTC touch -h -m -d \"$SHELL_TOUCHMTIME_W_NSEC\" \"/${SHELL_FILENAME}\" 2>/dev/null && \\\n" \ +" TZ=UTC touch -h -a -d \"$SHELL_TOUCHATIME_W_NSEC\" \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \ +" echo \"### 000\"\n" \ +"elif TZ=UTC touch -h -m -t $SHELL_TOUCHMTIME \"/${SHELL_FILENAME}\" 2>/dev/null && \\\n" \ +" TZ=UTC touch -h -a -t $SHELL_TOUCHATIME \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \ +" echo \"### 000\"\n" \ +"elif [ -n \"$SHELL_HAVE_PERL\" ] && \\\n" \ +" perl -e 'utime '$SHELL_FILEATIME','$SHELL_FILEMTIME',@ARGV;' \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \ +" echo \"### 000\"\n" \ +"else\n" \ +" echo \"### 500\"\n" \ "fi\n" - /* default 'rmdir' script */ -#define FISH_RMDIR_DEF_CONTENT "" \ -"if rmdir \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \ +#define VFS_SHELL_RMDIR_DEF_CONTENT "" \ +"if rmdir \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \ " echo \"### 000\"\n" \ "else\n" \ " echo \"### 500\"\n" \ "fi\n" /* default 'ln -s' symlink script */ -#define FISH_LN_DEF_CONTENT "" \ -"if ln -s \"/${FISH_FILEFROM}\" \"/${FISH_FILETO}\" 2>/dev/null; then\n" \ +#define VFS_SHELL_LN_DEF_CONTENT "" \ +"if ln -s \"/${SHELL_FILEFROM}\" \"/${SHELL_FILETO}\" 2>/dev/null; then\n" \ " echo \"### 000\"\n" \ "else\n" \ " echo \"### 500\"\n" \ "fi\n" /* default 'mv' script */ -#define FISH_MV_DEF_CONTENT "" \ -"if mv \"/${FISH_FILEFROM}\" \"/${FISH_FILETO}\" 2>/dev/null; then\n" \ +#define VFS_SHELL_MV_DEF_CONTENT "" \ +"if mv \"/${SHELL_FILEFROM}\" \"/${SHELL_FILETO}\" 2>/dev/null; then\n" \ " echo \"### 000\"\n" \ "else\n" \ " echo \"### 500\"\n" \ "fi\n" /* default 'ln' hardlink script */ -#define FISH_HARDLINK_DEF_CONTENT "" \ -"if ln \"/${FISH_FILEFROM}\" \"/${FISH_FILETO}\" 2>/dev/null; then\n" \ +#define VFS_SHELL_HARDLINK_DEF_CONTENT "" \ +"if ln \"/${SHELL_FILEFROM}\" \"/${SHELL_FILETO}\" 2>/dev/null; then\n" \ " echo \"### 000\"\n" \ "else\n" \ " echo \"### 500\"\n" \ "fi\n" /* default 'retr' script */ -#define FISH_GET_DEF_CONTENT "" \ -"export LC_TIME=C\n" \ -"if dd if=\"/${FISH_FILENAME}\" of=/dev/null bs=1 count=1 2>/dev/null ; then\n" \ -" ls -ln \"/${FISH_FILENAME}\" 2>/dev/null | (\n" \ -" read p l u g s r\n" \ -" echo $s\n" \ -" )\n" \ -" echo \"### 100\"\n" \ -" cat \"/${FISH_FILENAME}\"\n" \ -" echo \"### 200\"\n" \ -"else\n" \ -" echo \"### 500\"\n" \ +#define VFS_SHELL_GET_DEF_CONTENT "" \ +"export LC_TIME=C\n" \ +"if dd if=\"/${SHELL_FILENAME}\" of=/dev/null bs=1 count=1 2>/dev/null ; then\n" \ +" ls -ln \"/${SHELL_FILENAME}\" 2>/dev/null | (\n" \ +" read p l u g s r\n" \ +" echo $s\n" \ +" )\n" \ +" echo \"### 100\"\n" \ +" cat \"/${SHELL_FILENAME}\"\n" \ +" echo \"### 200\"\n" \ +"else\n" \ +" echo \"### 500\"\n" \ "fi\n" /* default 'stor' script */ -#define FISH_SEND_DEF_CONTENT "" \ -"FILENAME=\"/${FISH_FILENAME}\"\n" \ -"FILESIZE=${FISH_FILESIZE}\n" \ +#define VFS_SHELL_SEND_DEF_CONTENT "" \ +"FILENAME=\"/${SHELL_FILENAME}\"\n" \ +"FILESIZE=${SHELL_FILESIZE}\n" \ "echo \"### 001\"\n" \ "{\n" \ " while [ $FILESIZE -gt 0 ]; do\n" \ @@ -147,9 +146,9 @@ "}; echo \"### 200\"\n" /* default 'appe' script */ -#define FISH_APPEND_DEF_CONTENT "" \ -"FILENAME=\"/${FISH_FILENAME}\"\n" \ -"FILESIZE=${FISH_FILESIZE}\n" \ +#define VFS_SHELL_APPEND_DEF_CONTENT "" \ +"FILENAME=\"/${SHELL_FILENAME}\"\n" \ +"FILESIZE=${SHELL_FILESIZE}\n" \ "echo \"### 001\"\n" \ "res=`exec 3>&1\n" \ "(\n" \ @@ -168,15 +167,15 @@ "}; echo \"### 200\"\n" /* default 'info' script */ -#define FISH_INFO_DEF_CONTENT "" \ +#define VFS_SHELL_INFO_DEF_CONTENT "" \ "export LC_TIME=C\n" \ -"#FISH_HAVE_HEAD 1\n" \ -"#FISH_HAVE_SED 2\n" \ -"#FISH_HAVE_AWK 4\n" \ -"#FISH_HAVE_PERL 8\n" \ -"#FISH_HAVE_LSQ 16\n" \ -"#FISH_HAVE_DATE_MDYT 32\n" \ -"#FISH_HAVE_TAIL 64\n" \ +"#SHELL_HAVE_HEAD 1\n" \ +"#SHELL_HAVE_SED 2\n" \ +"#SHELL_HAVE_AWK 4\n" \ +"#SHELL_HAVE_PERL 8\n" \ +"#SHELL_HAVE_LSQ 16\n" \ +"#SHELL_HAVE_DATE_MDYT 32\n" \ +"#SHELL_HAVE_TAIL 64\n" \ "res=0\n" \ "if `echo yes| head -c 1 > /dev/null 2>&1` ; then\n" \ " res=`expr $res + 1`\n" \ @@ -221,4 +220,5 @@ /*** declarations of public functions ************************************************************/ /*** inline functions ****************************************************************************/ -#endif + +#endif /* MC__VFS_SHELL_DEF_H */ diff --git a/tests/lib/mcconfig/user_configs_path.c b/tests/lib/mcconfig/user_configs_path.c index 6140c1203..576468ab1 100644 --- a/tests/lib/mcconfig/user_configs_path.c +++ b/tests/lib/mcconfig/user_configs_path.c @@ -118,7 +118,7 @@ static const struct test_user_config_paths_ds }, { /* 10. */ CONF_DATA, - FISH_PREFIX + VFS_SHELL_PREFIX }, { /* 11. */ CONF_DATA,