monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] [bug #30150] annotate broken for files with revisio


From: Thomas Keller
Subject: Re: [Monotone-devel] [bug #30150] annotate broken for files with revisions signed by disliked signers
Date: Tue, 22 Jun 2010 15:58:33 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.9) Gecko/20100317 SUSE/3.0.4-1.1.1 Lightning/1.0b2pre Thunderbird/3.0.4

(I wrote this email some time ago, but apparently used a wrong address,
if you get this email a second time, I'm sorry...)

Am 16.06.10 08:30, schrieb 4get:
> 
> URL:
>   <http://savannah.nongnu.org/bugs/?30150>
> [...]
> mtn annotate fails with error message "misuse: unrecognized date (monotone
> only understands ISO 8601 format)" when trying to dump revisions signed by
> signers that are not on the trusted list.
> 
> Also revisions before 758da9215e79f1580611a92853def8e5430e00a5 were broken in
> a nonfatal way - mtn just printed empty strings in <author> and <date>
> fields.
> 
> Bug location: 
>  annotate.cc / build_revisions_to_annotations(..)
> 
> Bug sequence: 
>  project.db.erase_bogus_certs(..) kills untrusted certificates, 
>  cert_date_value(..) fails to locate untrusted certificate and tries to
> format an empty timestamp string.
> 
> Steps to reproduce:
> 
> 1) setup monotonerc with the following trust list
> http://www.i2p2.de/license-agreements.html 
> 2) mtn --db=i2p.mtn db init
> 3) mtn --db=i2p.mtn pull mtn.i2p-projekt.de i2p.i2p
> 4) mtn --db=i2p.mtn --branch=i2p.i2p checkout
> 5) cd i2p.i2p
> 6) mtn annotate apps/routerconsole/locale/messages_de.po
> 
> mtn would warn about 1 disliked signer on revision
> 136dff2bda139907eb30f0ec7d7bba09313bc829
> and fail with "misuse: unrecognized date (monotone only understands ISO 8601
> format)"

I've looked into this one. The easiest way to fix the issue (and restore
the original behaviour) is probably this:

#
# old_revision [648cf153cdebcadbda6760c35b1bffc11d3dabf7]
#
# patch "annotate.cc"
#  from [148031d40f893f9a31c9bcc5644e12e5601d5255]
#    to [d23b756a520000382e1a4c30c52498c16ef70a0d]
#
============================================================
--- annotate.cc 148031d40f893f9a31c9bcc5644e12e5601d5255
+++ annotate.cc d23b756a520000382e1a4c30c52498c16ef70a0d
@@ -379,7 +379,7 @@ cert_date_value(vector<cert> const & cer
                 string const & fmt)
 {
     string certval = cert_string_value(certs, name, from_start,
from_end, "");
-    if (fmt.empty())
+    if (fmt.empty() || certval.empty())
         return certval;
     return date_t(certval).as_formatted_localtime(fmt);
 }

but I think annotate should be a bit smarter than outputting nothing,
e.g. I thought it could output the string "<untrusted>" for each empty
cert it encounters, so the output could be

        86e0c6ba.. by <untrusted> 2010-01-01 : foo

for untrusted author certs,

        86e0c6ba.. by joe <untrusted>: foo

for untrusted date certs and finally

        86e0c6ba.. by <untrusted> <untrusted>: foo

if both certs are untrusted.

This is however a bit problematic, since we cannot distinguish at this
point between untrusted and simply non-existing certs, as
database::remove_bogus_certs plainly removed all invalid.

So I thought about removing the call to project.db.erase_bogus_certs()
and do the cert processing / evaluation in annotate.cc myself, but then
this looked like a bit more work and might be not wanted...

Opinions?

Thomas.

-- 
GPG-Key 0x160D1092 | address@hidden | http://thomaskeller.biz
Please note that according to the EU law on data retention, information
on every electronic information exchange might be retained for a period
of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en



Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]