Changeset 427 for vendor/current/source3/smbd
- Timestamp:
- Apr 9, 2010, 3:20:58 PM (15 years ago)
- Location:
- vendor/current/source3/smbd
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/smbd/blocking.c
r414 r427 73 73 struct blocking_lock_record *blr; 74 74 struct timeval next_timeout; 75 int max_brl_timeout = lp_parm_int(-1, "brl", "recalctime", 5); 75 76 76 77 TALLOC_FREE(brl_timeout); … … 99 100 DEBUG(10, ("Next timeout = Infinite.\n")); 100 101 return True; 102 } 103 104 /* 105 to account for unclean shutdowns by clients we need a 106 maximum timeout that we use for checking pending locks. If 107 we have any pending locks at all, then check if the pending 108 lock can continue at least every brl:recalctime seconds 109 (default 5 seconds). 110 111 This saves us needing to do a message_send_all() in the 112 SIGCHLD handler in the parent daemon. That 113 message_send_all() caused O(n^2) work to be done when IP 114 failovers happened in clustered Samba, which could make the 115 entire system unusable for many minutes. 116 */ 117 118 if (max_brl_timeout > 0) { 119 struct timeval min_to = timeval_current_ofs(max_brl_timeout, 0); 120 next_timeout = timeval_min(&next_timeout, &min_to); 101 121 } 102 122 -
vendor/current/source3/smbd/posix_acls.c
r414 r427 2699 2699 2700 2700 /* Use the psbuf that was passed in. */ 2701 fsp->fsp_name->st = *psbuf; 2701 if (psbuf != &fsp->fsp_name->st) { 2702 fsp->fsp_name->st = *psbuf; 2703 } 2702 2704 2703 2705 #if defined(POSIX_ACL_NEEDS_MASK) -
vendor/current/source3/smbd/process.c
r414 r427 1813 1813 1814 1814 if ((req->wct < 2) || (CVAL(req->outbuf, smb_wct) < 2)) { 1815 if (req->chain_outbuf == NULL) { 1816 req->chain_outbuf = TALLOC_REALLOC_ARRAY( 1817 req, req->outbuf, uint8_t, 1818 smb_len(req->outbuf) + 4); 1819 if (req->chain_outbuf == NULL) { 1820 smb_panic("talloc failed"); 1821 } 1822 } 1823 req->outbuf = NULL; 1815 1824 goto error; 1816 1825 } … … 1840 1849 req, req->outbuf, uint8_t, smb_len(req->outbuf) + 4); 1841 1850 if (req->chain_outbuf == NULL) { 1842 goto error;1851 smb_panic("talloc failed"); 1843 1852 } 1844 1853 req->outbuf = NULL; -
vendor/current/source3/smbd/reply.c
r414 r427 2397 2397 ret = SMB_VFS_LSTAT(conn, smb_fname); 2398 2398 } else { 2399 ret = SMB_VFS_ LSTAT(conn, smb_fname);2399 ret = SMB_VFS_STAT(conn, smb_fname); 2400 2400 } 2401 2401 if (ret != 0) { … … 5847 5847 smb_fname_str_dbg(smb_fname_dst))); 5848 5848 5849 if (lp_map_archive(SNUM(conn)) || 5850 lp_store_dos_attributes(SNUM(conn))) { 5851 /* We must set the archive bit on the newly 5852 renamed file. */ 5853 if (SMB_VFS_STAT(conn, smb_fname_dst) == 0) { 5854 uint32_t old_dosmode = dos_mode(conn, 5855 smb_fname_dst); 5856 file_set_dosmode(conn, 5857 smb_fname_dst, 5858 old_dosmode | FILE_ATTRIBUTE_ARCHIVE, 5859 NULL, 5860 true); 5861 } 5862 } 5863 5849 5864 notify_rename(conn, fsp->is_directory, fsp->fsp_name, 5850 5865 smb_fname_dst); -
vendor/current/source3/smbd/server.c
r414 r427 220 220 } 221 221 222 /* 223 at most every smbd:cleanuptime seconds (default 20), we scan the BRL 224 and locking database for entries to cleanup. As a side effect this 225 also cleans up dead entries in the connections database (due to the 226 traversal in message_send_all() 227 228 Using a timer for this prevents a flood of traversals when a large 229 number of clients disconnect at the same time (perhaps due to a 230 network outage). 231 */ 232 233 static void cleanup_timeout_fn(struct event_context *event_ctx, 234 struct timed_event *te, 235 struct timeval now, 236 void *private_data) 237 { 238 struct timed_event **cleanup_te = (struct timed_event **)private_data; 239 240 DEBUG(1,("Cleaning up brl and lock database after unclean shutdown\n")); 241 message_send_all(smbd_messaging_context(), MSG_SMB_UNLOCK, NULL, 0, NULL); 242 messaging_send_buf(smbd_messaging_context(), procid_self(), 243 MSG_SMB_BRL_VALIDATE, NULL, 0); 244 /* mark the cleanup as having been done */ 245 (*cleanup_te) = NULL; 246 } 247 222 248 static void remove_child_pid(pid_t pid, bool unclean_shutdown) 223 249 { 224 250 struct child_pid *child; 251 static struct timed_event *cleanup_te; 225 252 226 253 if (unclean_shutdown) { 227 /* a child terminated uncleanly so tickle all processes to see 228 if they can grab any of the pending locks 229 */ 230 DEBUG(3,(__location__ " Unclean shutdown of pid %u\n", (unsigned int)pid)); 231 messaging_send_buf(smbd_messaging_context(), procid_self(), 232 MSG_SMB_BRL_VALIDATE, NULL, 0); 233 message_send_all(smbd_messaging_context(), 234 MSG_SMB_UNLOCK, NULL, 0, NULL); 254 /* a child terminated uncleanly so tickle all 255 processes to see if they can grab any of the 256 pending locks 257 */ 258 DEBUG(3,(__location__ " Unclean shutdown of pid %u\n", 259 (unsigned int)pid)); 260 if (!cleanup_te) { 261 /* call the cleanup timer, but not too often */ 262 int cleanup_time = lp_parm_int(-1, "smbd", "cleanuptime", 20); 263 cleanup_te = event_add_timed(smbd_event_context(), NULL, 264 timeval_current_ofs(cleanup_time, 0), 265 cleanup_timeout_fn, 266 &cleanup_te); 267 DEBUG(1,("Scheduled cleanup of brl and lock database after unclean shutdown\n")); 268 } 235 269 } 236 270 … … 1048 1082 gain_root_group_privilege(); 1049 1083 1050 /*1051 * Ensure we have CAP_KILL capability set on Linux,1052 * where we need this to communicate with threads.1053 * This is inherited by new threads, but not by new1054 * processes across exec().1055 */1056 set_effective_capability(KILL_CAPABILITY);1057 1058 1084 fault_setup((void (*)(void *))exit_server_fault); 1059 1085 dump_core_setup("smbd"); … … 1281 1307 1282 1308 TALLOC_FREE(frame); 1309 /* make sure we always have a valid stackframe */ 1310 frame = talloc_stackframe(); 1283 1311 1284 1312 smbd_parent_loop(parent); 1285 1313 1286 1314 exit_server_cleanly(NULL); 1315 TALLOC_FREE(frame); 1287 1316 return(0); 1288 1317 } -
vendor/current/source3/smbd/service.c
r414 r427 340 340 iPrinterService = load_registry_service(PRINTERS_NAME); 341 341 } 342 if (iPrinterService ) {342 if (iPrinterService >= 0) { 343 343 DEBUG(3,("checking whether %s is a valid printer name...\n", service)); 344 344 if (pcap_printername_ok(service)) { -
vendor/current/source3/smbd/sesssetup.c
r414 r427 1214 1214 #endif 1215 1215 1216 p2 = (char *)req->buf + data_blob_len;1216 p2 = (char *)req->buf + blob1.length; 1217 1217 1218 1218 p2 += srvstr_pull_req_talloc(talloc_tos(), req, &tmp, p2,
Note:
See TracChangeset
for help on using the changeset viewer.