NetBSD Problem Report #37487

From martin@duskware.de  Thu Dec  6 13:03:36 2007
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id CD74E63B946
	for <gnats-bugs@gnats.netbsd.org>; Thu,  6 Dec 2007 13:03:35 +0000 (UTC)
Message-Id: <20071205214914.874E963B946@narn.NetBSD.org>
Date: Wed,  5 Dec 2007 21:49:14 +0000 (UTC)
From: from_netbsd6@frear.com
Reply-To: from_netbsd6@frear.com
To: netbsd-bugs-owner@NetBSD.org
Subject: Samba 3.0.26a won't compile on Netbsd 1.6.2
X-Send-Pr-Version: www-1.0

>Number:         37487
>Category:       pkg
>Synopsis:       Samba 3.0.26a won't compile on Netbsd 1.6.2
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jlam
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 06 13:05:01 +0000 2007
>Closed-Date:    Sun May 04 01:47:50 +0000 2008
>Last-Modified:  Sun May 04 01:47:50 +0000 2008
>Originator:     John Frear
>Release:        1.6.2
>Organization:
>Environment:
NetBSD mymachine 1.6.2 NetBSD 1.6.2 (mykernel) #0: Mon Jun 13 22:20:02 CDT 2005     myuser@mymachine:/sys/src/sys/arch/i386/compile/mykernel i386
>Description:
I'm not able to compile Samba 3.0.26a from the net/samba directory in pkgsrc.  My main Makefile has cvs version 1.177.

The output of the pkgsrc make command was:

Compiling smbd/trans2.c
In file included from /usr/include/termios.h:305,
                 from lib/replace/system/terminal.h:33,
                 from include/includes.h:115,
                 from /usr/pkgsrc/net/samba/work/samba-3.0.26a/source/smbd/trans2.c:27:
/usr/include/sys/ttydefaults.h:61: warning: `CTRL' redefined
/usr/pkgsrc/net/samba/work/.buildlink/include/readline/chardefs.h:64: warning: this is the location of the previous definition
/usr/pkgsrc/net/samba/work/samba-3.0.26a/source/smbd/trans2.c: In function `set_ea':
/usr/pkgsrc/net/samba/work/samba-3.0.26a/source/smbd/trans2.c:368: `ENODATA' undeclared (first use in this function)
/usr/pkgsrc/net/samba/work/samba-3.0.26a/source/smbd/trans2.c:368: (Each undeclared identifier is reported only once
/usr/pkgsrc/net/samba/work/samba-3.0.26a/source/smbd/trans2.c:368: for each function it appears in.)
The following command failed:
cc -I. -I/usr/pkgsrc/net/samba/work/samba-3.0.26a/source  -O2 -I/usr/pkg/include -D_SAMBA_BUILD_=3 -I/usr/pkgsrc/net/samba/work/samba-3.0.26a/source/popt -I/usr/pkgsrc/net/samba/work/samba-3.0.26a/source/iniparser/src -Iinclude -I./include  -I. -I. -I./lib/replace -I./lib/talloc -I./tdb/include -I./libaddns -I./librpc -DHAVE_CONFIG_H  -I/usr/pkg/include -I/usr/pkg/include -I/usr/pkg/include -I/usr/pkg/include    -I/usr/pkgsrc/net/samba/work/samba-3.0.26a/source/lib -D_SAMBA_BUILD_=3 -fPIC -DPIC -c /usr/pkgsrc/net/samba/work/samba-3.0.26a/source/smbd/trans2.c -o smbd/trans2.o
*** Error code 1

I looked into this problem and have resolved it on my own system.  The problem is due to samba's includes/include.h file declaring:

#ifndef ENOATTR
#define ENOATTR ENODATA
#endif

I also found a discussion at the following website useful:

http://www.nabble.com/bug-in-samba-3.0.25c-includes.h-t4314063.html

I created a patch for the pkgsrc system and it has resolved the problem for me.  The contents of my patch are:

--- include/includes.h.orig	Mon Aug 20 08:04:51 2007
+++ include/includes.h	Wed Dec  5 14:27:33 2007
@@ -225,6 +225,10 @@
 #include <sys/attributes.h>
 #endif

+#if !defined(ENOATTR) && !defined(ENODATA)
+#define ENOATTR EAGAIN
+#endif
+
 #ifndef ENOATTR
 #define ENOATTR ENODATA
 #endif

I looked in netbsd's cvsweb at /usr/include/sys/errno.h and the most current version at this time (rev 1.9) doesn't define either ENOATTR or ENODATA, so I believe this compile issue may affect all netbsd systems.  Anyhow, I hope my choice of mapping the error to EAGAIN was the right way to go.

Thanks for providing a great system everyone!
>How-To-Repeat:

>Fix:
Fix described above under 'full description' section.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->jlam
Responsible-Changed-By: wiz@netbsd.org
Responsible-Changed-When: Sat, 08 Dec 2007 09:08:14 +0000
Responsible-Changed-Why:
Over to maintainer (feel free to close though, since 1.6.x is
not supported any longer).


From: "Johnny C. Lam" <jlam@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/37487 CVS commit: pkgsrc/net/samba
Date: Thu,  3 Apr 2008 20:19:42 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	jlam
 Date:		Thu Apr  3 20:19:42 UTC 2008

 Modified Files:
 	pkgsrc/net/samba: Makefile Makefile.mirrors Makefile.patches PLIST
 	    distinfo options.mk
 	pkgsrc/net/samba/patches: patch-aa patch-ae patch-at patch-au patch-ax
 	    patch-ay patch-ba patch-be patch-bo patch-br patch-bs patch-ca
 Added Files:
 	pkgsrc/net/samba/patches: patch-db
 Removed Files:
 	pkgsrc/net/samba/patches: patch-ab patch-ah

 Log Message:
 Update samba to version 3.0.28a.

 CHANGES FOR PKGSRC:
 ==================

 Makefile:
   + Modify section that manually handles the ELF symlinks for samba
     shared libraries -- add additional libraries that are built (addns,
     smbsharemodes) and reorganize so we don't need two loops where one
     will do.

   + Pass --with-included-popt to the configure script to force using
     the popt distribution included with samba to avoid any library
     mismatch errors between samba and any installed popt.  This fixes
     PR pkg/34444 by Jason Lingohr.

   + Don't build the smbmount programs on Linux -- they're deprecated in
     favor of the mount.cifs programs.

   + Remove some pkgviews-related settings -- I'm not supporting pkgviews
     installation of samba.

 Makefile.patches:
   + Empty out PATCHFILES because we are updating to the latest release
     of samba, which has all previous patches for security advisories
     already rolled into the main sources.

 Makefile.mirrors:
   + Update SAMBA_MIRRORS in Makefile.mirrors to the latest list of FTP
     mirrors.

 options.mk:
   + Only show the ``acl'' option on platforms that actually support
     POSIX ACLs.

   + Add a new ``fam'' option to enable building the notify_fam VFS
     module.

 patch-ab, patch-ax:
   + Remove patch-ab and update patch-ax -- there's nothing for the
     scripts to back up so we don't need to patch the install* scripts
     to avoid this.

 patch-ae, patch-ah:
   + Update patch-ae and remove patch-ah -- we should definitely check
     that PAM_AUTHTOK_RECOVERY_ERR is defined before using its value to
     define PAM_AUTHTOK_RECOVER_ERR.

 patch-at, patch-au:
   + Fix patch-at and patch-au -- in configure.in, we need to "escape"
     left and right brackets or else m4 will strip them away in the
     resulting configure script.  This should fix the detection of FreeBSD
     and NetBSD systems capable of using nss_winbind noted in PR pkg/38076
     by Ingo Meyer.

 patch-ay:
   + Remove some unnecessary changes -- we can safely just do "mkdir" in
     some places because we know the parent and any intermediate directories
     exist.

 patch-be:
   + Fix a bug in locating WINS_LIST -- nmbd/nmbd_winsserver.c was
     referring to WINS_LIST under the state directory in one place and
     under the lock directory in another; change all references to be
     under the state directory.

 patch-db:
   + Add patch to fix the build of samba on older BSDs.  Patch supplied
     in PR pkg/37487 by John Frear.

 All remaining changes to patches/patch-* are simply to remove fuzz.

 MAJOR CHANGES FROM VERSION 3.0.26a:

 * Fix failure to join Windows 2008 domains.

 * Fix Windows Vista (including SP1 RC) inter-op issues.

 * Add a new ``administrative share'' service parameter for defining
   hidden shares that cannot be managed from Windows.

 * Fix for CVS-2007-6015 (already fixed in 3.0.26anb4 in pkgsrc).

 * Fix for CVS-2007-5398 (already fixed in 3.0.26anb4 in pkgsrc).

 * Fix for CVS-2007-4572 (already fixed in 3.0.26anb4 in pkgsrc).  Also
   subsequent fix for regression experienced by smbfs clients caused by
   the fix for CVS-2007-4572, noted in PR pkg/38300 by Dave Barnes.

 * Many other bugs fixed and memory leaks plugged.


 To generate a diff of this commit:
 cvs rdiff -r1.179 -r1.180 pkgsrc/net/samba/Makefile
 cvs rdiff -r1.4 -r1.5 pkgsrc/net/samba/Makefile.mirrors
 cvs rdiff -r1.7 -r1.8 pkgsrc/net/samba/Makefile.patches
 cvs rdiff -r1.37 -r1.38 pkgsrc/net/samba/PLIST
 cvs rdiff -r1.60 -r1.61 pkgsrc/net/samba/distinfo
 cvs rdiff -r1.22 -r1.23 pkgsrc/net/samba/options.mk
 cvs rdiff -r1.31 -r1.32 pkgsrc/net/samba/patches/patch-aa
 cvs rdiff -r1.26 -r0 pkgsrc/net/samba/patches/patch-ab
 cvs rdiff -r1.8 -r1.9 pkgsrc/net/samba/patches/patch-ae \
     pkgsrc/net/samba/patches/patch-at pkgsrc/net/samba/patches/patch-au
 cvs rdiff -r1.3 -r0 pkgsrc/net/samba/patches/patch-ah
 cvs rdiff -r1.2 -r1.3 pkgsrc/net/samba/patches/patch-ax
 cvs rdiff -r1.3 -r1.4 pkgsrc/net/samba/patches/patch-ay \
     pkgsrc/net/samba/patches/patch-be pkgsrc/net/samba/patches/patch-br
 cvs rdiff -r1.6 -r1.7 pkgsrc/net/samba/patches/patch-ba
 cvs rdiff -r1.4 -r1.5 pkgsrc/net/samba/patches/patch-bo \
     pkgsrc/net/samba/patches/patch-bs pkgsrc/net/samba/patches/patch-ca
 cvs rdiff -r0 -r1.1 pkgsrc/net/samba/patches/patch-db

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: jlam@NetBSD.org
State-Changed-When: Fri, 04 Apr 2008 01:18:09 +0000
State-Changed-Why:
The net/samba package was updated to version 3.0.28a along with the
following changes to the patches:

   + Add patch to fix the build of samba on older BSDs.  Patch supplied
     in PR pkg/37487 by John Frear.

This should fix the problem noted in this PR.  Please let me know if the
problem still exists.  Thanks!


From: John Frear <from_netbsd6@frear.com>
To: gnats-bugs@NetBSD.org
Cc: jlam@NetBSD.org, pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/37487 (Samba 3.0.26a won't compile on Netbsd 1.6.2)
Date: Mon, 7 Apr 2008 08:02:04 -0500 (CDT)

 On Fri, 4 Apr 2008, jlam@NetBSD.org wrote:

 > State-Changed-Why:
 > The net/samba package was updated to version 3.0.28a along with the
 > following changes to the patches:
 >
 >   + Add patch to fix the build of samba on older BSDs.  Patch supplied
 >     in PR pkg/37487 by John Frear.
 >
 > This should fix the problem noted in this PR.  Please let me know if the
 > problem still exists.  Thanks!

 This does in fact fix the problem - Thank you!

 - John

State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 04 May 2008 01:47:50 +0000
State-Changed-Why:
Confirmed fixed.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.