On Tue, 25 Sep 2007 14:29:13 +0100, Ben Clewett <[EMAIL PROTECTED]>
scribbled:

Hello
[snip]
> [Tue Sep 25 14:24:20 2007] [crit] Failed to remove dashboard file 
> '/tmp/mod_mono_dashboard_XXGLOBAL_1', further actions impossible. 
> Operation not permitted
Can you test the attached patch by applying it to mod_mono sources and
recompiling the module? Please let me know if it fixes your problem,

thanks,

marek
Index: src/mod_mono.c
===================================================================
--- src/mod_mono.c	(revision 86366)
+++ src/mod_mono.c	(working copy)
@@ -324,7 +324,19 @@
 			      "been parsed. Not initializing the dashboard.");
 		return;
 	}
+#endif
+
+	if (!xsp->dashboard_shm) {
+		DEBUG_PRINT (1, "removing dashboard file '%s' as root", xsp->dashboard_file);
+		if (unlink (xsp->dashboard_file) == -1 && errno != ENOENT) {
+			ap_log_error (APLOG_MARK, APLOG_CRIT, STATUS_AND_SERVER,
+				      "Failed to remove dashboard file '%s', further actions impossible. %s",
+				      xsp->dashboard_file, strerror (errno));
+			return;
+		}
+	}
 	
+#if defined (APR_HAS_USER) && defined (HAVE_UNIXD)
 	if (apr_uid_current (&cur_uid, &cur_gid, p) == APR_SUCCESS && cur_uid == 0) {
 		DEBUG_PRINT (2, "Temporarily switching to target uid/gid");
 		switch_back_to_root = 1;
@@ -366,12 +378,6 @@
 		rv = apr_shm_attach (&xsp->dashboard_shm, xsp->dashboard_file, p);
 		if (rv != APR_SUCCESS) {
 			DEBUG_PRINT (1, "creating dashboard '%s'", xsp->dashboard_file);
-			if (unlink (xsp->dashboard_file) == -1 && errno != ENOENT) {
-				ap_log_error (APLOG_MARK, APLOG_CRIT, STATUS_AND_SERVER,
-					      "Failed to remove dashboard file '%s', further actions impossible. %s",
-					      xsp->dashboard_file, strerror (errno));
-				goto restore_creds;
-			}
 			
 			old_umask = umask (0077);
 			rv = apr_shm_create (&xsp->dashboard_shm, sizeof (dashboard_data), xsp->dashboard_file, p);

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to