Bzr inetd smart server requires write access on the user's home directory

Bug #129030 reported by Raphaël Hertzog
6
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
High
Andrew Bennetts

Bug Description

I setup the smart server running with a user that has no write rights on any directory (not even his home directory) and if I try to checkout something over the smart server I get this error:
bzr: ERROR: Generic bzr smart protocol error: bad response ("failed to open trace file: [Errno 13] Permission denied: '.bzr.log'",)

I asked in #bzr and I've been told the following:
<spiv> buxy: Hmm, it'll be trying to open it in ~/.bzr.log, though.
<buxy> spiv: what is this used for?
<spiv> buxy: debugging
<buxy> spiv: and can't it be disabled?
<spiv> buxy: not at the moment :(
 buxy: I can tell you how to hack the source if that helps
<buxy> why not, but it's a bit strange, for something that should be runnable in production :-)
<spiv> buxy: it's a bug :)
* spiv thinks about best way to workaround it
<buxy> is the bug already reported or should I report it so that we have at least an option to disable it in the next release?
<spiv> Please report it.

So here you are. :-)

Revision history for this message
Andrew Bennetts (spiv) wrote :

Also from that conversation:

< buxy> Of course, it's started by inetd with a user that has no right on the repositories

So I've clarified the title of the bug appropriately, because it doesn't affect the the smart server in general, just in certain uses (e.g. bzr+ssh:// in a typical environment where a user has a write home directory works fine).

Revision history for this message
Andrew Bennetts (spiv) wrote :

I think this is a pretty serious bug.

Changed in bzr:
assignee: nobody → spiv
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Andrew Bennetts (spiv) wrote :

I gave this patch over IRC to workaround the problem:

=== modified file 'bzr'
--- bzr 2007-07-10 01:37:27 +0000
+++ bzr 2007-07-29 11:08:17 +0000
@@ -95,6 +95,7 @@
             % (bzrlib.__path__, bzrlib.version_info))

 if __name__ == '__main__':
+ bzrlib.trace.open_tracefile(tracefilename='/var/log/bzr/trace.log')
     bzrlib.trace.enable_default_logging()
     exit_val = bzrlib.commands.main(sys.argv)

=== modified file 'bzrlib/trace.py'
--- bzrlib/trace.py 2007-07-02 04:48:41 +0000
+++ bzrlib/trace.py 2007-07-29 11:10:44 +0000
@@ -152,6 +152,8 @@
         else:
             home = os.path.expanduser('~')
         _bzr_log_filename = os.path.join(home, '.bzr.log')
+ else:
+ _bzr_log_filename = tracefilename

     _bzr_log_filename = os.path.expanduser(_bzr_log_filename)
     _rollover_trace_maybe(_bzr_log_filename)

Probably what's needed is a command-line way to set the trace file explicitly.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 129030] Re: Bzr inetd smart server requires write access on the user's home directory

If I was setting it up from inetd then I'd want either

 - logging to syslog(daemon) by default
 - a command-line option to log to a given file

--
Martin

Revision history for this message
Sebastian Kuzminsky (seb-highlab) wrote :

(This bug should maybe be merged with https://bugs.launchpad.net/bzr/+bug/106117)

I'm trying to run the bzr smart-server from inetd as user nobody, to provide read-only access to the repo for our buildbot. nobody has no home, so the bzr client fails with this error:

0 buildbot@nappy /home/buildbot/Buildbot/masters/bionet2> bzr ls bzr://bioserve.colorado.edu/bionet2/trunk
Server does not understand Bazaar network protocol 3, reconnecting. (Upgrade the server to avoid this.)
Server does not understand Bazaar network protocol 2, reconnecting. (Upgrade the server to avoid this.)
bzr: ERROR: Generic bzr smart protocol error: Server is not a Bazaar server: Received bad protocol version marker: 'No handlers could be found for logger "bzr"\n'
3 buildbot@nappy /home/buildbot/Buildbot/masters/bionet2>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.