to the rule that symlink permissions are tested with the symlink
options of the parent directory. [Dean Gaudet] PR#353
+ *) CONFIG: The LockFile directive can be used to place the serializing
+ lockfile in any location. It previously defaulted to /usr/tmp/htlock.
+ [Somehow it took three of us: Jim Jaglieski, Dean Gaudet, Marc Slemko]
+
*) QUERY_STRING was unescaped in mod_include, it shouldn't be.
[Dean Gaudet] PR#644
directives. But using -DHIGH_SLACK_LINE=256 described above will
work around this problem. [Dean Gaudet]
+ *) USE_FLOCK_SERIALIZED_ACCEPT is now default for FreeBSD, A/UX, and
+ SunOS 4.
+
*) Improved unix error response logging. [Marc Slemko]
*) Update mod_rewrite from 3.0.5 to 3.0.6. New ruleflag
typedef int rlim_t;
#define memmove(a,b,c) bcopy(b,a,c)
#define NO_LINGCLOSE
+#define USE_FLOCK_SERIALIZED_ACCEPT
#elif defined(SOLARIS2)
#undef HAVE_GMTOFF
#define NEED_STRDUP
#define JMP_BUF sigjmp_buf
/* fcntl() locking is expensive with NFS */
-#undef USE_FLOCK_SERIALIZED_ACCEPT
+#define USE_FLOCK_SERIALIZED_ACCEPT
#define HAVE_SHMGET
-#define MOVEBREAK 0x4000000
/*
* NOTE: If when you run Apache under A/UX and you get a warning
- * that httpd couldn't move break, then the above value for
+ * that httpd couldn't move break, then the below value for
* MOVEBREAK (64megs) is too large for your setup. Try reducing
* to 0x2000000 which is still PLENTY of space. I doubt if
* even on heavy systems sbrk() would be called at all...
*/
+#define MOVEBREAK 0x4000000
#define NO_LINGCLOSE
#define NO_SLACK
(defined(__FreeBSD_version) && (__FreeBSD_version < 220000))
typedef quad_t rlim_t;
#endif
+#define USE_FLOCK_SERIALIZED_ACCEPT
#elif defined(QNX)
#ifndef crypt
typedef int rlim_t;
#define memmove(a,b,c) bcopy(b,a,c)
#define NO_LINGCLOSE
+#define USE_FLOCK_SERIALIZED_ACCEPT
#elif defined(SOLARIS2)
#undef HAVE_GMTOFF
#define NEED_STRDUP
#define JMP_BUF sigjmp_buf
/* fcntl() locking is expensive with NFS */
-#undef USE_FLOCK_SERIALIZED_ACCEPT
+#define USE_FLOCK_SERIALIZED_ACCEPT
#define HAVE_SHMGET
-#define MOVEBREAK 0x4000000
/*
* NOTE: If when you run Apache under A/UX and you get a warning
- * that httpd couldn't move break, then the above value for
+ * that httpd couldn't move break, then the below value for
* MOVEBREAK (64megs) is too large for your setup. Try reducing
* to 0x2000000 which is still PLENTY of space. I doubt if
* even on heavy systems sbrk() would be called at all...
*/
+#define MOVEBREAK 0x4000000
#define NO_LINGCLOSE
#define NO_SLACK
(defined(__FreeBSD_version) && (__FreeBSD_version < 220000))
typedef quad_t rlim_t;
#endif
+#define USE_FLOCK_SERIALIZED_ACCEPT
#elif defined(QNX)
#ifndef crypt
extern char *pid_fname;
extern char *scoreboard_fname;
+extern char *lock_fname;
extern char *server_argv0;
/* Trying to allocate these in the config pool gets us into some *nasty*
#endif
#define DEFAULT_PIDLOG "logs/httpd.pid"
#define DEFAULT_SCOREBOARD "logs/apache_runtime_status"
+#define DEFAULT_LOCKFILE "logs/accept.lock"
/* Define this to be what your HTML directory content files are called */
#define DEFAULT_INDEX "index.html"
daemons_limit = HARD_SERVER_LIMIT;
pid_fname = DEFAULT_PIDLOG;
scoreboard_fname = DEFAULT_SCOREBOARD;
+ lock_fname = DEFAULT_LOCKFILE;
max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
bind_address.s_addr = htonl(INADDR_ANY);
listeners = NULL;
return NULL;
}
+const char *set_lockfile (cmd_parms *cmd, void *dummy, char *arg) {
+ lock_fname = pstrdup (cmd->pool, arg);
+ return NULL;
+}
+
const char *set_idcheck (cmd_parms *cmd, core_dir_config *d, int arg) {
d->do_rfc1413 = arg;
return NULL;
"A file for logging the server process ID"},
{ "ScoreBoardFile", set_scoreboard, NULL, RSRC_CONF, TAKE1,
"A file for Apache to maintain runtime process management information"},
+{ "LockFile", set_lockfile, NULL, RSRC_CONF, TAKE1,
+ "The lockfile used when Apache needs to lock the accept() call"},
{ "AccessConfig", set_server_string_slot,
(void *)XtOffsetOf (server_rec, access_confname), RSRC_CONF, TAKE1,
"The filename of the access config file" },
int max_requests_per_child;
char *pid_fname;
char *scoreboard_fname;
+char *lock_fname;
char *server_argv0;
struct in_addr bind_address;
listen_rec *listeners;
#define ap_killpg(x, y) (killpg ((x), (y)))
#endif
+#if defined(USE_FCNTL_SERIALIZED_ACCEPT) || defined(USE_FLOCK_SERIALIZED_ACCEPT)
+static void expand_lock_fname(pool *p)
+{
+ char buf[20];
+
+ ap_snprintf( buf, sizeof(buf), ".%u", getpid() );
+ lock_fname = pstrcat (p, server_root_relative (p, lock_fname), buf, NULL);
+}
+#endif
+
#if defined(USE_FCNTL_SERIALIZED_ACCEPT)
static struct flock lock_it;
static struct flock unlock_it;
*/
void
accept_mutex_init(pool *p)
- {
- char lock_fname[256];
+{
lock_it.l_whence = SEEK_SET; /* from current point */
lock_it.l_start = 0; /* -"- */
unlock_it.l_type = F_UNLCK; /* set exclusive/write lock */
unlock_it.l_pid = 0; /* pid not actually interesting */
-#ifdef __MACHTEN__
- strncpy(lock_fname, "/var/tmp/htlock.XXXXXX", sizeof(lock_fname)-1);
-#else
- strncpy(lock_fname, "/usr/tmp/htlock.XXXXXX", sizeof(lock_fname)-1);
-#endif
- lock_fname[sizeof(lock_fname)-1] = '\0';
-
- if (mktemp(lock_fname) == NULL || lock_fname[0] == '\0')
- {
- fprintf (stderr, "Cannot assign name to lock file!\n");
- exit (1);
- }
-
+ expand_lock_fname (p);
lock_fd = popenf(p, lock_fname, O_CREAT | O_WRONLY | O_EXCL, 0644);
if (lock_fd == -1)
{
void
accept_mutex_init(pool *p)
{
- char lock_fname[256];
-
- strncpy(lock_fname, "/usr/tmp/htlock.XXXXXX", sizeof(lock_fname)-1);
- lock_fname[sizeof(lock_fname)-1] = '\0';
-
- if (mktemp(lock_fname) == NULL || lock_fname[0] == '\0')
- {
- fprintf (stderr, "Cannot assign name to lock file!\n");
- exit (1);
- }
+ expand_lock_fname (p);
lock_fd = popenf(p, lock_fname, O_CREAT | O_WRONLY | O_EXCL, 0644);
if (lock_fd == -1)
{