Skip to content

samba4: fix build on macOS <10.10 #28322

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions net/samba4/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ patchfiles-append patch-ldb-test.diff
# https://bugzilla.samba.org/show_bug.cgi?id=15850
patchfiles-append patch-util-crypt.diff

# https://trac.macports.org/ticket/72369
if {${os.platform} eq "darwin" && ${os.major} < 14} {
patchfiles-append \
patch-no-enotrecoverable.diff
}

configure.perl ${perl5.bin}
configure.python ${prefix}/bin/python${py_ver}
configure.env-append \
Expand Down
34 changes: 34 additions & 0 deletions net/samba4/files/patch-no-enotrecoverable.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Borrow from https://trac.ffmpeg.org/ticket/97

--- python/pyglue.c 2025-02-06 14:31:54
+++ python/pyglue.c 2025-04-19 19:51:44.000000000 +0800
@@ -548,7 +548,7 @@
ret = talloc_crypt_blob(frame, phrase, setting, &hash);
if (ret != 0) {
const char *errstr = talloc_crypt_errstring(frame, ret);
- if (ret == EINVAL || ret == ERANGE || ret == ENOTRECOVERABLE) {
+ if (ret == EINVAL || ret == ERANGE) {
PyErr_Format(PyExc_ValueError,
"could not crypt(): %s",
errstr);

--- lib/util/util_crypt.c 2025-02-06 14:31:54
+++ lib/util/util_crypt.c 2025-04-19 19:51:37.000000000 +0800
@@ -66,7 +66,7 @@
if (hash == NULL || hash[0] == '*') {
if (ret == 0) {
/* this is annoying */
- ret = ENOTRECOVERABLE;
+ ret = EINVAL;
}
}
if (ret != 0) {
@@ -111,7 +111,7 @@
mem_ctx,
"Password exceeds maximum length allowed for crypt() hashing");
}
- if (error == ENOTRECOVERABLE) {
+ if (error == EINVAL) {
/* probably weird RHEL7 crypt, see crypt_as_best_we_can() */
goto unknown;
}