svn commit: samba r7947 - in trunk/source/smbd: .
jra at samba.org
jra at samba.org
Mon Jun 27 17:14:14 GMT 2005
Author: jra
Date: 2005-06-27 17:14:13 +0000 (Mon, 27 Jun 2005)
New Revision: 7947
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7947
Log:
Ensure we call the vfs connection hook before doing a vfs stat.
Allows database vfs backends to initialise with a working connection.
Bugid #2827
Jeremy.
Modified:
trunk/source/smbd/service.c
Changeset:
Modified: trunk/source/smbd/service.c
===================================================================
--- trunk/source/smbd/service.c 2005-06-27 16:54:31 UTC (rev 7946)
+++ trunk/source/smbd/service.c 2005-06-27 17:14:13 UTC (rev 7947)
@@ -605,6 +605,25 @@
}
#endif
+ /* Add veto/hide lists */
+ if (!IS_IPC(conn) && !IS_PRINT(conn)) {
+ set_namearray( &conn->veto_list, lp_veto_files(snum));
+ set_namearray( &conn->hide_list, lp_hide_files(snum));
+ set_namearray( &conn->veto_oplock_list, lp_veto_oplocks(snum));
+ }
+
+ /* Invoke VFS make connection hook - do this before the VFS_STAT call to allow
+ any filesystems needing user credentials to initialize themselves. */
+
+ if (SMB_VFS_CONNECT(conn, lp_servicename(snum), user) < 0) {
+ DEBUG(0,("make_connection: VFS make connection failed!\n"));
+ change_to_root_user();
+ yield_connection(conn, lp_servicename(snum));
+ conn_free(conn);
+ *status = NT_STATUS_UNSUCCESSFUL;
+ return NULL;
+ }
+
/* win2000 does not check the permissions on the directory
during the tree connect, instead relying on permission
check during individual operations. To match this behaviour
@@ -613,6 +632,8 @@
if (SMB_VFS_STAT(conn, conn->connectpath, &st) != 0 || !S_ISDIR(st.st_mode)) {
DEBUG(0,("'%s' does not exist or is not a directory, when connecting to [%s]\n", conn->connectpath, lp_servicename(snum)));
change_to_root_user();
+ /* Call VFS disconnect hook */
+ SMB_VFS_DISCONNECT(conn);
yield_connection(conn, lp_servicename(snum));
conn_free(conn);
*status = NT_STATUS_BAD_NETWORK_NAME;
@@ -647,28 +668,8 @@
dbgtext( "(pid %d)\n", (int)sys_getpid() );
}
- /* Add veto/hide lists */
- if (!IS_IPC(conn) && !IS_PRINT(conn)) {
- set_namearray( &conn->veto_list, lp_veto_files(snum));
- set_namearray( &conn->hide_list, lp_hide_files(snum));
- set_namearray( &conn->veto_oplock_list, lp_veto_oplocks(snum));
- set_namearray( &conn->aio_write_behind_list, lp_aio_write_behind(snum));
- }
-
- /* Invoke VFS make connection hook */
-
- if (SMB_VFS_CONNECT(conn, lp_servicename(snum), user) < 0) {
- DEBUG(0,("make_connection: VFS make connection failed!\n"));
- change_to_root_user();
- yield_connection(conn, lp_servicename(snum));
- conn_free(conn);
- *status = NT_STATUS_UNSUCCESSFUL;
- return NULL;
- }
-
/* we've finished with the user stuff - go back to root */
change_to_root_user();
-
return(conn);
}
More information about the samba-cvs
mailing list