1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

Merge from HEAD - handle VFS module load failures, change some error returns to

avoid sending NT_STATUS_UNSUCCESSFUL.

Andrew Bartlett
(This used to be commit 7b95151ddcb1e4abd592e72d509ec24c5d160511)
This commit is contained in:
Andrew Bartlett 2003-01-06 07:40:39 +00:00
parent 64452be9ba
commit 0ba7c143b3
2 changed files with 9 additions and 3 deletions

View File

@ -569,7 +569,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
if (!smbd_vfs_init(conn)) { if (!smbd_vfs_init(conn)) {
DEBUG(0, ("vfs_init failed for service %s\n", lp_servicename(SNUM(conn)))); DEBUG(0, ("vfs_init failed for service %s\n", lp_servicename(SNUM(conn))));
conn_free(conn); conn_free(conn);
*status = NT_STATUS_UNSUCCESSFUL; *status = NT_STATUS_BAD_NETWORK_NAME;
return NULL; return NULL;
} }
@ -598,7 +598,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
DEBUG(1,("root preexec gave %d - failing connection\n", ret)); DEBUG(1,("root preexec gave %d - failing connection\n", ret));
yield_connection(conn, lp_servicename(SNUM(conn))); yield_connection(conn, lp_servicename(SNUM(conn)));
conn_free(conn); conn_free(conn);
*status = NT_STATUS_UNSUCCESSFUL; *status = NT_STATUS_ACCESS_DENIED;
return NULL; return NULL;
} }
} }
@ -627,7 +627,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
change_to_root_user(); change_to_root_user();
yield_connection(conn, lp_servicename(SNUM(conn))); yield_connection(conn, lp_servicename(SNUM(conn)));
conn_free(conn); conn_free(conn);
*status = NT_STATUS_UNSUCCESSFUL; *status = NT_STATUS_ACCESS_DENIED;
return NULL; return NULL;
} }
} }

View File

@ -164,6 +164,7 @@ BOOL vfs_init_custom(connection_struct *conn, const char *vfs_object)
if (init_fptr == NULL) { if (init_fptr == NULL) {
DEBUG(0, ("No vfs_init() symbol found in %s\n", vfs_object)); DEBUG(0, ("No vfs_init() symbol found in %s\n", vfs_object));
sys_dlclose(conn->vfs_private->handle);
return False; return False;
} }
@ -171,12 +172,14 @@ BOOL vfs_init_custom(connection_struct *conn, const char *vfs_object)
if ((ops = init_fptr(&vfs_version, &conn->vfs_ops, conn->vfs_private)) == NULL) { if ((ops = init_fptr(&vfs_version, &conn->vfs_ops, conn->vfs_private)) == NULL) {
DEBUG(0, ("vfs_init() function from %s failed\n", vfs_object)); DEBUG(0, ("vfs_init() function from %s failed\n", vfs_object));
sys_dlclose(conn->vfs_private->handle);
return False; return False;
} }
if ((vfs_version < SMB_VFS_INTERFACE_CASCADED)) { if ((vfs_version < SMB_VFS_INTERFACE_CASCADED)) {
DEBUG(0, ("vfs_init() returned wrong interface version info (was %d, should be no less than %d)\n", DEBUG(0, ("vfs_init() returned wrong interface version info (was %d, should be no less than %d)\n",
vfs_version, SMB_VFS_INTERFACE_VERSION )); vfs_version, SMB_VFS_INTERFACE_VERSION ));
sys_dlclose(conn->vfs_private->handle);
return False; return False;
} }
@ -184,6 +187,7 @@ BOOL vfs_init_custom(connection_struct *conn, const char *vfs_object)
DEBUG(0, ("Warning: vfs_init() states that module confirms interface version #%d, current interface version is #%d.\n\ DEBUG(0, ("Warning: vfs_init() states that module confirms interface version #%d, current interface version is #%d.\n\
Proceeding in compatibility mode, new operations (since version #%d) will fallback to default ones.\n", Proceeding in compatibility mode, new operations (since version #%d) will fallback to default ones.\n",
vfs_version, SMB_VFS_INTERFACE_VERSION, vfs_version )); vfs_version, SMB_VFS_INTERFACE_VERSION, vfs_version ));
sys_dlclose(conn->vfs_private->handle);
return False; return False;
} }
@ -249,6 +253,8 @@ BOOL smbd_vfs_init(connection_struct *conn)
DEBUG(0, ("smbd_vfs_init: vfs_init_custom failed for %s\n", vfs_module)); DEBUG(0, ("smbd_vfs_init: vfs_init_custom failed for %s\n", vfs_module));
string_free(&vfsobj); string_free(&vfsobj);
SAFE_FREE(vfs_module); SAFE_FREE(vfs_module);
DLIST_REMOVE(conn->vfs_private, handle);
SAFE_FREE(handle);
return False; return False;
} }
SAFE_FREE(vfs_module); SAFE_FREE(vfs_module);