2.2 release imminent.

Eric Boehm boehm at nortelnetworks.com
Tue Apr 10 00:35:10 GMT 2001


I submitted a patch to lib/util.c back in January/February. It's a rather
small change that makes it possible to open more than 1014 files under
Solaris, HP-UX, Linux without the need to raise the systemwide open file
descriptor limit. 

It also preserves existing behavior if the attempt fails.

--- samba-2.0.7/source/lib/util.c.~1~	Tue Apr 25 19:06:53 2000
+++ samba-2.0.7/source/lib/util.c	Tue Jan 23 08:00:48 2001
@@ -3012,6 +3012,18 @@
 	 * which always returns RLIM_INFINITY for rlp.rlim_max.
 	 */
 
+        if ( geteuid() == 0 ) {
+          
+          if ( rlp.rlim_max < requested_max ) {
+            rlp.rlim_max = requested_max;
+          }
+
+          if(setrlimit(RLIMIT_NOFILE, &rlp)) {
+            DEBUG(0,("set_maxfiles: setrlimit for RLIMIT_NOFILE for %d max files failed with error %s\n", 
+                     (int)rlp.rlim_max, strerror(errno) ));
+          }
+        }
+
 	saved_current_limit = rlp.rlim_cur = MIN(requested_max,rlp.rlim_max);
 
 	if(setrlimit(RLIMIT_NOFILE, &rlp)) {

-- 
Eric M. Boehm                               boehm at nortelnetworks.com




More information about the samba-technical mailing list