1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

Call VFS initialisation, share connect and share disconnect functions.

Initialise VFS function pointers with symbols from the 'vfs object'
file, use disk pointers otherwise.

Added a hook to check for a 'default' VFS share (like the [homes]
section).  Currently empty - I'm unsure whether this will be useful or
not.
(This used to be commit 15805164fe77b127372eba1ec51c70758467adee)
This commit is contained in:
Tim Potter 1999-04-04 06:22:22 +00:00
parent 10858bba8e
commit afc00dbd6f

View File

@ -144,6 +144,11 @@ int find_service(char *service)
}
}
/* Check for default vfs service? Unsure whether to implement this */
if (iService < 0)
{
}
/* just possibly it's a default service? */
if (iService < 0)
{
@ -340,7 +345,24 @@ connection_struct *make_connection(char *service,char *user,char *password, int
conn->veto_oplock_list = NULL;
string_set(&conn->dirpath,"");
string_set(&conn->user,user);
/* Initialise VFS function pointers */
if (*lp_vfsobj(SNUM(conn))) {
/* Loadable object file */
if (vfs_init_custom(conn) < 0) {
return NULL;
}
} else {
/* Normal share - initialise with disk access functions */
vfs_init_default(conn);
}
#ifdef HAVE_GETGRNAM
if (*lp_force_group(snum)) {
struct group *gptr;
@ -492,6 +514,14 @@ connection_struct *make_connection(char *service,char *user,char *password, int
dbgtext( "(uid=%d, gid=%d) ", (int)conn->uid, (int)conn->gid );
dbgtext( "(pid %d)\n", (int)getpid() );
}
/* Invoke make connection hook */
if (conn->vfs_ops.connect) {
if (conn->vfs_ops.connect(conn, service, user) < 0) {
return NULL;
}
}
return(conn);
}
@ -511,6 +541,10 @@ void close_cnum(connection_struct *conn, uint16 vuid)
remote_machine,client_addr(Client),
lp_servicename(SNUM(conn))));
if (conn->vfs_ops.disconnect != NULL) {
conn->vfs_ops.disconnect(conn, lp_servicename(SNUM(conn)));
}
yield_connection(conn,
lp_servicename(SNUM(conn)),
lp_max_connections(SNUM(conn)));