2 Unix SMB/CIFS implementation.
4 Copyright (C) Andrew Tridgell 2003
5 Copyright (C) Stefan (metze) Metzmacher 2004
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 this implements most of the POSIX NTVFS backend
23 This is the default backend
26 #include "include/includes.h"
29 connect to a share - used when a tree_connect operation comes
30 in. For a disk based backend we needs to ensure that the base
31 directory exists (tho it doesn't need to be accessible by the user,
34 static NTSTATUS pvfs_connect(struct smbsrv_request *req, const char *sharename)
36 DEBUG(0, ("Connection to share [%s] ACCESS DENIED!\n", sharename));
37 DEBUGADD(0,("This is because your using the 'ntvfs handler = default'.\n"));
38 DEBUGADD(0,("This backend is not functional at the moment.\n"));
39 DEBUGADD(0,("Please use one of the following backends:\n"));
40 DEBUGADD(0,("cifs - a proxy to another cifs-server\n"));
41 DEBUGADD(0,("simple - a very, very simple posix backend\n"));
42 DEBUGADD(0,(" all file acess is done as user 'root'\n"));
43 DEBUGADD(0,(" Please don't use this a sensitive data!!!\n"));
45 return NT_STATUS_ACCESS_DENIED;
49 disconnect from a share
51 static NTSTATUS pvfs_disconnect(struct tcon_context *tcon)
57 initialialise the POSIX disk backend, registering ourselves with the ntvfs subsystem
59 NTSTATUS ntvfs_posix_init(void)
67 ops.type = NTVFS_DISK;
69 /* fill in all the operations */
70 ops.connect = pvfs_connect;
71 ops.disconnect = pvfs_disconnect;
73 /* register ourselves with the NTVFS subsystem. We register under the name 'default'
74 as we wish to be the default backend */
75 ret = register_backend("ntvfs", &ops);
77 if (!NT_STATUS_IS_OK(ret)) {
78 DEBUG(0,("Failed to register POSIX backend!\n"));