You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the tool does not work under Windows without administrative privileges. This is a limitation due to Windows. I would suggest that binwalk would switch to hardlinks (does not need the admin privileges) for the original file when used with windows. Additionally it would probably make sense that a flag could be set to not create the symlink file at all. Anyway, the bug is quite easily fixed by:
diff --git a/src/binwalk.rs b/src/binwalk.rs
index 678df95..91c70fc 100644
--- a/src/binwalk.rs
+++ b/src/binwalk.rs
@@ -723,23 +723,23 @@ fn init_extraction_directory(
);
// Create a path for the symlink target path
- let symlink_path = path::Path::new(&symlink_target_path_str);
+ let link_path = path::Path::new(&symlink_target_path_str);
debug!(
"Creating symlink from {} -> {}",
- symlink_path.display(),
+ link_path.display(),
target_path.display()
);
// Create a symlink from inside the extraction directory to the specified target file
#[cfg(unix)]
{
- match unix::fs::symlink(target_path, symlink_path) {
+ match unix::fs::symlink(target_path, link_path) {
Ok(_) => Ok(symlink_target_path_str),
Err(e) => {
error!(
"Failed to create symlink {} -> {}: {}",
- symlink_path.display(),
+ link_path.display(),
target_path.display(),
e
);
@@ -749,14 +749,14 @@ fn init_extraction_directory(
}
#[cfg(windows)]
{
- match windows::fs::symlink_file(target_path, symlink_path) {
+ match std::fs::hard_link(target_path, link_path){
Ok(_) => {
return Ok(symlink_target_path_str);
}
Err(e) => {
error!(
- "Failed to create symlink {} -> {}: {}",
- symlink_path.display(),
+ "Failed to create hardlink {} -> {}: {}",
+ link_path.display(),
target_path.display(),
e
);
I could submit a PR regarding this issue.
BTW, big fan of the tool.
The text was updated successfully, but these errors were encountered:
I noticed that the tool does not work under Windows without administrative privileges. This is a limitation due to Windows. I would suggest that binwalk would switch to hardlinks (does not need the admin privileges) for the original file when used with windows. Additionally it would probably make sense that a flag could be set to not create the symlink file at all. Anyway, the bug is quite easily fixed by:
I could submit a PR regarding this issue.
BTW, big fan of the tool.
The text was updated successfully, but these errors were encountered: