Commit Graph

108 Commits

Author SHA1 Message Date
Andrew V. Samoilov a3668cd14a * ftpfs.c (dir_load): Don't handle empty remote_path in special
way.
2002-08-21 08:22:33 +00:00
Pavel Roskin 2be225d9e0 * ftpfs.c: Don't use SUP.home, use SUP.cwdir.
* fish.c: Likewise.
(dir_load): Update SUP.cwdir.
* xdirentry.h: Remove "home" field for fish and ftpfs.
2002-07-19 16:36:32 +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 0b4a33c10f * undelfs.c (undelfs_opendir): Use parametrized messages without
VFS name for success and failure.
* fish.c (dir_load): Use new messages from undelfs.c, indicate
success by printing "done".
* ftpfs.c (dir_load): Likewise.
2002-07-19 04:29:37 +00:00
Pavel Roskin 7978b33a9d * ftpfs.c: Replace bzero and bcopy with memset and memcpy.
* mcfs.c: Likewise.
* mcserv.c: Likewise.
* smbfs.c: Likewise.
* tar.c: Likewise.
2002-07-15 05:31:43 +00:00
Pavel Roskin 00700a9ce2 * ftpfs.c (login_server) [HSC_PROXY]: Fix crash. 2002-07-13 00:22:49 +00:00
Pavel Roskin afd132617d * ftpfs.c (ftp_split_url): Implement looking up password in
.netrc for known user.
2002-07-12 23:41:43 +00:00
Pavel Roskin e88191dd7c * ftpfs.c (ftp_split_url): Don't expect lookup_netrc() to always
return a username.
(netrc_has_incorrect_mode): Don't free anything, it can result
in freeing some variables twice.
(find_machine): New function to find matching "machine" or
"default" token.
(lookup_netrc): Eliminate external loop - scan for login and
password, but don't fallback to another string in case of
trouble.
2002-07-12 23:20:03 +00:00
Pavel Roskin 14bac1dda4 * ftpfs.c: Introduce enum keyword_t to improve readability.
(netrc_next): Fix return value for unknown keywords.
(lookup_netrc): Remove special processing of "*netrc*".
2002-07-12 20:00:03 +00:00
Pavel Roskin 1accbb4789 * ftpfs.c (ftp_split_url): Move protection against pass being
NULL ...
(lookup_netrc): ... here.
2002-07-12 17:39:01 +00:00
Pavel Roskin 4f52b831df * xdirentry.h: Eliminate use_proxy field.
* ftpfs.c (open_archive_int): Use SUP.proxy instead of
SUP.use_proxy.
(open_archive): Set SUP.proxy to ftpfs_proxy_host.
* ftpfs.h: Eliminate unused structures.
2002-07-12 00:05:11 +00:00
Pavel Roskin 6ddf5f78ed * vfs.h: Rename URL_DEFAULTANON to URL_ALLOW_ANON.
* utilvfs.c (vfs_split_url): Return NULL as username if
URL_ALLOW_ANON is set and no username is found in the URL,
otherwise use current name.
* ftpfs.c (ftp_split_url): New function - split URL and look up
username and password if needed.
(login_server): Use ftp_split_url().
(archive_same): Likewise.
2002-07-11 23:08:30 +00:00
Pavel Roskin 2acfb89cd4 * tcputil.h: Move use_netrc declaration ...
* vfs.h: ... here.
* ftpfs.c: Implement .netrc support unconditionally.
(lookup_netrc): Make static.
* utilvfs.c: Initialize default_is_netrc.
From Thomas Zajic <zlatko@gmx.at>
2002-07-10 21:26:55 +00:00
Pavel Roskin e385a9c9ab * ftpfs.c (setup_passive): Cast arguments to isdigit() to
unsigned char for compatibility with non-GNU libc.
* tar.c (from_oct): Likewise with isspace().
Reported by Roland Illig <1illig@informatik.uni-hamburg.de>
2002-07-03 19:09:03 +00:00
Pavel Roskin c8ef2d7ace * ftpfs.c (send_ftp_command): Use "anonymous@" as default
anonymous password.
From Eduardo Perez Ureta" <eperez@it.uc3m.es>
2002-07-02 17:08:10 +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 b314cad164 * fish.c (fish_fh_open): Generate fh->ino->localname
if this one is NULL and file is opened for writting only.
* ftpfs.c (ftpfs_fh_open): Likewise if control_connection_buzy
is true.
2002-05-22 13:31:15 +00:00
Andrew V. Samoilov c5626b241c * ftpfs.c (linear_read): Unset control_connection_buzy
on EOF.
(ftpfs_fh_close): Call vfs_s_invalidate ().
2002-05-21 17:10:50 +00:00
Andrew V. Samoilov 09bad78c80 * xdirentry.h (vfs_s_super): Add control_connection_buzy
field to ftp struct.

	* ftpfs.c (linear_start): Set control_connection_buzy.
	(linear_abort): Unset control_connection_buzy.
	(ftpfs_fh_open): Don't retrieve file if it is
	opened for writting only.  Open data connection as
	fh->handle and unlink/unset local temporary file
	if control connection isn't buzy.
	(ftpfs_fh_close): New function to serve opened in
	ftpfs_fh_open() data connection.  Unset fh->changed
	to prevent MEDATA->file_store() call from vfs_s_close().
2002-05-17 13:32:02 +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
Andrew V. Samoilov ccdd8e8859 * ftpfs.c (dir_load): Speed up cd_first calculation.
(ftpfs_flushdir): Resurrect.
2002-02-07 19:22:20 +00:00
Andrew V. Samoilov 0314076889 (ftpfs_chmod): Don't ignore errors. 2002-02-06 12:32:52 +00:00
Andrew V. Samoilov e32151bb9e * ftpfs.c (dir_load): Use "LIST -la" instead of "LIST -la ."
to eliminate problem with wu-ftpd.
Close sock on error. Eliminate goto.

(reconnect): Restore cwdir if login_server fails.
2002-02-06 12:28:08 +00:00
Andrew V. Samoilov 20c71f0c51 * ftpfs.c (translate_path): Remove leading slash(es) more
carefully.
(initconn): Check getsockname() return value.
Eliminate goto.
(linear_abort): Make ipbuf const array.
2002-02-01 12:21:55 +00:00
Andrew V. Samoilov d4f5c90dd6 * ftpfs.c (reconnect): New function to restore closed connection.
(command): Use reconnect if EPIPE received.
(dir_load): Eliminate recursion.
(login_server): Constify netrcpass parameter.
(is_same_dir): Constify path parameter.
2002-01-29 08:09:20 +00:00
Andrew V. Samoilov 38a5875f4c * ftpfs.c (ftpfs_chmod): Add missed '/'. 2002-01-22 09:42:41 +00:00
Pavel Roskin 2b9f5265b4 * ftpfs.c (command): Declare with the printf attribute.
* undelfs.c: Remove declaration of print_vfs_message().
2001-10-20 07:12:55 +00:00
Pavel Roskin 0c52fb0f99 * fish.c (file_store): Fix incorrect format string
for print_vfs_message().
* ftpfs.c (file_store): Likewise.
2001-10-20 07:04:31 +00:00
Andrew V. Samoilov 1e23c4fb68 * ftpfs.c (ftpfs_fill_names): New function.
(vfs_ftpfs_ops): Use ftpfs_fill_names insted of vfs_s_fill_names.
2001-08-06 15:39:08 +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 6fe51516de * cpio.c (vfs_cpiofs_ops): Use short name for the filesystem.
This avoids creating long filenames in dirent.c when the "name"
field is used.
* extfs.c (vfs_extfs_ops): Likewise.
* fish.c (vfs_fish_ops): Likewise.
* ftpfs.c (vfs_ftpfs_ops): Likewise.
* local.c (vfs_local_ops): Likewise.
(vfs_nil_ops): Likewise.
* mcfs.c (vfs_mcfs_ops): Likewise.
* sfs.c (vfs_sfs_ops): Likewise.
* tar.c (vfs_tarfs_ops): Likewise.
* undelfs.c (vfs_undelfs_ops): Likewise.
2001-06-11 21:58:58 +00:00
Pavel Roskin da80aef5a8 * ftpfs.c: Warning fixes. 2001-05-14 23:34:43 +00:00
Pavel Roskin 447597a790 * vfs.h: Include sys/timeb.h if it's present. Include time.h and
sys/time.h as recommended by Autoconf documentation.
* cpio.c: Remove all time-related includes - they are in vfs.h.
* extfs.c: Likewise.
* ftpfs.c: Likewise.
* mcfs.c: Likewise.
* mcserv.c: Likewise.
* tar.c: Likewise.
* util-alone.c: Likewise.
* vfs.c: Likewise. Include xdirentry.h.
2001-02-20 16:55:58 +00:00
Andrew V. Samoilov 94bcfc289d * ftpfs.c (vfs_ftpfs_ops): typo fixed 2000-12-04 19:14:52 +00:00
Pavel Machek 55e56a1426 Fixes from Roland: we may not g_free() strdup-ed text. 2000-10-31 15:43:49 +00:00
Andrew V. Samoilov a1e4132357 * ftpfs.c (open_data_connection): don't generate //filename, some
ftp servers can't store it;

	(command): g_strdup_vprintf() and g_strconcat() replaced
	by g_strdup_vprintf(), g_realloc() and strcpy()
	to reduce memory usage when trailing "\r\n" added;

	(ftpfs_set_debug, ftp_data): ftp_data.logfile assigned with logfile
	value to log servers replies
2000-10-16 18:37:54 +00:00
Pavel Roskin e828211662 Updated address of Free Software Foundation 2000-08-22 22:50:00 +00:00
Pavel Machek a1d1728dc8 ftpfs . / .. is broken, but previous fix was worse than disease. 2000-08-08 15:12:39 +00:00
Pavel Machek 127611ec77 Fix . and .. in ftpfs directories. 2000-08-04 12:15:46 +00:00
Pavel Machek 392c7489e3 2000-05-18 Andrew V. Samoilov <sav@bcs.zp.ua>
* ftpfs.c: (my_get_host_and_username) space between macro name and
       parentheses removed
2000-05-19 13:09:41 +00:00
Pavel Machek c319041ba8 2000-05-15 Andrew V. Samoilov <sav@bcs.zp.ua>
* tar.c (read_header): memory leaking for empty symlink's names fixed

	* utilvfs.c (vfs_split_url): *host is not assigned if host is null

	* ftpfs.c (login_server): new features of vfs_split_url () used,
	  my_get_host_and_username became macro

	* vfs.c (mc_opendir, mc_chdir): unneeded calls to concat_dir_and_file
	  removed (vfs_canon removes trailing '/')

	* sfs.c (vfmake, redirect): allocated memory realeased on errors
2000-05-16 14:59:33 +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
Timur Bakeyev ec83d4571e 2000-04-15 Timur Bakeyev <mc@bat.ru>
* ftpfs.c (netrc_next): "const char * keywords" is pretty nice.

	* ftpfs.c (dir_load): At last, found place, that broke handling
	directories with spaces in name. Problem was in prepending "/"
	to "." for current directory. Which was, obviously, wrong. Hacked
	to make just "LIST -la ." instead.

	* vfs.c: Changed to BUF_* constants in some places.
2000-04-14 01:14:26 +00:00
Pavel Machek f5f1ec0523 2000-04-05 Andrew V. Samoilov <sav@bcs.zp.ua>
* utilfs.c (vfs_split_url): don't assign *pass if pass is NULL
        * fish.c (archive_open, archive_same): memory allocated by
          vfs_split_url () must be released after use, don't strdup()
          values allocated by vfs_split_url () and NULL passed to
          vfs_split_url () when password value is unused
        * ftpfs.c (archive_open, archive_same): ditto plus same for
          ftpfs_get_proxy_host_and_port ()
2000-04-10 12:00:43 +00:00
Timur Bakeyev 3bfe8a0b3c 2000-04-06 Timur Bakeyev <mc@bat.ru>
* ftpfs.c (netrc_next): Turned strange "const char * const keywords"
	into more alike "const char const * keywords". Still, think, it's
	too strict.

	* smbfs.c: Add #define BOOL_DEFINED before inclusion of samba headers.
	Libncurses(or slang?) defines BOOL and that can cause problems. (In fact,
	I can't find references to that const, but sure, I hade reason to do that:)

	* util-alone.h: Declare load_anon_passwd() to avoid warnings.
2000-04-09 23:06:59 +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 24c6ab65f5 Do not free paths returned from vfs_s_get_path_mangle. 2000-04-03 10:35:48 +00:00
Chris Toshok 749789cdf8 include sys/types.h 2000-03-20 01:57:58 +00:00
Pavel Machek 0b25d26cf0 2000-02-25 Pavel Machek <pavel@artax.karlin.mff.cuni.cz>
Patch by  Andrew V. Samoilov <sav@bcs.zp.ua>

        * vfs.[ch] (vfs_canon, mc_open, vfs_file_is_local,
          mc_(un)?getlocalcopy): added const qualifier
        (mc_def_getlocalcopy): tempnam() returns malloc()ed buffer,
          so, free() it, not g_free();
        (vfs_canon): prepend filename by cwd when tilde '~' cannot be expanded;
2000-02-25 12:53:06 +00:00