Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Rewrite should back up the original jar(s) by default #13

Open
mslinn opened this issue Dec 29, 2021 · 5 comments
Open

Rewrite should back up the original jar(s) by default #13

mslinn opened this issue Dec 29, 2021 · 5 comments

Comments

@mslinn
Copy link

mslinn commented Dec 29, 2021

Tools that offer to fix things without backing up the originals can create a problem if the process dies unexpectedly. The original jar(s) should be saved by default, perhaps with a .jar.save suffix.

There could be an option to suppress the backup, for the brave, the foolish, and for dev/test.

@ericchiang
Copy link
Member

Would be okay with this behind a flag. On other systems, we run this continuously, and we don't want to continually detect the backup. Maybe something like:

-b --backup   Suffix to use to backup a file when rewriting (.bak)

So you could supply

log4jscanner --rewrite --backup '.save' /

@mslinn
Copy link
Author

mslinn commented Dec 29, 2021

LGTM

@karchx
Copy link
Contributor

karchx commented Jan 4, 2022

That problem has already been solved or can I try to take care of it?

@mslinn
Copy link
Author

mslinn commented Jan 4, 2022

The current HEAD shows log4jscanner.go does not contain a -b / --backup option. The way @ericchiang worded his response above, it would seem that the option was only discussed and no-one took on the job.

Go for it!

@karchx
Copy link
Contributor

karchx commented Jan 6, 2022

Greetings @ericchiang, with a simple query, for the functions used in the backup, do I put it in the jar / backup.go directory or create a separate directory?

@karchx karchx mentioned this issue Jun 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants