Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#64396 closed update (fixed)

samba4: Update to 4.15.3

Reported by: BjarneDMat Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: evanmiller (Evan Miller)
Port: samba4

Description (last modified by BjarneDMat)

[1052/3660] Compiling lib/tdb_wrap/tdb_wrap.c
../../lib/tdb_wrap/tdb_wrap.c:107:16: error: use of undeclared identifier 'O_CLOEXEC'
        open_flags |= O_CLOEXEC;
                      ^
[xxxx/3660] Compiling source4/heimdal/lib/krb5/get_addrs.c:
undeclared indentifiers :
lib/krb5/get_addrs.c:142:	if ((ifa->ifa_flags & IFF_UP) == 0)
                                                      ^
lib/krb5/get_addrs.c:183:	    if ((ifa->ifa_flags & IFF_UP) == 0)
                                                          ^
lib/krb5/get_addrs.c:193:	    if ((ifa->ifa_flags & IFF_LOOPBACK) == 0)
                                                          ^

Ok - this is with an updated Portfile

Attachments (6)

patch-no-xsltproc.diff (1.7 KB) - added by BjarneDMat 2 years ago.
fixed offsets
main.log (755.0 KB) - added by BjarneDMat 2 years ago.
KeyRing.png (1.2 MB) - added by BjarneDMat 2 years ago.
Buildbot.png (654.2 KB) - added by BjarneDMat 2 years ago.
Portfile (8.4 KB) - added by BjarneDMat 2 years ago.
Updated Portfile
Portfile.diff (2.8 KB) - added by BjarneDMat 2 years ago.

Change History (27)

Changed 2 years ago by BjarneDMat

Attachment: patch-no-xsltproc.diff added

fixed offsets

comment:1 Changed 2 years ago by BjarneDMat

I'm trying to install samba4 on 10.6.8 in order to get it compatible w/ 11.x & 12.x as afp is removed from those & one will have to use smb

so, the samba4 portfile is outdated & fails to compile, so I thought I'ld try to update it.

My 1st problem is :

:notice:fetch --->  Attempting to fetch samba-4.15.3.tar.gz from https://download.samba.org/pub/samba/stable
:debug:fetch Fetching distfile failed: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

How do I fix this ?

for now, I'll do a manual download :

curl --url \
  "https://download.samba.org/pub/samba/stable/{samba-4.15.3.tar.gz}" \
  --create-dirs \
  -o /opt/local/var/macports/distfiles/samba4/#1

comment:2 Changed 2 years ago by BjarneDMat

Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_samba4/samba4/work/samba-4.15.3" && /usr/bin/patch -p1 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/net/samba4/files/patch-fix-debug.diff'
DEBUG: system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_samba4/samba4/work/samba-4.15.3" && /usr/bin/patch -p1 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/net/samba4/files/patch-fix-debug.diff'
patching file lib/util/charset/charset_macosxfs.c
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file lib/util/charset/charset_macosxfs.c.rej
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_samba4/samba4/work/samba-4.15.3" && /usr/bin/patch -p1 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/net/samba4/files/patch-fix-debug.diff'
Exit code: 1
Error: Failed to patch samba4: command execution failed

But applying manually :

root@MiniWeb 02:45:55 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_samba4/samba4/work/samba-4.15.3
#=> /usr/bin/patch -p1 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/net/samba4/files/patch-fix-debug.diff' patching file lib/util/charset/charset_macosxfs.c
Reversed (or previously applied) patch detected!  Assume -R? [n] y

and success !?!

Changed 2 years ago by BjarneDMat

Attachment: main.log added

comment:3 in reply to:  2 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to BjarneDMat:

My 1st problem is :

:notice:fetch --->  Attempting to fetch samba-4.15.3.tar.gz from https://download.samba.org/pub/samba/stable
:debug:fetch Fetching distfile failed: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

How do I fix this ?

Read ProblemHotlist#letsencrypt.

Replying to BjarneDMat:

Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_samba4/samba4/work/samba-4.15.3" && /usr/bin/patch -p1 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/net/samba4/files/patch-fix-debug.diff'
DEBUG: system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_samba4/samba4/work/samba-4.15.3" && /usr/bin/patch -p1 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/net/samba4/files/patch-fix-debug.diff'
patching file lib/util/charset/charset_macosxfs.c
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file lib/util/charset/charset_macosxfs.c.rej
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_samba4/samba4/work/samba-4.15.3" && /usr/bin/patch -p1 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/net/samba4/files/patch-fix-debug.diff'
Exit code: 1
Error: Failed to patch samba4: command execution failed

But applying manually :

root@MiniWeb 02:45:55 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_samba4/samba4/work/samba-4.15.3
#=> /usr/bin/patch -p1 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/net/samba4/files/patch-fix-debug.diff' patching file lib/util/charset/charset_macosxfs.c
Reversed (or previously applied) patch detected!  Assume -R? [n] y

and success !?!

Based on the name of the patchfile, it fixed some debug problem. It failed to apply, perhaps because upstream integrated it into their sources. You answered "y" to the question of whether to apply the patch in reverse order, thereby undoing whatever the patch was fixing. So try again after removing this patch.

comment:4 Changed 2 years ago by evanmiller (Evan Miller)

Cc: evanmiller added

comment:5 Changed 2 years ago by BjarneDMat

Replying to ryandesign:

My 1st problem is :

:notice:fetch --->  Attempting to fetch samba-4.15.3.tar.gz from https://download.samba.org/pub/samba/stable
:debug:fetch Fetching distfile failed: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

How do I fix this ?
Read ProblemHotlist#letsencrypt.

That didn't fix the problem [thumbs-down]

I've followed the procedure exactly
& even done a reboot
& re-installed Macports 2.7.1

So, I pushed the Apple curl aside :

root@MiniWeb 17:17:26 /usr/bin
  506  mv curl curl.apple
  507  mv curl-config curl-config.apple
  508  ln -h $(which curl) .
  509  ln -h $(which curl-config) .
root@MiniWeb 17:54:33 /usr/bin
#=> ls -l cur*
-rwxr-xr-x  2 root  admin  238972 12 Nov 19:00 curl
-rwxr-xr-x  2 root  admin    6321 12 Nov 19:00 curl-config
-rwxr-xr-x  1 root  wheel    3835 25 Jun  2010 curl-config.apple
-rwxr-xr-x  1 root  wheel  369584 21 Mar  2012 curl.apple

& re-installed Macports 2.7.1
& I'm still getting the exact same error

#=>  /usr/bin/curl.apple 
    --url    "https://download.samba.org/pub/samba/stable/{samba-4.15.3.tar.gz}"
    --create-dirs
    -o /opt/local/var/macports/distfiles/samba4/#1
curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

Changed 2 years ago by BjarneDMat

Attachment: KeyRing.png added

Changed 2 years ago by BjarneDMat

Attachment: Buildbot.png added

comment:6 Changed 2 years ago by BjarneDMat

Original trac issue :

 [ 761/3660] Linking bin/default/lib/util/libsamba-util.dylib
 Undefined symbols for architecture x86_64:
   "_DEBUG", referenced from:
       _macosxfs_encoding_pull in charset_macosxfs.c.1.o
       _macosxfs_encoding_push in charset_macosxfs.c.1.o
 ld: symbol(s) not found for architecture x86_64

removing the patch-fix-debug.diff fixed the original issue [thumbs-up]

comment:7 Changed 2 years ago by BjarneDMat

Description: modified (diff)
Summary: [samba4] Undefined symbols for architecture x86_64 in charset_macosxfs.c.1.o[samba4] use of undeclared identifier 'O_CLOEXEC' in tdb_wrap.c

comment:8 Changed 2 years ago by BjarneDMat

see : #43203

Last edited 2 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:10 Changed 2 years ago by evanmiller (Evan Miller)

To follow up on @kencu's suggestion, try adding these lines to the Portfile:

PortGroup legacysupport 1.1

# O_CLOEXEC
legacysupport.newest_darwin_requires_legacy 10

comment:11 Changed 2 years ago by BjarneDMat

Description: modified (diff)
Summary: [samba4] use of undeclared identifier 'O_CLOEXEC' in tdb_wrap.c[samba4] use of undeclared identifiers => legacysupport

Changed 2 years ago by BjarneDMat

Attachment: Portfile added

Updated Portfile

Changed 2 years ago by BjarneDMat

Attachment: Portfile.diff added

comment:12 Changed 2 years ago by kencu (Ken)

did it build?

and does it actually work?

Last edited 2 years ago by kencu (Ken) (previous) (diff)

comment:13 Changed 2 years ago by BjarneDMat

Status :

1) fetch has to be done manually using /opt/local/bin/curl as described
2) it compiles & installs !!!

Now to make it work ...

comment:14 in reply to:  13 ; Changed 2 years ago by kencu (Ken)

Replying to BjarneDMat:

Status :

1) fetch has to be done manually using /opt/local/bin/curl as described

You will eventually use the /opt/bootstrap workaround we all use ;>

comment:15 in reply to:  14 ; Changed 2 years ago by BjarneDMat

Replying to kencu:

Replying to BjarneDMat:

Status :

1) fetch has to be done manually using /opt/local/bin/curl as described

You will eventually use the /opt/bootstrap workaround we all use ;>

& how do I use this in my case [thinking]
I'm not that well versed in Portfile construction - I'm just doing my best to solve simple problems

comment:16 in reply to:  5 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to BjarneDMat:

Replying to ryandesign:

My 1st problem is :

:notice:fetch --->  Attempting to fetch samba-4.15.3.tar.gz from https://download.samba.org/pub/samba/stable
:debug:fetch Fetching distfile failed: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

How do I fix this ?
Read ProblemHotlist#letsencrypt.

That didn't fix the problem [thumbs-down]

As I wrote in that wiki page, if just installing the new root certificate doesn't solve the problem, then the problem is with the specific server you're connecting to (in this case download.samba.org), and you'll need to contact its administrator and ask them to fix the certificate chain they're sending.

So, I pushed the Apple curl aside :

root@MiniWeb 17:17:26 /usr/bin
  506  mv curl curl.apple
  507  mv curl-config curl-config.apple
  508  ln -h $(which curl) .
  509  ln -h $(which curl-config) .
root@MiniWeb 17:54:33 /usr/bin
#=> ls -l cur*
-rwxr-xr-x  2 root  admin  238972 12 Nov 19:00 curl
-rwxr-xr-x  2 root  admin    6321 12 Nov 19:00 curl-config
-rwxr-xr-x  1 root  wheel    3835 25 Jun  2010 curl-config.apple
-rwxr-xr-x  1 root  wheel  369584 21 Mar  2012 curl.apple

& re-installed Macports 2.7.1
& I'm still getting the exact same error

#=>  /usr/bin/curl.apple 
    --url    "https://download.samba.org/pub/samba/stable/{samba-4.15.3.tar.gz}"
    --create-dirs
    -o /opt/local/var/macports/distfiles/samba4/#1
curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

You're getting the same error because you're still using Apple's old curl (which you've called curl.apple) rather than the newer MacPorts curl.

comment:17 in reply to:  15 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to BjarneDMat:

You will eventually use the /opt/bootstrap workaround we all use ;>

& how do I use this in my case [thinking]
I'm not that well versed in Portfile construction - I'm just doing my best to solve simple problems

Ken is suggesting you install a separate copy of curl in a separate copy of MacPorts with prefix /opt/bootstrap and then tell your primary copy of MacPorts in /opt/local to use that newer copy of curl. It has nothing to do with Portfile contruction.

comment:18 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added
Owner: set to ryandesign
Status: newaccepted
Summary: [samba4] use of undeclared identifiers => legacysupportsamba4: Update to 4.15.3
Type: defectupdate

I'll update the port using inspiration from your suggestions, but:

  • I'll use python 3.10 because that is the recommended default today
  • I'll continue to use perl 5.28 because that is still the recommended default today
  • I won't remove patch-macos-grouplimit.diff because I assume it is still needed
  • I'll limit the use of legacysupport to those systems that need it

comment:19 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 5660d78073684cbe6b646f94926a616d4d77e1ac/macports-ports (master):

samba4: Update to 4.15.3

Closes: #64396

comment:20 Changed 2 years ago by BjarneDMat

according to https://bugzilla.samba.org/show_bug.cgi?id=8773 patch-macos-grouplimit.diff is no longer needed as it's marked as fixed

comment:21 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Agreed, thanks. I didn't notice any reference to that bug report URL, and the patch still applied to the code after being refreshed; I didn't realize they had fixed the problem in a different place in the code. Perhaps we can remove the patch at the same time that we fix #64403.

Note: See TracTickets for help on using tickets.