Pavel Roskin
de12104436
* gc.c: Use NULL instead of -1 for empty vfsid. Adjust all
...
dependencies.
* undelfs.c (undelfs_get_path): Don't shadow static ext2_fname.
(undelfs_getid): Likewise. Use fs for non-empty vfsid.
2003-11-12 23:00:16 +00:00
Pavel Roskin
4eab382dba
* gc.c: Make getid(), nothingisopen() and free() methods
...
optional. Eliminate trivial implementations.
(vfs_getid): New function - safe wrapper around getid(). Use
it everywhere.
(vfs_ncs_getid): Remove dead code, inprove readability.
2003-11-08 23:53:00 +00:00
Pavel Roskin
b33f2cbb47
* vfs.c: Split garbage collection code into ...
...
* gc.c: ... this.
* vfs.h: Corresponding code moved ...
* gc.h: ... here.
* Makefile.am: Adjustments for the above.
2003-11-07 23:43:55 +00:00
Pavel Roskin
0318ed5d0b
* vfs.c: Move all parsing code, vfs_die() and vfs_get_password()
...
to utilvfs.c, vfs_print_stats() to direntry.c.
* utilvfs.c (vfs_parse_ls_lga): Disable caching current date,
it's done incorrectly.
2003-11-05 06:08:16 +00:00
Pavel Roskin
edce41facd
* utilvfs.c (vfs_mkstemps): New function - create temporary file
...
with the name resembling the original, but safe for scripts.
* direntry.c (vfs_s_open): Use it.
(vfs_s_retrieve_file): Likewise.
* extfs.c (extfs_open): Likewise.
* sfs.c (sfs_redirect): Likewise.
2003-10-29 00:50:36 +00:00
Pavel Roskin
77bcdc8127
* vfs.c (mc_ungetlocalcopy): Free local path here, not in class
...
implementations.
* vfs.h (struct vfs_s_class): Constify "local" argument for
ungetlocalcopy. Adjust all implementations.
2003-10-28 21:52:06 +00:00
Pavel Roskin
bb184c9c8b
Typo in the last commit.
2003-10-28 08:47:04 +00:00
Pavel Roskin
67cd859ea3
* direntry.c (vfs_s_init_class): Use our getlocalcopy for remote
...
filesystems that cache files, not for archives.
(vfs_s_getlocalcopy): Corresponding changes.
2003-10-28 08:20:30 +00:00
Pavel Roskin
8e3a0c9d65
* direntry.c (vfs_s_init_class): Improve interface to allow more
...
code reuse. Change all callers.
(vfs_s_getlocalcopy): New implementation. Don't use
mc_def_getlocalcopy(). Use vfs_s_open() to create local copy.
(vfs_s_ungetlocalcopy): New function.
* xdirentry.h: Add new field "flags" to struct vfs_s_subclass.
* extfs.c (extfs_ungetlocalcopy): Don't use
mc_def_ungetlocalcopy() in the dead branch.
* vfs.c (mc_def_getlocalcopy): Make static.
(mc_def_ungetlocalcopy): Likewise.
2003-10-28 07:09:39 +00:00
Pavel Roskin
7d16d65e35
* vfs.h: Constify some arguments for many functions.
...
* xdirentry.h: Likewise. Adjust all dependencies.
2003-10-28 02:10:33 +00:00
Pavel Roskin
bc455d5840
* direntry.c (vfs_s_find_inode): Only allow search from root.
...
Change second argument to superblock to prevent abuse.
2003-10-27 03:09:40 +00:00
Pavel Roskin
ad670bade6
* direntry.c (vfs_s_find_entry_tree): Eliminate buffer of fixed
...
size. Don't prepare path for vfs_s_resolve_symlink().
(vfs_s_resolve_symlink): Remove unused argument "path".
2003-10-27 02:54:59 +00:00
Pavel Roskin
511321bcfd
* direntry.c (vfs_s_add_dots): Remove. Fix all callers.
...
(vfs_s_free_inode): Remove support for "." and ".." entries.
* ftpfs.c (dir_load): Likewise.
Support for "." and ".." entries was a hack that could make the
cache non-traversible from inodes to the root and cause infinite
loop in vfs_s_fullpath().
Reported by Frédéric L. W. Meunier <lists1@pervalidus.net>
2003-10-27 01:26:18 +00:00
Pavel Roskin
211ce16fac
* wtools.c: Merge mc_message() and message() into one background
...
safe function message(). Fix all callers.
2003-10-26 04:47:20 +00:00
Pavel Roskin
50045218ab
Remove unneeded includes in ../src
2003-10-25 21:34:57 +00:00
Pavel Roskin
2d33b5047e
* background.c: Replace all message stubs with a new function
...
mc_message(). Protect against strlen(MSG_ERROR). Adjust all
dependencies.
2003-10-25 19:54:24 +00:00
Pavel Roskin
274a5a1c41
* direntry.c (vfs_s_find_entry_tree): Canonicalize path.
2003-10-17 03:25:43 +00:00
Pavel Roskin
e09739368e
* direntry.c (vfs_s_resolve_symlink): Don't use buffers of fixed
...
size. This fixes a security hole. Always start from the root.
Remove broken code for making symlinks relative.
(vfs_s_find_entry_tree): Protect against long path, since this
function uses a buffer of fixed size.
(vfs_s_fullpath): Implement support for archives (real trees).
2003-10-16 23:58:43 +00:00
Pavel Roskin
7c4fc715da
* direntry.c (vfs_s_setctl): Implement VFS_SETCTL_FLUSH.
...
* ftpfs.c: Remove ftpfs_flushdir. Use MEDATA->flush.
* fish.c: Use MEDATA->flush.
2003-10-16 18:51:41 +00:00
Pavel Roskin
e9ffcceae5
* direntry.c (vfs_s_setctl): Add support to VFS_SETCTL_LOGFILE.
...
* ftpfs.c (ftpfs_set_debug): Remove.
2003-10-16 17:08:38 +00:00
Pavel Roskin
52844a3092
* vfs.h: Rename commands for mc_ctl() and mc_setctl() to make it
...
clear which function they are used with.
* vfs.c (mc_ctl): Change last argument to (void*).
(mc_set): Likewise.
Adjust all dependencies.
2003-10-16 16:12:19 +00:00
Pavel Roskin
fc7267906f
* xdirentry.h: Move system includes to the files that need them.
2003-10-16 08:47:33 +00:00
Pavel Roskin
426c1836d5
* vfs.h: Remove all references to seekdir and telldir. Adjust
...
all dependencies.
2003-10-14 22:24:26 +00:00
Pavel Roskin
6cf97f4069
* xdirentry.h: Remove all typedefs, there is no need to hide the
...
fact that structures are structures. Fix all dependencies.
2003-10-12 01:00:44 +00:00
Pavel Roskin
00b57fd4bf
* vfs.h: Remove typedef vfs, it's too ambiguous. Massive
...
changes to use struct vfs_class instead.
2003-10-12 00:24:00 +00:00
Pavel Roskin
6e6fd9b352
* vfs.c (vfs_add_noncurrent_stamps): Call vfs_rm_parents() at
...
the end. Change all callers not to call it.
(vfs_rm_parents): Make static.
2003-10-11 17:30:54 +00:00
Pavel Roskin
3fb8e46501
* direntry.c: Don't use vfs_local_fs directly, use VFSF_LOCAL.
...
* extfs.c: Likewise.
* vfs.c (vfs_addstamp): Likewise.
(vfs_init): Register vfs_local_fs like other classes.
2003-10-11 16:54:46 +00:00
Pavel Roskin
523589cddc
* direntry.c: Make more functions static. They are filled in in
...
vfs_s_init_class() now and don't need to be exported.
2003-10-11 10:13:36 +00:00
Pavel Roskin
091023c37a
* undelfs.c (undelfs_get_path): Constify first argument.
...
* vfs.h (struct vfs_class): Constify path. Fix all dependencies.
2003-10-11 07:20:53 +00:00
Pavel Roskin
9d1f2aae71
* vfs.c (vfs_type): Rename to vfs_get_class(). Fix prototype to
...
avoid using internal vfs type. Adjust all dependencies.
(vfs_rosplit): Rename to _vfs_get_class().
2003-10-11 06:25:29 +00:00
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