1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
samba-mirror/source4/ntvfs
Sam Liddicott 4b21ad9db7 Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename
This change brings ntvfs_connect into compliance with other ntvfs functions
which take an ntvfs module, an ntvfs request and an smb io union.

It now becomes the responsibility of ntvfs modules to examine
tcon->generic.level themselves and derive the share name and any other
options
directly; e.g.

	const char *sharename;

	switch (tcon->generic.level) {
	case RAW_TCON_TCON:
		sharename = tcon->tcon.in.service;
		break;
	case RAW_TCON_TCONX:
		sharename = tcon->tconx.in.path;
		break;
	case RAW_TCON_SMB2:
	default:
		return NT_STATUS_INVALID_LEVEL;
	}

	if (strncmp(sharename, "\\\\", 2) == 0) {
		char *p = strchr(sharename+2, '\\');
		if (p) {
			sharename = p + 1;
		}
	}

service.c smbsrv_tcon_backend() is called before ntvfs_connect and fills in
some of the tcon->..out values.
For the case of RAW_TCON_TCONX, it filles out tcon->tconx.out.tid and
tcon->tconx.out.options

For the case of RAW_TCON_TCON it fills out tcon->tcon.out.tid and
tcon->tcon.out.max_xmit

Thus the ntvfs_connect function for vfs modules may override these values
if desired, but are not required to.

ntvfs_connect functions are required to fill in the tcon->tconx.out.*_type
fields, for RAW_TCON_TCONX, perhaps something like:

	if (tcon->generic.level == RAW_TCON_TCONX) {
		tcon->tconx.out.fs_type = ntvfs->ctx->fs_type;
		tcon->tconx.out.dev_type = ntvfs->ctx->dev_type;
	}

Signed-off-by: Sam Liddicott <sam@liddicott.com>

(I fixed the ntvfs_connect() in the smb_server/smb2/
 and the RAW_TCON_SMB2 switch case in the modules)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-05-20 13:32:27 +02:00
..
cifs Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename 2009-05-20 13:32:27 +02:00
cifs_posix_cli Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename 2009-05-20 13:32:27 +02:00
common s4:ntvfs/common: s/private/private_data 2009-02-02 13:08:32 +01:00
ipc Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename 2009-05-20 13:32:27 +02:00
nbench Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename 2009-05-20 13:32:27 +02:00
posix Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename 2009-05-20 13:32:27 +02:00
print Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename 2009-05-20 13:32:27 +02:00
simple Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename 2009-05-20 13:32:27 +02:00
smb2 Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename 2009-05-20 13:32:27 +02:00
sysdep s4:sysdep/inotify: use tevent_fd_set_auto_close() 2009-01-03 19:58:52 +01:00
unixuid Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename 2009-05-20 13:32:27 +02:00
config.mk Use variables for directories in ntvfs smb2 module. 2008-05-28 03:07:42 +02:00
ntvfs_base.c s4:lib/tevent: rename structs 2008-12-29 20:46:40 +01:00
ntvfs_generic.c s4:ntvfs_generic: use talloc_get_type() to remote compiler warnings 2009-02-13 13:44:36 +01:00
ntvfs_interface.c Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename 2009-05-20 13:32:27 +02:00
ntvfs_util.c Fix include paths to new location of libutil. 2008-10-11 21:31:42 +02:00
ntvfs.h Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename 2009-05-20 13:32:27 +02:00
README first public release of samba4 code 2003-08-13 01:53:07 +00:00

This is the base of the new NTVFS subsystem for Samba. The model for
NTVFS backends is quite different than for the older style VFS
backends, in particular:

- the NTVFS backends receive windows style file names, although they
  are in the unix charset (usually UTF8). This means the backend is
  responsible for mapping windows filename conventions to unix
  filename conventions if necessary

- the NTVFS backends are responsible for changing effective UID before
  calling any OS local filesystem operations (if needed). The
  become_*() functions are provided to make this easier.

- the NTVFS backends are responsible for resolving DFS paths

- each NTVFS backend handles either disk, printer or IPC$ shares,
  rather than one backend handling all types

- the entry points of the NTVFS backends correspond closely with basic
  SMB operations, wheres the old VFS was modelled directly on the
  POSIX filesystem interface.

- the NTVFS backends are responsible for all semantic mappings, such
  as mapping dos file attributes, ACLs, file ownership and file times