Re: [Monotone-devel] Server fails to start up because it messes with MT directory

2005-05-07 Thread Nathaniel Smith
On Sat, May 07, 2005 at 12:25:16AM -0500, Timothy Brownawell wrote:
 It's trying to read MT/options. Since anything in this file can be put
 on the command line (so it's not critical to be able to read this),
 here's a patch to turn this into a warning. If there are no
 objections, I'll merge it in a couple days.

Looks good to me.  Add a test?

-- Nathaniel

-- 
  /* Tell the world that we're going to be the grim
   * reaper of innocent orphaned children.
   */
-- Linux kernel 2.4.5, main.c


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] Server fails to start up because it messes with MT directory

2005-05-07 Thread Timothy Brownawell
On 5/7/05, Nathaniel Smith [EMAIL PROTECTED] wrote:
 On Sat, May 07, 2005 at 12:25:16AM -0500, Timothy Brownawell wrote:
  It's trying to read MT/options. Since anything in this file can be put
  on the command line (so it's not critical to be able to read this),
  here's a patch to turn this into a warning. If there are no
  objections, I'll merge it in a couple days.
 
 Looks good to me.  Add a test?

OK, there's a test now, and also a matching check in write_options.
Will be merged tomorrow.

Might also get some of the places that could do with more informative
error messages for this (unreadable files).

Tim


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] Server fails to start up because it messes with MT directory

2005-05-06 Thread Timothy Brownawell
On 02 May 2005 14:36:41 +0200, Peter Simons [EMAIL PROTECTED] wrote:
 Hi,
 
 I've run into the following problem: I start my monotone
 Netsync server using a separate user id: 'monoserv'. When I
 do so while being in a current working directory which is a
 monotone repository though, I get this error message:
 
   monotone: fatal: std::exception:
 boost::filesystem::is_directory: /root/MT:
 Permission denied
 
 That's what I got while being in ~root, obviously.
 
 Now, I start the process with
 
   --norc --rcfile=/full/path/to/permissions.lua
 
 flags, so IMHO it shouldn't access the local MT directory!
 
 Did I miss something, or is this a bug?

It's trying to read MT/options. Since anything in this file can be put
on the command line (so it's not critical to be able to read this),
here's a patch to turn this into a warning. If there are no
objections, I'll merge it in a couple days.

Tim

#
# patch app_state.cc
#  from [da30ae47064dd3743fd31e7ce99dcb9c7fdf7813]
#to [428b3e3ec88e16568de00a00f1b79fb3fe4bb983]
#
--- app_state.cc
+++ app_state.cc
@@ -356,13 +356,19 @@
 {
   local_path o_path;
   get_options_path(o_path);
-
-  if (file_exists(o_path))
+  try
 {
-  data dat;
-  read_data(o_path, dat);
-  read_options_map(dat, options);
+  if (file_exists(o_path))
+{
+  data dat;
+  read_data(o_path, dat);
+  read_options_map(dat, options);
+}
 }
+  catch(std::exception  e)
+{
+  W(F(Failed to read options file %s) % o_path);
+}
 }

 void


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel