Commit Graph

61 Commits

Author SHA1 Message Date
Pavel Roskin 72c64a60e2 * extfs.c: Switch to self-registration.
* mcfs.c: Likewise.
* sfs.c: Likewise.
* smbfs.c: Likewise.
* undelfs.c: Likewise.
* vfs.s (_vfs_add_noncurrent_stamps): Temporary disable code
that uses vfs_extfs_ops.
(vfs_file_is_smb): Remove.
2003-10-12 22:25:53 +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 1d6e00faf0 * vfs.h: Introduce new VFS flags instead of the old unused ones.
* vfs.c (vfs_file_class_flags): New function.
(vfs_file_is_ftp): Eliminate.
(vfs_file_is_smb): Likewise.
(vfs_file_is_local): Likewise.
(vfs_current_is_local): Use new VFSF_LOCAL flag.
2003-10-11 08:21:16 +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
Andrew V. Samoilov 6f188101cf * smbfs.c (open_readwrite): New function to replace open_read()
and open_write().  Use cli_close() if cli_qfileinfo() or
cli_getattrE() fail.

(smbfs_open): Use open_readwrite(). Free remote_handle if
open_readwrite() fails.
2003-04-03 10:45:03 +00:00
Andrew V. Samoilov cbe4a1adf4 * smbfs.c (smbfs_lseek): Backport from Samba 2.2.7 Suite.
(fake_server_stat): Warning fix for AIX.  Reformat function.
(fake_share_stat): Likewise.
(smbfs_mkdir): Likewise.
2003-02-19 12:56:03 +00:00
Pavel Roskin 4d4294fdb4 * smbfs.c (smbfs_nothingisopen): Warning fix for 64-bit systems.
(smbfs_free): Likewise.
2003-01-24 20:55:55 +00:00
Andrew V. Samoilov f5dc73aa71 * smbfs.c: Resurrect and use myumask for generated permissions. 2002-12-20 18:16:45 +00:00
Andrew V. Samoilov 6b0df00830 * smbfs.c (new_dir_entry): Initialize st_ino, so recursive directory
copying is possible now.
2002-11-07 14:49:13 +00:00
Andrew V. Samoilov f4a0b6e40b * smbfs.c (fake_share_stat): Make sure share exists by
smbfs_get_path() and fill buf with realistic data
if current_share_info is NULL.  Reformat function.
(smbfs_get_path): Add const qualifier to path.
2002-10-11 15:29:55 +00:00
Andrew V. Samoilov e751871446 (smbfs_stat): Don't write to path. 2002-10-10 10:04:41 +00:00
Andrew V. Samoilov 872e77eb1d * smbfs.c: Allow username in URL (/#smb:[user@]machine) and
reformat changed functions.
(smbfs_get_host_and_username): Fix comment.
(smbfs_fill_names): Add username@ before hostname.
(smbfs_open_link): Use IPC$ if share is empty.
(smbfs_get_path): Pass remote_path to smbfs_open_link().
(smbfs_stat): Copy username@ to server_url if passed.
2002-10-09 13:18:10 +00:00
Andrew V. Samoilov 3d95a5fa29 * smbfs.c: Don't define BOOL_DEFINED to fix compilation on SunOS 5.8. 2002-10-07 10:05:36 +00:00
Pavel Roskin da7e82d253 Global removal of RCS Id: flags. 2002-09-26 23:13:45 +00:00
Andrew V. Samoilov e98d979a69 * smbfs.c: Undef USE_NCURSES - no needs to include *curces.h.
(smbfs_loaddir): Fix warning.
2002-09-24 15:26:55 +00:00
Andrew V. Samoilov 3bab5199aa Fix some possible NULL dereferences. 2002-09-13 11:29:35 +00:00
Andrew V. Samoilov 6a6fb355df * smbfs.c (smbfs_set_debugf): New function to specify logfile.
* smbfs.h: Declare smbfs_set_debugf().
2002-09-13 09:46:33 +00:00
Andrew V. Samoilov 14c3f90d2f * smbfs.c (statfile_helper): Merge with loaddir_helper().
(get_remote_stat): Use loaddir_helper().  Care about
single_entry instead of eliminated statfile_helper().
2002-09-12 06:25:21 +00:00
Andrew V. Samoilov 8e1af10110 * samba/libsmb/clientgen.c (cli_NetServerEnum): Add void*
parameter to (*fn)() and void *state parameter.
(cli_list): Likewise.
(cli_RNetShareEnum): Likewise.  Return int.
* samba/include/proto.h: Adjust declarations.
* smbfs.c: Adjust all helpers and dependencies.
From Samba patchsets.
2002-09-11 16:43:41 +00:00
Andrew V. Samoilov 1f06c11cc6 * smbfs.c (statfile_helper): Remove write permissions if file
has readonly attribute.  Add execute permissions for directory.
Reformat whole function.
2002-09-11 15:35:55 +00:00
Andrew V. Samoilov 996dd893b5 * smbfs.c (loaddir_helper): Remove write permissions if file
has readonly attribute.  Add execute permissions for directory.
Reformat whole function.
(server_browsing_helper): Add execute permissions.  Reformat.
(browsing_helper): Likewise.
2002-09-11 12:53:58 +00:00
Pavel Roskin 83d0b9a9d6 Global replacement for two quasi-english strings from vfs/smbfs.c. 2002-09-11 04:06:25 +00:00
Andrew V. Samoilov 47f1a6a51b * smbfs.c (smbfs_close): Return -1 if cli->outbuf is NULL and
set my_errno to EINVAL - temporary fix.  Reformat function.
2002-09-02 10:54:22 +00:00
Andrew V. Samoilov 019c16b047 * samba/param/loadparm.c: Add global_scope variable.
(parm_table): Add netbios scope parameter.
* samba/lib/util.c: Remove scope variable.  Use global_scope instead.
* samba/libsmb/nmblib.c (make_nmb_name): Remove scope parameter and
use global_scope instead.
* samba/libsmb/namequery.c: Adjust make_nmb_name() calls.
* samba/include/proto.h: Adjust make_nmb_name() declaration.

From samba 2.0.7 patchset.

* samba/param/loadparm.c (lp_adduser_script): Commented out.
(lp_deluser_script): Likewise.
(lp_add_printer): Likewise.
(lp_add_one_printer): Likewise.
* samba/lib/util.c (reduce_name): Likewise.
(transfer_file): Likewise.

* smbfs.c (smbfs_do_connect): Adjust make_nmb_name() calls.
2002-09-01 06:51:24 +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
Andrew V. Samoilov c29498db11 * smbfs.c (myumask): Removed. It is only written and never read.
(smbfs_init): Use PATH_SEP_STR and reformat.
2002-08-06 06:02:52 +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
Andrew V. Samoilov dabc54bbcd * smbfs.c: Undefine PACKAGE_BUGREPORT, PACKAGE_NAME,
PACKAGE_STRING, PACKAGE_TARNAME and PACKAGE_VERSION
before including "samba/include/config.h" to prevent warnings.
(smbfs_init): Set DEBUGLEVEL to 0.
(do_connect): Rename to ...
(smbfs_do_connect): ... this to avoid namespace clash and
make static.  Make server const. Adjust all callers.
(smbfs_add_dots): Remove.
(smbfs_stat): Remove code duplication.
(smbfs_lstat): Define as smbfs_stat.
2002-06-21 12:26:45 +00:00
Andrew V. Samoilov d8bec56efe * Makefile.am (AM_CFLAGS): Add -DCONFIGDIR=\""@configdir@"\"
if smbfs support is enabled.

* smbfs.c (smbfs_init): Use CONFIGDIR for smb.conf.
2002-01-11 08:24:17 +00:00
Andrew V. Samoilov b3f9ba7f98 * smbfs.c (smbfs_add_dots): New function. Insert a "." and ".."
entries into the linked list.
(smbfs_loaddir): Call smbfs_add_dots for shares or servers.
(smbfs_get_free_bucket): Eliminate utime.
(fake_share_stat): Make path const.

* samba/configure.in: Don't check whether getpass
should be replaced.
2001-11-05 13:16:17 +00:00
Andrew V. Samoilov 2cc50a14d6 Don't include "tcputil.h".
(loaddir): Symplify.
(fake_share_stat): Declare server_url const.
Use "%4o" for st_mode.
(fake_server_stat): Likewise.  Return -1 if server_list != True.
2001-10-30 15:24:01 +00:00
Andrew V. Samoilov 0b88e8d6ce (myhostname): Declare extern.
(get_master_browser): Declare ipzero extern. By drk@sgi.com.
http://bugzilla.gnome.org/show_bug.cgi?id=60933
2001-10-30 14:40:46 +00:00
Andrew V. Samoilov a04a0a6b4b * smbfs.c: Include <config.h> before everything else. 2001-10-30 12:20:11 +00:00
Pavel Roskin 689c3fb9ac Replace "Can't" with "Cannot" everywhere. 2001-08-14 00:55:34 +00:00
Andrew V. Samoilov 2e4e496c36 * smbfs.c: Eliminate smbfs_get_free_bucket_init. convert_path
gives malloced filename, so this memory must be released after use.

(reconnect): Fix segmentation fault.
(smbfs_loadddir): Don't g_strdup path.
(smbfs_get_free_bucket): Eliminate smbfs_get_free_bucket_init and
smbfs_connections initialisation.
(smbfs_open_link): Likewise. Release host after get_master_browser.
(get_stat_info): Fix unneeded g_strdup/g_free calls.
(smbfs_mkdir): Release path after use.
(smbfs_mkdir): Likewise.
(smbfs_open): Fix memory leak.
(smbfs_unlink): Likewise. Fix error message.
(smbfs_rename): Fix memory leaks.
(smbfs_stat): Fix url parsing.
2001-08-06 15:36:33 +00:00
Andrew V. Samoilov 3002c837ab * smbfs.c (new_dir_entry): New function with repeated code from
browsing_helper, loaddir_helper and server_browsing_helper.
(browsing_helper): Use new_dir_entry.
(loaddir_helper): Likewise.
(server_browsing_helper): Likewise.

(cached_lstat_info): Eliminated.
(smbfs_readdir): Make dirent_dest static const.
Eliminate cached_lstat_info.
(smbfs_open_link): Make user parameter const. Fix memory leak.
(fake_server_stat): Make path parameter const. Symplify.
(smbfs_fstat): Set my_errno to EFAULT before return.
2001-08-03 10:19:45 +00:00
Andrew V. Samoilov ae7fd2fcd2 (search_dir_entry): Make text parameter const.
(smbfs_get_host_and_username): Make macro.
(my_forget): Fix compilation.
2001-08-01 12:24:35 +00:00
Andrew V. Samoilov 0db7865c82 * smbfs.c: Undefine VERSION to prevent warning. Comments fixes.
(do_connect): Symplify.
(get_stat_info): Symplify. Eliminate another fake_stat.
(smbfs_chdir): Release remote_dir after use.
(smbfs_stat): Likewise. Fix another 2 memory leaks.
(smbfs_mkdir): Release remote_file after use.
(smbfs_rmdir): Likewise.
(smbfs_open): Likewise. Indentation fixes.
(smbfs_unlink): Likewise.
(smbfs_rename): Release rb and ra after use.
2001-08-01 10:40:15 +00:00
Pavel Roskin 820a35758e * vfs/smbfs.c: Rename authinfo to smb_authinfo and
authinfo_get_authinfo_from_user() to vfs_smb_get_authinfo()
and remove their definitions.
* vfs/vfs.h: Declare smb_authinfo and vfs_smb_get_authinfo().
2001-07-15 07:01:41 +00:00
Pavel Roskin ab828100df * smbfs.c (vfs_smbfs_ops): Use short name "smbfs" for the
filesystem. Don't translate it.
2001-07-10 04:05:47 +00:00
Andrew V. Samoilov 69c85ec184 * smbfs.c: Include <config.h>. Make all internal variables static.
(get_stat_info): Eliminate fake_stat, memory leak fixed.
(IPC, URL_HEADER): Make static const.
(smbfs_stat): Fix segmentation violation.
(statfile_helper): Allocate memory for single_entry once. It is never
freed now, and only my_stat element of this structure is used.
2001-06-27 12:26:27 +00:00
Andrew V. Samoilov 1eadb1fc3f * smbfs.c: Include utilvfs.h instead of ../config.h, ../src/main.h,
../src/tty.h and ../src/global.h.

(password, username): Made static.
(is_error): Commented out.
(loaddir_helper): Don't ignore hidden files, style fixes.
(browsing_helper): typestr declared as char *, fstrcpy replaced by =.

(do_connect): Call cli_shutdown () and authinfo_remove () if
cli_session_setup () fails. It is not good idea to remember
wrong username/password.

(smbfs_free_dir): Nested between #ifdef SMBFS_FREE_DIR ... #endif.
(smbfs_readdir): #ifdef SMBFS_FREE_DIR used instead of C comment.
2001-05-22 13:26:59 +00:00
Andrew V. Samoilov 0d20e2fa8a * samba/includes/proto.h, samba/libsmb/nterr.c (get_nt_error): return
NULL when appropriative error message can't be found as it is expected
in cli_errstr(). Return type changed to const char *

* smbfs.c (smbfs_fill_names): implemented

(smbfs_stat): unneeded g_strdup/g_free calls removed
(smbfs_loaddir): memory leaking fixed
2001-04-09 11:34:15 +00:00
Pavel Roskin bb912def1a * gtkedit/editcmd.c: Remove support for XView layout attributes.
* gtkedit/editoptions.c: Likewise.
* pc/chmod.c: Likewise.
* pc/drive.c: Likewise.
* src/boxes.c: Likewise.
* src/chmod.c: Likewise.
* src/dlg.c: Likewise.
* src/dlg.h: Likewise.
* src/filegui.c: Likewise.
* src/find.c: Likewise.
* src/hotlist.c: Likewise.
* src/layout.c: Likewise.
* src/listmode.c: Likewise.
* src/main.c: Likewise.
* src/option.c: Likewise.
* src/panelize.c: Likewise.
* src/wtools.c: Likewise.
* src/wtools.h: Likewise.
* vfs/smbfs.c: Likewise.
2001-04-06 21:48:11 +00:00
Andrew V. Samoilov b7b5c71de3 * samba/libsmb/smbdes.c: undefine uchar before redefine it
* smbfs.c (smbfs_close): honour changed semantics for return value
(on error -1 is expected).

* (fs): it is at least strange use char * for counter. Changed to int
2001-03-15 18:19:23 +00:00
Andrew V. Samoilov fbf86d5a22 * extfs/patchfs: LANG overrides LC_TIME at least in glibc,
so use LC_ALL=C to override any locale
* smbfs.c (smbfs_open_link): service initialized
* (my_forget): new features of vfs_split_url used
smbfs.c at all: make gcc some more happy
2001-03-04 18:55:17 +00:00
Pavel Roskin e828211662 Updated address of Free Software Foundation 2000-08-22 22:50:00 +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 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