jorabin / KeePassJava2

Java API for KeePass Password Databases - Read/Write 2.x (File versions 3 and 4), Read 1.x
Apache License 2.0
250 stars 71 forks source link

Detect existing Recycle Bin group if it wasn't specified in Meta #34

Closed aivanovski closed 1 year ago

aivanovski commented 2 years ago

Some KeePass clients may create "Recycle Bin" but don't specify it in database metadata. In order to not create an excessive "Recycle Bin" group, it can be detected by name. If a group with the name "Recycle Bin" wasn't found, then create a new one.

aivanovski commented 2 years ago

@jorabin Hi, could you please have a look at this PR?

jorabin-51d commented 2 years ago

hi @aivanovski many thanks for your PR - I'm afraid I have had zero time to attend to anything on this project, but hope to be able to do an update at some point in the not too distant future. Plan will first to merge the branch with v4 file format/encryption then we will see where we are.

jorabin commented 1 year ago

I thought I had left a comment on this some days ago, but don't see it. Apologies for any duplication.

I'm concerned that any such change might have a negative impact if implemented across the board. Wonder if it is better addressed in user code where it could be tailored to specific known problems, using a combination of

database.findEntries("Recycle Bin")

and

database.getRecycleBin()

or am I misunderstanding the problem? Are you saying that a

database.setRecycleBin(Group g)

method is needed?

aivanovski commented 1 year ago

Hi, You understand it absolutely correctly and your solution database.setRecycleBin(Group g) will definitely work better than my hot-fix. I think it's better to cancel this PR then. @jorabin

jorabin commented 1 year ago

Hi, You understand it absolutely correctly and your solution database.setRecycleBin(Group g) will definitely work better than my hot-fix. I think it's better to cancel this PR then. @jorabin

OK, well then I raised #44 as a result. Keen to hear your views and I am closing this now, assuming we don't need to proceed with it.