Commit Graph

62 Commits

Author SHA1 Message Date
Pavel Roskin 413f8cbabd * fish.c: Convert to calling vfs_register_class().
* fish.h: Eliminate.  Adjust all dependencies.
* direntry.c (vfs_s_init_class): Add missing vfs_s_setctl().
2003-10-10 23:38:03 +00:00
Pavel Roskin b2edfddd7e * vfs.h: Rename "struct _vfs" to "struct vfs_class". Allow
calling vfs_register() in the file defining the VFS class.
* vfs.c (vfs_init): Register cpiofs in cpio.c.
(vfs_register): Rename to vfs_register_class(), remove "static".
* direntry.c (vfs_s_init_class): New function - generic VFS
class registraction for vfs_s descendants.
* cpio.c: Register VFS class locally.
2003-10-10 23:13:09 +00:00
Pavel Roskin b1aba35e22 * direntry.c: Make functions static when possible.
* xdirentry.h: Remove unneeded declarations.
2003-10-07 22:38:28 +00:00
Pavel Roskin 94e14aacfb * direntry.c (vfs_s_dump): Commented out.
* extfs.c (s_readlink): Fix return value and possible buffer
overflow.
* mcfs.c (mcfs_readlink): Fix return value.
* mcserv.c (do_readlink):  Fix possible off-by-one.
(commands): Make const array and remove needless comma.
2003-08-29 22:48:25 +00:00
Andrew V. Samoilov 55ccd00c73 * direntry.c (vfs_s_dump): SunOS 5.8 warning fix. Reformat function. 2003-02-19 14:04:35 +00:00
Pavel Roskin f2c028ce46 s/can not/cannot/ 2002-12-26 02:21:37 +00:00
Pavel Roskin ddf2ad1612 * direntry.c (vfs_s_open): If the filesystem is read-only,
disable file creation.
2002-12-25 04:57:26 +00:00
Pavel Roskin 1b2f7e7d13 s/Dir cache/Directory cache/
"Dir cache" should be in geek.po :-)
2002-12-16 06:04:02 +00:00
Pavel Roskin 416008fc74 * direntry.c (vfs_s_resolve_symlink): Use g_snprintf() instead
of non-portable snprintf().
Reported by Xu Qiang <Xu.Qiang@xssc.sgp.xerox.com>
2002-10-07 05:32:45 +00:00
Pavel Roskin 99800b2f24 * direntry.c (vfs_s_retrieve_file): Allow interrupt by Ctrl-C.
From Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz>
2002-09-29 18:35:14 +00:00
Pavel Roskin da7e82d253 Global removal of RCS Id: flags. 2002-09-26 23:13:45 +00:00
Pavel Roskin 04c7da6358 * direntry.c [!USE_NETCODE]: Disable functions used in networked
filesystems only.
2002-09-06 01:34:12 +00:00
Pavel Roskin 1c411834a8 * direntry.c (vfs_s_get_line): Fix off-by-one buffer overflow. 2002-08-20 01:08:34 +00:00
Pavel Roskin 7f923cc9c0 * direntry.c (vfs_s_getlocalcopy): Fix potentially dangerous
strcpy().
2002-08-15 21:31:54 +00:00
Pavel Roskin cf8ab0de99 * extfs.c (s_readdir): Simplify.
* direntry.c (vfs_s_readdir): Use vfs_dirent.
* mcfs.c (mcfs_readdir): Likewise.
* smbfs.c (smbfs_readdir): Likewise.
* undelfs.c (undelfs_readdir): Use vfs_dirent and
compute_namelen().
2002-08-15 21:15:17 +00:00
Pavel Roskin 8b8d7de7ca * direntry.c (vfs_s_readdir): Use compute_namelen().
* extfs.c (s_readdir): Likewise.
* mcfs.c (mcfs_readdir): Likewise.
* smbfs.c (smbfs_readdir): Likewise.
2002-08-15 19:38:17 +00:00
Pavel Roskin e66ab47cf1 * direntry.c (vfs_s_find_entry_linear): Canonicalize path before searching 2002-07-26 21:58:43 +00:00
Pavel Roskin 982a256ee0 * xdirentry.h: Get rid of ifree(), it's equivalent to g_free().
* direntry.c: Likewise.
* fish.c: Likewise.
* ftpfs.c: Likewise.
2002-07-19 16:04:27 +00:00
Pavel Roskin 6f3a7c8029 * direntry.c (vfs_s_open): Don't pass O_LINEAR to open() -
this flag is for VFS only, and causes side effects in Cygwin.
* extfs.c (extfs_open): Likewise.
* sfs.c (sfs_open): Likewise.
Reported by Pavel Tsekov <ptsekov@gmx.net>
2002-07-10 17:56:27 +00:00
Andrew V. Samoilov a60f38583a * xdirentry.h (vfs_s_fh.u.ftp): Add append field.
(vfs_s_data.file_store): Change second argument
to (vfs_s_fh *fh).
* direntry.c (vfs_s_close): Adjust.
* fish.c (file_store): Likewise.
* ftpfs.c (file_store): Likewise.  Use "APPE" if
fh->u.ftp.append is true.
(linear_start): Care about fh->u.ftp.append.
(ftpfs_fh_open): Likewise.
2002-05-22 17:19:24 +00:00
Andrew V. Samoilov 12ba0fc8a4 * direntry.c (vfs_s_retrieve_file): Please, care about
fish.local_stat ...
* fish.c (linear_close): ... here.
2002-05-21 17:27:30 +00:00
Andrew V. Samoilov a844c07aac * direntry.c (vfs_s_read): Move MEDATA->linear_start() ...
* (vfs_s_open): ... here.
2002-05-17 07:08:03 +00:00
Andrew V. Samoilov 7df53e2bd2 * direntry.c (vfs_s_resolve_symlink): Comment out buggy code.
(vfs_s_retrieve_file): Set fh->handle to -1.
(vfs_s_read): Don't manipulate with FH->handle if it is -1.
(vfs_s_write): Likewise.
(vfs_s_close): Likewise.
2002-03-06 08:46:35 +00:00
Andrew V. Samoilov 1711c0ab8b * direntry.c (vfs_s_retrieve_file): Use off_t for total
and stat_size.

* vfs.c (vfs_s_resolve_symlink): Use snprintf
instead of sprintf.
(vfs_print_stats): Use off_t for have and need.  Cast
have to double to eliminate negative percent(s).
Fix print_vfs_message string formats.

* vfs.h (vfs_print_stats): Adjust declaration.

* ftpfs.c (file_store): Use off_t for total.
Fix print_vfs_message string format.
2002-02-08 09:42:38 +00:00
Pavel Roskin 0b36c6e5eb * direntry.c (vfs_s_free_super): Remove i18n on commented out
developer-only code.
2001-08-16 22:23:05 +00:00
Pavel Roskin 680f3f7ed2 * cpio.c: Include <config.h> before everything else.
* direntry.c: Likewise.
* fish.c: Likewise.
* ftpfs.c: Likewise.
* local.c: Likewise.
* tar.c: Likewise.
* utilvfs.h: Don't include <config.h> - it should be included
in all C files instead.
* xdirentry.h: Likewise.
2001-06-25 21:34:46 +00:00
Pavel Roskin 5da3b42969 * ftpfs.c: Declare functions without declarations static. Don't
omit `void' in declarations.
* cpio.c: Likewise.
* direntry.c: Likewise.
* extfs.c: Likewise.
* mcfs.c: Likewise.
* tar.c: Likewise.
* vfs.c: Likewise.
* vfs.h: Likewise.
* mcserv.c: Likewise. Remove unused functions.
2001-06-14 20:08:27 +00:00
Pavel Roskin bea09b932d * src/ext.c (exec_extension): Use mc_mkstemps().
* src/user.c (execute_menu_command): Use mc_mkstemps().
* src/util.c (mc_mkstemps): New function - safely create and
open temporary file. Return the handle and the name.
* src/util.h: Declarations for init_tmpdir() and mc_mkstemps().
Define TMPDIR_DEFAULT and SCRIPT_SUFFIX.
* vfs/direntry.c (vfs_s_open): Use mc_mkstemps. Create and close
temporary file to reserve its name on the filesystem.
(vfs_s_retrieve_file): Use mc_mkstemps().
(g_tempnam): Remove.
* vfs/extfs.c (extfs_open): Use mc_mkstemps().
* vfs/sfs.c (redirect): Likewise.
* vfs/shared_ftp_fish.c (_get_file_entry): Likewise.
(retrieve_file): Likewise.
* vfs/vfs.c (mc_def_getlocalcopy): Likewise.
* vfs/xdirentry.h: Remove declaration of g_tempnam().
2001-05-21 16:21:07 +00:00
Pavel Machek 55e56a1426 Fixes from Roland: we may not g_free() strdup-ed text. 2000-10-31 15:43:49 +00:00
Pavel Machek 7d50be2f1c Do not leave st_nlink uninitialized. 2000-05-10 10:19:00 +00:00
Pavel Machek 8542ae3328 Fixed problems with stating / of ftp archive; minor bugfix. 2000-05-03 19:10:52 +00:00
Pavel Machek d91a2b9a63 2000-04-28 Pavel Machek <pavel@artax.karlin.mff.cuni.cz>
* direntry.c (vfs_s_internal_stat): added ugly special case for /
        of archive to always exist. It seems I'm hiding some underlying
        problem :-(.
2000-04-28 07:56:30 +00:00
Pavel Machek d7bf5305b1 2000-04-26 Andrew V. Samoilov <sav@bcs.zp.ua>
* direntry.c (vfs_s_find_entry_tree): segfault fixed when root is NULL

        (vfs_s_new_inode, vfs_s_new_entry): g_new replaced by g_new0

        * ftpfs.c (dir_load): ent->name is free()d for "." and ".."

        (ftpfs_directory_timeout): default value changed to 900

        (netrc_next): "const char * const keywords" go to rodata and is shared
2000-04-28 07:43:13 +00:00
Pavel Machek a1225de8b3 Fix problems with stating / of ftp server + NO_LOCALHASH to prevent
podfuk deadlocs
2000-04-16 19:13:00 +00:00
Pavel Machek 425dbd07c1 2000-03-31 Andrew V. Samoilov <sav@bcs.zp.ua>
* vfs.c (mc_def_getlocalcopy): free() replaced by g_free() to prevent
	  crushes with mad, thanks to Timur I. Bakeyev <timur@bat.ru>
	* fish.c (linear_start): name wasn't freed after usage
	* cpio.c (cpio_ungetlocalcopy): return type changed to int,
	  function return 0 now
	* direntry.c (vfs_s_close, vfs_s_resolve_symlink): memory, allocated
	  by vfs_s_fullpath () is freed after use
	* ftpfs.c (linear_start): ditto;
2000-04-05 13:08:42 +00:00
Pavel Machek aa6cbcbc89 2000-01-31 Andrew V. Samoilov <sav@bcs.zp.ua>
* direntry.c: (vfs_s_resolve_symlink, vfs_s_readlink) fixed segfaults
	for broken symlinks like 2001 -> The Space Oddysea.
2000-01-31 13:48:00 +00:00
Pavel Machek 28eb60242d ftpfs can not handle homes nicely. Is there good way to solve this? 2000-01-24 12:35:52 +00:00
Pavel Machek 748e4c38f9 1999-12-15 Pavel Machek <pavel@artax.karlin.mff.cuni.cz>
* Merged changes by Andrew V. Samoilov <sav@bcs.zp.ua>. They are
	mostly internationalization + fixing stupid bugs of mine
1999-12-16 12:55:16 +00:00
Pavel Machek bcfd532240 1999-12-08 Pavel Machek <pavel@artax.karlin.mff.cuni.cz>
* ftpfs.c: basically replaced ftpfs with new one. Unlike the
        previous one, this uses new direntry.c layer, so shared_ftp_fish.c
        can be killed.

        This is new code, so beware.
1999-12-08 11:39:14 +00:00
Pavel Machek a0878908e1 1999-02-17 Pavel Machek <pavel@bug.ucw.cz>
* direntry.c (vfs_s_getlocalcopy): fixed segfault, getlocalcopy's
	name has to be malloced.
1999-11-03 14:51:22 +00:00
Norbert Warmuth d988df6100 1999-08-18 Norbert Warmuth <nwarmuth@privat.circular.de>
* vfs/direntry.c (vfs_s_getlocalcopy): There's an aditional strdup
needed. In rare cases a pointer was freed twice. Pavel Machek
pointed this out a while ago but obviously it hasn't been fixed, yet.

* vfs/sfs.c (vfmake): Quote characters with a special meaning to the
shell in filenames/-pathes (Fix Bug #1931, VFS will not work if
your full path has the space character in it.).
1999-08-18 19:08:56 +00:00
Miguel de Icaza 7ca0948527 OS/2 portability changes by Ilya 1999-02-13 21:39:18 +00:00
Timur Bakeyev e57da1f7b3 Glibing....
Wed Jan 27 03:09:48 1999  Timur I. Bakeyev <mc@bat.ru>

	* All around the source: Changed copy_strings() to g_strconcat(). Modi-
	fy last parameter in concat_dir_and_file() to "" - to prevent stack from
	disbalancing.
1999-01-27 00:49:11 +00:00
Timur Bakeyev bf81009392 Actually commit all my changers. Fear :> 1999-01-20 22:01:11 +00:00
Miguel de Icaza a89cb1c50a Make the code compile, take 2 1999-01-17 23:10:53 +00:00
Miguel de Icaza 3eb8325e67 Make the code compile.
Reindent
1999-01-17 23:10:05 +00:00
Paul Sheer fa40fbcafa more fixes to resolve symlinks 1999-01-17 12:33:45 +00:00
Paul Sheer ff2b951de7 vfs_s_find_entry_tree() does not actually follow symlinks - fixed 1999-01-17 11:46:42 +00:00
Paul Sheer e035287a51 vfs_s_resolve_symlink(): convert absolute linknames to relative linkname with some leading ../ 1999-01-17 10:07:37 +00:00
Miguel de Icaza 85f17a4dc6 Lots of changes:
- SFS-based file systems now work on GNOME edition, I was
	  not waiting for child process to finish decompressing.

	- VFS code cleanup.  I am going to eventually get rid of all
	  the macro-mania that has creeped into the vfs layer.

Miguel
1999-01-11 00:48:23 +00:00