- Updated `cupsRasterReadPixels` and `cupsRasterWritePixels` to not try reading
or writing if the number of bytes passed is 0 (Issue #914)
- Updated and documented the MIME typing buffering limit (Issue #925)
+- Updated the maximum file descriptor limit for `cupsd` to 64k-1 (Issue #989)
- Fixed use-after-free in `cupsdAcceptClient()` when we log warning during error
handling (fixes CVE-2023-34241)
- Fixed hanging of `lpstat` on Solaris (Issue #156)
#endif /* HAVE_DBUS_THREADS_INIT */
/*
- * Set the maximum number of files...
+ * Set the maximum number of files, which for practical reasons can be limited
+ * to the number of TCP port number values (64k-1)...
*/
getrlimit(RLIMIT_NOFILE, &limit);
-#ifdef RLIM_INFINITY
- if (limit.rlim_max == RLIM_INFINITY)
- MaxFDs = 16384;
- else
-#endif /* RLIM_INFINITY */
- MaxFDs = limit.rlim_max;
+ if ((MaxFDs = limit.rlim_max) > 65535)
+ MaxFDs = 65535;
limit.rlim_cur = (rlim_t)MaxFDs;