aboutsummaryrefslogtreecommitdiff
path: root/net/samba36
diff options
context:
space:
mode:
authorTimur I. Bakeyev <timur@FreeBSD.org>2013-03-25 15:18:58 +0000
committerTimur I. Bakeyev <timur@FreeBSD.org>2013-03-25 15:18:58 +0000
commitd7c3cd6810bb7dc20e72fd9c685870aa55493fa1 (patch)
tree0242b03022539774e940f46659f0a0afc7c63f49 /net/samba36
parent2cc867a57ededf2101c8dda67693709e94bb3b36 (diff)
downloadports-d7c3cd6810bb7dc20e72fd9c685870aa55493fa1.tar.gz
ports-d7c3cd6810bb7dc20e72fd9c685870aa55493fa1.zip
Notes
Diffstat (limited to 'net/samba36')
-rw-r--r--net/samba36/Makefile151
-rw-r--r--net/samba36/distinfo4
-rw-r--r--net/samba36/files/patch-nsswitch__winbind_nss_freebsd.c100
-rw-r--r--net/samba36/files/patch-nsswitch__wins_freebsd.c10
4 files changed, 179 insertions, 86 deletions
diff --git a/net/samba36/Makefile b/net/samba36/Makefile
index d968f67a9cb6..fad488f970ea 100644
--- a/net/samba36/Makefile
+++ b/net/samba36/Makefile
@@ -1,29 +1,24 @@
-# New ports collection makefile for: samba36
-# Date created: 1 May 2011
-# Whom: timur@FreeBSD.org
-#
# $FreeBSD$
-#
PORTNAME= ${SAMBA_BASENAME}36
-PORTVERSION= 3.6.12
+PORTVERSION= 3.6.13
PORTREVISION?= 0
CATEGORIES?= net
MASTER_SITES= ${MASTER_SITE_SAMBA}
-MASTER_SITE_SUBDIR= samba samba/old-versions samba/rc samba/pre
+MASTER_SITE_SUBDIR= samba samba/stable samba/pre
DISTNAME= ${SAMBA_BASENAME}-${PORTVERSION:S|.p|pre|:S|.r|rc|:S|.t|tp|:S|.a|alpha|}
MAINTAINER?= timur@FreeBSD.org
COMMENT?= A free SMB and CIFS client and server for UNIX
+LICENSE= GPLv3
+LICENSE_FILE= ${WRKDIR}/${DISTNAME}/COPYING
+
CONFLICTS?= *samba3[2-5]-3.*
# Additional patches from Sernet.de
PATCH_STRIP= -p1
EXTRA_PATCHES= ${PATCHDIR}/sernet.patch
-LICENSE= GPLv3
-LICENSE_FILE= ${WRKDIR}/${DISTNAME}/COPYING
-
SAMBA_BASENAME= samba
LATEST_LINK= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
@@ -80,15 +75,14 @@ CONFIGURE_ARGS+= --exec-prefix="${PREFIX}" \
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
-CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}" \
- PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
+CONFIGURE_ENV+= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
PTHREAD_LDFLAGS="${PTHREAD_LIBS}"
# XXX: Temporary hack for RELENG6
CONFIGURE_ENV+= ac_cv_header_sys_mount_h=yes
# XXX: readdir test fails on ZFS, bringing unusable replacement code
CONFIGURE_ENV+= libreplace_cv_READDIR_NEEDED=no
# Let process generate meaningful backtrace on a core dump
-LIB_DEPENDS+= execinfo.1:${PORTSDIR}/devel/libexecinfo
+LIB_DEPENDS+= execinfo:${PORTSDIR}/devel/libexecinfo
# tdb
BUILD_DEPENDS+= tdb>=1.2.6:${PORTSDIR}/databases/tdb
RUN_DEPENDS+= tdb>=1.2.6:${PORTSDIR}/databases/tdb
@@ -102,26 +96,30 @@ CONFIGURE_ARGS+= --with-libiconv="${LOCALBASE}" \
--disable-as-needed
.if !defined(SAMBA_SUBPORT)
-OPTIONS= LDAP "With LDAP support" on \
- ADS "With Active Directory support" off \
- CUPS "With CUPS printing support" on \
- WINBIND "With WinBIND support" on \
- SWAT "With SWAT WebGUI" off \
- ACL_SUPPORT "With ACL support" on \
- AIO_SUPPORT "With Asyncronous IO support" on \
- FAM_SUPPORT "With File Alteration Monitor" off \
- SYSLOG "With Syslog support" off \
- QUOTAS "With Disk quota support" off \
- UTMP "With UTMP accounting support" off \
- PAM_SMBPASS "With PAM authentication vs passdb backends" off \
- DNSUPDATE "With dynamic DNS update(require ADS)" off \
- AVAHI "With Bonjour service discovery support" off \
- PTHREADPOOL "With pthread pool" on \
- EXP_MODULES "With experimental modules" off \
- POPT "With system-wide POPT library" on \
- IPV6 "With IPv6 support" on \
- MAX_DEBUG "With maximum debugging" off \
- SMBTORTURE "With smbtorture" off
+OPTIONS_DEFINE= ACL_SUPPORT ADS AIO_SUPPORT AVAHI CUPS DNSUPDATE \
+ EXP_MODULES FAM_SUPPORT IPV6 LDAP MAX_DEBUG \
+ PAM_SMBPASS POPT PTHREADPOOL QUOTAS SMBTORTURE \
+ SWAT SYSLOG UTMP WINBIND
+
+OPTIONS_DEFAULT= ACL_SUPPORT AIO_SUPPORT CUPS LDAP POPT PTHREADPOOL \
+ WINBIND
+
+ACL_SUPPORT_DESC= ACL support
+ADS_DESC= Active Directory support
+AIO_SUPPORT_DESC= Asyncronous IO support
+DNSUPDATE_DESC= Dynamic DNS update(require ADS)
+EXP_MODULES_DESC= Experimental modules
+FAM_SUPPORT_DESC= File Alteration Monitor
+MAX_DEBUG_DESC= Maximum debugging
+PAM_SMBPASS_DESC= PAM authentication vs passdb backends
+POPT_DESC= System-wide POPT library
+PTHREADPOOL_DESC= Pthread pool
+QUOTAS_DESC= Disk quota support
+SMBTORTURE_DESC= smbtorture
+SWAT_DESC= SWAT WebGUI
+UTMP_DESC= UTMP accounting support
+WINBIND_DESC= WinBIND support
+
# !SAMBA_SUBPORT
.endif
@@ -142,10 +140,6 @@ CONFIGURE_ARGS+= --disable-cups --disable-fam --without-winbind \
--without-syslog --without-quotas --without-utmp \
--without-pam --without-pam_smbpass \
--without-aio-support --with-included-popt
-# Dirty hack to work around usage of OPTIONS in slave ports
-. if exists(${.CURDIR}/Makefile.inc)
-. include "${.CURDIR}/Makefile.inc"
-. endif
.else
# Samba server itself
USE_RC_SUBR= ${SAMBA_BASENAME}
@@ -163,16 +157,16 @@ CONFIGURE_ARGS+= --with-pam --with-readline=/usr \
--without-libnetapi \
--without-libsmbsharemodes
-.if !defined(WITH_IPV6)
+.if ! ${PORT_OPTIONS:MIPV6}
CONFIGURE_ENV+= libreplace_cv_HAVE_IPV6=no
.endif
-.if !defined(WITHOUT_LDAP)
+.if ${PORT_OPTIONS:MLDAP}
SAMBA_WANT_LDAP= yes
.endif
-.if !defined(WITHOUT_CUPS)
-LIB_DEPENDS+= cups.2:${PORTSDIR}/print/cups-client
+.if ${PORT_OPTIONS:MCUPS}
+LIB_DEPENDS+= cups:${PORTSDIR}/print/cups-client
CONFIGURE_ARGS+= --enable-cups --enable-iprint
SUB_LIST+= CUPS=""
.else
@@ -180,10 +174,10 @@ CONFIGURE_ARGS+= --disable-cups --disable-iprint
SUB_LIST+= CUPS="@comment "
.endif
-.if defined(WITH_MAX_DEBUG)
+.if ${PORT_OPTIONS:MMAX_DEBUG}
CPPFLAGS+= -g
LDFLAGS+= -g
-LIB_DEPENDS+= dmalloc.1:${PORTSDIR}/devel/dmalloc
+LIB_DEPENDS+= dmalloc:${PORTSDIR}/devel/dmalloc
CONFIGURE_ARGS+= --enable-debug
# --enable-socket-wrapper --enable-nss-wrapper \
# --enable-developer --enable-krb5developer \
@@ -197,25 +191,25 @@ CONFIGURE_ARGS+= --disable-debug \
--disable-dmalloc --without-profiling-data
.endif
-.if defined(WITH_SYSLOG)
+.if ${PORT_OPTIONS:MSYSLOG}
CONFIGURE_ARGS+= --with-syslog
.else
CONFIGURE_ARGS+= --without-syslog
.endif
-.if defined(WITH_QUOTAS)
+.if ${PORT_OPTIONS:MQUOTAS}
CONFIGURE_ARGS+= --with-quotas
.else
CONFIGURE_ARGS+= --without-quotas
.endif
-.if !defined(WITHOUT_UTMP)
+.if ${PORT_OPTIONS:MUTMP}
CONFIGURE_ARGS+= --with-utmp
.else
CONFIGURE_ARGS+= --without-utmp
.endif
-.if !defined(WITHOUT_WINBIND)
+.if ${PORT_OPTIONS:MWINBIND}
CONFIGURE_ARGS+= --with-winbind
PLIST_SUB+= WINBIND=""
SUB_LIST+= WINBIND=""
@@ -225,7 +219,7 @@ PLIST_SUB+= WINBIND="@comment "
SUB_LIST+= WINBIND="@comment "
.endif
-.if !defined(WITHOUT_SWAT)
+.if ${PORT_OPTIONS:MSWAT}
CONFIGURE_ARGS+= --enable-swat
PLIST_SUB+= SWAT=""
.else
@@ -233,11 +227,11 @@ CONFIGURE_ARGS+= --disable-swat
PLIST_SUB+= SWAT="@comment "
.endif
# Add some shared modules
-.if defined(WITH_EXP_MODULES)
+.if ${PORT_OPTIONS:MEXP_MODULES}
. if !defined(WANT_EXP_MODULES) || empty(WANT_EXP_MODULES)
WANT_EXP_MODULES= idmap_tdb2 idmap_ad idmap_adex idmap_hash idmap_rid \
charset_weird
-. if !defined(WITH_MAX_DEBUG)
+. if ! ${PORT_OPTIONS:MMAX_DEBUG}
WANT_EXP_MODULES+= rpc_echo
. endif
WANT_EXP_MODULES+= vfs_cacheprime vfs_catia vfs_commit vfs_dirsort \
@@ -245,7 +239,7 @@ WANT_EXP_MODULES+= vfs_cacheprime vfs_catia vfs_commit vfs_dirsort \
. endif
.endif
-.if defined(WITH_FAM_SUPPORT)
+.if ${PORT_OPTIONS:MFAM_SUPPORT}
USE_FAM= yes
WANT_EXP_MODULES+= vfs_notify_fam
CONFIGURE_ARGS+= --enable-fam
@@ -253,17 +247,17 @@ CONFIGURE_ARGS+= --enable-fam
CONFIGURE_ARGS+= --disable-fam
.endif
-.if defined(WITH_ACL_SUPPORT)
+.if ${PORT_OPTIONS:MACL_SUPPORT}
CONFIGURE_ARGS+= --with-acl-support
. if ${OSVERSION} > 800000
WANT_EXP_MODULES+= vfs_zfsacl
-LIB_DEPENDS+= sunacl.1:${PORTSDIR}/sysutils/libsunacl
+LIB_DEPENDS+= sunacl:${PORTSDIR}/sysutils/libsunacl
. endif
.else
CONFIGURE_ARGS+= --without-acl-support
.endif
-.if defined(WITH_AIO_SUPPORT)
+.if ${PORT_OPTIONS:MAIO_SUPPORT}
.if ${OSVERSION} < 700055
IGNORE= an AIO support requires 7.0-RELEASE or later. Disable AIO support
.endif
@@ -272,7 +266,7 @@ CONFIGURE_ARGS+= --with-aio-support
CONFIGURE_ARGS+= --without-aio-support
.endif
-.if defined(WITH_PAM_SMBPASS)
+.if ${PORT_OPTIONS:MPAM_SMBPASS}
CONFIGURE_ARGS+= --with-pam_smbpass
PLIST_SUB+= SMBPASS=""
.else
@@ -280,39 +274,39 @@ CONFIGURE_ARGS+= --without-pam_smbpass
PLIST_SUB+= SMBPASS="@comment "
.endif
-.if defined(WITH_DNSUPDATE)
-. if !defined(WITH_ADS)
+.if ${PORT_OPTIONS:MDNSUPDATE}
+. if ! ${PORT_OPTIONS:MADS}
IGNORE= dynamic DNS updates require ADS support. Disable DNSUPDATE support
. endif
-LIB_DEPENDS+= uuid.1:${PORTSDIR}/misc/e2fsprogs-libuuid
+LIB_DEPENDS+= uuid:${PORTSDIR}/misc/e2fsprogs-libuuid
CONFIGURE_ARGS+= --with-dnsupdate
.else
CONFIGURE_ARGS+= --without-dnsupdate
.endif
-.if defined(WITH_AVAHI)
+.if ${PORT_OPTIONS:MAVAHI}
CPPFLAGS+= `pkg-config --cflags avahi-client`
CONFIGURE_ENV+= DNSSD_LIBS="`pkg-config --libs avahi-client`"
-LIB_DEPENDS+= avahi-client.3:${PORTSDIR}/net/avahi-app
+LIB_DEPENDS+= avahi-client:${PORTSDIR}/net/avahi-app
CONFIGURE_ARGS+= --enable-avahi
.else
CONFIGURE_ARGS+= --disable-avahi
.endif
-.if defined(WITH_PTHREADPOOL)
+.if ${PORT_OPTIONS:MPTHREADPOOL}
CONFIGURE_ARGS+= --enable-pthreadpool
.else
CONFIGURE_ARGS+= --disable-pthreadpool
.endif
-.if !defined(WITHOUT_POPT)
-LIB_DEPENDS+= popt.0:${PORTSDIR}/devel/popt
+.if ${PORT_OPTIONS:MPOPT}
+LIB_DEPENDS+= popt:${PORTSDIR}/devel/popt
CONFIGURE_ARGS+= --without-included-popt
.else
CONFIGURE_ARGS+= --with-included-popt
.endif
-.if defined(WITH_SMBTORTURE)
+.if ${PORT_OPTIONS:MSMBTORTURE}
PLIST_SUB+= SMBTORTURE=""
.else
PLIST_SUB+= SMBTORTURE="@comment "
@@ -324,7 +318,7 @@ PLIST_SUB+= SMBTORTURE="@comment "
### Common part for port and it's subports
###
-.if defined(WITH_ADS)
+.if ${PORT_OPTIONS:MADS}
SAMBA_WANT_LDAP= yes
SAMBA_WANT_KRB5= yes
CONFIGURE_ARGS+= --with-ads
@@ -371,7 +365,7 @@ post-patch:
.if !defined(SAMBA_SUBPORT)
# Samba server only
-MAN1= findsmb.1 \
+MAN1= dbwrap_tool.1 findsmb.1 \
log2pcap.1 nmblookup.1 ntlm_auth.1 profiles.1 rpcclient.1 \
sharesec.1 smbcacls.1 smbclient.1 smbcontrol.1 smbcquotas.1 \
smbget.1 smbstatus.1 smbtar.1 smbtree.1 testparm.1 vfstest.1
@@ -387,22 +381,22 @@ MAN8= eventlogadm.8 net.8 nmbd.8 pdbedit.8 smbd.8 smbpasswd.8 \
vfs_shadow_copy2.8 vfs_smb_traffic_analyzer.8 \
vfs_streams_xattr.8 vfs_xattr_tdb.8
-.if !defined(WITHOUT_WINBIND)
+.if ${PORT_OPTIONS:MWINBIND}
MAN1+= wbinfo.1
MAN5+= pam_winbind.conf.5
MAN7+= winbind_krb5_locator.7
MAN8+= pam_winbind.8 winbindd.8
.endif
-.if !defined(WITHOUT_SWAT)
+.if ${PORT_OPTIONS:MSWAT}
MAN8+= swat.8
.endif
-.if defined(WITH_FAM_SUPPORT)
+.if ${PORT_OPTIONS:MFAM_SUPPORT}
MAN8+= vfs_notify_fam.8
.endif
-.if defined(WITH_PTHREADPOOL)
+.if ${PORT_OPTIONS:MPTHREADPOOL}
MAN8+= vfs_aio_pthread.8
.endif
@@ -460,7 +454,7 @@ PLIST_SUB+= ${SAMBA_SUB}
SUB_LIST+= ${SAMBA_SUB}
ALL_TARGET= all
-.if defined(WITH_SMBTORTURE)
+.if ${PORT_OPTIONS:MSMBTORTURE}
ALL_TARGET+= smbtorture
.endif
@@ -468,7 +462,7 @@ ALL_TARGET+= smbtorture
INSTALL_TARGET= installservers installbin installscripts installdat \
installmodules installlibs
-.if !defined(WITHOUT_SWAT)
+.if ${PORT_OPTIONS:MSWAT}
INSTALL_TARGET+=installswat
.endif
@@ -505,23 +499,23 @@ post-install:
# Put examples in place
@${MKDIR} "${EXAMPLESDIR}"
@${CP} -Rp ${WRKDIR}/${DISTNAME}/examples/* "${EXAMPLESDIR}"
-.if defined(WITH_PAM_SMBPASS)
+.if ${PORT_OPTIONS:MPAM_SMBPASS}
@${MKDIR} "${EXAMPLESDIR}/pam_smbpass"
@${CP} -Rp ${WRKSRC}/pam_smbpass/samples/* "${EXAMPLESDIR}/pam_smbpass"
.endif
${INSTALL_DATA} "${WRKDIR}/smb.conf.sample" "${EXAMPLESDIR}/${SAMBA_CONFIG}.sample"
${INSTALL_SCRIPT} "${WRKSRC}/script/mksmbpasswd.sh" "${PREFIX}/bin/make_smbpasswd"
# Winbind
-.if !defined(WITHOUT_WINBIND)
+.if ${PORT_OPTIONS:MWINBIND}
${INSTALL_PROGRAM} "${WRKDIR}/${DISTNAME}/nsswitch/nss_winbind.so" "${SAMBA_LIBDIR}/nss_winbind.so.1"
${INSTALL_PROGRAM} "${WRKDIR}/${DISTNAME}/nsswitch/nss_wins.so" "${SAMBA_LIBDIR}/nss_wins.so.1"
${INSTALL_PROGRAM} "${WRKSRC}/bin/pam_winbind.so" "${SAMBA_LIBDIR}"
.endif
-.if defined(WITH_PAM_SMBPASS)
+.if ${PORT_OPTIONS:MPAM_SMBPASS}
${INSTALL_PROGRAM} "${WRKSRC}/bin/pam_smbpass.so" "${SAMBA_LIBDIR}"
.endif
# smbtorture
-.if defined(WITH_SMBTORTURE)
+.if ${PORT_OPTIONS:MSMBTORTURE}
${INSTALL_PROGRAM} "${WRKSRC}/bin/smbtorture" "${PREFIX}/bin"
.endif
# Lib
@@ -530,7 +524,7 @@ post-install:
${ECHO_CMD} "@unexec ${RMDIR} \"$$d\" 2>/dev/null || true" >> ${TMPPLIST}; \
done
# Documentation
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${DOCSDIR}
@${CP} -Rp "${WRKDIR}/${DISTNAME}/docs/registry" "${DOCSDIR}"
. for f in Samba3-ByExample.pdf Samba3-HOWTO.pdf Samba3-Developers-Guide.pdf
@@ -541,13 +535,12 @@ post-install:
@${INSTALL_DATA} "${WRKDIR}/${DISTNAME}/${f}" "${DOCSDIR}"
. endfor
@${INSTALL_DATA} "${FILESDIR}/README.FreeBSD" "${DOCSDIR}"
-# !NOPORTDOCS
.endif
# Run post-install script
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${CAT} ${PKGMESSAGE}
-.if defined(WITH_MAX_DEBUG)
+.if ${PORT_OPTIONS:MMAX_DEBUG}
test:
(cd ${WRKSRC} && ${GMAKE} test_nss_modules test_pam_modules && ${GMAKE} test)
.endif
diff --git a/net/samba36/distinfo b/net/samba36/distinfo
index 79cde8b0fec2..3cf71c8a64ac 100644
--- a/net/samba36/distinfo
+++ b/net/samba36/distinfo
@@ -1,2 +1,2 @@
-SHA256 (samba-3.6.12.tar.gz) = 6ff797c1772613bd5172d2c8b900fd56bf096d7252faee8b47c4925a4fdc9f8b
-SIZE (samba-3.6.12.tar.gz) = 34073788
+SHA256 (samba-3.6.13.tar.gz) = 992f8ad56717bf551b00ad1d31170588a087fb5c2d4d9cd38fd11544f2b8a596
+SIZE (samba-3.6.13.tar.gz) = 34101849
diff --git a/net/samba36/files/patch-nsswitch__winbind_nss_freebsd.c b/net/samba36/files/patch-nsswitch__winbind_nss_freebsd.c
new file mode 100644
index 000000000000..103059a96790
--- /dev/null
+++ b/net/samba36/files/patch-nsswitch__winbind_nss_freebsd.c
@@ -0,0 +1,100 @@
+--- ./nsswitch/winbind_nss_freebsd.c.orig 2012-10-02 08:24:41.000000000 +0000
++++ ./nsswitch/winbind_nss_freebsd.c 2013-03-13 09:40:37.285778609 +0000
+@@ -5,6 +5,7 @@
+ routines against Samba winbind/Windows NT Domain
+
+ Copyright (C) Aaron Collins 2003
++ Copyright (C) Timur I. Bakeyev 2013
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+@@ -53,6 +54,9 @@
+ NSS_METHOD_PROTOTYPE(__nss_compat_getpwent_r);
+ NSS_METHOD_PROTOTYPE(__nss_compat_setpwent);
+ NSS_METHOD_PROTOTYPE(__nss_compat_endpwent);
++NSS_METHOD_PROTOTYPE(__nss_compat_endpwent);
++
++NSS_METHOD_PROTOTYPE(__freebsd_getgroupmembership);
+
+ static ns_mtab methods[] = {
+ { NSDB_GROUP, "getgrnam_r", __nss_compat_getgrnam_r, _nss_winbind_getgrnam_r },
+@@ -60,6 +64,7 @@
+ { NSDB_GROUP, "getgrent_r", __nss_compat_getgrent_r, _nss_winbind_getgrent_r },
+ { NSDB_GROUP, "setgrent", __nss_compat_setgrent, _nss_winbind_setgrent },
+ { NSDB_GROUP, "endgrent", __nss_compat_endgrent, _nss_winbind_endgrent },
++{ NSDB_GROUP, "getgroupmembership", __freebsd_getgroupmembership, NULL },
+
+ { NSDB_PASSWD, "getpwnam_r", __nss_compat_getpwnam_r, _nss_winbind_getpwnam_r },
+ { NSDB_PASSWD, "getpwuid_r", __nss_compat_getpwuid_r, _nss_winbind_getpwuid_r },
+@@ -69,6 +74,71 @@
+
+ };
+
++/* Taken from libc */
++static int
++gr_addgid(gid_t gid, gid_t *groups, int maxgrp, int *grpcnt)
++{
++ int ret, dupc;
++
++ /* skip duplicates */
++ for (dupc = 0; dupc < MIN(maxgrp, *grpcnt); dupc++) {
++ if (groups[dupc] == gid)
++ return 1;
++ }
++
++ ret = 1;
++ if (*grpcnt < maxgrp) /* add this gid */
++ groups[*grpcnt] = gid;
++ else
++ ret = 0;
++
++ (*grpcnt)++;
++
++ return ret;
++}
++
++/*
++ rv = _nsdispatch(NULL, dtab, NSDB_GROUP, "getgroupmembership",
++ defaultsrc, uname, agroup, groups, maxgrp, grpcnt);
++*/
++
++int
++__freebsd_getgroupmembership(void *retval, void *mdata, va_list ap)
++{
++ const char *uname = va_arg(ap, const char *);
++ gid_t group = va_arg(ap, gid_t);
++ gid_t *groups = va_arg(ap, gid_t *);
++ int maxgrp = va_arg(ap, int);
++ int *groupc = va_arg(ap, int *);
++
++ NSS_STATUS ret;
++ long int lcount, lsize;
++ int i, errnop;
++ gid_t *tmpgroups;
++
++ /* Can be realloc() inside _nss_winbind_initgroups_dyn() */
++ if ((tmpgroups=calloc(maxgrp, sizeof(gid_t))) == NULL) {
++ errno = ENOMEM;
++ return NS_TRYAGAIN;
++ }
++
++ lcount = 0;
++ lsize = maxgrp;
++ /* insert primary membership(possibly already there) */
++ gr_addgid(group, groups, maxgrp, groupc);
++ /* Don't limit number of groups, we want to know total size */
++ ret = _nss_winbind_initgroups_dyn(uname, group, &lcount, &lsize,
++ &tmpgroups, 0, &errnop);
++ if (ret == NSS_STATUS_SUCCESS) {
++ /* lcount potentially can be bigger than maxgrp, so would groupc */
++ for (i = 0; i < lcount; i++)
++ gr_addgid(tmpgroups[i], groups, maxgrp, groupc);
++ }
++ free(tmpgroups);
++ /* Let following nsswitch backend(s) add more groups(?) */
++ return NSS_STATUS_NOTFOUND;
++}
++
+ ns_mtab *
+ nss_module_register(const char *source, unsigned int *mtabsize,
+ nss_module_unregister_fn *unreg)
diff --git a/net/samba36/files/patch-nsswitch__wins_freebsd.c b/net/samba36/files/patch-nsswitch__wins_freebsd.c
index b526acc53730..e0f837760482 100644
--- a/net/samba36/files/patch-nsswitch__wins_freebsd.c
+++ b/net/samba36/files/patch-nsswitch__wins_freebsd.c
@@ -1,25 +1,25 @@
--- ./nsswitch/wins_freebsd.c.orig 2010-04-23 01:08:35.000000000 +0200
+++ ./nsswitch/wins_freebsd.c 2010-04-23 01:08:35.000000000 +0200
@@ -0,0 +1,79 @@
-+/*
++/*
+ Unix SMB/CIFS implementation.
+
+ Copyright (C) Timur I. Bakeyev 2007
-+
++
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
-+
++
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-+
++
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ Boston, MA 02111-1307, USA.
++ Boston, MA 02111-1307, USA.
+*/
+
+#include "winbind_client.h"