From ef2e26c91b80556af033d3335e55f5dfa6fff31d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Aug 2003 01:53:07 +0000 Subject: first public release of samba4 code (This used to be commit b0510b5428b3461aeb9bbe3cc95f62fc73e2b97f) --- source4/ntvfs/posix/vfs_posix.c | 151 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 source4/ntvfs/posix/vfs_posix.c (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c new file mode 100644 index 0000000000..b27e7493a0 --- /dev/null +++ b/source4/ntvfs/posix/vfs_posix.c @@ -0,0 +1,151 @@ +/* + Unix SMB/CIFS implementation. + POSIX NTVFS backend + Copyright (C) Andrew Tridgell 1992-2003 + Copyright (C) Andrew Bartlett 2001 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +/* + this implements most of the POSIX NTVFS backend + This is the default backend +*/ + +#include "includes.h" + +/* + connect to a share - used when a tree_connect operation comes + in. For a disk based backend we needs to ensure that the base + directory exists (tho it doesn't need to be accessible by the user, + that comes later) +*/ +static NTSTATUS pvfs_connect(struct ntvfs_context *ctx, const char *sharename) +{ + struct stat st; + struct connection_struct *conn = ctx->conn; + NTSTATUS status; + + /* the directory must exist */ + if (stat(conn->connectpath, &st) != 0 || !S_ISDIR(st.st_mode)) { + DEBUG(0,("'%s' is not a directory, when connecting to [%s]\n", + conn->connectpath, lp_servicename(SNUM(conn)))); + return NT_STATUS_BAD_NETWORK_NAME; + } + + /* Initialise old VFS function pointers */ + if (!smbd_vfs_init(conn)) { + DEBUG(0, ("vfs_init failed for service %s\n", lp_servicename(SNUM(conn)))); + return NT_STATUS_BAD_NETWORK_NAME; + } + + /* become the user for the rest */ + status = ntvfs_change_to_user(ctx); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + /* the posix backend can do preexec */ + status = ntvfs_connect_preexec(ctx); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + /* Invoke the old POSIX VFS make connection hook */ + if (conn->vfs_ops.connect && + conn->vfs_ops.connect(conn, lp_servicename(snum), user) < 0) { + DEBUG(0,("make_connection: POSIX VFS make connection failed!\n")); + return NT_STATUS_UNSUCCESSFUL; + } + } + + + /* + * Print out the 'connected as' stuff here as we need + * to know the effective uid and gid we will be using + * (at least initially). + */ + if( DEBUGLVL( IS_IPC(conn) ? 3 : 1 ) ) { + dbgtext( "%s (%s) ", get_remote_machine_name(), conn->client_address ); + dbgtext( "connect to service %s ", lp_servicename(SNUM(conn)) ); + dbgtext( "initially as user %s ", user ); + dbgtext( "(uid=%d, gid=%d) ", (int)geteuid(), (int)getegid() ); + dbgtext( "(pid %d)\n", (int)sys_getpid() ); + } + + return NT_STATUS_OK; +} + +/* + disconnect from a share +*/ +static NTSTATUS pvfs_disconnect(struct ntvfs_context *ctx) +{ + return NT_STATUS_OK; +} + +/* + delete a file - the dirtype specifies the file types to include in the search. + The name can contain CIFS wildcards, but rarely does (except with OS/2 clients) +*/ +static NTSTATUS pvfs_unlink(struct ntvfs_context *ctx, const char *name, uint16 dirtype) +{ + NTSTATUS status; + + if (ntvfs_dfs_redirect(ctx, name)) { + return NT_STATUS_PATH_NOT_COVERED; + } + + status = unlink_internals(ctx->conn, dirtype, name); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + ntvfs_run_change_notify_queue(); + + return NT_STATUS_OK; +} + + + + + + + +/* + initialialise the POSIX disk backend, registering ourselves with the ntvfs subsystem + */ +BOOL posix_vfs_init(void) +{ + BOOL ret; + struct ntvfs_ops ops; + + ZERO_STRUCT(ops); + + /* fill in all the operations */ + ops.connect = pvfs_connect; + ops.disconnect = pvfs_disconnect; + ops.unlink = pvfs_unlink; + + /* register ourselves with the NTVFS subsystem. We register under the name 'default' + as we wish to be the default backend */ + ret = ntvfs_register("default", NTVFS_DISK, &ops); + + if (!ret) { + DEBUG(0,("Failed to register POSIX backend!\n")); + return False; + } + + return True; +} -- cgit From a846e592058726b670e40505493a4668bd856186 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 25 Nov 2003 03:15:26 +0000 Subject: CVS: ---------------------------------------------------------------------- CVS: Enter Log. Lines beginning with `CVS:' are removed automatically CVS: CVS: Committing in . CVS: CVS: Modified Files: CVS: Makefile.in configure.in include/includes.h include/ntvfs.h CVS: include/smb.h lib/iconv.c lib/module.c ntvfs/ntvfs_base.c CVS: ntvfs/cifs/vfs_cifs.c ntvfs/ipc/vfs_ipc.c CVS: ntvfs/posix/vfs_posix.c ntvfs/print/vfs_print.c CVS: ntvfs/reference/vfs_ref.c ntvfs/simple/vfs_simple.c CVS: passdb/pdb_interface.c CVS: Added Files: CVS: include/module.h CVS: ---------------------------------------------------------------------- Update to the modules system. Fixed: - get rid of smb_probe_module - merge older updates from 3.0 - introduced register_subsystem() and register_backend() functions - adapt ntvfs and charset to use new register functions - made smb_load_modules() work recursively (e.g. 'preload modules = /usr/lib/samba') - got rid of some old remains Things that still need work: - Did I break tankFS? I don't think so, but I can't test it here :-( - Add 'postload modules = ' (for modules that need to be loaded after fork() in smbd, if applicable) - Convert RPC, auth, passdb, etc to use new register_{subsystem,backend}() functions - Accept wildcards in 'preload modules' option, instead of loading recursively (This used to be commit 7512b9ab1a8b3103f7a6c13f736353c46a26b668) --- source4/ntvfs/posix/vfs_posix.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index b27e7493a0..9a35f19322 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -23,7 +23,7 @@ This is the default backend */ -#include "includes.h" +#include "include/includes.h" /* connect to a share - used when a tree_connect operation comes @@ -126,12 +126,15 @@ static NTSTATUS pvfs_unlink(struct ntvfs_context *ctx, const char *name, uint16 /* initialialise the POSIX disk backend, registering ourselves with the ntvfs subsystem */ -BOOL posix_vfs_init(void) +NTSTATUS ntvfs_posix_init(void) { - BOOL ret; + NTSTATUS ret; struct ntvfs_ops ops; ZERO_STRUCT(ops); + + ops.name = "default"; + ops.type = NTVFS_DISK; /* fill in all the operations */ ops.connect = pvfs_connect; @@ -140,12 +143,11 @@ BOOL posix_vfs_init(void) /* register ourselves with the NTVFS subsystem. We register under the name 'default' as we wish to be the default backend */ - ret = ntvfs_register("default", NTVFS_DISK, &ops); + ret = register_backend("ntvfs", &ops); - if (!ret) { + if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register POSIX backend!\n")); - return False; } - return True; + return ret; } -- cgit From ee0588bb6fbfbb250f5f2a3373556b100f2eb399 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 21 Apr 2004 14:19:03 +0000 Subject: r312: let ntvfs posix backend return NT_STATUS_ACCESS_DENIED in the connect hook and print out an error message to the debug log which say: use 'cifs' or 'simple' as ntvfs handler this also warns about 'root' fileaccess in the 'simple' module the 'default' ntvfs handler is now registered by the posix backend metze (This used to be commit 84b3589daa60cfdd2c868d9468192b0a6e1eebae) --- source4/ntvfs/posix/vfs_posix.c | 99 ++++++----------------------------------- 1 file changed, 14 insertions(+), 85 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 9a35f19322..e013e01979 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -1,8 +1,8 @@ /* Unix SMB/CIFS implementation. POSIX NTVFS backend - Copyright (C) Andrew Tridgell 1992-2003 - Copyright (C) Andrew Bartlett 2001 + Copyright (C) Andrew Tridgell 2003 + Copyright (C) Stefan (metze) Metzmacher 2004 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,98 +31,28 @@ directory exists (tho it doesn't need to be accessible by the user, that comes later) */ -static NTSTATUS pvfs_connect(struct ntvfs_context *ctx, const char *sharename) +static NTSTATUS pvfs_connect(struct request_context *req, const char *sharename) { - struct stat st; - struct connection_struct *conn = ctx->conn; - NTSTATUS status; - - /* the directory must exist */ - if (stat(conn->connectpath, &st) != 0 || !S_ISDIR(st.st_mode)) { - DEBUG(0,("'%s' is not a directory, when connecting to [%s]\n", - conn->connectpath, lp_servicename(SNUM(conn)))); - return NT_STATUS_BAD_NETWORK_NAME; - } - - /* Initialise old VFS function pointers */ - if (!smbd_vfs_init(conn)) { - DEBUG(0, ("vfs_init failed for service %s\n", lp_servicename(SNUM(conn)))); - return NT_STATUS_BAD_NETWORK_NAME; - } - - /* become the user for the rest */ - status = ntvfs_change_to_user(ctx); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - /* the posix backend can do preexec */ - status = ntvfs_connect_preexec(ctx); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - /* Invoke the old POSIX VFS make connection hook */ - if (conn->vfs_ops.connect && - conn->vfs_ops.connect(conn, lp_servicename(snum), user) < 0) { - DEBUG(0,("make_connection: POSIX VFS make connection failed!\n")); - return NT_STATUS_UNSUCCESSFUL; - } - } - - - /* - * Print out the 'connected as' stuff here as we need - * to know the effective uid and gid we will be using - * (at least initially). - */ - if( DEBUGLVL( IS_IPC(conn) ? 3 : 1 ) ) { - dbgtext( "%s (%s) ", get_remote_machine_name(), conn->client_address ); - dbgtext( "connect to service %s ", lp_servicename(SNUM(conn)) ); - dbgtext( "initially as user %s ", user ); - dbgtext( "(uid=%d, gid=%d) ", (int)geteuid(), (int)getegid() ); - dbgtext( "(pid %d)\n", (int)sys_getpid() ); - } - - return NT_STATUS_OK; + DEBUG(0, ("Connection to share [%s] ACCESS DENIED!\n", sharename)); + DEBUGADD(0,("This is because your using the 'ntvfs handler = default'.\n")); + DEBUGADD(0,("This backend is not functional at the moment.\n")); + DEBUGADD(0,("Please use one of the following backends:\n")); + DEBUGADD(0,("cifs - a proxy to another cifs-server\n")); + DEBUGADD(0,("simple - a very, very simple posix backend\n")); + DEBUGADD(0,(" all file acess is done as user 'root'\n")); + DEBUGADD(0,(" Please don't use this a sensitive data!!!\n")); + + return NT_STATUS_ACCESS_DENIED; } /* disconnect from a share */ -static NTSTATUS pvfs_disconnect(struct ntvfs_context *ctx) +static NTSTATUS pvfs_disconnect(struct tcon_context *tcon) { return NT_STATUS_OK; } -/* - delete a file - the dirtype specifies the file types to include in the search. - The name can contain CIFS wildcards, but rarely does (except with OS/2 clients) -*/ -static NTSTATUS pvfs_unlink(struct ntvfs_context *ctx, const char *name, uint16 dirtype) -{ - NTSTATUS status; - - if (ntvfs_dfs_redirect(ctx, name)) { - return NT_STATUS_PATH_NOT_COVERED; - } - - status = unlink_internals(ctx->conn, dirtype, name); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - ntvfs_run_change_notify_queue(); - - return NT_STATUS_OK; -} - - - - - - - /* initialialise the POSIX disk backend, registering ourselves with the ntvfs subsystem */ @@ -139,7 +69,6 @@ NTSTATUS ntvfs_posix_init(void) /* fill in all the operations */ ops.connect = pvfs_connect; ops.disconnect = pvfs_disconnect; - ops.unlink = pvfs_unlink; /* register ourselves with the NTVFS subsystem. We register under the name 'default' as we wish to be the default backend */ -- cgit From 8bf537d119be3e1823ad41b8b8af0d163251b1c5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 28 Jun 2004 08:39:00 +0000 Subject: r1280: rename struct request_context to smbsrv_request metze (This used to be commit a85d2db5826a84b812ea5162a11f54edd25f74e3) --- source4/ntvfs/posix/vfs_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index e013e01979..90b6f9248d 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -31,7 +31,7 @@ directory exists (tho it doesn't need to be accessible by the user, that comes later) */ -static NTSTATUS pvfs_connect(struct request_context *req, const char *sharename) +static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename) { DEBUG(0, ("Connection to share [%s] ACCESS DENIED!\n", sharename)); DEBUGADD(0,("This is because your using the 'ntvfs handler = default'.\n")); -- cgit From b87fa55bdc69fe50743ddb58977e408853abb4cb Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 28 Jun 2004 11:10:24 +0000 Subject: r1286: rename struct tcon_context to smbsrv_tcon metze (This used to be commit a6c0ca9de52b2395b092cb245bb94cbd55dfdd46) --- source4/ntvfs/posix/vfs_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 90b6f9248d..cfbb892d9c 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -48,7 +48,7 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename) /* disconnect from a share */ -static NTSTATUS pvfs_disconnect(struct tcon_context *tcon) +static NTSTATUS pvfs_disconnect(struct smbsrv_tcon *tcon) { return NT_STATUS_OK; } -- cgit From ad5acba254ff7936cc959eaeaf88726095b3fe28 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 19 Aug 2004 12:50:41 +0000 Subject: r1916: return a more clear error, we are miss configure in this case metze (This used to be commit a908f831cb9dd265f9b183512053f9e608feec3d) --- source4/ntvfs/posix/vfs_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index cfbb892d9c..93cfbd74a9 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -42,7 +42,7 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename) DEBUGADD(0,(" all file acess is done as user 'root'\n")); DEBUGADD(0,(" Please don't use this a sensitive data!!!\n")); - return NT_STATUS_ACCESS_DENIED; + return NT_STATUS_DEVICE_CONFIGURATION_ERROR; } /* -- cgit From 893c62d38388b20c52cf3c45069d836c46f42bd3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 8 Sep 2004 05:39:06 +0000 Subject: r2249: got rid of some more mem_ctx elements in structures (This used to be commit 21ef338cbbe96acc8594ffc550ef60c6a40fb951) --- source4/ntvfs/posix/vfs_posix.c | 42 +++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 93cfbd74a9..8269f9bba7 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -1,8 +1,9 @@ /* Unix SMB/CIFS implementation. + POSIX NTVFS backend - Copyright (C) Andrew Tridgell 2003 - Copyright (C) Stefan (metze) Metzmacher 2004 + + Copyright (C) Andrew Tridgell 2004 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,6 +25,8 @@ */ #include "include/includes.h" +#include "vfs_posix.h" + /* connect to a share - used when a tree_connect operation comes @@ -33,16 +36,31 @@ */ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename) { - DEBUG(0, ("Connection to share [%s] ACCESS DENIED!\n", sharename)); - DEBUGADD(0,("This is because your using the 'ntvfs handler = default'.\n")); - DEBUGADD(0,("This backend is not functional at the moment.\n")); - DEBUGADD(0,("Please use one of the following backends:\n")); - DEBUGADD(0,("cifs - a proxy to another cifs-server\n")); - DEBUGADD(0,("simple - a very, very simple posix backend\n")); - DEBUGADD(0,(" all file acess is done as user 'root'\n")); - DEBUGADD(0,(" Please don't use this a sensitive data!!!\n")); - - return NT_STATUS_DEVICE_CONFIGURATION_ERROR; + struct smbsrv_tcon *tcon = req->tcon; + struct pvfs_state *pvfs; + struct stat st; + + DEBUG(0,("WARNING: the posix vfs handler is incomplete - you probably want \"ntvfs handler = simple\"\n")); + + pvfs = talloc_named(tcon, sizeof(struct pvfs_state), "pvfs_connect(%s)", sharename); + if (pvfs == NULL) { + return NT_STATUS_NO_MEMORY; + } + + pvfs->base_directory = talloc_strdup(pvfs, lp_pathname(tcon->service)); + + /* the directory must exist. Note that we deliberately don't + check that it is readable */ + if (stat(pvfs->base_directory, &st) != 0 || !S_ISDIR(st.st_mode)) { + DEBUG(0,("pvfs_connect: '%s' is not a directory, when connecting to [%s]\n", + pvfs->base_directory, sharename)); + return NT_STATUS_BAD_NETWORK_NAME; + } + + tcon->fs_type = talloc_strdup(tcon, "NTFS"); + tcon->dev_type = talloc_strdup(tcon, "A:"); + + return NT_STATUS_OK; } /* -- cgit From 2cbbbe35352e2833a1acceb757538db69f5db5f0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 8 Sep 2004 07:59:52 +0000 Subject: r2251: forgot to add vfs_posix.h in my last commit note that this is just a skeleton so far. More to come soon. (This used to be commit efc8850b9aa9348f5f7c4b342aa76dab1635e7d4) --- source4/ntvfs/posix/vfs_posix.c | 236 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 234 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 8269f9bba7..fb53f87f27 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -71,6 +71,209 @@ static NTSTATUS pvfs_disconnect(struct smbsrv_tcon *tcon) return NT_STATUS_OK; } +/* + delete a file - the dirtype specifies the file types to include in the search. + The name can contain CIFS wildcards, but rarely does (except with OS/2 clients) +*/ +static NTSTATUS pvfs_unlink(struct smbsrv_request *req, struct smb_unlink *unl) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + + +/* + ioctl interface - we don't do any +*/ +static NTSTATUS pvfs_ioctl(struct smbsrv_request *req, union smb_ioctl *io) +{ + return NT_STATUS_INVALID_PARAMETER; +} + +/* + check if a directory exists +*/ +static NTSTATUS pvfs_chkpath(struct smbsrv_request *req, struct smb_chkpath *cp) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* + return info on a pathname +*/ +static NTSTATUS pvfs_qpathinfo(struct smbsrv_request *req, union smb_fileinfo *info) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* + query info on a open file +*/ +static NTSTATUS pvfs_qfileinfo(struct smbsrv_request *req, union smb_fileinfo *info) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + + +/* + open a file +*/ +static NTSTATUS pvfs_open(struct smbsrv_request *req, union smb_open *io) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* + create a directory +*/ +static NTSTATUS pvfs_mkdir(struct smbsrv_request *req, union smb_mkdir *md) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* + remove a directory +*/ +static NTSTATUS pvfs_rmdir(struct smbsrv_request *req, struct smb_rmdir *rd) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* + rename a set of files +*/ +static NTSTATUS pvfs_rename(struct smbsrv_request *req, union smb_rename *ren) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* + copy a set of files +*/ +static NTSTATUS pvfs_copy(struct smbsrv_request *req, struct smb_copy *cp) +{ + return NT_STATUS_NOT_SUPPORTED; +} + +/* + read from a file +*/ +static NTSTATUS pvfs_read(struct smbsrv_request *req, union smb_read *rd) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* + write to a file +*/ +static NTSTATUS pvfs_write(struct smbsrv_request *req, union smb_write *wr) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* + seek in a file +*/ +static NTSTATUS pvfs_seek(struct smbsrv_request *req, struct smb_seek *io) +{ + return NT_STATUS_NOT_SUPPORTED; +} + +/* + flush a file +*/ +static NTSTATUS pvfs_flush(struct smbsrv_request *req, struct smb_flush *io) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* + close a file +*/ +static NTSTATUS pvfs_close(struct smbsrv_request *req, union smb_close *io) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* + exit - closing files? +*/ +static NTSTATUS pvfs_exit(struct smbsrv_request *req) +{ + return NT_STATUS_NOT_SUPPORTED; +} + +/* + lock a byte range +*/ +static NTSTATUS pvfs_lock(struct smbsrv_request *req, union smb_lock *lck) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* + set info on a pathname +*/ +static NTSTATUS pvfs_setpathinfo(struct smbsrv_request *req, union smb_setfileinfo *st) +{ + return NT_STATUS_NOT_SUPPORTED; +} + +/* + set info on a open file +*/ +static NTSTATUS pvfs_setfileinfo(struct smbsrv_request *req, + union smb_setfileinfo *info) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + + +/* + return filesystem space info +*/ +static NTSTATUS pvfs_fsinfo(struct smbsrv_request *req, union smb_fsinfo *fs) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* + return print queue info +*/ +static NTSTATUS pvfs_lpq(struct smbsrv_request *req, union smb_lpq *lpq) +{ + return NT_STATUS_NOT_SUPPORTED; +} + +/* + list files in a directory matching a wildcard pattern +*/ +static NTSTATUS pvfs_search_first(struct smbsrv_request *req, union smb_search_first *io, + void *search_private, + BOOL (*callback)(void *, union smb_search_data *)) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* continue a search */ +static NTSTATUS pvfs_search_next(struct smbsrv_request *req, union smb_search_next *io, + void *search_private, + BOOL (*callback)(void *, union smb_search_data *)) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* close a search */ +static NTSTATUS pvfs_search_close(struct smbsrv_request *req, union smb_search_close *io) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +/* SMBtrans - not used on file shares */ +static NTSTATUS pvfs_trans(struct smbsrv_request *req, struct smb_trans2 *trans2) +{ + return NT_STATUS_ACCESS_DENIED; +} + /* initialialise the POSIX disk backend, registering ourselves with the ntvfs subsystem */ @@ -87,9 +290,38 @@ NTSTATUS ntvfs_posix_init(void) /* fill in all the operations */ ops.connect = pvfs_connect; ops.disconnect = pvfs_disconnect; + ops.unlink = pvfs_unlink; + ops.chkpath = pvfs_chkpath; + ops.qpathinfo = pvfs_qpathinfo; + ops.setpathinfo = pvfs_setpathinfo; + ops.open = pvfs_open; + ops.mkdir = pvfs_mkdir; + ops.rmdir = pvfs_rmdir; + ops.rename = pvfs_rename; + ops.copy = pvfs_copy; + ops.ioctl = pvfs_ioctl; + ops.read = pvfs_read; + ops.write = pvfs_write; + ops.seek = pvfs_seek; + ops.flush = pvfs_flush; + ops.close = pvfs_close; + ops.exit = pvfs_exit; + ops.lock = pvfs_lock; + ops.setfileinfo = pvfs_setfileinfo; + ops.qfileinfo = pvfs_qfileinfo; + ops.fsinfo = pvfs_fsinfo; + ops.lpq = pvfs_lpq; + ops.search_first = pvfs_search_first; + ops.search_next = pvfs_search_next; + ops.search_close = pvfs_search_close; + ops.trans = pvfs_trans; + + /* register ourselves with the NTVFS subsystem. We register + under the name 'default' as we wish to be the default + backend, and also register as 'posix' */ + ops.name = "posix"; + ret = register_backend("ntvfs", &ops); - /* register ourselves with the NTVFS subsystem. We register under the name 'default' - as we wish to be the default backend */ ret = register_backend("ntvfs", &ops); if (!NT_STATUS_IS_OK(ret)) { -- cgit From 0e6799177c5d1c0904a904d4ff705d33d74d7d56 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 8 Sep 2004 11:01:18 +0000 Subject: r2252: don't register the same name twice (This used to be commit fdb675bbad1322ddd94c646f67803b9678468a64) --- source4/ntvfs/posix/vfs_posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index fb53f87f27..ee70e79835 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -284,7 +284,6 @@ NTSTATUS ntvfs_posix_init(void) ZERO_STRUCT(ops); - ops.name = "default"; ops.type = NTVFS_DISK; /* fill in all the operations */ @@ -319,9 +318,10 @@ NTSTATUS ntvfs_posix_init(void) /* register ourselves with the NTVFS subsystem. We register under the name 'default' as we wish to be the default backend, and also register as 'posix' */ - ops.name = "posix"; + ops.name = "default"; ret = register_backend("ntvfs", &ops); + ops.name = "posix"; ret = register_backend("ntvfs", &ops); if (!NT_STATUS_IS_OK(ret)) { -- cgit From 03cb4367d67ba9cdedf22df743d25d81093941d7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 18 Sep 2004 08:16:14 +0000 Subject: r2404: the first large lump of posix vfs stuff. this is still very much a skeleton (with many limbs missing too!). I am committing this early to get some feedback on the approach taken. (This used to be commit 40d5cae5ebbfe328e193eadb685df6a370730299) --- source4/ntvfs/posix/vfs_posix.c | 81 +++++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 36 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index ee70e79835..86179debc5 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -39,6 +39,7 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename) struct smbsrv_tcon *tcon = req->tcon; struct pvfs_state *pvfs; struct stat st; + char *base_directory; DEBUG(0,("WARNING: the posix vfs handler is incomplete - you probably want \"ntvfs handler = simple\"\n")); @@ -46,8 +47,13 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename) if (pvfs == NULL) { return NT_STATUS_NO_MEMORY; } + ZERO_STRUCTP(pvfs); - pvfs->base_directory = talloc_strdup(pvfs, lp_pathname(tcon->service)); + /* for simplicity of path construction, remove any trailing slash now */ + base_directory = talloc_strdup(pvfs, lp_pathname(tcon->service)); + trim_string(base_directory, NULL, "/"); + + pvfs->base_directory = base_directory; /* the directory must exist. Note that we deliberately don't check that it is readable */ @@ -59,6 +65,7 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename) tcon->fs_type = talloc_strdup(tcon, "NTFS"); tcon->dev_type = talloc_strdup(tcon, "A:"); + tcon->ntvfs_private = pvfs; return NT_STATUS_OK; } @@ -71,21 +78,12 @@ static NTSTATUS pvfs_disconnect(struct smbsrv_tcon *tcon) return NT_STATUS_OK; } -/* - delete a file - the dirtype specifies the file types to include in the search. - The name can contain CIFS wildcards, but rarely does (except with OS/2 clients) -*/ -static NTSTATUS pvfs_unlink(struct smbsrv_request *req, struct smb_unlink *unl) -{ - return NT_STATUS_NOT_IMPLEMENTED; -} - - /* ioctl interface - we don't do any */ static NTSTATUS pvfs_ioctl(struct smbsrv_request *req, union smb_ioctl *io) { + DEBUG(0,("pvfs_ioctl not implemented\n")); return NT_STATUS_INVALID_PARAMETER; } @@ -94,7 +92,25 @@ static NTSTATUS pvfs_ioctl(struct smbsrv_request *req, union smb_ioctl *io) */ static NTSTATUS pvfs_chkpath(struct smbsrv_request *req, struct smb_chkpath *cp) { - return NT_STATUS_NOT_IMPLEMENTED; + struct pvfs_state *pvfs = req->tcon->ntvfs_private; + struct pvfs_filename *name; + NTSTATUS status; + + /* resolve the cifs name to a posix name */ + status = pvfs_resolve_name(pvfs, req, cp->in.path, 0, &name); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (!name->exists) { + return NT_STATUS_OBJECT_NAME_NOT_FOUND; + } + + if (!S_ISDIR(name->st.st_mode)) { + return NT_STATUS_NOT_A_DIRECTORY; + } + + return NT_STATUS_OK; } /* @@ -102,6 +118,7 @@ static NTSTATUS pvfs_chkpath(struct smbsrv_request *req, struct smb_chkpath *cp) */ static NTSTATUS pvfs_qpathinfo(struct smbsrv_request *req, union smb_fileinfo *info) { + DEBUG(0,("pvfs_qpathinfo not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -110,6 +127,7 @@ static NTSTATUS pvfs_qpathinfo(struct smbsrv_request *req, union smb_fileinfo *i */ static NTSTATUS pvfs_qfileinfo(struct smbsrv_request *req, union smb_fileinfo *info) { + DEBUG(0,("pvfs_qfileinfo not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -119,6 +137,7 @@ static NTSTATUS pvfs_qfileinfo(struct smbsrv_request *req, union smb_fileinfo *i */ static NTSTATUS pvfs_open(struct smbsrv_request *req, union smb_open *io) { + DEBUG(0,("pvfs_open not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -127,6 +146,7 @@ static NTSTATUS pvfs_open(struct smbsrv_request *req, union smb_open *io) */ static NTSTATUS pvfs_mkdir(struct smbsrv_request *req, union smb_mkdir *md) { + DEBUG(0,("pvfs_mkdir not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -135,6 +155,7 @@ static NTSTATUS pvfs_mkdir(struct smbsrv_request *req, union smb_mkdir *md) */ static NTSTATUS pvfs_rmdir(struct smbsrv_request *req, struct smb_rmdir *rd) { + DEBUG(0,("pvfs_rmdir not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -143,6 +164,7 @@ static NTSTATUS pvfs_rmdir(struct smbsrv_request *req, struct smb_rmdir *rd) */ static NTSTATUS pvfs_rename(struct smbsrv_request *req, union smb_rename *ren) { + DEBUG(0,("pvfs_rename not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -151,6 +173,7 @@ static NTSTATUS pvfs_rename(struct smbsrv_request *req, union smb_rename *ren) */ static NTSTATUS pvfs_copy(struct smbsrv_request *req, struct smb_copy *cp) { + DEBUG(0,("pvfs_copy not implemented\n")); return NT_STATUS_NOT_SUPPORTED; } @@ -159,6 +182,7 @@ static NTSTATUS pvfs_copy(struct smbsrv_request *req, struct smb_copy *cp) */ static NTSTATUS pvfs_read(struct smbsrv_request *req, union smb_read *rd) { + DEBUG(0,("pvfs_read not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -167,6 +191,7 @@ static NTSTATUS pvfs_read(struct smbsrv_request *req, union smb_read *rd) */ static NTSTATUS pvfs_write(struct smbsrv_request *req, union smb_write *wr) { + DEBUG(0,("pvfs_write not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -175,6 +200,7 @@ static NTSTATUS pvfs_write(struct smbsrv_request *req, union smb_write *wr) */ static NTSTATUS pvfs_seek(struct smbsrv_request *req, struct smb_seek *io) { + DEBUG(0,("pvfs_seek not implemented\n")); return NT_STATUS_NOT_SUPPORTED; } @@ -183,6 +209,7 @@ static NTSTATUS pvfs_seek(struct smbsrv_request *req, struct smb_seek *io) */ static NTSTATUS pvfs_flush(struct smbsrv_request *req, struct smb_flush *io) { + DEBUG(0,("pvfs_flush not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -191,6 +218,7 @@ static NTSTATUS pvfs_flush(struct smbsrv_request *req, struct smb_flush *io) */ static NTSTATUS pvfs_close(struct smbsrv_request *req, union smb_close *io) { + DEBUG(0,("pvfs_close not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -199,6 +227,7 @@ static NTSTATUS pvfs_close(struct smbsrv_request *req, union smb_close *io) */ static NTSTATUS pvfs_exit(struct smbsrv_request *req) { + DEBUG(0,("pvfs_exit not implemented\n")); return NT_STATUS_NOT_SUPPORTED; } @@ -207,6 +236,7 @@ static NTSTATUS pvfs_exit(struct smbsrv_request *req) */ static NTSTATUS pvfs_lock(struct smbsrv_request *req, union smb_lock *lck) { + DEBUG(0,("pvfs_lock not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -215,6 +245,7 @@ static NTSTATUS pvfs_lock(struct smbsrv_request *req, union smb_lock *lck) */ static NTSTATUS pvfs_setpathinfo(struct smbsrv_request *req, union smb_setfileinfo *st) { + DEBUG(0,("pvfs_setpathinfo not implemented\n")); return NT_STATUS_NOT_SUPPORTED; } @@ -224,6 +255,7 @@ static NTSTATUS pvfs_setpathinfo(struct smbsrv_request *req, union smb_setfilein static NTSTATUS pvfs_setfileinfo(struct smbsrv_request *req, union smb_setfileinfo *info) { + DEBUG(0,("pvfs_setfileinfo not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -233,6 +265,7 @@ static NTSTATUS pvfs_setfileinfo(struct smbsrv_request *req, */ static NTSTATUS pvfs_fsinfo(struct smbsrv_request *req, union smb_fsinfo *fs) { + DEBUG(0,("pvfs_fsinfo not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; } @@ -244,30 +277,6 @@ static NTSTATUS pvfs_lpq(struct smbsrv_request *req, union smb_lpq *lpq) return NT_STATUS_NOT_SUPPORTED; } -/* - list files in a directory matching a wildcard pattern -*/ -static NTSTATUS pvfs_search_first(struct smbsrv_request *req, union smb_search_first *io, - void *search_private, - BOOL (*callback)(void *, union smb_search_data *)) -{ - return NT_STATUS_NOT_IMPLEMENTED; -} - -/* continue a search */ -static NTSTATUS pvfs_search_next(struct smbsrv_request *req, union smb_search_next *io, - void *search_private, - BOOL (*callback)(void *, union smb_search_data *)) -{ - return NT_STATUS_NOT_IMPLEMENTED; -} - -/* close a search */ -static NTSTATUS pvfs_search_close(struct smbsrv_request *req, union smb_search_close *io) -{ - return NT_STATUS_NOT_IMPLEMENTED; -} - /* SMBtrans - not used on file shares */ static NTSTATUS pvfs_trans(struct smbsrv_request *req, struct smb_trans2 *trans2) { -- cgit From 8a1c3ddd947039bf3b62efd94d3429359b593e15 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 20 Sep 2004 07:28:43 +0000 Subject: r2436: the second big lump of posix vfs code. this is still just a skeleton, and many of the functions are just based on the simple vfs backend, they are there to allow me to run smbtorture tests against the real parts of the posix backend. (This used to be commit f2fa7fe565e89360dba3bb5434d3a6a36f398348) --- source4/ntvfs/posix/vfs_posix.c | 112 +++++++--------------------------------- 1 file changed, 19 insertions(+), 93 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 86179debc5..b2c9d81086 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -28,6 +28,22 @@ #include "vfs_posix.h" +/* + setup config options for a posix share +*/ +static void pvfs_setup_options(struct pvfs_state *pvfs) +{ + int snum = pvfs->tcon->service; + + if (lp_map_hidden(snum)) pvfs->flags |= PVFS_FLAG_MAP_HIDDEN; + if (lp_map_archive(snum)) pvfs->flags |= PVFS_FLAG_MAP_ARCHIVE; + if (lp_map_system(snum)) pvfs->flags |= PVFS_FLAG_MAP_SYSTEM; + if (lp_readonly(snum)) pvfs->flags |= PVFS_FLAG_READONLY; + + pvfs->share_name = talloc_strdup(pvfs, lp_servicename(snum)); +} + + /* connect to a share - used when a tree_connect operation comes in. For a disk based backend we needs to ensure that the base @@ -53,6 +69,7 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename) base_directory = talloc_strdup(pvfs, lp_pathname(tcon->service)); trim_string(base_directory, NULL, "/"); + pvfs->tcon = tcon; pvfs->base_directory = base_directory; /* the directory must exist. Note that we deliberately don't @@ -67,6 +84,8 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename) tcon->dev_type = talloc_strdup(tcon, "A:"); tcon->ntvfs_private = pvfs; + pvfs_setup_options(pvfs); + return NT_STATUS_OK; } @@ -113,52 +132,6 @@ static NTSTATUS pvfs_chkpath(struct smbsrv_request *req, struct smb_chkpath *cp) return NT_STATUS_OK; } -/* - return info on a pathname -*/ -static NTSTATUS pvfs_qpathinfo(struct smbsrv_request *req, union smb_fileinfo *info) -{ - DEBUG(0,("pvfs_qpathinfo not implemented\n")); - return NT_STATUS_NOT_IMPLEMENTED; -} - -/* - query info on a open file -*/ -static NTSTATUS pvfs_qfileinfo(struct smbsrv_request *req, union smb_fileinfo *info) -{ - DEBUG(0,("pvfs_qfileinfo not implemented\n")); - return NT_STATUS_NOT_IMPLEMENTED; -} - - -/* - open a file -*/ -static NTSTATUS pvfs_open(struct smbsrv_request *req, union smb_open *io) -{ - DEBUG(0,("pvfs_open not implemented\n")); - return NT_STATUS_NOT_IMPLEMENTED; -} - -/* - create a directory -*/ -static NTSTATUS pvfs_mkdir(struct smbsrv_request *req, union smb_mkdir *md) -{ - DEBUG(0,("pvfs_mkdir not implemented\n")); - return NT_STATUS_NOT_IMPLEMENTED; -} - -/* - remove a directory -*/ -static NTSTATUS pvfs_rmdir(struct smbsrv_request *req, struct smb_rmdir *rd) -{ - DEBUG(0,("pvfs_rmdir not implemented\n")); - return NT_STATUS_NOT_IMPLEMENTED; -} - /* rename a set of files */ @@ -177,24 +150,6 @@ static NTSTATUS pvfs_copy(struct smbsrv_request *req, struct smb_copy *cp) return NT_STATUS_NOT_SUPPORTED; } -/* - read from a file -*/ -static NTSTATUS pvfs_read(struct smbsrv_request *req, union smb_read *rd) -{ - DEBUG(0,("pvfs_read not implemented\n")); - return NT_STATUS_NOT_IMPLEMENTED; -} - -/* - write to a file -*/ -static NTSTATUS pvfs_write(struct smbsrv_request *req, union smb_write *wr) -{ - DEBUG(0,("pvfs_write not implemented\n")); - return NT_STATUS_NOT_IMPLEMENTED; -} - /* seek in a file */ @@ -213,15 +168,6 @@ static NTSTATUS pvfs_flush(struct smbsrv_request *req, struct smb_flush *io) return NT_STATUS_NOT_IMPLEMENTED; } -/* - close a file -*/ -static NTSTATUS pvfs_close(struct smbsrv_request *req, union smb_close *io) -{ - DEBUG(0,("pvfs_close not implemented\n")); - return NT_STATUS_NOT_IMPLEMENTED; -} - /* exit - closing files? */ @@ -249,26 +195,6 @@ static NTSTATUS pvfs_setpathinfo(struct smbsrv_request *req, union smb_setfilein return NT_STATUS_NOT_SUPPORTED; } -/* - set info on a open file -*/ -static NTSTATUS pvfs_setfileinfo(struct smbsrv_request *req, - union smb_setfileinfo *info) -{ - DEBUG(0,("pvfs_setfileinfo not implemented\n")); - return NT_STATUS_NOT_IMPLEMENTED; -} - - -/* - return filesystem space info -*/ -static NTSTATUS pvfs_fsinfo(struct smbsrv_request *req, union smb_fsinfo *fs) -{ - DEBUG(0,("pvfs_fsinfo not implemented\n")); - return NT_STATUS_NOT_IMPLEMENTED; -} - /* return print queue info */ -- cgit From d3fc90eaa185a15f2bd7fca11663e898feb2c81c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 22 Sep 2004 13:01:55 +0000 Subject: r2524: a simple pvfs rename implementation to make testing easier (This used to be commit 98c1c75076fdb0df3a7c616f8c2e1ed138a6ff9a) --- source4/ntvfs/posix/vfs_posix.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index b2c9d81086..84a5647075 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -102,7 +102,6 @@ static NTSTATUS pvfs_disconnect(struct smbsrv_tcon *tcon) */ static NTSTATUS pvfs_ioctl(struct smbsrv_request *req, union smb_ioctl *io) { - DEBUG(0,("pvfs_ioctl not implemented\n")); return NT_STATUS_INVALID_PARAMETER; } @@ -132,15 +131,6 @@ static NTSTATUS pvfs_chkpath(struct smbsrv_request *req, struct smb_chkpath *cp) return NT_STATUS_OK; } -/* - rename a set of files -*/ -static NTSTATUS pvfs_rename(struct smbsrv_request *req, union smb_rename *ren) -{ - DEBUG(0,("pvfs_rename not implemented\n")); - return NT_STATUS_NOT_IMPLEMENTED; -} - /* copy a set of files */ -- cgit From a3cec511bbef2cc7768906f3af947ce2f900bde6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 23 Sep 2004 07:44:42 +0000 Subject: r2561: completely redid the ntvfs module chaining code, You can now do something like: ntvfs handler = nbench posix and the nbench pass-thru module will be called before the posix module. The chaining logic is now much saner, and less racy, with each level in the chain getting its own private pointer rather than relying on save/restore logic in the pass-thru module. The only pass-thru module we have at the moment is the nbench one (which records all traffic in a nbench compatibe format), but I plan on soon writing a "unixuid" pass-thru module that will implement the setegid()/setgroups()/seteuid() logic for standard posix uid handling. This separation of the posix backend from the uid handling should simplify the code, and make development easier. I also modified the nbench module so it can do multiple chaining, so if you want to you can do: ntvfs module = nbench nbench posix and it will save 2 copies of the log file in /tmp. This is really only useful for testing at the moment until we have more than one pass-thru module. (This used to be commit f84c0af35cb54c8fdc4933afefc18fa4c062aae4) --- source4/ntvfs/posix/vfs_posix.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 84a5647075..9bd060c639 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -50,7 +50,7 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) directory exists (tho it doesn't need to be accessible by the user, that comes later) */ -static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename) +static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename, int depth) { struct smbsrv_tcon *tcon = req->tcon; struct pvfs_state *pvfs; @@ -71,6 +71,7 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename) pvfs->tcon = tcon; pvfs->base_directory = base_directory; + pvfs->ops = ntvfs_backend_byname("posix", NTVFS_DISK); /* the directory must exist. Note that we deliberately don't check that it is readable */ @@ -82,7 +83,8 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename) tcon->fs_type = talloc_strdup(tcon, "NTFS"); tcon->dev_type = talloc_strdup(tcon, "A:"); - tcon->ntvfs_private = pvfs; + + ntvfs_set_private(tcon, depth, pvfs); pvfs_setup_options(pvfs); @@ -92,7 +94,7 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename) /* disconnect from a share */ -static NTSTATUS pvfs_disconnect(struct smbsrv_tcon *tcon) +static NTSTATUS pvfs_disconnect(struct smbsrv_tcon *tcon, int depth) { return NT_STATUS_OK; } @@ -110,7 +112,7 @@ static NTSTATUS pvfs_ioctl(struct smbsrv_request *req, union smb_ioctl *io) */ static NTSTATUS pvfs_chkpath(struct smbsrv_request *req, struct smb_chkpath *cp) { - struct pvfs_state *pvfs = req->tcon->ntvfs_private; + NTVFS_GET_PRIVATE(pvfs_state, pvfs, req); struct pvfs_filename *name; NTSTATUS status; -- cgit From 3ea916b2278c202c99c80c02e80e588bd7daedb8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 26 Sep 2004 06:44:08 +0000 Subject: r2654: fixed some more server memory leaks. We are now down to a single leak of 16 bytes, caused by the 16 byte data_blob in the smb_signing code. (This used to be commit 2f1b788e09686e065d22f621f5c0c585192c6740) --- source4/ntvfs/posix/vfs_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 9bd060c639..8705317b2a 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -59,7 +59,7 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename, DEBUG(0,("WARNING: the posix vfs handler is incomplete - you probably want \"ntvfs handler = simple\"\n")); - pvfs = talloc_named(tcon, sizeof(struct pvfs_state), "pvfs_connect(%s)", sharename); + pvfs = talloc_p(tcon, struct pvfs_state); if (pvfs == NULL) { return NT_STATUS_NO_MEMORY; } -- cgit From e3880fa759cfa03222262327854fe7bbe585fe01 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 26 Sep 2004 11:30:20 +0000 Subject: r2660: - converted the libcli/raw/ library to use talloc_increase_ref_count() rather than manual reference counts - properly support SMBexit in the cifs and posix backends - added a logoff method to all backends With these changes the RAW-CONTEXT test now passes against the posix backend (This used to be commit c315d6ac1cc40546fde1474702a6d66d07ee13c8) --- source4/ntvfs/posix/vfs_posix.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 8705317b2a..7ae7c6759a 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -160,15 +160,6 @@ static NTSTATUS pvfs_flush(struct smbsrv_request *req, struct smb_flush *io) return NT_STATUS_NOT_IMPLEMENTED; } -/* - exit - closing files? -*/ -static NTSTATUS pvfs_exit(struct smbsrv_request *req) -{ - DEBUG(0,("pvfs_exit not implemented\n")); - return NT_STATUS_NOT_SUPPORTED; -} - /* lock a byte range */ @@ -241,6 +232,7 @@ NTSTATUS ntvfs_posix_init(void) ops.search_next = pvfs_search_next; ops.search_close = pvfs_search_close; ops.trans = pvfs_trans; + ops.logoff = pvfs_logoff; /* register ourselves with the NTVFS subsystem. We register under the name 'default' as we wish to be the default -- cgit From dcad0f6fd492506efd9a69b4e32c7bbfa5da90e5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 29 Sep 2004 13:17:09 +0000 Subject: r2751: this is a new ntvfs design which tries to solve: - the stacking of modules - finding the modules private data - hide the ntvfs details from the calling layer - I set NTVFS_INTERFACE_VERSION 0 till we are closer to release (because we need to solve some async problems with the module stacking) metze (This used to be commit 3ff03b5cb21bb79afdd3b1609be9635f6688a539) --- source4/ntvfs/posix/vfs_posix.c | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 7ae7c6759a..44875f1879 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -50,7 +50,8 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) directory exists (tho it doesn't need to be accessible by the user, that comes later) */ -static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename, int depth) +static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req, const char *sharename) { struct smbsrv_tcon *tcon = req->tcon; struct pvfs_state *pvfs; @@ -71,7 +72,6 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename, pvfs->tcon = tcon; pvfs->base_directory = base_directory; - pvfs->ops = ntvfs_backend_byname("posix", NTVFS_DISK); /* the directory must exist. Note that we deliberately don't check that it is readable */ @@ -84,7 +84,7 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename, tcon->fs_type = talloc_strdup(tcon, "NTFS"); tcon->dev_type = talloc_strdup(tcon, "A:"); - ntvfs_set_private(tcon, depth, pvfs); + ntvfs->private_data = pvfs; pvfs_setup_options(pvfs); @@ -94,7 +94,8 @@ static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename, /* disconnect from a share */ -static NTSTATUS pvfs_disconnect(struct smbsrv_tcon *tcon, int depth) +static NTSTATUS pvfs_disconnect(struct ntvfs_module_context *ntvfs, + struct smbsrv_tcon *tcon) { return NT_STATUS_OK; } @@ -102,7 +103,8 @@ static NTSTATUS pvfs_disconnect(struct smbsrv_tcon *tcon, int depth) /* ioctl interface - we don't do any */ -static NTSTATUS pvfs_ioctl(struct smbsrv_request *req, union smb_ioctl *io) +static NTSTATUS pvfs_ioctl(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req, union smb_ioctl *io) { return NT_STATUS_INVALID_PARAMETER; } @@ -110,9 +112,10 @@ static NTSTATUS pvfs_ioctl(struct smbsrv_request *req, union smb_ioctl *io) /* check if a directory exists */ -static NTSTATUS pvfs_chkpath(struct smbsrv_request *req, struct smb_chkpath *cp) +static NTSTATUS pvfs_chkpath(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req, struct smb_chkpath *cp) { - NTVFS_GET_PRIVATE(pvfs_state, pvfs, req); + struct pvfs_state *pvfs = ntvfs->private_data; struct pvfs_filename *name; NTSTATUS status; @@ -136,7 +139,8 @@ static NTSTATUS pvfs_chkpath(struct smbsrv_request *req, struct smb_chkpath *cp) /* copy a set of files */ -static NTSTATUS pvfs_copy(struct smbsrv_request *req, struct smb_copy *cp) +static NTSTATUS pvfs_copy(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req, struct smb_copy *cp) { DEBUG(0,("pvfs_copy not implemented\n")); return NT_STATUS_NOT_SUPPORTED; @@ -145,7 +149,8 @@ static NTSTATUS pvfs_copy(struct smbsrv_request *req, struct smb_copy *cp) /* seek in a file */ -static NTSTATUS pvfs_seek(struct smbsrv_request *req, struct smb_seek *io) +static NTSTATUS pvfs_seek(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req, struct smb_seek *io) { DEBUG(0,("pvfs_seek not implemented\n")); return NT_STATUS_NOT_SUPPORTED; @@ -154,7 +159,8 @@ static NTSTATUS pvfs_seek(struct smbsrv_request *req, struct smb_seek *io) /* flush a file */ -static NTSTATUS pvfs_flush(struct smbsrv_request *req, struct smb_flush *io) +static NTSTATUS pvfs_flush(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req, struct smb_flush *io) { DEBUG(0,("pvfs_flush not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; @@ -163,7 +169,8 @@ static NTSTATUS pvfs_flush(struct smbsrv_request *req, struct smb_flush *io) /* lock a byte range */ -static NTSTATUS pvfs_lock(struct smbsrv_request *req, union smb_lock *lck) +static NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req, union smb_lock *lck) { DEBUG(0,("pvfs_lock not implemented\n")); return NT_STATUS_NOT_IMPLEMENTED; @@ -172,7 +179,8 @@ static NTSTATUS pvfs_lock(struct smbsrv_request *req, union smb_lock *lck) /* set info on a pathname */ -static NTSTATUS pvfs_setpathinfo(struct smbsrv_request *req, union smb_setfileinfo *st) +static NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req, union smb_setfileinfo *st) { DEBUG(0,("pvfs_setpathinfo not implemented\n")); return NT_STATUS_NOT_SUPPORTED; @@ -181,13 +189,15 @@ static NTSTATUS pvfs_setpathinfo(struct smbsrv_request *req, union smb_setfilein /* return print queue info */ -static NTSTATUS pvfs_lpq(struct smbsrv_request *req, union smb_lpq *lpq) +static NTSTATUS pvfs_lpq(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req, union smb_lpq *lpq) { return NT_STATUS_NOT_SUPPORTED; } /* SMBtrans - not used on file shares */ -static NTSTATUS pvfs_trans(struct smbsrv_request *req, struct smb_trans2 *trans2) +static NTSTATUS pvfs_trans(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req, struct smb_trans2 *trans2) { return NT_STATUS_ACCESS_DENIED; } -- cgit From a56c984df498488f2e99b1fa8ae156a882f82175 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 3 Oct 2004 08:27:56 +0000 Subject: r2800: removed the warning about using the posix ntvfs handler, as it is now considerably more complete than the simple handler (This used to be commit e6ecd31be8e91f552d891c41b2f8737519a490a1) --- source4/ntvfs/posix/vfs_posix.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 44875f1879..1990f77f82 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -58,8 +58,6 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, struct stat st; char *base_directory; - DEBUG(0,("WARNING: the posix vfs handler is incomplete - you probably want \"ntvfs handler = simple\"\n")); - pvfs = talloc_p(tcon, struct pvfs_state); if (pvfs == NULL) { return NT_STATUS_NO_MEMORY; -- cgit From 52f525c104ae2d17901f104cbf482395dc803cc1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 12 Oct 2004 05:10:43 +0000 Subject: r2927: imported the hash2 name mangling code from Samba3 into Samba4, but heavily modified to suit the Samba4 architecture. Samba4 with posix backend now passes the BASE-MANGLE test (This used to be commit ed52d69e8a065b6a8df2fb73c89be67acfdbca65) --- source4/ntvfs/posix/vfs_posix.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 1990f77f82..7d532c3596 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -57,6 +57,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, struct pvfs_state *pvfs; struct stat st; char *base_directory; + NTSTATUS status; pvfs = talloc_p(tcon, struct pvfs_state); if (pvfs == NULL) { @@ -84,6 +85,11 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, ntvfs->private_data = pvfs; + status = pvfs_mangle_init(pvfs); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + pvfs_setup_options(pvfs); return NT_STATUS_OK; -- cgit From 2003ab2598e7dc93ceb2afc7f71986e5f27758b8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 12 Oct 2004 22:18:02 +0000 Subject: r2941: added pvfs_flush() implementation to the posix backend (This used to be commit dac00ef3b0d0f8467367d7b6ff77db7b63a042cc) --- source4/ntvfs/posix/vfs_posix.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 7d532c3596..a17b90e369 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -39,6 +39,7 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) if (lp_map_archive(snum)) pvfs->flags |= PVFS_FLAG_MAP_ARCHIVE; if (lp_map_system(snum)) pvfs->flags |= PVFS_FLAG_MAP_SYSTEM; if (lp_readonly(snum)) pvfs->flags |= PVFS_FLAG_READONLY; + if (lp_strict_sync(snum)) pvfs->flags |= PVFS_FLAG_STRICT_SYNC; pvfs->share_name = talloc_strdup(pvfs, lp_servicename(snum)); } @@ -160,16 +161,6 @@ static NTSTATUS pvfs_seek(struct ntvfs_module_context *ntvfs, return NT_STATUS_NOT_SUPPORTED; } -/* - flush a file -*/ -static NTSTATUS pvfs_flush(struct ntvfs_module_context *ntvfs, - struct smbsrv_request *req, struct smb_flush *io) -{ - DEBUG(0,("pvfs_flush not implemented\n")); - return NT_STATUS_NOT_IMPLEMENTED; -} - /* lock a byte range */ -- cgit From fef617c31bd4a8be09449d6bc726c729ae758423 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 17 Oct 2004 02:55:47 +0000 Subject: r3012: added initial support for byte range locking in the posix vfs. This is enough for us to pass locktest, but does not yet support lock timeouts and some of the other esoteric features. (This used to be commit 58a92abd88f190bc60894a68e0528e95ae33fe39) --- source4/ntvfs/posix/vfs_posix.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index a17b90e369..5e7a605c9f 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -35,11 +35,12 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) { int snum = pvfs->tcon->service; - if (lp_map_hidden(snum)) pvfs->flags |= PVFS_FLAG_MAP_HIDDEN; - if (lp_map_archive(snum)) pvfs->flags |= PVFS_FLAG_MAP_ARCHIVE; - if (lp_map_system(snum)) pvfs->flags |= PVFS_FLAG_MAP_SYSTEM; - if (lp_readonly(snum)) pvfs->flags |= PVFS_FLAG_READONLY; - if (lp_strict_sync(snum)) pvfs->flags |= PVFS_FLAG_STRICT_SYNC; + if (lp_map_hidden(snum)) pvfs->flags |= PVFS_FLAG_MAP_HIDDEN; + if (lp_map_archive(snum)) pvfs->flags |= PVFS_FLAG_MAP_ARCHIVE; + if (lp_map_system(snum)) pvfs->flags |= PVFS_FLAG_MAP_SYSTEM; + if (lp_readonly(snum)) pvfs->flags |= PVFS_FLAG_READONLY; + if (lp_strict_sync(snum)) pvfs->flags |= PVFS_FLAG_STRICT_SYNC; + if (lp_strict_locking(snum)) pvfs->flags |= PVFS_FLAG_STRICT_LOCKING; pvfs->share_name = talloc_strdup(pvfs, lp_servicename(snum)); } @@ -86,6 +87,13 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, ntvfs->private_data = pvfs; + pvfs->brl_context = brl_init(pvfs, + pvfs->tcon->smb_conn->connection->server_id, + pvfs->tcon->service); + if (pvfs->brl_context == NULL) { + return NT_STATUS_INTERNAL_DB_CORRUPTION; + } + status = pvfs_mangle_init(pvfs); if (!NT_STATUS_IS_OK(status)) { return status; @@ -161,16 +169,6 @@ static NTSTATUS pvfs_seek(struct ntvfs_module_context *ntvfs, return NT_STATUS_NOT_SUPPORTED; } -/* - lock a byte range -*/ -static NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs, - struct smbsrv_request *req, union smb_lock *lck) -{ - DEBUG(0,("pvfs_lock not implemented\n")); - return NT_STATUS_NOT_IMPLEMENTED; -} - /* set info on a pathname */ -- cgit From d0cc571e30bf49443ac7d1b1a0b896ee72d7d9a6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 18 Oct 2004 07:40:17 +0000 Subject: r3029: implemented byte range lock timeouts. This adds a pvfs_wait_message() routine which uses the new messaging system, event timers and talloc destructors to give a nice generic async event handling system with a easy to use interface. The extensions to pvfs_lock.c are based on calls to pvfs_wait_message() routines. We now pass all of our smbtorture locking tests, although while writing this code I have thought of some additonal tests that should be added, particularly for lock cancel operations. I'll work on that soon. This commit also extends the smbtorture lock tests to test the rather weird 0xEEFFFFFF locking semantics that I have discovered in win2003. Win2003 treats the 0xEEFFFFFF boundary as special, and will give different error codes on either side of it. Locks on both sides are allowed, the only difference is which error code is given when a lock is denied. Anyone like to hazard a guess as to why? It has me stumped. (This used to be commit 4395c0557ab175d6a8dd99df03c266325949ffa5) --- source4/ntvfs/posix/vfs_posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 5e7a605c9f..6e6c8b4275 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -89,7 +89,8 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, pvfs->brl_context = brl_init(pvfs, pvfs->tcon->smb_conn->connection->server_id, - pvfs->tcon->service); + pvfs->tcon->service, + pvfs->tcon->smb_conn->connection->messaging_ctx); if (pvfs->brl_context == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } -- cgit From 142d295aa8e70477c85d1835f2907f81c4c3c519 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 18 Oct 2004 13:27:22 +0000 Subject: r3039: This solves the problem of async handlers in ntvfs backends not being in the right state when called. For example, when we use the unixuid handler in the chain of handlers, and a backend decides to continue a call asynchronously then we need to ensure that the continuation happens with the right security context. The solution is to add a new ntvfs operation ntvfs_async_setup(), which calls all the way down through the layers, setting up anything that is required, and takes a private pointer. The backend wanting to make a async calls can use ntvfs_async_setup() to ensure that the modules above it are called when doing async processing. (This used to be commit a256e71029727fa1659ade6257085df537308c7d) --- source4/ntvfs/posix/vfs_posix.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 6e6c8b4275..e989f8de67 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -237,6 +237,7 @@ NTSTATUS ntvfs_posix_init(void) ops.search_close = pvfs_search_close; ops.trans = pvfs_trans; ops.logoff = pvfs_logoff; + ops.async_setup = pvfs_async_setup; /* register ourselves with the NTVFS subsystem. We register under the name 'default' as we wish to be the default -- cgit From cf1b85348a0fc5bf4788291109c9dca9e95eb9c2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 19 Oct 2004 06:39:51 +0000 Subject: r3056: added a id -> pointer data structure (a type of radix tree). This is an extremely efficient way of mapping from an integer handle (such as an open file handle) to a pointer (such as the structure containing the open file information). The code is taken from lib/idr.c in the 2.6 Linux kernel, and is very fast and space efficient. By using talloc it even has auto cleanup. This commit converts the handling of open file handles and open directory search handles to use the idtree routines. In combination with talloc destructors, this simplifies the structure handling in the pvfs backend a lot. For example, we no longer need to keep a linked list of open directory searches at all, and we no longer need to do linear scans of the list of open files on most operations. The end result is that the pvfs code is now extremely scalable. You can have 10s of thousands of open files and open searches and the code still runs very fast. I have also added a small optimisation into the file close path, to avoid looking in the byte range locking database if we know that there are no locks outstanding. (This used to be commit 16835a0ef91a16fa01145b773aad8d43da215dbf) --- source4/ntvfs/posix/vfs_posix.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index e989f8de67..8aa028919c 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -61,11 +61,10 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, char *base_directory; NTSTATUS status; - pvfs = talloc_p(tcon, struct pvfs_state); + pvfs = talloc_zero_p(tcon, struct pvfs_state); if (pvfs == NULL) { return NT_STATUS_NO_MEMORY; } - ZERO_STRUCTP(pvfs); /* for simplicity of path construction, remove any trailing slash now */ base_directory = talloc_strdup(pvfs, lp_pathname(tcon->service)); @@ -95,6 +94,18 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, return NT_STATUS_INTERNAL_DB_CORRUPTION; } + /* allocate the fnum id -> ptr tree */ + pvfs->idtree_fnum = idr_init(pvfs); + if (pvfs->idtree_fnum == NULL) { + return NT_STATUS_NO_MEMORY; + } + + /* allocate the search handle -> ptr tree */ + pvfs->idtree_search = idr_init(pvfs); + if (pvfs->idtree_search == NULL) { + return NT_STATUS_NO_MEMORY; + } + status = pvfs_mangle_init(pvfs); if (!NT_STATUS_IS_OK(status)) { return status; -- cgit From 1cd1b172d52a1fb336cd001ac0ca2fbf7e26a9a3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 22 Oct 2004 01:19:07 +0000 Subject: r3127: added the initial code for the open files database. Doesn't do anything yet, but will soon be the core of the shares modes code. (This used to be commit ad1edabf95c6c331aac4f0caa7d31193e26bc176) --- source4/ntvfs/posix/vfs_posix.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 8aa028919c..383dbf7a16 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -94,6 +94,14 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, return NT_STATUS_INTERNAL_DB_CORRUPTION; } + pvfs->odb_context = odb_init(pvfs, + pvfs->tcon->smb_conn->connection->server_id, + pvfs->tcon->service, + pvfs->tcon->smb_conn->connection->messaging_ctx); + if (pvfs->odb_context == NULL) { + return NT_STATUS_INTERNAL_DB_CORRUPTION; + } + /* allocate the fnum id -> ptr tree */ pvfs->idtree_fnum = idr_init(pvfs); if (pvfs->idtree_fnum == NULL) { -- cgit From 62e58ea7180e265ffe79b998e7488f20909d3fa0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 24 Oct 2004 14:18:03 +0000 Subject: r3161: pvfs now passes the RAW-SEEK test (This used to be commit a953d4a42c8fa3fe930c319d5157fc406a1035da) --- source4/ntvfs/posix/vfs_posix.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 383dbf7a16..64f0e09f59 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -179,26 +179,6 @@ static NTSTATUS pvfs_copy(struct ntvfs_module_context *ntvfs, return NT_STATUS_NOT_SUPPORTED; } -/* - seek in a file -*/ -static NTSTATUS pvfs_seek(struct ntvfs_module_context *ntvfs, - struct smbsrv_request *req, struct smb_seek *io) -{ - DEBUG(0,("pvfs_seek not implemented\n")); - return NT_STATUS_NOT_SUPPORTED; -} - -/* - set info on a pathname -*/ -static NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs, - struct smbsrv_request *req, union smb_setfileinfo *st) -{ - DEBUG(0,("pvfs_setpathinfo not implemented\n")); - return NT_STATUS_NOT_SUPPORTED; -} - /* return print queue info */ -- cgit From d5fd12648e004b47bbe5ed2623838866fedcbeb0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 26 Oct 2004 00:59:06 +0000 Subject: r3227: added a per-share option "case insensitive filesystem", that tells the backend that the underlying filesystem is case insensitive, so it can bypass the directory search if the name is not found. (This used to be commit d84ade90ce7e03ec749d6ae8dcdcb41de85d836e) --- source4/ntvfs/posix/vfs_posix.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 64f0e09f59..cd41bf2329 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -41,6 +41,7 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) if (lp_readonly(snum)) pvfs->flags |= PVFS_FLAG_READONLY; if (lp_strict_sync(snum)) pvfs->flags |= PVFS_FLAG_STRICT_SYNC; if (lp_strict_locking(snum)) pvfs->flags |= PVFS_FLAG_STRICT_LOCKING; + if (lp_ci_filesystem(snum)) pvfs->flags |= PVFS_FLAG_CI_FILESYSTEM; pvfs->share_name = talloc_strdup(pvfs, lp_servicename(snum)); } -- cgit From 7f60959e64c4281e02fd11fbcce2d15f43da1892 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 26 Oct 2004 08:35:29 +0000 Subject: r3253: - added rudimentary support for ntioctl in pvfs - catch the SIGXFSZ signal, which for some completely insane reason is generated in current Linux systems when you write before the maximum offset in a file (maximum is 2^41 on my box). Why wasn't errno good enough for this? - give the right ntstatus code for large offset write failures (This used to be commit 367f0c2af409e4292f727e8a865762a008fd7e67) --- source4/ntvfs/posix/vfs_posix.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index cd41bf2329..b83e4c494e 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -122,6 +122,12 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, pvfs_setup_options(pvfs); +#ifdef SIGXFSZ + /* who had the stupid idea to generate a signal on a large + file write instead of just failing it!? */ + BlockSignals(True, SIGXFSZ); +#endif + return NT_STATUS_OK; } @@ -134,15 +140,6 @@ static NTSTATUS pvfs_disconnect(struct ntvfs_module_context *ntvfs, return NT_STATUS_OK; } -/* - ioctl interface - we don't do any -*/ -static NTSTATUS pvfs_ioctl(struct ntvfs_module_context *ntvfs, - struct smbsrv_request *req, union smb_ioctl *io) -{ - return NT_STATUS_INVALID_PARAMETER; -} - /* check if a directory exists */ -- cgit From 074da7ccf72bba1868d3f9e4ce206acbd56c8074 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 27 Oct 2004 08:36:51 +0000 Subject: r3288: - updated the path processing in pvfs to pass the RAW-CHKPATH test. This rather extensive test reveals some really bizarre error code handling in w2k3. - extended and simplified the RAW-CHKPATH test, making it easier to read (note that Samba3 fails the new tests - jra may wish to look) - marked RAW-CHKPATH as pass for pvfs (This used to be commit 32dccf91cfa5b57f84dd6307720b3f45faa10ae0) --- source4/ntvfs/posix/vfs_posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index b83e4c494e..8dc87b160d 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -151,7 +151,8 @@ static NTSTATUS pvfs_chkpath(struct ntvfs_module_context *ntvfs, NTSTATUS status; /* resolve the cifs name to a posix name */ - status = pvfs_resolve_name(pvfs, req, cp->in.path, 0, &name); + status = pvfs_resolve_name(pvfs, req, cp->in.path, + PVFS_RESOLVE_NO_WILDCARD, &name); if (!NT_STATUS_IS_OK(status)) { return status; } -- cgit From 2df2d1b67f9bf2907f452688b2c54b73052cfb49 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Nov 2004 04:51:57 +0000 Subject: r3461: another place where "open" was used as a structure element (This used to be commit 1087ea830e7aead86d54a1836512e88554afc919) --- source4/ntvfs/posix/vfs_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 8dc87b160d..7ebea2ea9a 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -213,7 +213,7 @@ NTSTATUS ntvfs_posix_init(void) ops.chkpath = pvfs_chkpath; ops.qpathinfo = pvfs_qpathinfo; ops.setpathinfo = pvfs_setpathinfo; - ops.open = pvfs_open; + ops.openfile = pvfs_open; ops.mkdir = pvfs_mkdir; ops.rmdir = pvfs_rmdir; ops.rename = pvfs_rename; -- cgit From c870ae8b898d3bcc81ed9fd1afd505d78dea52cc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 4 Nov 2004 11:28:38 +0000 Subject: r3528: added support for the SMBntcancel() operation, which cancels any outstanding async operation (triggering an immediate timeout). pvfs now passes the RAW-MUX test (This used to be commit 3423e2f41461d054067ef168b9b986f62cc8f77c) --- source4/ntvfs/posix/vfs_posix.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 7ebea2ea9a..9ad1d3cb35 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -236,6 +236,7 @@ NTSTATUS ntvfs_posix_init(void) ops.trans = pvfs_trans; ops.logoff = pvfs_logoff; ops.async_setup = pvfs_async_setup; + ops.cancel = pvfs_cancel; /* register ourselves with the NTVFS subsystem. We register under the name 'default' as we wish to be the default -- cgit From b2617daeb658af9959ea71432d87fa4273b7f1a4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 4 Nov 2004 13:27:29 +0000 Subject: r3532: make sharing violation delay in pvfs configurable with "posix:sharedelay = usecs" (This used to be commit c4758776491e5ed9f5b8c387226d1e75bc70eb2e) --- source4/ntvfs/posix/vfs_posix.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 9ad1d3cb35..2f0f38dd22 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -34,6 +34,7 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) { int snum = pvfs->tcon->service; + int delay; if (lp_map_hidden(snum)) pvfs->flags |= PVFS_FLAG_MAP_HIDDEN; if (lp_map_archive(snum)) pvfs->flags |= PVFS_FLAG_MAP_ARCHIVE; @@ -43,6 +44,12 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) if (lp_strict_locking(snum)) pvfs->flags |= PVFS_FLAG_STRICT_LOCKING; if (lp_ci_filesystem(snum)) pvfs->flags |= PVFS_FLAG_CI_FILESYSTEM; + pvfs->sharing_violation_delay = 1000000; + delay = lp_parm_int(snum, "posix", "sharedelay"); + if (delay != -1) { + pvfs->sharing_violation_delay = delay; + } + pvfs->share_name = talloc_strdup(pvfs, lp_servicename(snum)); } -- cgit From 9fe5fa11d637252f1fbe79c7baf778e2d3cdade2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 5 Nov 2004 07:29:02 +0000 Subject: r3545: initial support for using extended attributes to hold extended dos attributes of files. I decided to use IDL/NDR to encode the attribute, as it gives us a simple way to describe and extend the saved attributes. The xattr code needs to hook into quite a few more places in the pvfs code, but this at least gets the basics done. I will start encoding alternate data streams streams, DOS EAs etc soon using the same basic mechanism. I'll probably stick to "version 1" for the xattr.idl for quite a while even though it will be changing, as I don't expect anyone to be deploying this in production just yet. Once we have production users we will need to keep compatibility by supporting all the old version numbers in xattr.idl. (This used to be commit c54253ed1b7dce1d14f43e747da61089aea87094) --- source4/ntvfs/posix/vfs_posix.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 2f0f38dd22..da4296d062 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -24,7 +24,7 @@ This is the default backend */ -#include "include/includes.h" +#include "includes.h" #include "vfs_posix.h" @@ -44,6 +44,10 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) if (lp_strict_locking(snum)) pvfs->flags |= PVFS_FLAG_STRICT_LOCKING; if (lp_ci_filesystem(snum)) pvfs->flags |= PVFS_FLAG_CI_FILESYSTEM; +#if HAVE_XATTR_SUPPORT + if (lp_parm_bool(snum, "posix", "xattr", True)) pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; +#endif + pvfs->sharing_violation_delay = 1000000; delay = lp_parm_int(snum, "posix", "sharedelay"); if (delay != -1) { -- cgit From 19fc6e8f511f028aa40122cc7e40c83908d07ebe Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 8 Nov 2004 03:54:12 +0000 Subject: r3615: split out struct pvfs_file_handle from struct pvfs_file. This is in preparation for adding code to pass the BASE-DENY1 and BASE-DENYDOS tests, which require a shared filesystem handle for some specific combinations of two DENY_DOS opens on the same connection. (This used to be commit 6e4fdf01d19051e3923d7703dbf990fc1722b09a) --- source4/ntvfs/posix/vfs_posix.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index da4296d062..39f6717cae 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -108,7 +108,6 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, pvfs->odb_context = odb_init(pvfs, pvfs->tcon->smb_conn->connection->server_id, - pvfs->tcon->service, pvfs->tcon->smb_conn->connection->messaging_ctx); if (pvfs->odb_context == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; -- cgit From 31ded4901b4529ad2e49871502cab5ecba71483a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 14 Nov 2004 22:23:23 +0000 Subject: r3737: - Get rid of the register_subsystem() and register_backend() functions. - Re-disable tdbtool (it was building fine on my Debian box but other machines were having problems) (This used to be commit 0d7bb2c40b7a9ed59df3f8944133ea562697e814) --- source4/ntvfs/posix/vfs_posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 39f6717cae..e5712e3e7d 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -252,10 +252,10 @@ NTSTATUS ntvfs_posix_init(void) under the name 'default' as we wish to be the default backend, and also register as 'posix' */ ops.name = "default"; - ret = register_backend("ntvfs", &ops); + ret = ntvfs_register(&ops); ops.name = "posix"; - ret = register_backend("ntvfs", &ops); + ret = ntvfs_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register POSIX backend!\n")); -- cgit From 187412f3da4fbc6feeca15bd0c2527534255964e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 15 Nov 2004 06:57:26 +0000 Subject: r3747: - added some of the infrastructure needed for streams support in pvfs (the IDL, and the load/save meta-data logic) - changed pvfs_resolve_name() to default to non-wildcard, needing PVFS_RESOLVE_WILDCARD to enable wildcards. Most callers don't want wildcards, so defaulting this way makes more sense. - fixed deletion of EAs (This used to be commit e7afd4403cc1b7e0928776929f8988aa6f15640b) --- source4/ntvfs/posix/vfs_posix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index e5712e3e7d..2b4eef04ba 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -161,8 +161,7 @@ static NTSTATUS pvfs_chkpath(struct ntvfs_module_context *ntvfs, NTSTATUS status; /* resolve the cifs name to a posix name */ - status = pvfs_resolve_name(pvfs, req, cp->in.path, - PVFS_RESOLVE_NO_WILDCARD, &name); + status = pvfs_resolve_name(pvfs, req, cp->in.path, 0, &name); if (!NT_STATUS_IS_OK(status)) { return status; } -- cgit From 5a34ef4df6152f5e970afbfb463d4665a823deb7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 17 Nov 2004 06:30:06 +0000 Subject: r3799: - added the bit for FS_ATTR_NAMED_STREAMS support into qfsinfo filesystem attribute reply - pvfs passes the RAW-STREAMS test (This used to be commit c1a48a7542a52df734b54031f405d574e4c891e3) --- source4/ntvfs/posix/vfs_posix.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 2b4eef04ba..e02bd7aa32 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -55,6 +55,16 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) } pvfs->share_name = talloc_strdup(pvfs, lp_servicename(snum)); + + pvfs->fs_attribs = + FS_ATTR_CASE_SENSITIVE_SEARCH | + FS_ATTR_CASE_PRESERVED_NAMES | + FS_ATTR_UNICODE_ON_DISK | + FS_ATTR_SPARSE_FILES; + + if (pvfs->flags & PVFS_FLAG_XATTR_ENABLE) { + pvfs->fs_attribs |= FS_ATTR_NAMED_STREAMS; + } } -- cgit From bc7b4abc3a85e78a73d401345265b2c022f0f04d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 18 Nov 2004 03:31:35 +0000 Subject: r3832: added NT ACL query/set to the posix NTVFS backend. The default ACL is based on the current nttoken, which is completely wrong, but works as a start. The ACL is stored in the xattr system.DosAcl, using a NDR encoded IDL union with a version number to allow for future expansion. pvfs does not yet check the ACL for file access. At the moment the ACL is just query/set. We also need to do some RPC work to allow the windows ACL editor to be used. At the moment is queries the ACL fine, but displays an error when it fails to map the SIDs via rpc. (This used to be commit 3a1f20d874ab2d8b2a2f2485b7a705847abf1263) --- source4/ntvfs/posix/vfs_posix.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index e02bd7aa32..e19b0739c7 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -65,6 +65,9 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) if (pvfs->flags & PVFS_FLAG_XATTR_ENABLE) { pvfs->fs_attribs |= FS_ATTR_NAMED_STREAMS; } + if (pvfs->flags & PVFS_FLAG_XATTR_ENABLE) { + pvfs->fs_attribs |= FS_ATTR_PERSISTANT_ACLS; + } } -- cgit From f2a605eeab5752e4884987496f2661368f85b271 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 24 Nov 2004 06:09:14 +0000 Subject: r3939: - added "posix:fakeoplocks" option for testing with oplocks forced on - added support for sticky write times after a setfileinfo, by using a write_time field in the DosAttrib xattr structure. (This used to be commit 4a52fae82d8305e999f94f1947daa21dab54cdfd) --- source4/ntvfs/posix/vfs_posix.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index e19b0739c7..95b4c20551 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -44,6 +44,10 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) if (lp_strict_locking(snum)) pvfs->flags |= PVFS_FLAG_STRICT_LOCKING; if (lp_ci_filesystem(snum)) pvfs->flags |= PVFS_FLAG_CI_FILESYSTEM; + if (lp_parm_bool(snum, "posix", "fakeoplocks", True)) { + pvfs->flags |= PVFS_FLAG_FAKE_OPLOCKS; + } + #if HAVE_XATTR_SUPPORT if (lp_parm_bool(snum, "posix", "xattr", True)) pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; #endif -- cgit From dc0e4975d6da7ccfb5777639eac6f27bf1998e87 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 27 Nov 2004 00:28:03 +0000 Subject: r3983: posix:fakeoplocks should default to False, not True ! (This used to be commit 052d91c59f177851b5e0e53c8a033bdd28702f64) --- source4/ntvfs/posix/vfs_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 95b4c20551..e340e8cbf6 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -44,7 +44,7 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) if (lp_strict_locking(snum)) pvfs->flags |= PVFS_FLAG_STRICT_LOCKING; if (lp_ci_filesystem(snum)) pvfs->flags |= PVFS_FLAG_CI_FILESYSTEM; - if (lp_parm_bool(snum, "posix", "fakeoplocks", True)) { + if (lp_parm_bool(snum, "posix", "fakeoplocks", False)) { pvfs->flags |= PVFS_FLAG_FAKE_OPLOCKS; } -- cgit From 71a81e9dcbbdc3e8d443967e47110ce9187a7c1d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 29 Nov 2004 03:22:44 +0000 Subject: r3990: take advantage of the uid->sid and gid->sid code to create a much better default NT ACL in pvfs (This used to be commit 9ff6ecbdb6c08528193f7958d7ea7d9a8df6defd) --- source4/ntvfs/posix/vfs_posix.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index e340e8cbf6..ff3d3448f2 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -130,6 +130,11 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, return NT_STATUS_INTERNAL_DB_CORRUPTION; } + pvfs->sidmap = sidmap_open(pvfs); + if (pvfs->sidmap == NULL) { + return NT_STATUS_INTERNAL_DB_CORRUPTION; + } + /* allocate the fnum id -> ptr tree */ pvfs->idtree_fnum = idr_init(pvfs); if (pvfs->idtree_fnum == NULL) { -- cgit From 50005129ab0a5c5f2422460e6d7c19616e5e1124 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 17 Dec 2004 03:39:29 +0000 Subject: r4242: added support for storing xattrs in a tdb. This allows all advanced NT attributes (streams, EAs, NT ACLs, timestamps etc) to be used on filesystems that don't support xattrs. It also allows for large streams, although they are very inefficient. I won't enable this by default, as I really wrote it as a way of testing large stream support while still using ext3, but perhaps with a bit more work this could be generally usable. To enable this use: posix:eadb = /home/test/myeas.tdb (This used to be commit 0c927d912cb65754351189d3a0442004a14aa5c6) --- source4/ntvfs/posix/vfs_posix.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index ff3d3448f2..6f4de1e038 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -35,6 +35,7 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) { int snum = pvfs->tcon->service; int delay; + const char *eadb; if (lp_map_hidden(snum)) pvfs->flags |= PVFS_FLAG_MAP_HIDDEN; if (lp_map_archive(snum)) pvfs->flags |= PVFS_FLAG_MAP_ARCHIVE; @@ -66,6 +67,21 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) FS_ATTR_UNICODE_ON_DISK | FS_ATTR_SPARSE_FILES; + /* allow xattrs to be stored in a external tdb */ + eadb = lp_parm_string(snum, "posix", "eadb"); + if (eadb != NULL) { + pvfs->ea_db = tdb_wrap_open(pvfs, eadb, 50000, + TDB_DEFAULT, O_RDWR|O_CREAT, 0600); + if (pvfs->ea_db != NULL) { + pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; + } else { + DEBUG(0,("Failed to open eadb '%s' - %s\n", + eadb, strerror(errno))); + pvfs->flags &= ~PVFS_FLAG_XATTR_ENABLE; + } + } + + if (pvfs->flags & PVFS_FLAG_XATTR_ENABLE) { pvfs->fs_attribs |= FS_ATTR_NAMED_STREAMS; } -- cgit From 0128bd6d3f06fd433ec3747686da1e1a1133ab3d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 31 Dec 2004 01:03:57 +0000 Subject: r4423: give lp_parm_int() and lp_parm_ulong() default values metze (This used to be commit c44f4d44b51789916e50c9da93046d0a15245edc) --- source4/ntvfs/posix/vfs_posix.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 6f4de1e038..eecc379064 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -34,7 +34,6 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) { int snum = pvfs->tcon->service; - int delay; const char *eadb; if (lp_map_hidden(snum)) pvfs->flags |= PVFS_FLAG_MAP_HIDDEN; @@ -53,11 +52,7 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) if (lp_parm_bool(snum, "posix", "xattr", True)) pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; #endif - pvfs->sharing_violation_delay = 1000000; - delay = lp_parm_int(snum, "posix", "sharedelay"); - if (delay != -1) { - pvfs->sharing_violation_delay = delay; - } + pvfs->sharing_violation_delay = lp_parm_int(snum, "posix", "sharedelay", 1000000); pvfs->share_name = talloc_strdup(pvfs, lp_servicename(snum)); @@ -81,7 +76,6 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) } } - if (pvfs->flags & PVFS_FLAG_XATTR_ENABLE) { pvfs->fs_attribs |= FS_ATTR_NAMED_STREAMS; } -- cgit From d4b16573966d2b5e45a3a83d75fe0827ce9dc4be Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 1 Jan 2005 04:25:46 +0000 Subject: r4464: added pvfs backend support for the special CREATOR_OWNER and CREATOR_GROUP inheritance rules (This used to be commit 0a29fb45c310b4b8c348d187b8ff1833deaac6c3) --- source4/ntvfs/posix/vfs_posix.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index eecc379064..e5bdc3faae 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -26,6 +26,7 @@ #include "includes.h" #include "vfs_posix.h" +#include "librpc/gen_ndr/ndr_security.h" /* @@ -82,6 +83,9 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) if (pvfs->flags & PVFS_FLAG_XATTR_ENABLE) { pvfs->fs_attribs |= FS_ATTR_PERSISTANT_ACLS; } + + pvfs->sid_cache.creator_owner = dom_sid_parse_talloc(pvfs, SID_CREATOR_OWNER); + pvfs->sid_cache.creator_group = dom_sid_parse_talloc(pvfs, SID_CREATOR_GROUP); } -- cgit From 9327ec51d11855ec0ceac3ce1f4e0a75c8b57081 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 14 Jan 2005 01:32:56 +0000 Subject: r4728: split up server_services into: - stream_socket services the smb, ldap and rpc service which sets up a srtam socket end then waits for connections and - task services which this you can create a seperate task that do something (this is also going through the process_model subsystem so with -M standard a new process for this created with -M thread a new thread ... I'll add datagram services later when we whave support for datagram sockets in lib/socket/ see the next commit as an example for service_task's metze (This used to be commit d5fa02746c6569b09b6e05785642da2fad3ba3e0) --- source4/ntvfs/posix/vfs_posix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index e5bdc3faae..0b642adb01 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -130,16 +130,16 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, ntvfs->private_data = pvfs; pvfs->brl_context = brl_init(pvfs, - pvfs->tcon->smb_conn->connection->server_id, + pvfs->tcon->smb_conn->connection->connection.id, pvfs->tcon->service, - pvfs->tcon->smb_conn->connection->messaging_ctx); + pvfs->tcon->smb_conn->connection->messaging.ctx); if (pvfs->brl_context == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } pvfs->odb_context = odb_init(pvfs, - pvfs->tcon->smb_conn->connection->server_id, - pvfs->tcon->smb_conn->connection->messaging_ctx); + pvfs->tcon->smb_conn->connection->connection.id, + pvfs->tcon->smb_conn->connection->messaging.ctx); if (pvfs->odb_context == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } -- cgit From 759da3b915e2006d4c87b5ace47f399accd9ce91 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 27 Jan 2005 07:08:20 +0000 Subject: r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the large commit. I thought this was worthwhile to get done for consistency. (This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0) --- source4/ntvfs/posix/vfs_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 0b642adb01..314f9736a3 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -104,7 +104,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, char *base_directory; NTSTATUS status; - pvfs = talloc_zero_p(tcon, struct pvfs_state); + pvfs = talloc_zero(tcon, struct pvfs_state); if (pvfs == NULL) { return NT_STATUS_NO_MEMORY; } -- cgit From 55d4d36993293fee914a009f1d8f05810e347f2b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 30 Jan 2005 00:54:57 +0000 Subject: r5102: This is a major simplification of the logic for controlling top level servers in smbd. The old code still contained a fairly bit of legacy from the time when smbd was only handling SMB connection. The new code gets rid of all of the smb_server specific code in smbd/, and creates a much simpler infrastructures for new server code. Major changes include: - simplified the process model code a lot. - got rid of the top level server and service structures completely. The top level context is now the event_context. This got rid of service.h and server.h completely (they were the most confusing parts of the old code) - added service_stream.[ch] for the helper functions that are specific to stream type services (services that handle streams, and use a logically separate process per connection) - got rid of the builtin idle_handler code in the service logic, as none of the servers were using it, and it can easily be handled by a server in future by adding its own timed_event to the event context. - fixed some major memory leaks in the rpc server code. - added registration of servers, rather than hard coding our list of possible servers. This allows for servers as modules in the future. - temporarily disabled the winbind code until I add the helper functions for that type of server - added error checking on service startup. If a configured server fails to startup then smbd doesn't startup. - cleaned up the command line handling in smbd, removing unused options (This used to be commit cf6a46c3cbde7b1eb1b86bd3882b953a2de3a42e) --- source4/ntvfs/posix/vfs_posix.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 314f9736a3..0ed878c1f0 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -27,6 +27,7 @@ #include "includes.h" #include "vfs_posix.h" #include "librpc/gen_ndr/ndr_security.h" +#include "smbd/service_stream.h" /* @@ -130,16 +131,16 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, ntvfs->private_data = pvfs; pvfs->brl_context = brl_init(pvfs, - pvfs->tcon->smb_conn->connection->connection.id, + pvfs->tcon->smb_conn->connection->server_id, pvfs->tcon->service, - pvfs->tcon->smb_conn->connection->messaging.ctx); + pvfs->tcon->smb_conn->connection->msg_ctx); if (pvfs->brl_context == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } pvfs->odb_context = odb_init(pvfs, - pvfs->tcon->smb_conn->connection->connection.id, - pvfs->tcon->smb_conn->connection->messaging.ctx); + pvfs->tcon->smb_conn->connection->server_id, + pvfs->tcon->smb_conn->connection->msg_ctx); if (pvfs->odb_context == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } -- cgit From fedf0b0d91fdf2a6ae0ef47acd4047f662bd3374 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 10 Feb 2005 03:48:43 +0000 Subject: r5296: - only include the tdb headers where they are needed - removed the u32 hack in events.c as I think this was only needed as tdb.h defines u32. Metze, can you check that this hack is indeed no longer needed on your suse system? (This used to be commit 6f79432fe656164d4770dbce114a30dda5e7bf9a) --- source4/ntvfs/posix/vfs_posix.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 0ed878c1f0..529ff7a98b 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -28,6 +28,7 @@ #include "vfs_posix.h" #include "librpc/gen_ndr/ndr_security.h" #include "smbd/service_stream.h" +#include "lib/tdb/include/tdb.h" /* -- cgit From 218f289ed75e9e10feadb92fbbb41e69025ab010 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 22 Feb 2005 11:35:38 +0000 Subject: r5501: check the return of talloc with the NT_STATUS_HAVE_NO_MEMORY() macro... metze (This used to be commit 9ec6c0e97765e60ef195296f17d6a27b5d0dcca9) --- source4/ntvfs/posix/vfs_posix.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 529ff7a98b..ec8db07d01 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -107,12 +107,11 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, NTSTATUS status; pvfs = talloc_zero(tcon, struct pvfs_state); - if (pvfs == NULL) { - return NT_STATUS_NO_MEMORY; - } + NT_STATUS_HAVE_NO_MEMORY(pvfs); /* for simplicity of path construction, remove any trailing slash now */ base_directory = talloc_strdup(pvfs, lp_pathname(tcon->service)); + NT_STATUS_HAVE_NO_MEMORY(base_directory); trim_string(base_directory, NULL, "/"); pvfs->tcon = tcon; @@ -127,7 +126,10 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, } tcon->fs_type = talloc_strdup(tcon, "NTFS"); + NT_STATUS_HAVE_NO_MEMORY(tcon->fs_type); + tcon->dev_type = talloc_strdup(tcon, "A:"); + NT_STATUS_HAVE_NO_MEMORY(tcon->dev_type); ntvfs->private_data = pvfs; @@ -153,20 +155,14 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, /* allocate the fnum id -> ptr tree */ pvfs->idtree_fnum = idr_init(pvfs); - if (pvfs->idtree_fnum == NULL) { - return NT_STATUS_NO_MEMORY; - } + NT_STATUS_HAVE_NO_MEMORY(pvfs->idtree_fnum); /* allocate the search handle -> ptr tree */ pvfs->idtree_search = idr_init(pvfs); - if (pvfs->idtree_search == NULL) { - return NT_STATUS_NO_MEMORY; - } + NT_STATUS_HAVE_NO_MEMORY(pvfs->idtree_search); status = pvfs_mangle_init(pvfs); - if (!NT_STATUS_IS_OK(status)) { - return status; - } + NT_STATUS_NOT_OK_RETURN(status); pvfs_setup_options(pvfs); @@ -200,9 +196,7 @@ static NTSTATUS pvfs_chkpath(struct ntvfs_module_context *ntvfs, /* resolve the cifs name to a posix name */ status = pvfs_resolve_name(pvfs, req, cp->in.path, 0, &name); - if (!NT_STATUS_IS_OK(status)) { - return status; - } + NT_STATUS_NOT_OK_RETURN(status); if (!name->exists) { return NT_STATUS_OBJECT_NAME_NOT_FOUND; -- cgit From 46727924a0ca1c255311121e8f0e2ecf7a66db1a Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Tue, 3 May 2005 13:02:14 +0000 Subject: r6599: Fix formating using 'linux' C style Fix memory handling for blkid caches which need to be cleared when session is done. (This used to be commit c623cc60541f747f0a801eb77d97bb0a3bb6956f) --- source4/ntvfs/posix/vfs_posix.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index ec8db07d01..1d3979aabf 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -88,6 +88,9 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) pvfs->sid_cache.creator_owner = dom_sid_parse_talloc(pvfs, SID_CREATOR_OWNER); pvfs->sid_cache.creator_group = dom_sid_parse_talloc(pvfs, SID_CREATOR_GROUP); +#ifdef HAVE_BLKID + pvfs->blkid_cache = NULL; +#endif } -- cgit From f29b9278bb782b48c4f31dd7d42dc530ce598969 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 14 Jun 2005 01:11:24 +0000 Subject: r7557: trigger a probe at tconx time to see if xattrs are really supported by the filesystem (This used to be commit 71e281ae2fe2ce169aeb09f72376a60d28845808) --- source4/ntvfs/posix/vfs_posix.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 1d3979aabf..846ba61a86 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -91,6 +91,11 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) #ifdef HAVE_BLKID pvfs->blkid_cache = NULL; #endif + + /* check if the system really supports xattrs */ + if (pvfs->flags & PVFS_FLAG_XATTR_ENABLE) { + pvfs_xattr_probe(pvfs); + } } -- cgit From 51b1451cbaf7b27af1d5f1a5f5a42430afe99234 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 21 Jun 2005 04:23:05 +0000 Subject: r7792: make the allocation size rounding in pvfs configurable (This used to be commit 1f35642bed1129d0834906b3e94e8868992d6eb9) --- source4/ntvfs/posix/vfs_posix.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 846ba61a86..906428fc6d 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -51,6 +51,9 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) pvfs->flags |= PVFS_FLAG_FAKE_OPLOCKS; } + /* this must be a power of 2 */ + pvfs->alloc_size_rounding = lp_parm_int(-1, "posix", "allocationrounding", 512); + #if HAVE_XATTR_SUPPORT if (lp_parm_bool(snum, "posix", "xattr", True)) pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; #endif -- cgit From 5e40d0187b86f758b0fa744365e657ec6ee40ff5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 21 Jun 2005 04:33:24 +0000 Subject: r7795: use a share specific allocation rounding (This used to be commit 9adacb0d1620d4cfadd515239b853977cf03a719) --- source4/ntvfs/posix/vfs_posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 906428fc6d..ac12f3853f 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -52,7 +52,8 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) } /* this must be a power of 2 */ - pvfs->alloc_size_rounding = lp_parm_int(-1, "posix", "allocationrounding", 512); + pvfs->alloc_size_rounding = lp_parm_int(snum, + "posix", "allocationrounding", 512); #if HAVE_XATTR_SUPPORT if (lp_parm_bool(snum, "posix", "xattr", True)) pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; -- cgit From b37e82567d28626d39ce02c392d09a815cce497f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 18 Jul 2005 03:35:52 +0000 Subject: r8535: no longer rely on seekdir working after a closedir. Instead, keep directories open, but close search states based on an inactivity timer, with a default of a 5 minute timeout (This used to be commit 2e8d154e7dfb9b320a1344e957a39e96e1eefadd) --- source4/ntvfs/posix/vfs_posix.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index ac12f3853f..a4b15e3c57 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -55,6 +55,9 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) pvfs->alloc_size_rounding = lp_parm_int(snum, "posix", "allocationrounding", 512); + pvfs->search_inactivity_time = lp_parm_int(snum, + "posix", "searchinactivity", 300); + #if HAVE_XATTR_SUPPORT if (lp_parm_bool(snum, "posix", "xattr", True)) pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; #endif -- cgit From 3c016355e44afbb10ee02b9ba09e107355b27f7a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Dec 2005 14:53:56 +0000 Subject: r12019: - let us only reference libblkid stuff in one file - and make it it bit simpler, by caching the GUID struct instead of the device name - and this also removes all compiler warnings... metze (This used to be commit f4f0d626e00116e85a91962bf8534c1fbb69334c) --- source4/ntvfs/posix/vfs_posix.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index a4b15e3c57..bedc81389c 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -95,9 +95,6 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) pvfs->sid_cache.creator_owner = dom_sid_parse_talloc(pvfs, SID_CREATOR_OWNER); pvfs->sid_cache.creator_group = dom_sid_parse_talloc(pvfs, SID_CREATOR_GROUP); -#ifdef HAVE_BLKID - pvfs->blkid_cache = NULL; -#endif /* check if the system really supports xattrs */ if (pvfs->flags & PVFS_FLAG_XATTR_ENABLE) { -- cgit From 5bfa7bef7d48ff3c12c70f099a7c5c348ab64906 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 24 Jan 2006 00:34:58 +0000 Subject: r13099: allow shares that point to / (This used to be commit ac4b8b98392cba69d0d06bce8e9023769ee301d8) --- source4/ntvfs/posix/vfs_posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index bedc81389c..3b52ff6237 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -124,7 +124,9 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, /* for simplicity of path construction, remove any trailing slash now */ base_directory = talloc_strdup(pvfs, lp_pathname(tcon->service)); NT_STATUS_HAVE_NO_MEMORY(base_directory); - trim_string(base_directory, NULL, "/"); + if (strcmp(base_directory, "/") != 0) { + trim_string(base_directory, NULL, "/"); + } pvfs->tcon = tcon; pvfs->base_directory = base_directory; -- cgit From 4ac2be99588b48b0652a524bf12fb1aa9c3f5fbb Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 7 Mar 2006 11:07:23 +0000 Subject: r13924: Split more prototypes out of include/proto.h + initial work on header file dependencies (This used to be commit 122835876748a3eaf5e8d31ad1abddab9acb8781) --- source4/ntvfs/posix/vfs_posix.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 3b52ff6237..e600be446a 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -29,6 +29,8 @@ #include "librpc/gen_ndr/ndr_security.h" #include "smbd/service_stream.h" #include "lib/tdb/include/tdb.h" +#include "db_wrap.h" +#include "libcli/security/proto.h" /* -- cgit From 86497db6113c4ec3210d671c3fcf957d1026098c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 10 Mar 2006 14:31:17 +0000 Subject: r14157: - pass a struct ntvfs_request to the ntvfs layer (for now we just do #define ntvfs_request smbsrv_request, but it's the first step...) - rename ntvfs_openfile() -> ntvfs_open() - fix the talloc hierachie in some places in the ntvfs_map_*() code metze (This used to be commit ed9ed1f48f602354810937c0b0de850b44322191) --- source4/ntvfs/posix/vfs_posix.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index e600be446a..66fbc4bb4c 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -112,7 +112,7 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) that comes later) */ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, - struct smbsrv_request *req, const char *sharename) + struct ntvfs_request *req, const char *sharename) { struct smbsrv_tcon *tcon = req->tcon; struct pvfs_state *pvfs; @@ -194,8 +194,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, /* disconnect from a share */ -static NTSTATUS pvfs_disconnect(struct ntvfs_module_context *ntvfs, - struct smbsrv_tcon *tcon) +static NTSTATUS pvfs_disconnect(struct ntvfs_module_context *ntvfs) { return NT_STATUS_OK; } @@ -204,7 +203,7 @@ static NTSTATUS pvfs_disconnect(struct ntvfs_module_context *ntvfs, check if a directory exists */ static NTSTATUS pvfs_chkpath(struct ntvfs_module_context *ntvfs, - struct smbsrv_request *req, struct smb_chkpath *cp) + struct ntvfs_request *req, struct smb_chkpath *cp) { struct pvfs_state *pvfs = ntvfs->private_data; struct pvfs_filename *name; @@ -229,7 +228,7 @@ static NTSTATUS pvfs_chkpath(struct ntvfs_module_context *ntvfs, copy a set of files */ static NTSTATUS pvfs_copy(struct ntvfs_module_context *ntvfs, - struct smbsrv_request *req, struct smb_copy *cp) + struct ntvfs_request *req, struct smb_copy *cp) { DEBUG(0,("pvfs_copy not implemented\n")); return NT_STATUS_NOT_SUPPORTED; @@ -239,14 +238,14 @@ static NTSTATUS pvfs_copy(struct ntvfs_module_context *ntvfs, return print queue info */ static NTSTATUS pvfs_lpq(struct ntvfs_module_context *ntvfs, - struct smbsrv_request *req, union smb_lpq *lpq) + struct ntvfs_request *req, union smb_lpq *lpq) { return NT_STATUS_NOT_SUPPORTED; } /* SMBtrans - not used on file shares */ static NTSTATUS pvfs_trans(struct ntvfs_module_context *ntvfs, - struct smbsrv_request *req, struct smb_trans2 *trans2) + struct ntvfs_request *req, struct smb_trans2 *trans2) { return NT_STATUS_ACCESS_DENIED; } @@ -270,7 +269,7 @@ NTSTATUS ntvfs_posix_init(void) ops.chkpath = pvfs_chkpath; ops.qpathinfo = pvfs_qpathinfo; ops.setpathinfo = pvfs_setpathinfo; - ops.openfile = pvfs_open; + ops.open = pvfs_open; ops.mkdir = pvfs_mkdir; ops.rmdir = pvfs_rmdir; ops.rename = pvfs_rename; -- cgit From 307e43bb5628e8b53a930c2928279af994281ba5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 10 Mar 2006 20:49:20 +0000 Subject: r14173: change smb interface structures to always use a union smb_file, to abtract - const char *path fot qpathinfo and setpathinfo - uint16_t fnum for SMB - smb2_handle handle for SMB2 the idea is to later add a struct ntvfs_handle *ntvfs so that the ntvfs subsystem don't need to know the difference between SMB and SMB2 metze (This used to be commit 2ef3f5970901b5accdb50f0d0115b5d46b0c788f) --- source4/ntvfs/posix/vfs_posix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 66fbc4bb4c..ba53dc65e0 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -203,14 +203,15 @@ static NTSTATUS pvfs_disconnect(struct ntvfs_module_context *ntvfs) check if a directory exists */ static NTSTATUS pvfs_chkpath(struct ntvfs_module_context *ntvfs, - struct ntvfs_request *req, struct smb_chkpath *cp) + struct ntvfs_request *req, + union smb_chkpath *cp) { struct pvfs_state *pvfs = ntvfs->private_data; struct pvfs_filename *name; NTSTATUS status; /* resolve the cifs name to a posix name */ - status = pvfs_resolve_name(pvfs, req, cp->in.path, 0, &name); + status = pvfs_resolve_name(pvfs, req, cp->chkpath.in.path, 0, &name); NT_STATUS_NOT_OK_RETURN(status); if (!name->exists) { -- cgit From 2e7df84576d26bc37eb87b7e3c79fcb3fb358d68 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 15 Mar 2006 17:28:46 +0000 Subject: r14456: don't access the smbsrv_tcon inside the ntvfs modules metze (This used to be commit 5709c1c4e1a561dd9af98cfefbbbdac9b18765b7) --- source4/ntvfs/posix/vfs_posix.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index ba53dc65e0..31588fdf78 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -38,7 +38,7 @@ */ static void pvfs_setup_options(struct pvfs_state *pvfs) { - int snum = pvfs->tcon->service; + int snum = pvfs->ntvfs->ctx->config.snum; const char *eadb; if (lp_map_hidden(snum)) pvfs->flags |= PVFS_FLAG_MAP_HIDDEN; @@ -114,23 +114,22 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, const char *sharename) { - struct smbsrv_tcon *tcon = req->tcon; struct pvfs_state *pvfs; struct stat st; char *base_directory; NTSTATUS status; - pvfs = talloc_zero(tcon, struct pvfs_state); + pvfs = talloc_zero(ntvfs, struct pvfs_state); NT_STATUS_HAVE_NO_MEMORY(pvfs); /* for simplicity of path construction, remove any trailing slash now */ - base_directory = talloc_strdup(pvfs, lp_pathname(tcon->service)); + base_directory = talloc_strdup(pvfs, lp_pathname(ntvfs->ctx->config.snum)); NT_STATUS_HAVE_NO_MEMORY(base_directory); if (strcmp(base_directory, "/") != 0) { trim_string(base_directory, NULL, "/"); } - pvfs->tcon = tcon; + pvfs->ntvfs = ntvfs; pvfs->base_directory = base_directory; /* the directory must exist. Note that we deliberately don't @@ -141,25 +140,25 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, return NT_STATUS_BAD_NETWORK_NAME; } - tcon->fs_type = talloc_strdup(tcon, "NTFS"); - NT_STATUS_HAVE_NO_MEMORY(tcon->fs_type); + ntvfs->ctx->fs_type = talloc_strdup(ntvfs->ctx, "NTFS"); + NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->fs_type); - tcon->dev_type = talloc_strdup(tcon, "A:"); - NT_STATUS_HAVE_NO_MEMORY(tcon->dev_type); + ntvfs->ctx->dev_type = talloc_strdup(ntvfs->ctx, "A:"); + NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->dev_type); ntvfs->private_data = pvfs; pvfs->brl_context = brl_init(pvfs, - pvfs->tcon->smb_conn->connection->server_id, - pvfs->tcon->service, - pvfs->tcon->smb_conn->connection->msg_ctx); + pvfs->ntvfs->ctx->server_id, + pvfs->ntvfs->ctx->config.snum, + pvfs->ntvfs->ctx->msg_ctx); if (pvfs->brl_context == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } pvfs->odb_context = odb_init(pvfs, - pvfs->tcon->smb_conn->connection->server_id, - pvfs->tcon->smb_conn->connection->msg_ctx); + pvfs->ntvfs->ctx->server_id, + pvfs->ntvfs->ctx->msg_ctx); if (pvfs->odb_context == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } -- cgit From 8528016978b084213ef53d66e1b6e831b1a01acc Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 16 Mar 2006 00:23:11 +0000 Subject: r14464: Don't include ndr_BASENAME.h files unless strictly required, instead try to include just the BASENAME.h files (containing only structs) (This used to be commit 3dd477ca5147f28a962b8437e2611a8222d706bd) --- source4/ntvfs/posix/vfs_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 31588fdf78..3f1c676df3 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -26,7 +26,7 @@ #include "includes.h" #include "vfs_posix.h" -#include "librpc/gen_ndr/ndr_security.h" +#include "librpc/gen_ndr/security.h" #include "smbd/service_stream.h" #include "lib/tdb/include/tdb.h" #include "db_wrap.h" -- cgit From 75140d6150264ba50a47e104c3ce1ae40bd3f0c8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 18 Mar 2006 10:38:38 +0000 Subject: r14540: fix a talloc hierachie problem, make sure file and search handles are cleaned up before anything else in the pvfs_state struct, as there destructors reply on a valid pvfs_state struct metze (This used to be commit aaa5d377b9b6145a83c0e686c7fbb7b561ae8988) --- source4/ntvfs/posix/vfs_posix.c | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 3f1c676df3..cb441cb4c9 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -57,7 +57,7 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) pvfs->alloc_size_rounding = lp_parm_int(snum, "posix", "allocationrounding", 512); - pvfs->search_inactivity_time = lp_parm_int(snum, + pvfs->search.inactivity_time = lp_parm_int(snum, "posix", "searchinactivity", 300); #if HAVE_XATTR_SUPPORT @@ -104,6 +104,28 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) } } +static int pvfs_state_destructor(void *ptr) +{ + struct pvfs_state *pvfs = talloc_get_type(ptr, struct pvfs_state); + struct pvfs_file *f, *fn; + struct pvfs_search_state *s, *sn; + + /* + * make sure we cleanup files and searches before anythingelse + * because there destructors need to acess the pvfs_state struct + */ + for (f=pvfs->files.list; f; f=fn) { + fn = f->next; + talloc_free(f); + } + + for (s=pvfs->search.list; s; s=sn) { + sn = s->next; + talloc_free(s); + } + + return 0; +} /* connect to a share - used when a tree_connect operation comes @@ -169,18 +191,20 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, } /* allocate the fnum id -> ptr tree */ - pvfs->idtree_fnum = idr_init(pvfs); - NT_STATUS_HAVE_NO_MEMORY(pvfs->idtree_fnum); + pvfs->files.idtree = idr_init(pvfs); + NT_STATUS_HAVE_NO_MEMORY(pvfs->files.idtree); /* allocate the search handle -> ptr tree */ - pvfs->idtree_search = idr_init(pvfs); - NT_STATUS_HAVE_NO_MEMORY(pvfs->idtree_search); + pvfs->search.idtree = idr_init(pvfs); + NT_STATUS_HAVE_NO_MEMORY(pvfs->search.idtree); status = pvfs_mangle_init(pvfs); NT_STATUS_NOT_OK_RETURN(status); pvfs_setup_options(pvfs); + talloc_set_destructor(pvfs, pvfs_state_destructor); + #ifdef SIGXFSZ /* who had the stupid idea to generate a signal on a large file write instead of just failing it!? */ -- cgit From 3434cd778c975eb1bb29d257770bd6dbb2335ce9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 21 Mar 2006 11:47:24 +0000 Subject: r14616: added notify change support to the posix backend It doesn't fully work yet, and doesn't yet have all the efficiency that is planned, but it doesn't break anything and I wanted to get the code in the tree to minimise the chance of collisions with the work metze is doing. (This used to be commit 1624ea88e6eef89caacc36e7513aa79df0d579b9) --- source4/ntvfs/posix/vfs_posix.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index cb441cb4c9..0469e54d35 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -185,6 +185,13 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, return NT_STATUS_INTERNAL_DB_CORRUPTION; } + pvfs->notify_context = notify_init(pvfs, + pvfs->ntvfs->ctx->server_id, + pvfs->ntvfs->ctx->msg_ctx); + if (pvfs->notify_context == NULL) { + return NT_STATUS_INTERNAL_DB_CORRUPTION; + } + pvfs->sidmap = sidmap_open(pvfs); if (pvfs->sidmap == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; @@ -317,6 +324,7 @@ NTSTATUS ntvfs_posix_init(void) ops.logoff = pvfs_logoff; ops.async_setup = pvfs_async_setup; ops.cancel = pvfs_cancel; + ops.notify = pvfs_notify; /* register ourselves with the NTVFS subsystem. We register under the name 'default' as we wish to be the default -- cgit From ad06a8bd651e3a8b598c92a356ac1ce4117ae72e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 26 Mar 2006 01:23:40 +0000 Subject: r14736: - the ntvfs subsystem should not know about smb_server.h - the process module subsystem should not know about smb_server.h - the smb_server module should not know about process models metze (This used to be commit bac95bb8f4ad35a31ee666f5916ff9b2f292d964) --- source4/ntvfs/posix/vfs_posix.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 0469e54d35..28cf2cc6cd 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -27,7 +27,6 @@ #include "includes.h" #include "vfs_posix.h" #include "librpc/gen_ndr/security.h" -#include "smbd/service_stream.h" #include "lib/tdb/include/tdb.h" #include "db_wrap.h" #include "libcli/security/proto.h" -- cgit From 1af925f394b1084779f5b1b5a10c2ec512d7e5be Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 2 Apr 2006 12:02:01 +0000 Subject: r14860: create libcli/security/security.h metze (This used to be commit 9ec706238c173992dc938d537bdf1103bf519dbf) --- source4/ntvfs/posix/vfs_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 28cf2cc6cd..d161dac5a4 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -29,7 +29,7 @@ #include "librpc/gen_ndr/security.h" #include "lib/tdb/include/tdb.h" #include "db_wrap.h" -#include "libcli/security/proto.h" +#include "libcli/security/security.h" /* -- cgit From 6d98076c15e8726606da0a99714cd3382d82f9ac Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 3 Apr 2006 06:46:55 +0000 Subject: r14877: added support for the kernel inotify mechanism. This passes basic tests, but still needs some more work to ensure we correctly cope with events that may generate both a system inotify event and a internal notify event. The system inotify events won't handle recursion, and don't understand things like streams. This also adds the ntvfs/sysdep/ directory, which is meant for system dependent code that is not tied to a particular ntvfs backend. The inotify code is a good example of that. (This used to be commit eadadbb44adb3c4081d6ff1d85a9b850a0227059) --- source4/ntvfs/posix/vfs_posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index d161dac5a4..c279350e2f 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -30,6 +30,7 @@ #include "lib/tdb/include/tdb.h" #include "db_wrap.h" #include "libcli/security/security.h" +#include "lib/events/events.h" /* @@ -186,7 +187,8 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, pvfs->notify_context = notify_init(pvfs, pvfs->ntvfs->ctx->server_id, - pvfs->ntvfs->ctx->msg_ctx); + pvfs->ntvfs->ctx->msg_ctx, + event_context_find(pvfs)); if (pvfs->notify_context == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } -- cgit From e54abee4e19538760119e8e63eb23f78fd88da4f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 6 Apr 2006 01:56:04 +0000 Subject: r14933: fix the handling of notify filters to be much closer to the behaviour of w2k3. The behaviour is particularly tricky for rename. (This used to be commit 4d3b8d95498a328ffc08ecb62d9531b6bfe4e2b5) --- source4/ntvfs/posix/vfs_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index c279350e2f..c0c1d6501c 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -111,7 +111,7 @@ static int pvfs_state_destructor(void *ptr) struct pvfs_search_state *s, *sn; /* - * make sure we cleanup files and searches before anythingelse + * make sure we cleanup files and searches before anything else * because there destructors need to acess the pvfs_state struct */ for (f=pvfs->files.list; f; f=fn) { -- cgit From fa91368fb4ea2c31f6e1b1037f1bd16ef9f3ba98 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 6 Apr 2006 10:12:36 +0000 Subject: r14945: allow the notify backend to be specified per share (This used to be commit 467027e7730a3bc56f152df7e2ec272905e19584) --- source4/ntvfs/posix/vfs_posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index c0c1d6501c..3e141219f4 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -188,7 +188,8 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, pvfs->notify_context = notify_init(pvfs, pvfs->ntvfs->ctx->server_id, pvfs->ntvfs->ctx->msg_ctx, - event_context_find(pvfs)); + event_context_find(pvfs), + pvfs->ntvfs->ctx->config.snum); if (pvfs->notify_context == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } -- cgit From cd794e79f999b3b7b639c4fe89ea1af23ed362f6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 7 Apr 2006 11:25:21 +0000 Subject: r14959: allow change notify to be disabled completely using notify:enable=False (This used to be commit 2a8f093105f3047a3697f29aadcc9c48c6ac88e1) --- source4/ntvfs/posix/vfs_posix.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 3e141219f4..dd8c3fe81f 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -185,14 +185,12 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, return NT_STATUS_INTERNAL_DB_CORRUPTION; } + /* allow this to be NULL - we just disable change notify */ pvfs->notify_context = notify_init(pvfs, pvfs->ntvfs->ctx->server_id, pvfs->ntvfs->ctx->msg_ctx, event_context_find(pvfs), pvfs->ntvfs->ctx->config.snum); - if (pvfs->notify_context == NULL) { - return NT_STATUS_INTERNAL_DB_CORRUPTION; - } pvfs->sidmap = sidmap_open(pvfs); if (pvfs->sidmap == NULL) { -- cgit From 2e894625e7c951b5ee66670124b4bef82a8129d9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 7 Apr 2006 13:15:46 +0000 Subject: r14964: - move sidmap code from ntvfs_common to SAMDB - make ntvfs_common a library - create sys_notify library metze (This used to be commit a3e1d56cf7b688c515f5d6d4d43e0b24c2261d15) --- source4/ntvfs/posix/vfs_posix.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index dd8c3fe81f..c4d4d11c04 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -332,11 +332,19 @@ NTSTATUS ntvfs_posix_init(void) ops.name = "default"; ret = ntvfs_register(&ops); + if (!NT_STATUS_IS_OK(ret)) { + DEBUG(0,("Failed to register POSIX backend as '%s'!\n", ops.name)); + } + ops.name = "posix"; ret = ntvfs_register(&ops); if (!NT_STATUS_IS_OK(ret)) { - DEBUG(0,("Failed to register POSIX backend!\n")); + DEBUG(0,("Failed to register POSIX backend as '%s'!\n", ops.name)); + } + + if (NT_STATUS_IS_OK(ret)) { + ret = ntvfs_common_init(); } return ret; -- cgit From 289911bb4e7980bf42cc87305d3f94477c5f2b75 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 12 Apr 2006 04:42:40 +0000 Subject: r15048: started on the server side implementation of oplocks. The code is not functional yet, I'm committing so it doesn't diverge too much from other peoples work. It is disabled by default. (This used to be commit ba0b8a218dfe1ef6cdf7de724fb30650301369dd) --- source4/ntvfs/posix/vfs_posix.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index c4d4d11c04..eddc49c919 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -178,9 +178,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - pvfs->odb_context = odb_init(pvfs, - pvfs->ntvfs->ctx->server_id, - pvfs->ntvfs->ctx->msg_ctx); + pvfs->odb_context = odb_init(pvfs, pvfs->ntvfs->ctx); if (pvfs->odb_context == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } -- cgit From f380d365eaad89db2c46331a3fa2d5d8600aeba1 Mon Sep 17 00:00:00 2001 From: James Peach Date: Sun, 23 Apr 2006 23:44:14 +0000 Subject: r15185: Force all NTVFS modules to provide a critical sizes structure so the version information can be checked when modules are registered. (This used to be commit 95eb55806339fc5409c0adf137ebd5bffd7098ac) --- source4/ntvfs/posix/vfs_posix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index eddc49c919..2d40ceb85d 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -286,6 +286,7 @@ NTSTATUS ntvfs_posix_init(void) { NTSTATUS ret; struct ntvfs_ops ops; + NTVFS_CURRENT_CRITICAL_SIZES(vers); ZERO_STRUCT(ops); @@ -328,14 +329,14 @@ NTSTATUS ntvfs_posix_init(void) under the name 'default' as we wish to be the default backend, and also register as 'posix' */ ops.name = "default"; - ret = ntvfs_register(&ops); + ret = ntvfs_register(&ops, &vers); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register POSIX backend as '%s'!\n", ops.name)); } ops.name = "posix"; - ret = ntvfs_register(&ops); + ret = ntvfs_register(&ops, &vers); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register POSIX backend as '%s'!\n", ops.name)); -- cgit From 6ab33938d5239e8688440f65e802f627622d301b Mon Sep 17 00:00:00 2001 From: James Peach Date: Mon, 24 Apr 2006 00:16:51 +0000 Subject: r15186: Introduce ISDOT and ISDOTDOT macros for testing whether a filename is "." for "..". These express the intention better that strcmp or strequal and improve searchability via cscope/ctags. (This used to be commit 7e4ad7e8e5ec266b969e3075c4ad7f021571f24e) --- source4/ntvfs/posix/vfs_posix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 2d40ceb85d..eddc49c919 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -286,7 +286,6 @@ NTSTATUS ntvfs_posix_init(void) { NTSTATUS ret; struct ntvfs_ops ops; - NTVFS_CURRENT_CRITICAL_SIZES(vers); ZERO_STRUCT(ops); @@ -329,14 +328,14 @@ NTSTATUS ntvfs_posix_init(void) under the name 'default' as we wish to be the default backend, and also register as 'posix' */ ops.name = "default"; - ret = ntvfs_register(&ops, &vers); + ret = ntvfs_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register POSIX backend as '%s'!\n", ops.name)); } ops.name = "posix"; - ret = ntvfs_register(&ops, &vers); + ret = ntvfs_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register POSIX backend as '%s'!\n", ops.name)); -- cgit From 7baa8a13aa751e2a1de287d43de0884ea638f04e Mon Sep 17 00:00:00 2001 From: James Peach Date: Mon, 24 Apr 2006 01:26:31 +0000 Subject: r15188: Restore svn rev. 15183, 15184 and 15185, which I inadvertantly clobbered in r15186. I don't think I should be allowed to use quilt and svn at the same time any more :( (This used to be commit e0ca5ead27743c84f5d9310a05d6d718862ead1d) --- source4/ntvfs/posix/vfs_posix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index eddc49c919..2d40ceb85d 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -286,6 +286,7 @@ NTSTATUS ntvfs_posix_init(void) { NTSTATUS ret; struct ntvfs_ops ops; + NTVFS_CURRENT_CRITICAL_SIZES(vers); ZERO_STRUCT(ops); @@ -328,14 +329,14 @@ NTSTATUS ntvfs_posix_init(void) under the name 'default' as we wish to be the default backend, and also register as 'posix' */ ops.name = "default"; - ret = ntvfs_register(&ops); + ret = ntvfs_register(&ops, &vers); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register POSIX backend as '%s'!\n", ops.name)); } ops.name = "posix"; - ret = ntvfs_register(&ops); + ret = ntvfs_register(&ops, &vers); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register POSIX backend as '%s'!\n", ops.name)); -- cgit From be0bd9fa336464e7c1fa2ab7cc5cd34075d595ce Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 15 May 2006 11:43:25 +0000 Subject: r15613: the snum doesn't identify the tcon, but the brl_context pointer does metze (This used to be commit 5e256f4b78441269de2e53c9582f3237e4220f6c) --- source4/ntvfs/posix/vfs_posix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 2d40ceb85d..eeee00313b 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -171,8 +171,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, ntvfs->private_data = pvfs; pvfs->brl_context = brl_init(pvfs, - pvfs->ntvfs->ctx->server_id, - pvfs->ntvfs->ctx->config.snum, + pvfs->ntvfs->ctx->server_id, pvfs->ntvfs->ctx->msg_ctx); if (pvfs->brl_context == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; -- cgit From 9ef33f5f5c786b83311ca088357fb2f0aa72fc9e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 20 May 2006 08:15:22 +0000 Subject: r15734: This is a major change to the NTVFS subsystem: - to use a struct ntvfs_handle instead of a uint16_t fnum. (to make it independend from the frontend protocol) - the allocation of handles now is provided by the frontend (smbsrv_*) via callbacks and not by each backend module - this also makes sure that file handles are only passed to the ntvfs subsystem when the tcon and session matches, so modules can rely on this and need to check this. - this allows multiple modules in the ntvfs module chain to allocate file handles. This can be used for virtual files like "\\$Extend\\$Quota:$Q:$INDEX_ALLOCATION"... - also this will make SMB2 with 128 bit file handles possible metze (This used to be commit 287fc1c22d670f6e568014b420f7f4cb31dc7958) --- source4/ntvfs/posix/vfs_posix.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index eeee00313b..1682a94ac9 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -194,10 +194,6 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - /* allocate the fnum id -> ptr tree */ - pvfs->files.idtree = idr_init(pvfs); - NT_STATUS_HAVE_NO_MEMORY(pvfs->files.idtree); - /* allocate the search handle -> ptr tree */ pvfs->search.idtree = idr_init(pvfs); NT_STATUS_HAVE_NO_MEMORY(pvfs->search.idtree); -- cgit From 92acfc07998da1546182579ad12a063f025c9286 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 24 May 2006 07:35:06 +0000 Subject: r15855: more talloc_set_destructor() typesafe fixes. nearly done ... (This used to be commit 396d82a231b6e3a91178db08b706626d4d4b420c) --- source4/ntvfs/posix/vfs_posix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 1682a94ac9..e7ef9bafd8 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -104,9 +104,8 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) } } -static int pvfs_state_destructor(void *ptr) +static int pvfs_state_destructor(struct pvfs_state *pvfs) { - struct pvfs_state *pvfs = talloc_get_type(ptr, struct pvfs_state); struct pvfs_file *f, *fn; struct pvfs_search_state *s, *sn; -- cgit From 9c66f601f1520a99b9236c32bc9f03a33bd4b2aa Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 23 Jul 2006 18:43:07 +0000 Subject: r17206: Add a modular API for share configuration. Commit the classic backwards compatible module which is the default one (This used to be commit a89cc346b9296cb49929898d257a064a6c2bae86) --- source4/ntvfs/posix/vfs_posix.c | 51 +++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 20 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index e7ef9bafd8..975649eeb5 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -38,35 +38,46 @@ */ static void pvfs_setup_options(struct pvfs_state *pvfs) { - int snum = pvfs->ntvfs->ctx->config.snum; + struct share_config *scfg = pvfs->ntvfs->ctx->config; const char *eadb; - if (lp_map_hidden(snum)) pvfs->flags |= PVFS_FLAG_MAP_HIDDEN; - if (lp_map_archive(snum)) pvfs->flags |= PVFS_FLAG_MAP_ARCHIVE; - if (lp_map_system(snum)) pvfs->flags |= PVFS_FLAG_MAP_SYSTEM; - if (lp_readonly(snum)) pvfs->flags |= PVFS_FLAG_READONLY; - if (lp_strict_sync(snum)) pvfs->flags |= PVFS_FLAG_STRICT_SYNC; - if (lp_strict_locking(snum)) pvfs->flags |= PVFS_FLAG_STRICT_LOCKING; - if (lp_ci_filesystem(snum)) pvfs->flags |= PVFS_FLAG_CI_FILESYSTEM; - - if (lp_parm_bool(snum, "posix", "fakeoplocks", False)) { + if (share_bool_option(scfg, SHARE_MAP_HIDDEN, SHARE_MAP_HIDDEN_DEFAULT)) + pvfs->flags |= PVFS_FLAG_MAP_HIDDEN; + if (share_bool_option(scfg, SHARE_MAP_ARCHIVE, SHARE_MAP_ARCHIVE_DEFAULT)) + pvfs->flags |= PVFS_FLAG_MAP_ARCHIVE; + if (share_bool_option(scfg, SHARE_MAP_SYSTEM, SHARE_MAP_SYSTEM_DEFAULT)) + pvfs->flags |= PVFS_FLAG_MAP_SYSTEM; + if (share_bool_option(scfg, SHARE_READONLY, SHARE_READONLY_DEFAULT)) + pvfs->flags |= PVFS_FLAG_READONLY; + if (share_bool_option(scfg, SHARE_STRICT_SYNC, SHARE_STRICT_SYNC_DEFAULT)) + pvfs->flags |= PVFS_FLAG_STRICT_SYNC; + if (share_bool_option(scfg, SHARE_STRICT_LOCKING, SHARE_STRICT_LOCKING_DEFAULT)) + pvfs->flags |= PVFS_FLAG_STRICT_LOCKING; + if (share_bool_option(scfg, SHARE_CI_FILESYSTEM, SHARE_CI_FILESYSTEM_DEFAULT)) + pvfs->flags |= PVFS_FLAG_CI_FILESYSTEM; + if (share_bool_option(scfg, PVFS_FAKE_OPLOCKS, PVFS_FAKE_OPLOCKS_DEFAULT)) { pvfs->flags |= PVFS_FLAG_FAKE_OPLOCKS; } /* this must be a power of 2 */ - pvfs->alloc_size_rounding = lp_parm_int(snum, - "posix", "allocationrounding", 512); + pvfs->alloc_size_rounding = share_int_option(scfg, + PVFS_ALLOCATION_ROUNDING, + PVFS_ALLOCATION_ROUNDING_DEFAULT); - pvfs->search.inactivity_time = lp_parm_int(snum, - "posix", "searchinactivity", 300); + pvfs->search.inactivity_time = share_int_option(scfg, + PVFS_SEARCH_INACTIVITY, + PVFS_SEARCH_INACTIVITY_DEFAULT); #if HAVE_XATTR_SUPPORT - if (lp_parm_bool(snum, "posix", "xattr", True)) pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; + if (share_bool_option(scfg, PVFS_XATTR, PVFS_XATTR_DEFAULT)) + pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; #endif - pvfs->sharing_violation_delay = lp_parm_int(snum, "posix", "sharedelay", 1000000); + pvfs->sharing_violation_delay = share_int_option(scfg, + PVFS_SHARE_DELAY, + PVFS_SHARE_DELAY_DEFAULT); - pvfs->share_name = talloc_strdup(pvfs, lp_servicename(snum)); + pvfs->share_name = talloc_strdup(pvfs, scfg->name); pvfs->fs_attribs = FS_ATTR_CASE_SENSITIVE_SEARCH | @@ -75,7 +86,7 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) FS_ATTR_SPARSE_FILES; /* allow xattrs to be stored in a external tdb */ - eadb = lp_parm_string(snum, "posix", "eadb"); + eadb = share_string_option(scfg, PVFS_EADB, NULL); if (eadb != NULL) { pvfs->ea_db = tdb_wrap_open(pvfs, eadb, 50000, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); @@ -144,7 +155,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, NT_STATUS_HAVE_NO_MEMORY(pvfs); /* for simplicity of path construction, remove any trailing slash now */ - base_directory = talloc_strdup(pvfs, lp_pathname(ntvfs->ctx->config.snum)); + base_directory = talloc_strdup(pvfs, share_string_option(ntvfs->ctx->config, SHARE_PATH, "")); NT_STATUS_HAVE_NO_MEMORY(base_directory); if (strcmp(base_directory, "/") != 0) { trim_string(base_directory, NULL, "/"); @@ -186,7 +197,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, pvfs->ntvfs->ctx->server_id, pvfs->ntvfs->ctx->msg_ctx, event_context_find(pvfs), - pvfs->ntvfs->ctx->config.snum); + pvfs->ntvfs->ctx->config); pvfs->sidmap = sidmap_open(pvfs); if (pvfs->sidmap == NULL) { -- cgit From 2338e978322510d5b6def6edac40a868e4945d2e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 9 Oct 2006 11:13:49 +0000 Subject: r19199: split out the xattr NTACL code into a separate part of the posix backend, allowing other ACL backends to be added. The xattr backend is still the default backend (This used to be commit 90f044e63b12d32228310c7529382198bd7e6dfe) --- source4/ntvfs/posix/vfs_posix.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 975649eeb5..ad47908b6e 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -113,6 +113,9 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) if (pvfs->flags & PVFS_FLAG_XATTR_ENABLE) { pvfs_xattr_probe(pvfs); } + + /* enable an ACL backend */ + pvfs->acl_ops = pvfs_acl_backend_byname(share_string_option(scfg, PVFS_ACL, "xattr")); } static int pvfs_state_destructor(struct pvfs_state *pvfs) -- cgit From e0e96ae80d21c6b94e05fbf3af457001a005ce09 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 9 Jan 2007 04:04:26 +0000 Subject: r20624: added AIO read to pvfs backend (This used to be commit d6e20d6d8c5c207e7f04b0d0523224437b209917) --- source4/ntvfs/posix/vfs_posix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index ad47908b6e..c8d85b557c 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -55,9 +55,10 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) pvfs->flags |= PVFS_FLAG_STRICT_LOCKING; if (share_bool_option(scfg, SHARE_CI_FILESYSTEM, SHARE_CI_FILESYSTEM_DEFAULT)) pvfs->flags |= PVFS_FLAG_CI_FILESYSTEM; - if (share_bool_option(scfg, PVFS_FAKE_OPLOCKS, PVFS_FAKE_OPLOCKS_DEFAULT)) { + if (share_bool_option(scfg, PVFS_FAKE_OPLOCKS, PVFS_FAKE_OPLOCKS_DEFAULT)) pvfs->flags |= PVFS_FLAG_FAKE_OPLOCKS; - } + if (share_bool_option(scfg, PVFS_AIO, False)) + pvfs->flags |= PVFS_FLAG_LINUX_AIO; /* this must be a power of 2 */ pvfs->alloc_size_rounding = share_int_option(scfg, -- cgit From 879e1e0ec746d9d06c3bef1c91d1d2cd6f916442 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 4 Jul 2007 04:16:16 +0000 Subject: r23697: use the file perm options in the posix backend (This used to be commit 701d06ac016c69fcd9ac92b5afefa2346c9bc26f) --- source4/ntvfs/posix/vfs_posix.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index c8d85b557c..2508496fac 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -60,6 +60,19 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) if (share_bool_option(scfg, PVFS_AIO, False)) pvfs->flags |= PVFS_FLAG_LINUX_AIO; + /* file perm options */ + pvfs->options.create_mask = share_int_option(scfg, + SHARE_CREATE_MASK, + SHARE_CREATE_MASK_DEFAULT); + pvfs->options.dir_mask = share_int_option(scfg, + SHARE_DIR_MASK, + SHARE_DIR_MASK_DEFAULT); + pvfs->options.force_dir_mode = share_int_option(scfg, + SHARE_FORCE_DIR_MODE, + SHARE_FORCE_DIR_MODE_DEFAULT); + pvfs->options.force_create_mode = share_int_option(scfg, + SHARE_FORCE_CREATE_MODE, + SHARE_FORCE_CREATE_MODE_DEFAULT); /* this must be a power of 2 */ pvfs->alloc_size_rounding = share_int_option(scfg, PVFS_ALLOCATION_ROUNDING, -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/ntvfs/posix/vfs_posix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 2508496fac..2c414065cb 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -7,7 +7,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ /* this implements most of the POSIX NTVFS backend -- cgit From 2151cde58014ea2e822c13d2f8a369b45dc19ca8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:28:14 +0000 Subject: r25554: Convert last instances of BOOL, True and False to the standard types. (This used to be commit 566aa14139510788548a874e9213d91317f83ca9) --- source4/ntvfs/posix/vfs_posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 2c414065cb..208c9e62b7 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -56,7 +56,7 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) pvfs->flags |= PVFS_FLAG_CI_FILESYSTEM; if (share_bool_option(scfg, PVFS_FAKE_OPLOCKS, PVFS_FAKE_OPLOCKS_DEFAULT)) pvfs->flags |= PVFS_FLAG_FAKE_OPLOCKS; - if (share_bool_option(scfg, PVFS_AIO, False)) + if (share_bool_option(scfg, PVFS_AIO, false)) pvfs->flags |= PVFS_FLAG_LINUX_AIO; /* file perm options */ @@ -234,7 +234,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, #ifdef SIGXFSZ /* who had the stupid idea to generate a signal on a large file write instead of just failing it!? */ - BlockSignals(True, SIGXFSZ); + BlockSignals(true, SIGXFSZ); #endif return NT_STATUS_OK; -- cgit From ca0b72a1fdb7bd965065e833df34662afef0423e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 16 Nov 2007 20:12:00 +0100 Subject: r26003: Split up DB_WRAP, as first step in an attempt to sanitize dependencies. (This used to be commit 56dfcb4f2f8e74c9d8b2fe3a0df043781188a555) --- source4/ntvfs/posix/vfs_posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 208c9e62b7..24aa023de5 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -27,7 +27,8 @@ #include "vfs_posix.h" #include "librpc/gen_ndr/security.h" #include "lib/tdb/include/tdb.h" -#include "db_wrap.h" +#include "tdb_wrap.h" +#include "util/util_ldb.h" #include "libcli/security/security.h" #include "lib/events/events.h" -- cgit From 51db4c3f3d81d1ed03beae6426786c843ac59807 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 2 Dec 2007 17:56:09 +0100 Subject: r26228: Store loadparm context in auth context, move more loadparm_contexts up the call stack. (This used to be commit ba75f1613a9aac69dd5df94dd8a2b37820acd166) --- source4/ntvfs/posix/vfs_posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 24aa023de5..07948a64e2 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -31,7 +31,7 @@ #include "util/util_ldb.h" #include "libcli/security/security.h" #include "lib/events/events.h" - +#include "param/param.h" /* setup config options for a posix share @@ -216,7 +216,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, event_context_find(pvfs), pvfs->ntvfs->ctx->config); - pvfs->sidmap = sidmap_open(pvfs); + pvfs->sidmap = sidmap_open(pvfs, global_loadparm); if (pvfs->sidmap == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } -- cgit From a72c5053c587f0ed6113ef514fe3739cb81e7abf Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Dec 2007 23:32:43 +0100 Subject: r26353: Remove use of global_loadparm. (This used to be commit 17637e4490e42db6cdef619286c4d5a0982e9d1a) --- source4/ntvfs/posix/vfs_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 07948a64e2..c1e15976d2 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -216,7 +216,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, event_context_find(pvfs), pvfs->ntvfs->ctx->config); - pvfs->sidmap = sidmap_open(pvfs, global_loadparm); + pvfs->sidmap = sidmap_open(pvfs, pvfs->ntvfs->ctx->lp_ctx); if (pvfs->sidmap == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } -- cgit From b65dba2245bf382c47d65c95ac9b1efa43918fc0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 10 Dec 2007 04:33:16 +0100 Subject: r26355: Eliminate global_loadparm in more places. (This used to be commit 5d589a0d94bd76a9b4c9fc748854e8098ea43c4d) --- source4/ntvfs/posix/vfs_posix.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index c1e15976d2..8e5e5a6942 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -199,6 +199,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, pvfs->brl_context = brl_init(pvfs, pvfs->ntvfs->ctx->server_id, + pvfs->ntvfs->ctx->lp_ctx, pvfs->ntvfs->ctx->msg_ctx); if (pvfs->brl_context == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; -- cgit From e31abef15f7696cf39e9e81307f153da93568e02 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 13 Dec 2007 22:46:55 +0100 Subject: r26440: Remove more uses of global_loadparm. (This used to be commit 8858cf39722f192865e531164c72039fd18d7a8d) --- source4/ntvfs/posix/vfs_posix.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 8e5e5a6942..e058e6f546 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -214,6 +214,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, pvfs->notify_context = notify_init(pvfs, pvfs->ntvfs->ctx->server_id, pvfs->ntvfs->ctx->msg_ctx, + pvfs->ntvfs->ctx->lp_ctx, event_context_find(pvfs), pvfs->ntvfs->ctx->config); -- cgit From c0d1543a6a5fee3d767a366186dd634a395c8146 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 25 Feb 2008 19:17:45 +0100 Subject: pvfs: add posix:oplocktimeout=30 option metze (This used to be commit 5abc57ddab558c13db3864d13afc2ad3b1641d1c) --- source4/ntvfs/posix/vfs_posix.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index e058e6f546..ca874d1db1 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -91,6 +91,10 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) PVFS_SHARE_DELAY, PVFS_SHARE_DELAY_DEFAULT); + pvfs->oplock_break_timeout = share_int_option(scfg, + PVFS_OPLOCK_TIMEOUT, + PVFS_OPLOCK_TIMEOUT_DEFAULT); + pvfs->share_name = talloc_strdup(pvfs, scfg->name); pvfs->fs_attribs = -- cgit From 4133bd85e9f5860712cf392ccac36f30f9e423de Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Fri, 28 Mar 2008 23:29:01 +0100 Subject: ntvfs: Use wbclient for pvfs_acl and pvfs_acl_nfs4 (This used to be commit ac5e5fee1db2999053dee82d1fcf97ca8799c9b5) --- source4/ntvfs/posix/vfs_posix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index ca874d1db1..ebc2d88e70 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -222,8 +222,10 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, event_context_find(pvfs), pvfs->ntvfs->ctx->config); - pvfs->sidmap = sidmap_open(pvfs, pvfs->ntvfs->ctx->lp_ctx); - if (pvfs->sidmap == NULL) { + pvfs->wbc_ctx = wbc_init(pvfs, + pvfs->ntvfs->ctx->msg_ctx, + pvfs->ntvfs->ctx->event_ctx); + if (pvfs->wbc_ctx == NULL) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } -- cgit From a195cd9d8f3d0c0185fbf82388bd1efaa63e7bd5 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 16 Apr 2008 22:52:07 +0200 Subject: Use readily available event context. (This used to be commit 2823fca23a4cacc996c808f22cba50b4482b5921) --- source4/ntvfs/posix/vfs_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index ebc2d88e70..14b5210fd0 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -219,7 +219,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, pvfs->ntvfs->ctx->server_id, pvfs->ntvfs->ctx->msg_ctx, pvfs->ntvfs->ctx->lp_ctx, - event_context_find(pvfs), + pvfs->ntvfs->ctx->event_ctx, pvfs->ntvfs->ctx->config); pvfs->wbc_ctx = wbc_init(pvfs, -- cgit From 47b54c7680c98fee40916cbfb5c3ad05a178d3a1 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 3 Jun 2008 11:34:10 +0200 Subject: pvfs: add posix:writetimeupdatedelay option metze (This used to be commit c3ba19ca62affced96b927fcbe63cf5d075aed22) --- source4/ntvfs/posix/vfs_posix.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 14b5210fd0..b5dd270346 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -95,6 +95,10 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) PVFS_OPLOCK_TIMEOUT, PVFS_OPLOCK_TIMEOUT_DEFAULT); + pvfs->writetime_delay = share_int_option(scfg, + PVFS_WRITETIME_DELAY, + PVFS_WRITETIME_DELAY_DEFAULT); + pvfs->share_name = talloc_strdup(pvfs, scfg->name); pvfs->fs_attribs = -- cgit From 98014c5668e3269a059658e433d636213e2b06e6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 28 Jun 2008 10:28:15 +0200 Subject: pvfs: create a pvfs_acl subsystem That means that the pvfs_acl implementations no longer register as ntvfs modules (which was wrong) metze (This used to be commit 89e90556ec57fce24faf0ed3d6fe262edd974b28) --- source4/ntvfs/posix/vfs_posix.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source4/ntvfs/posix/vfs_posix.c') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index b5dd270346..ce0da7033d 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -176,6 +176,13 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, char *base_directory; NTSTATUS status; + /* + * TODO: call this from ntvfs_posix_init() + * but currently we don't have a lp_ctx there + */ + status = pvfs_acl_init(ntvfs->ctx->lp_ctx); + NT_STATUS_NOT_OK_RETURN(status); + pvfs = talloc_zero(ntvfs, struct pvfs_state); NT_STATUS_HAVE_NO_MEMORY(pvfs); -- cgit