-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Carriage returns in file names cause corrupted verbose output #4191
Comments
Is it not better to fix the actual shenanigans in your filenames instead of shoving them under the carpet? If restic silently sanitizes CR you will keep having bad filenames ;) |
You can't expect users to change the data they're going to back up to suit the backup program. That goes against the idea of backups. |
Thanks, but you seem to have completely misread what I wrote. I never suggested that users change their data to suit the backup program. I asked them if they wouldn't think that fixing the actual root cause of the problem is a good idea, instead of just hiding the problem. Simply because fixing things instead of hiding things is generally a good idea.
The idea of backups is to back data up, and this is exactly what restic does regardless of whether there's a CR in the filename or not. I also never suggested that we should not clean broken filenames up when printing them. |
Alright, misunderstanding on my part. Sorry! |
Fixed by #4192 |
Output of
restic version
restic 0.15.0 compiled with go1.19.5 on darwin/arm64
How did you run restic exactly?
What backend/server/service did you use to store the repository?
GCP Coldline storage
Expected behavior
If a filename contains a carriage return, it should be sanitized before printing to the terminal.
Actual behavior
When backing up file names containing carriage returns, the verbose output gets corrupted because the carriage returns are output directly to the terminal, sending the following output to the beginning of the lines. Here's a a real example. Dunno why, but I have a folder whos name contains a carriage return character:
Linux Admin Security Guide<CR>
. The verbose output prints like:These first seven lines should appear more like:
Steps to reproduce the behavior
restic backup
with verbose output enabled.Do you have any idea what may have caused this?
Special characters in file names are printed as-is to the terminal.
Do you have an idea how to solve the issue?
Special characters in file names should be sanitized before printing to the terminal.
Did restic help you today? Did it make you happy in any way?
Restic is awesome. Thanks!
The text was updated successfully, but these errors were encountered: