~sircmpwn/himitsu-devel

2

Re: [PATCH himitsu] himitsu::query: Add error message about duplicate keys

Details
Message ID
<Za6UhN4XzxHHoP2p@cloudsdale.the-delta.net.eu.org>
DKIM signature
pass
Download raw message
[2024-01-22 15:01:55+0100] Armin Preiml:
> query::parse_items should not have the side-effect of writing error
> messages to stdout. It does not fail silently since it returns the
> dupkeys error.

Yeah but that's ignored by secstore/secstore.ha:331 and dupkeys is just !void
so doesn't contains enough information to be useful.

> I think figuring out what keys are duplicates can easily be done by the
> user. Though if this is really a desired feature, the output should be
> done at the tool that uses query::parse. The tool must then figure out
> the duplicates on their own, but then a method to find duplicates could
> be provided by the query module.

Maybe it could pass the duplicated key? And I'm not sure which tool you're
referring to, himitsud will abort once the passphrase is unlocked when there's
duplicated keys.
Which btw I'd see as a bug, as then you can't remove the offending entry.

At least for me with 316 entries (which you'd multiply by ~3 for keys) it
wasn't really doable to do a manual check.

Re: [PATCH himitsu] himitsu::query: Add error message about duplicate keys

Details
Message ID
<8a8b636f-d172-4775-8b8b-20dead76f897@strohwolke.at>
In-Reply-To
<Za6UhN4XzxHHoP2p@cloudsdale.the-delta.net.eu.org> (view parent)
DKIM signature
pass
Download raw message
On 1/22/24 17:17, Haelwenn (lanodan) Monnier wrote:
> Maybe it could pass the duplicated key? And I'm not sure which tool you're
> referring to, himitsud will abort once the passphrase is unlocked when 
> there's
> duplicated keys.
> Which btw I'd see as a bug, as then you can't remove the offending entry.

I see. I'd suggest maybe to split the validation into a separate 
function and provide something like query::parse_unsafe, that is only 
called in himitsud? So himitsu can call this and then validate. Validate 
will provide all duplicate keys. The normal parse function calls 
validate, frees the return and then returns only the error?

Or dupkeys could just be a slice of strings. But I don't really like 
having errors with allocated values, since it's easy to forget freeing them.

Re: [PATCH himitsu] himitsu::query: Add error message about duplicate keys

Details
Message ID
<02db25b6-23ca-411f-a74c-06f2ebe74364@strohwolke.at>
In-Reply-To
<Za6UhN4XzxHHoP2p@cloudsdale.the-delta.net.eu.org> (view parent)
DKIM signature
pass
Download raw message
I have an idea for a simpler solution. Will send a patch tomorrow.
Reply to thread Export thread (mbox)