Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b286c29
Showing
5 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
*** ext4magic-fix-segfault-extent-free.patch | ||
--- a/src/block.c | ||
+++ b/src/block.c | ||
@@ -699,7 +699,7 @@ errcode_t local_block_iterate3(ext2_fils | ||
mark_extent_block(fs, (char*) inode.i_block); | ||
|
||
extent_errout: | ||
- local_ext2fs_extent_free(handle); | ||
+ ext2fs_extent_free(handle); | ||
ret |= BLOCK_ERROR | BLOCK_ABORT; | ||
goto errout; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ lib, stdenv, fetchurl, fetchpatch, file, libuuid, e2fsprogs, zlib, bzip2, ... }: | ||
# This and glibc-fix.patch were copied from nixpkgs on 2024/03/16 | ||
# /pkgs/tools/filesystems/ext4magic/default.nix | ||
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/filesystems/ext4magic/default.nix | ||
|
||
stdenv.mkDerivation rec { | ||
version = "0.3.2"; | ||
pname = "ext4magic"; | ||
|
||
src = fetchurl { | ||
url = "mirror://sourceforge/ext4magic/${pname}-${version}.tar.gz"; | ||
sha256 = "8d9c6a594f212aecf4eb5410d277caeaea3adc03d35378257dfd017ef20ea115"; | ||
}; | ||
|
||
patches = [ | ||
(fetchpatch { | ||
url = "https://sourceforge.net/p/ext4magic/tickets/10/attachment/ext4magic-0.3.2-i_dir_acl.patch"; | ||
sha256 = "1accydd8kigid68yir2fbihm3r3x8ws3iyznp25snkx41w6y6x8c"; | ||
}) | ||
./glibc-fix.patch | ||
./encrypted-segfault-fix.patch | ||
]; | ||
|
||
buildInputs = [ file libuuid e2fsprogs zlib bzip2 ]; | ||
installFlags = [ "PREFIX=$(out)" ]; | ||
|
||
meta = with lib; { | ||
description = "Recover / undelete files from ext3 or ext4 partitions"; | ||
longDescription = '' | ||
ext4magic can recover/undelete files from ext3 or ext4 partitions | ||
by retrieving file-information from the filesystem journal. | ||
If the information in the journal are sufficient, ext4magic can | ||
recover the most file types, with original filename, owner and group, | ||
file mode bits and also the old atime/mtime stamps. | ||
It's much more effective and works much better than extundelete. | ||
''; | ||
homepage = "https://ext4magic.sourceforge.net/ext4magic_en.html"; | ||
license = licenses.gpl2; | ||
platforms = platforms.linux; | ||
maintainers = [ maintainers.rkoe ]; | ||
mainProgram = "ext4magic"; | ||
}; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
description = "a patched version of ext4magic that might not segfault on encrypted drives. patch from markusbauer@users.sourceforge.net https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854497"; | ||
inputs = { | ||
nixpkgs = { url = "github:NixOS/nixpkgs/nixos-unstable"; }; | ||
}; | ||
|
||
outputs = inputs@{ self, nixpkgs, ... }: | ||
{ | ||
packages = let | ||
pkgSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; | ||
packagesForEachSystem = f: nixpkgs.lib.genAttrs pkgSystems (system: f { | ||
pkgs = import nixpkgs { inherit system; }; | ||
}); | ||
in packagesForEachSystem ({ pkgs }: | ||
let | ||
ext4magic = import ./ext4magic.nix pkgs; # needed to add `, ...` to the imported module's param list so it would be ok with the presence of other params like `system` | ||
in { | ||
default = ext4magic; | ||
}); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/src/recover.c b/src/recover.c | ||
index 41b4aee..30b5d8f 100644 | ||
--- a/src/recover.c | ||
+++ b/src/recover.c | ||
@@ -24,6 +24,7 @@ | ||
#include <errno.h> | ||
#include <fcntl.h> | ||
#include <utime.h> | ||
+#include <sys/sysmacros.h> | ||
|
||
#ifndef O_LARGEFILE | ||
#define O_LARGEFILE 0 |