bugmonotone - Bugs: bug #5273, lscerts crashes if it finds a cert...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #5273: lscerts crashes if it finds a cert with unknown key

Submitted by:  Nathaniel Smith <njs>
Submitted on:  Sun 14 Sep 2003 06:22:12 AM UTC  
 
Category: command line UISeverity: 1 - Wish
Item Group: incorrect behaviorStatus: Fixed
Privacy: PublicAssigned to: graydon hoare <graydon>
Open/Closed: Closed
mtn version --full: 

Sun 14 Sep 2003 06:22:12 AM UTC, original submission:

$ monotone fetch http://www.off.net/monotone/depot.cgi \
monotone
fetching packets from group monotone at http://www.off.net/monotone/depot.cgi
fetched 540 packets
$ monotone --branch=monotone lscerts manifest \
c04615a4dad6552a985074bc0d5362982c3b3d02
skipping nonexistent rcfile '/home/njs/.monotonerc'
executing lscerts command
db.execute("BEGIN")
db.fetch("SELECT version FROM schema_version")
db.fetch("SELECT id, name, value, keypair, signature FROM 'manifest_certs' WHERE id = 'c04615a4dad6552a985074bc0d5362982c3b3d02'")
cert: signable text [ancestor@c04615a4dad6552a985074bc0d5362982c3b3d02:YjNmNTRiODYzMjJkOGY2NjBlNTBmY2NkNThkNzI5MjYxNmRjZTg0Mg==]
db.fetch("SELECT keydata FROM public_keys where id = 'tromey@peakpeak.com'")
db.execute("ROLLBACK")

      • Error: std::runtime_error: db query [SELECT keydata FROM public_keys where id = '%q']: wanted 1 columns, got 0
        • error return code 205
                    • errors detected; see standard output for details ***********

The problem is that cert.cc:check_cert calls app.db.get_key(), which throws the above exception when asked to fetch a key that doesn't exist. The fix isn't obvious to me; somehow get_key should be being more specific about the error it's throwing (check_cert shouldn't just catch all runtime_exceptions, including "database corrupt" and the like), and then check_cert needs to do something useful with this information. Unfortunately check_cert just returns a boolean good/bad signature, which isn't really sufficient in this case, since lscerts would like to distinguish cert good/cert bad/cert of unknown provenance.

Nathaniel Smith <njs>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 6 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 01 Oct 2003 09:43:47 PM UTCgraydonCategoryNone=>(Error - Not Found)
  Severity3 - Normal=>(Error - Not Found)
  Item GroupNone=>(Error - Not Found)
  StatusNone=>(Error - Not Found)
  Assigned toNone=>NA
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1