Bug 13897 - samba-4.9.0 --nonshared-binary=smbpasswd failure by rep_closefrom
Summary: samba-4.9.0 --nonshared-binary=smbpasswd failure by rep_closefrom
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.9.0
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-15 01:30 UTC by Jones Syue
Modified: 2022-02-14 01:05 UTC (History)
2 users (show)

See Also:


Attachments
Patch source4/heimdal_build/config.h (1.31 KB, application/mbox)
2019-04-15 01:30 UTC, Jones Syue
no flags Details
Patch source4/heimdal_build/config.h and roken.in.h (2.48 KB, application/mbox)
2019-04-15 01:33 UTC, Jones Syue
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jones Syue 2019-04-15 01:30:06 UTC
Created attachment 15061 [details]
Patch source4/heimdal_build/config.h

Hello list,

This patch fix --nonshared-binary=smbpasswd failure by rep_closefrom,
looks like 3a7ebd0e940e80b185a9240c093e1fee6795fd5b introduced it from samba-4.9.0 and later,
please help review and push, thank you.

logs:
[1727/1727] Linking default/source3/utils/smbpasswd
default/source4/heimdal/lib/roken/closefrom_1.o: In function `rep_closefrom':
closefrom.c:(.text+0x0): multiple definition of `rep_closefrom'
default/lib/replace/closefrom_2.o:closefrom.c:(.text+0x26f): first defined here
collect2: error: ld returned 1 exit status

build steps:
./configure --without-ad-dc --without-json --without-libarchive --without-acl-support --without-ldap --without-ads --without-pam --nonshared-binary="smbpasswd"; \
make smbpasswd

build failed:
samba-4.10.2
samba-4.10.0
samba-4.9.6
samba-4.9.0

build passed:
samba-4.8.11
Comment 1 Jones Syue 2019-04-15 01:33:22 UTC
Created attachment 15062 [details]
Patch source4/heimdal_build/config.h and roken.in.h

This v2.patch will change roken.in.h which is came from upstream Heimdal,
hence might not a good idea.
Comment 2 Andrew Bartlett 2022-02-14 01:05:15 UTC
I would have thought this was fixed by:

commit 3a7ebd0e940e80b185a9240c093e1fee6795fd5b
Author: Bjoern Jacke <bjacke@samba.org>
Date:   Wed Feb 21 01:51:42 2018 -0800

    heimdal_build: use closefrom from libreplace
    
    this silences a lot of "... has been redefined" compiler warnings on
    platforms that don't have closefrom
    
    Signed-off-by: Bjoern Jacke <bjacke@samba.org>
    Reviewed-by: Stefan Metzmacher <metze@samba.org>

However this is included in the failing versions noted.  Odd.