Changeset 411 for branches/samba-3.3.x/source/smbd/service.c
- Timestamp:
- Mar 1, 2010, 3:05:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/smbd/service.c
r338 r411 725 725 int ret; 726 726 char addr[INET6_ADDRSTRLEN]; 727 bool on_err_call_dis_hook = false;728 727 NTSTATUS status; 729 728 … … 926 925 } 927 926 928 /*929 * If widelinks are disallowed we need to canonicalise the connect930 * path here to ensure we don't have any symlinks in the931 * connectpath. We will be checking all paths on this connection are932 * below this directory. We must do this after the VFS init as we933 * depend on the realpath() pointer in the vfs table. JRA.934 */935 if (!lp_widelinks(snum)) {936 if (!canonicalize_connect_path(conn)) {937 DEBUG(0, ("canonicalize_connect_path failed "938 "for service %s, path %s\n",939 lp_servicename(snum),940 conn->connectpath));941 conn_free(conn);942 *pstatus = NT_STATUS_BAD_NETWORK_NAME;943 return NULL;944 }945 }946 947 927 if ((!conn->printer) && (!conn->ipc)) { 948 928 conn->notify_ctx = notify_init(conn, server_id_self(), … … 952 932 } 953 933 954 /* ROOT Activities: */ 934 /* ROOT Activities: */ 935 /* explicitly check widelinks here so that we can correctly warn 936 * in the logs. */ 937 widelinks_warning(snum); 938 955 939 /* 956 940 * Enforce the max connections parameter. … … 977 961 return NULL; 978 962 } 963 964 /* Invoke VFS make connection hook - must be the first 965 VFS operation we do. */ 966 967 if (SMB_VFS_CONNECT(conn, lp_servicename(snum), 968 conn->server_info->unix_name) < 0) { 969 DEBUG(0,("make_connection: VFS make connection failed!\n")); 970 yield_connection(conn, lp_servicename(snum)); 971 conn_free(conn); 972 *pstatus = NT_STATUS_UNSUCCESSFUL; 973 return NULL; 974 } 975 976 /* 977 * Fix compatibility issue pointed out by Volker. 978 * We pass the conn->connectpath to the preexec 979 * scripts as a parameter, so attempt to canonicalize 980 * it here before calling the preexec scripts. 981 * We ignore errors here, as it is possible that 982 * the conn->connectpath doesn't exist yet and 983 * the preexec scripts will create them. 984 */ 985 986 (void)canonicalize_connect_path(conn); 979 987 980 988 /* Preexecs are done here as they might make the dir we are to ChDir … … 996 1004 DEBUG(1,("root preexec gave %d - failing " 997 1005 "connection\n", ret)); 1006 SMB_VFS_DISCONNECT(conn); 998 1007 yield_connection(conn, lp_servicename(snum)); 999 1008 conn_free(conn); … … 1007 1016 /* No point continuing if they fail the basic checks */ 1008 1017 DEBUG(0,("Can't become connected user!\n")); 1018 SMB_VFS_DISCONNECT(conn); 1009 1019 yield_connection(conn, lp_servicename(snum)); 1010 1020 conn_free(conn); … … 1039 1049 } 1040 1050 1051 /* 1052 * If widelinks are disallowed we need to canonicalise the connect 1053 * path here to ensure we don't have any symlinks in the 1054 * connectpath. We will be checking all paths on this connection are 1055 * below this directory. We must do this after the VFS init as we 1056 * depend on the realpath() pointer in the vfs table. JRA. 1057 */ 1058 if (!lp_widelinks(snum)) { 1059 if (!canonicalize_connect_path(conn)) { 1060 DEBUG(0, ("canonicalize_connect_path failed " 1061 "for service %s, path %s\n", 1062 lp_servicename(snum), 1063 conn->connectpath)); 1064 *pstatus = NT_STATUS_BAD_NETWORK_NAME; 1065 goto err_root_exit; 1066 } 1067 } 1068 1041 1069 #ifdef WITH_FAKE_KASERVER 1042 1070 if (lp_afs_share(snum)) { … … 1054 1082 } 1055 1083 1056 /* Invoke VFS make connection hook - do this before the VFS_STAT call1057 to allow any filesystems needing user credentials to initialize1058 themselves. */1059 1060 if (SMB_VFS_CONNECT(conn, lp_servicename(snum),1061 conn->server_info->unix_name) < 0) {1062 DEBUG(0,("make_connection: VFS make connection failed!\n"));1063 *pstatus = NT_STATUS_UNSUCCESSFUL;1064 goto err_root_exit;1065 }1066 1067 /* Any error exit after here needs to call the disconnect hook. */1068 on_err_call_dis_hook = true;1069 1084 1070 1085 /* win2000 does not check the permissions on the directory … … 1139 1154 1140 1155 change_to_root_user(); 1141 if (on_err_call_dis_hook) { 1142 /* Call VFS disconnect hook */ 1143 SMB_VFS_DISCONNECT(conn); 1144 } 1156 /* Call VFS disconnect hook */ 1157 SMB_VFS_DISCONNECT(conn); 1145 1158 yield_connection(conn, lp_servicename(snum)); 1146 1159 conn_free(conn);
Note:
See TracChangeset
for help on using the changeset viewer.