Skip to content
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

acl: backport patch for musl 1.2.4 #229440

Merged
merged 1 commit into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions pkgs/development/libraries/acl/LFS64.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 2b42f64737adf6a2ddd491213580d6e9cdd2f5af Mon Sep 17 00:00:00 2001
From: Khem Raj <[email protected]>
Date: Thu, 10 Nov 2022 18:04:15 -0800
Subject: chacl: Use portable version of dirent and readdir

Using 64bit versions on 32bit architectures should be enabled with
--enable-largefile, this makes it portable across musl and glibc

Signed-off-by: Khem Raj <[email protected]>
---
tools/chacl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/chacl.c b/tools/chacl.c
index 525a7ff..8fff875 100644
--- a/tools/chacl.c
+++ b/tools/chacl.c
@@ -320,7 +320,7 @@ walk_dir(acl_t acl, acl_t dacl, const char *fname)
{
int failed = 0;
DIR *dir;
- struct dirent64 *d;
+ struct dirent *d;
char *name;

if ((dir = opendir(fname)) == NULL) {
@@ -332,7 +332,7 @@ walk_dir(acl_t acl, acl_t dacl, const char *fname)
return(0); /* got a file, not an error */
}

- while ((d = readdir64(dir)) != NULL) {
+ while ((d = readdir(dir)) != NULL) {
/* skip "." and ".." entries */
if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0)
continue;
--
cgit v1.1

6 changes: 5 additions & 1 deletion pkgs/development/libraries/acl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ stdenv.mkDerivation rec {
sha256 = "sha256-dgxhxokBs3/dXu/ur0wMeia9/disdHoe3/HODiQ8Ea8=";
};

patches = [
./LFS64.patch
];

outputs = [ "bin" "dev" "out" "man" "doc" ];

nativeBuildInputs = [ gettext ];
Expand All @@ -24,7 +28,7 @@ stdenv.mkDerivation rec {

# Upstream use C++-style comments in C code. Remove them.
# This comment breaks compilation if too strict gcc flags are used.
patchPhase = ''
postPatch = ''
echo "Removing C++-style comments from include/acl.h"
sed -e '/^\/\//d' -i include/acl.h

Expand Down