redballoonsecurity / ofrak

OFRAK: unpack, modify, and repack binaries.
https://ofrak.com
Other
1.85k stars 127 forks source link

Cloning repository on Windows adds carriage return characters which can break Docker builds #248

Open EdwardLarson opened 1 year ago

EdwardLarson commented 1 year ago

What is the problem? (Here is where you provide a complete Traceback.) For example, building the ofrak tutorial image will fail with a "file not found" error which traces back to the interpreter on the first line of generate_stripped_notebook.sh being not found, because it is looking for "/bin/bash^M" (^M is the carriage return character that Windows expects and automatically added by git).

Please provide some information about your environment. This is seen on Windows with the Windows Git GUI.

If you've discovered it, what is the root cause of the problem? Git (and/or perhaps Visual Studio) adding Windows line endings to files which are only meant to run in Linux Docker containers.

How often does the issue happen?

What are the steps to reproduce the issue? Git clone the repo on windows, run the command to build the tutorial image.

How would you implement this fix? According to this, we might be able to set up .gitattributes so that git will not try to change the line endings when cloning on Windows. We can target this at specific files, maybe we want it on all files. TBD

Are there any (reasonable) alternative approaches? Not sure, TBD

Are you interested in implementing it yourself? Certainly not today