After applying the patch I get this during a static compile.

alloc.c: In function `ap_init_alloc_shared':
alloc.c:579: `ap_user_id' undeclared (first use in this function)
alloc.c:579: (Each undeclared identifier is reported only once
alloc.c:579: for each function it appears in.)
make[3]: *** [alloc.o] Error 1
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/tmp/apache-ssl/apache_1.3.6/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/tmp/apache-ssl/apache_1.3.6'
make: *** [build] Error 2

John

-----Original Message-----
From: Ralf S. Engelschall [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 24, 1999 2:44 AM
To: [EMAIL PROTECTED]
Subject: Re: mod_ssl 2.3.4 + RH6.0 ==> SIGSEGV


On Thu, Jun 24, 1999, Khimenko Victor wrote:

> 22-Jun-99 15:03 you wrote:
> > On Tue, Jun 22, 1999, GOMEZ Henri wrote:
> 
> >> > > In /var/run directory, the httpd.mm.sem file is
> >> > > owned by root. Mustn't it be by nobody ?
> >> > > When I chown to nobody, seems to work normally.
> >> >
> >>      [GOMEZ Henri]  I could see there is 2 files in /var/run with
.sem
> >> extensions :
> >>
> >>      httpd.mm.sem owned by root
> >>      ssl_scache.sem which is owned by nobody !
> >>
> >>      [GOMEZ Henri]  Who create httpd.mm.sem ?
> 
> > httpd.mm.sem is the mutex lock for the MM library
> > and ssl_scache.sem is the mutex lock of mod_ssl.
> > But both should be owned by nobody, of course.
> 
> With current version of EAPI httpd.mm.sem will be owned by root for
sure.
> This file is created via ap_init_alloc_shared from REALMAIN ...
> WELL before switch from root to nobody. Before even config reading !
> [...]
> Is it really good place for this call ? Or may be we just need one
more chown
> somewhere ? In present state mod_ssl 2.3.5 + mm 1.0.7 need some punch
on
> startup and this is Bad Thing[tm].

Yes, it _has_ to be exactly after the option parsing (to allow -d to
change
the MM paths) and before the config reading (to allow modules to store
the
config data already into shared memory pools). But you're right, a
ap_mm_permission() call after config reading (where ap_user_id is
available)
is missing which does the chown! I append you a patch which I think will
fix
the problem for mod_ssl 2.3.6. Please try it out quickly and give me
feedback
whether it works also for you. Just apply it to the Apache source tree
after
mod_ssl was already applied.
                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com

Index: main/alloc.c
===================================================================
RCS file: /e/modssl/cvs/mod_ssl/pkg.apache/src/main/alloc.c,v
retrieving revision 1.2
diff -u -r1.2 alloc.c
--- main/alloc.c        1999/04/13 10:19:08     1.2
+++ main/alloc.c        1999/06/24 09:41:11
@@ -553,20 +553,31 @@
 }
 
 #if defined(EAPI)
-void ap_init_alloc_shared(void)
+void ap_init_alloc_shared(int early)
 {
 #if defined(EAPI_MM)
     int mm_size;
     char *mm_path;
 
-    mm_size = ap_mm_maxsize();
-    if (mm_size > EAPI_MM_CORE_MAXSIZE)
-        mm_size = EAPI_MM_CORE_MAXSIZE;
-    mm_path = ap_server_root_relative(permanent_pool,
EAPI_MM_CORE_PATH);
-    if ((mm = ap_mm_create(mm_size, mm_path)) == NULL) {
-        fprintf(stderr, "Ouch! ap_mm_create() failed\n");
-        abort();
-        exit(1);
+    if (early) {
+        /* process very early on startup */
+        mm_size = ap_mm_maxsize();
+        if (mm_size > EAPI_MM_CORE_MAXSIZE)
+            mm_size = EAPI_MM_CORE_MAXSIZE;
+        mm_path = ap_server_root_relative(permanent_pool,
EAPI_MM_CORE_PATH);
+        if ((mm = ap_mm_create(mm_size, mm_path)) == NULL) {
+            fprintf(stderr, "Ouch! ap_mm_create() failed\n");
+            abort();
+            exit(1);
+        }
+    }
+    else {
+        /* process a lot later on startup */
+#ifdef WIN32
+        ap_mm_permission(mm, (_S_IREAD|_S_IWRITE), ap_user_id, -1);
+#else
+        ap_mm_permission(mm, (S_IRUSR|S_IWUSR), ap_user_id, -1);
+#endif
     }
 #endif /* EAPI_MM */
     return; 
Index: main/http_main.c
===================================================================
RCS file: /e/modssl/cvs/mod_ssl/pkg.apache/src/main/http_main.c,v
retrieving revision 1.22
diff -u -r1.22 http_main.c
--- main/http_main.c    1999/04/13 10:19:08     1.22
+++ main/http_main.c    1999/06/24 09:36:46
@@ -4661,12 +4661,16 @@
 #endif /* TPF */
 
 #ifdef EAPI
-    ap_init_alloc_shared();
+    ap_init_alloc_shared(TRUE);
 #endif
 
     ap_suexec_enabled = init_suexec();
     server_conf = ap_read_config(pconf, ptrans, ap_server_confname);
 
+#ifdef EAPI
+    ap_init_alloc_shared(FALSE);
+#endif
+
     if (configtestonly) {
         fprintf(stderr, "Syntax OK\n");
         exit(0);
@@ -6045,7 +6049,7 @@
     }
 
 #ifdef EAPI
-    ap_init_alloc_shared();
+    ap_init_alloc_shared(TRUE);
 #endif
 
     if (!child && run_as_service) {
@@ -6053,6 +6057,10 @@
     }
 
     server_conf = ap_read_config(pconf, ptrans, ap_server_confname);
+
+#ifdef EAPI
+    ap_init_alloc_shared(FALSE);
+#endif
 
     if (configtestonly) {
         fprintf(stderr, "Syntax OK\n");
Index: include/alloc.h
===================================================================
RCS file: /e/modssl/cvs/mod_ssl/pkg.apache/src/include/alloc.h,v
retrieving revision 1.2
diff -u -r1.2 alloc.h
--- include/alloc.h     1999/04/13 10:18:27     1.2
+++ include/alloc.h     1999/06/24 09:34:27
@@ -96,7 +96,7 @@
 #if defined(EAPI)
 typedef enum { AP_POOL_RD, AP_POOL_RW } ap_pool_lock_mode;
 int ap_shared_pool_possible(void);
-void ap_init_alloc_shared(void);
+void ap_init_alloc_shared(int);
 API_EXPORT(pool *) ap_make_shared_sub_pool(pool *);
 API_EXPORT(int) ap_acquire_pool(pool *, ap_pool_lock_mode);
 API_EXPORT(int) ap_release_pool(pool *);
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to