summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/samba30/DESCR6
-rw-r--r--net/samba30/MESSAGE10
-rw-r--r--net/samba30/Makefile175
-rw-r--r--net/samba30/Makefile.mirrors28
-rw-r--r--net/samba30/Makefile.patches16
-rw-r--r--net/samba30/PLIST624
-rw-r--r--net/samba30/buildlink3.mk16
-rw-r--r--net/samba30/distinfo44
-rw-r--r--net/samba30/files/adduser.sh161
-rw-r--r--net/samba30/files/deluser.sh68
-rwxr-xr-xnet/samba30/files/nmbd.sh21
-rw-r--r--net/samba30/files/samba.sh52
-rwxr-xr-xnet/samba30/files/smbd.sh32
-rw-r--r--net/samba30/files/winbindd.sh17
-rw-r--r--net/samba30/hacks.mk8
-rw-r--r--net/samba30/options.mk183
-rw-r--r--net/samba30/patches/patch-aa13
-rw-r--r--net/samba30/patches/patch-ac17
-rw-r--r--net/samba30/patches/patch-ae15
-rw-r--r--net/samba30/patches/patch-af57
-rw-r--r--net/samba30/patches/patch-ag23
-rw-r--r--net/samba30/patches/patch-ak13
-rw-r--r--net/samba30/patches/patch-at298
-rw-r--r--net/samba30/patches/patch-au161
-rw-r--r--net/samba30/patches/patch-av13
-rw-r--r--net/samba30/patches/patch-aw13
-rw-r--r--net/samba30/patches/patch-ax13
-rw-r--r--net/samba30/patches/patch-ay13
-rw-r--r--net/samba30/patches/patch-ba118
-rw-r--r--net/samba30/patches/patch-bc13
-rw-r--r--net/samba30/patches/patch-bd16
-rw-r--r--net/samba30/patches/patch-be31
-rw-r--r--net/samba30/patches/patch-bg49
-rw-r--r--net/samba30/patches/patch-bh34
-rw-r--r--net/samba30/patches/patch-bi17
-rw-r--r--net/samba30/patches/patch-bm17
-rw-r--r--net/samba30/patches/patch-bn11
-rw-r--r--net/samba30/patches/patch-bo15
-rw-r--r--net/samba30/patches/patch-bp14
-rw-r--r--net/samba30/patches/patch-bq17
-rw-r--r--net/samba30/patches/patch-br31
-rw-r--r--net/samba30/patches/patch-bs77
-rw-r--r--net/samba30/patches/patch-bu36
-rw-r--r--net/samba30/patches/patch-bv71
-rw-r--r--net/samba30/patches/patch-bw34
-rw-r--r--net/samba30/patches/patch-ca11
-rw-r--r--net/samba30/patches/patch-ce13
-rw-r--r--net/samba30/patches/patch-cf13
-rw-r--r--net/samba30/patches/patch-cg13
-rw-r--r--net/samba30/patches/patch-ch22
-rw-r--r--net/samba30/patches/patch-ci13
-rw-r--r--net/samba30/patches/patch-da47
-rw-r--r--net/samba30/patches/patch-ee40
-rw-r--r--net/samba30/patches/patch-lib_replace_test_os2__delete.c14
-rw-r--r--net/samba30/patches/patch-libsmb_clikrb5.c15
55 files changed, 2912 insertions, 0 deletions
diff --git a/net/samba30/DESCR b/net/samba30/DESCR
new file mode 100644
index 00000000000..fec691f5722
--- /dev/null
+++ b/net/samba30/DESCR
@@ -0,0 +1,6 @@
+Samba provides file and print services for Microsoft Windows clients.
+These services may be hosted off any TCP/IP-enabled platform. The
+Samba project includes not only an impressive feature set in file and
+print serving capabilities, but has been extended to include client
+functionality, utilities to ease migration to Samba, tools to aid
+interoperability with Microsoft Windows, and administration tools.
diff --git a/net/samba30/MESSAGE b/net/samba30/MESSAGE
new file mode 100644
index 00000000000..3c05586dfb0
--- /dev/null
+++ b/net/samba30/MESSAGE
@@ -0,0 +1,10 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2011/12/15 22:23:23 asau Exp $
+
+When upgrading a Samba installation and "lock directory" has been set
+to a non-default value in the configuration files, then "state directory"
+needs to be set appropriately and/or the files located in the lock
+directory should be moved to the state directory. Please read the
+documentation on "state directory" in the smb.conf(5) manual page for
+more information.
+===========================================================================
diff --git a/net/samba30/Makefile b/net/samba30/Makefile
new file mode 100644
index 00000000000..25145c511ef
--- /dev/null
+++ b/net/samba30/Makefile
@@ -0,0 +1,175 @@
+# $NetBSD: Makefile,v 1.1.1.1 2011/12/15 22:23:23 asau Exp $
+
+.include "Makefile.mirrors"
+
+DISTNAME= samba-${VERSION}
+PKGREVISION= 7
+CATEGORIES= net
+MASTER_SITES= ${SAMBA_MIRRORS:=old-versions/}
+
+.include "Makefile.patches"
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://www.samba.org/
+COMMENT= SMB/CIFS protocol server suite
+LICENSE= gnu-gpl-v2
+
+VERSION= 3.0.37
+CONFLICTS+= ja-samba-[0-9]* pam-smbpass-[0-9]* tdb-[0-9]* \
+ winbind-[0-9]*
+MAKE_JOBS_SAFE= NO
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+WRKSRC= ${WRKDIR}/${DISTNAME}/source
+GNU_CONFIGURE= yes
+BUILD_DEFS+= VARBASE
+CHECK_WRKREF_SKIP= *
+
+.include "../../mk/bsd.prefs.mk"
+
+PKG_SYSCONFSUBDIR?= samba
+SAMBA_ETCDIR?= ${PKG_SYSCONFDIR}
+SAMBA_LIBDIR?= ${PREFIX}/lib/samba
+SAMBA_LOCKDIR?= ${SAMBA_VARDIR}/run/samba
+SAMBA_LOGDIR?= ${SAMBA_VARDIR}/log
+SAMBA_PIDDIR?= ${SAMBA_VARDIR}/run
+SAMBA_PRIVATE?= ${SAMBA_ETCDIR}/private
+SAMBA_STATEDIR?= ${SAMBA_VARDIR}/db/samba
+SAMBA_VARDIR?= ${VARBASE}
+WINBINDD_RCD_SCRIPT= # empty
+
+FILES_SUBST+= SAMBA_ETCDIR=${SAMBA_ETCDIR:Q}
+FILES_SUBST+= SAMBA_LOCKDIR=${SAMBA_LOCKDIR:Q}
+FILES_SUBST+= SAMBA_LOGDIR=${SAMBA_LOGDIR:Q}
+FILES_SUBST+= SAMBA_PIDDIR=${SAMBA_PIDDIR:Q}
+FILES_SUBST+= SAMBA_PRIVATE=${SAMBA_PRIVATE:Q}
+FILES_SUBST+= SAMBA_STATEDIR=${SAMBA_STATEDIR:Q}
+FILES_SUBST+= SAMBA_VARDIR=${SAMBA_VARDIR:Q}
+FILES_SUBST+= WINBINDD_RCD_SCRIPT=${WINBINDD_RCD_SCRIPT:Q}
+
+CONFIGURE_ARGS+= --with-configdir=${SAMBA_ETCDIR:Q}
+CONFIGURE_ARGS+= --with-libdir=${SAMBA_LIBDIR:Q}
+CONFIGURE_ARGS+= --with-lockdir=${SAMBA_LOCKDIR:Q}
+CONFIGURE_ARGS+= --with-logfilebase=${SAMBA_LOGDIR:Q}
+CONFIGURE_ARGS+= --with-piddir=${SAMBA_PIDDIR:Q}
+CONFIGURE_ARGS+= --with-privatedir=${SAMBA_PRIVATE:Q}
+CONFIGURE_ARGS+= --with-statedir=${SAMBA_STATEDIR:Q}
+CONFIGURE_ARGS+= --localstatedir=${SAMBA_VARDIR:Q}
+
+CONFIGURE_ARGS+= --with-mandir=${PREFIX:Q}/${PKGMANDIR:Q}
+CONFIGURE_ARGS+= --with-swatdir=${PREFIX:Q}/share/samba/swat
+
+.include "../../converters/libiconv/buildlink3.mk"
+CONFIGURE_ARGS+= --with-libiconv=${BUILDLINK_PREFIX.iconv}
+
+USE_GNU_READLINE= yes
+.include "../../devel/readline/buildlink3.mk"
+CONFIGURE_ARGS+= --with-readline=${BUILDLINK_PREFIX.readline}
+
+.include "options.mk"
+
+# Only Linux supports mount.cifs for mounting a CIFS share into the
+# filesystem.
+#
+PLIST_VARS+= cifsmount
+.if ${OPSYS} == "Linux"
+CONFIGURE_ARGS+= --with-cifsmount
+PLIST.cifsmount= yes
+.endif
+
+# mktemp is useful for the replacement adduser script, but don't require
+# a full dependency since it's not actually needed by samba.
+#
+USE_TOOLS+= mktemp
+
+# findsmb uses perl
+#
+USE_TOOLS+= perl:run
+REPLACE_PERL= script/findsmb.in
+
+.if !defined(PWD_MKDB)
+PWD_MKDB!= ${TYPE} pwd_mkdb 2>&1 | \
+ ${AWK} '/not found/ { print "pwd_mkdb"; exit } { print $$3 }'
+MAKEFLAGS+= PWD_MKDB=${PWD_MKDB:Q}
+.endif
+FILES_SUBST+= MKTEMP=${MKTEMP:Q}
+FILES_SUBST+= PWD_MKDB=${PWD_MKDB:Q}
+
+DOCDIR= share/doc/${PKGBASE}
+EGDIR= share/examples/${PKGBASE}
+
+INSTALLATION_DIRS+= ${DOCDIR} ${EGDIR}
+
+CONF_FILES= ${PREFIX}/${EGDIR}/smb.conf.default ${SAMBA_ETCDIR}/smb.conf
+MAKE_DIRS= ${SAMBA_VARDIR} ${SAMBA_LOGDIR} ${SAMBA_PIDDIR}
+OWN_DIRS= ${SAMBA_ETCDIR} ${SAMBA_LOCKDIR} ${SAMBA_STATEDIR}
+OWN_DIRS_PERMS= ${SAMBA_PRIVATE} ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0700
+RCD_SCRIPTS+= samba nmbd smbd ${WINBINDD_RCD_SCRIPT}
+
+SUBST_CLASSES+= paths
+SUBST_FILES.paths= ${WRKDIR}/adduser.sh ${WRKDIR}/deluser.sh
+SUBST_SED.paths+= -e 's,@AWK@,${AWK},g' -e 's,@CAT@,${CAT},g'
+SUBST_SED.paths+= -e 's,@MKTEMP@,${MKTEMP},g' -e 's,@RM@,${RM},g'
+SUBST_SED.paths+= -e 's,@PWD_MKDB@,${PWD_MKDB},g' -e 's,@SH@,${SH},g'
+SUBST_STAGE.paths= post-patch
+
+# Get the shared library major and minors for the installed shared
+# libraries. We'll need these to create the versioned symlinks for
+# the shared libraries because samba Makefile doesn't do it on its
+# own.
+#
+SAMBA_LIBS= smbclient msrpc smbsharemodes addns
+
+.PHONY: install-samba-lib-symlinks
+.for l in ${SAMBA_LIBS}
+. for NUM in MAJOR MINOR
+LIB${NUM}_cmd.${l}= ${AWK} -F= '/^LIB${l:tu}_${NUM}/ { print $$2; }' \
+ ${WRKSRC:Q}/Makefile.in
+LIB${NUM}.${l}= ${LIB${NUM}_cmd.${l}:sh}
+PLIST_SUBST+= LIB${NUM}.${l}=${LIB${NUM}.${l}}
+. endfor
+
+SAMBA_VERSIONS.${l}= ${LIBMAJOR.${l}} ${LIBMAJOR.${l}}.${LIBMINOR.${l}}
+
+.PHONY: install-samba-lib-symlinks-${l}
+install-samba-lib-symlinks: install-samba-lib-symlinks-${l}
+install-samba-lib-symlinks-${l}:
+ for v in ${SAMBA_VERSIONS.${l}}; do \
+ cd ${DESTDIR}${SAMBA_LIBDIR} && \
+ rm -f lib${l}.so.$$v && \
+ ln -s lib${l}.so lib${l}.so.$$v; \
+ done
+.endfor
+
+post-extract:
+ ${CP} ${FILESDIR}/adduser.sh ${FILESDIR}/deluser.sh ${WRKDIR}
+
+post-install: install-samba-lib-symlinks
+ ${RMDIR} ${DESTDIR}${PREFIX}/share/samba/swat/js
+ ${RMDIR} ${DESTDIR}${PREFIX}/share/samba/swat/lang/ja/include
+ ${RMDIR} ${DESTDIR}${PREFIX}/share/samba/swat/lang/ja/images
+ ${RMDIR} ${DESTDIR}${PREFIX}/share/samba/swat/lang/ja/js
+ ${RMDIR} ${DESTDIR}${PREFIX}/share/samba/swat/lang/tr/include
+ ${RMDIR} ${DESTDIR}${PREFIX}/share/samba/swat/lang/tr/js
+ for d in idmap pdb rpc; do \
+ ${RMDIR} ${DESTDIR}${SAMBA_LIBDIR}/$$d; \
+ done
+ cd ${WRKDIR}/${DISTNAME}/docs/registry; for f in *.reg; do \
+ ${INSTALL_DATA} $${f} ${DESTDIR}${PREFIX}/${DOCDIR}/$${f}; \
+ done
+ ${INSTALL_SCRIPT} ${WRKDIR}/adduser.sh ${DESTDIR}${PREFIX}/${EGDIR}/adduser.sh
+ ${INSTALL_SCRIPT} ${WRKDIR}/deluser.sh ${DESTDIR}${PREFIX}/${EGDIR}/deluser.sh
+ cd ${WRKDIR}/${DISTNAME}/examples; \
+ ${INSTALL_DATA} LDAP/samba.schema ${DESTDIR}${PREFIX}/${EGDIR}; \
+ ${INSTALL_DATA} smb.conf.default ${DESTDIR}${PREFIX}/${EGDIR}
+ cd ${WRKSRC}/script; ${INSTALL_SCRIPT} mknissmbpasswd.sh ${DESTDIR}${PREFIX}/${EGDIR}
+ cd ${WRKSRC}/script; ${INSTALL_SCRIPT} mknissmbpwdtbl.sh ${DESTDIR}${PREFIX}/${EGDIR}
+ cd ${WRKSRC}/script; ${INSTALL_SCRIPT} mksmbpasswd.sh ${DESTDIR}${PREFIX}/${EGDIR}
+ cd ${WRKSRC}/script; ${INSTALL_SCRIPT} updatesmbpasswd.sh ${DESTDIR}${PREFIX}/${EGDIR}
+ ${CHMOD} ${SHAREMODE} ${DESTDIR}${PREFIX}/include/libmsrpc.h \
+ ${DESTDIR}${PREFIX}/include/libsmbclient.h
+
+.include "../../security/openssl/buildlink3.mk"
+.include "../../devel/popt/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/net/samba30/Makefile.mirrors b/net/samba30/Makefile.mirrors
new file mode 100644
index 00000000000..5739b1d8f2f
--- /dev/null
+++ b/net/samba30/Makefile.mirrors
@@ -0,0 +1,28 @@
+# $NetBSD: Makefile.mirrors,v 1.1.1.1 2011/12/15 22:23:23 asau Exp $
+#
+# This Makefile fragment contains the mirror sites for fetching Samba.
+
+###
+### This list was last updated on 20080403 from:
+### http://www.samba.org/samba/download/ftp_mirrors.html
+###
+SAMBA_MIRRORS= \
+ ftp://ftp.easynet.be/samba/ \
+ http://mirrors.uol.com.br/pub/samba/ \
+ ftp://ca.samba.org/ \
+ ftp://mirrors.dotsrc.org/samba/ \
+ ftp://de3.samba.org/pub/samba/ \
+ ftp://ftp.ntua.gr/pub/net/samba/ \
+ ftp://ftp.hkmirror.org/pub/samba/sambaftp/ \
+ ftp://ftp.heanet.ie/pub/samba/ \
+ ftp://ftp.ring.gr.jp/pub/net/samba/ \
+ ftp://ftp.samba.gr.jp/pub/samba/ \
+ http://samba.osmirror.nl/samba/ftp/ \
+ ftp://ftp.bit.nl/mirror/samba/ \
+ ftp://www.bibsyst.no/pub/samba/ \
+ ftp://pl.samba.org/pub/unix/net/samba/ \
+ ftp://ftp.chg.ru/packages/samba/ \
+ ftp://ftp.oss.eznetsols.org/samba/ \
+ ftp://us5.samba.org/pub/samba-ftp/ \
+ ftp://download.samba.org/pub/samba/ \
+ http://download.samba.org/samba/ftp/
diff --git a/net/samba30/Makefile.patches b/net/samba30/Makefile.patches
new file mode 100644
index 00000000000..df33dd67702
--- /dev/null
+++ b/net/samba30/Makefile.patches
@@ -0,0 +1,16 @@
+# $NetBSD: Makefile.patches,v 1.1.1.1 2011/12/15 22:23:23 asau Exp $
+#
+# This Makefile fragment describes the recommended patches for the
+# currently packaged version of Samba. All recommended patches for
+# particular release of Samba are also integrated into the next release
+# of Samba, so upon updating to the latest release of Samba, the
+# PATCHFILES variable should be empty.
+#
+# The PATCHFILES are listed in chronological order according to the time
+# they are added to ${PATCH_SITES}.
+#
+#PATCH_SITES= http://www.samba.org/samba/patches/patches-${VERSION}/
+#PATCHFILES=
+#PATCH_DIST_STRIP= -p2
+#PATCH_SITES= http://www.samba.org/samba/ftp/patches/security/
+#PATCHFILES=
diff --git a/net/samba30/PLIST b/net/samba30/PLIST
new file mode 100644
index 00000000000..7b9b5f67dec
--- /dev/null
+++ b/net/samba30/PLIST
@@ -0,0 +1,624 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2011/12/15 22:23:23 asau Exp $
+bin/eventlogadm
+bin/findsmb
+bin/net
+bin/nmblookup
+bin/ntlm_auth
+bin/pdbedit
+bin/profiles
+bin/rpcclient
+bin/smbcacls
+bin/smbclient
+bin/smbcontrol
+bin/smbcquotas
+bin/smbget
+bin/smbpasswd
+bin/smbspool
+bin/smbstatus
+bin/smbtar
+bin/smbtree
+bin/tdbbackup
+bin/tdbdump
+bin/tdbtool
+bin/testparm
+${PLIST.winbind}bin/wbinfo
+include/libmsrpc.h
+include/libsmbclient.h
+${PLIST.winbind}${NSS_WINBIND}
+${PLIST.winbind}${NSS_WINS}
+lib/samba/auth/script.so
+lib/samba/charset/CP437.so
+lib/samba/charset/CP850.so
+lib/samba/de.msg
+lib/samba/en.msg
+lib/samba/fi.msg
+lib/samba/fr.msg
+lib/samba/it.msg
+lib/samba/ja.msg
+lib/samba/libaddns.so
+lib/samba/libaddns.so.${LIBMAJOR.addns}
+lib/samba/libaddns.so.${LIBMAJOR.addns}.${LIBMINOR.addns}
+lib/samba/libmsrpc.so
+lib/samba/libmsrpc.so.${LIBMAJOR.msrpc}
+lib/samba/libmsrpc.so.${LIBMAJOR.msrpc}.${LIBMINOR.msrpc}
+lib/samba/libsmbclient.so
+lib/samba/libsmbclient.so.${LIBMAJOR.smbclient}
+lib/samba/libsmbclient.so.${LIBMAJOR.smbclient}.${LIBMINOR.smbclient}
+lib/samba/libsmbsharemodes.so
+lib/samba/libsmbsharemodes.so.${LIBMAJOR.smbsharemodes}
+lib/samba/libsmbsharemodes.so.${LIBMAJOR.smbsharemodes}.${LIBMINOR.smbsharemodes}
+lib/samba/lowcase.dat
+lib/samba/nl.msg
+lib/samba/pl.msg
+lib/samba/tr.msg
+lib/samba/upcase.dat
+lib/samba/valid.dat
+lib/samba/vfs/audit.so
+lib/samba/vfs/cap.so
+lib/samba/vfs/default_quota.so
+lib/samba/vfs/expand_msdfs.so
+lib/samba/vfs/extd_audit.so
+lib/samba/vfs/fake_perms.so
+lib/samba/vfs/full_audit.so
+lib/samba/vfs/netatalk.so
+${PLIST.fam}lib/samba/vfs/notify_fam.so
+lib/samba/vfs/readahead.so
+lib/samba/vfs/readonly.so
+lib/samba/vfs/recycle.so
+lib/samba/vfs/shadow_copy.so
+${PLIST.pam}lib/security/pam_smbpass.so
+${PLIST.pam}${PLIST.winbind}lib/security/pam_winbind.so
+${PLIST.cups}libexec/cups/backend/smb
+man/man1/findsmb.1
+man/man1/log2pcap.1
+man/man1/nmblookup.1
+man/man1/ntlm_auth.1
+man/man1/profiles.1
+man/man1/rpcclient.1
+man/man1/smbcacls.1
+man/man1/smbclient.1
+man/man1/smbcontrol.1
+man/man1/smbcquotas.1
+man/man1/smbget.1
+man/man1/smbstatus.1
+man/man1/smbtar.1
+man/man1/smbtree.1
+man/man1/testparm.1
+man/man1/vfstest.1
+man/man1/wbinfo.1
+man/man5/lmhosts.5
+man/man5/smb.conf.5
+man/man5/smbgetrc.5
+man/man5/smbpasswd.5
+man/man7/libsmbclient.7
+man/man7/pam_winbind.7
+man/man7/samba.7
+man/man8/eventlogadm.8
+man/man8/idmap_ad.8
+man/man8/idmap_ldap.8
+man/man8/idmap_nss.8
+man/man8/idmap_rid.8
+man/man8/idmap_tdb.8
+man/man8/mount.cifs.8
+man/man8/net.8
+man/man8/nmbd.8
+man/man8/pdbedit.8
+man/man8/smbd.8
+man/man8/smbpasswd.8
+man/man8/smbspool.8
+man/man8/swat.8
+man/man8/tdbbackup.8
+man/man8/tdbdump.8
+man/man8/tdbtool.8
+man/man8/umount.cifs.8
+man/man8/vfs_audit.8
+man/man8/vfs_cacheprime.8
+man/man8/vfs_cap.8
+man/man8/vfs_catia.8
+man/man8/vfs_commit.8
+man/man8/vfs_default_quota.8
+man/man8/vfs_extd_audit.8
+man/man8/vfs_fake_perms.8
+man/man8/vfs_full_audit.8
+man/man8/vfs_gpfs.8
+man/man8/vfs_netatalk.8
+man/man8/vfs_notify_fam.8
+man/man8/vfs_prealloc.8
+man/man8/vfs_readahead.8
+man/man8/vfs_readonly.8
+man/man8/vfs_recycle.8
+man/man8/vfs_shadow_copy.8
+man/man8/vfs_xattr_tdb.8
+man/man8/winbindd.8
+${PLIST.cifsmount}sbin/mount.cifs
+sbin/nmbd
+sbin/smbd
+sbin/swat
+${PLIST.cifsmount}sbin/umount.cifs
+${PLIST.winbind}sbin/winbindd
+share/doc/samba/NT4-Locking.reg
+share/doc/samba/NT4_PlainPassword.reg
+${PLIST.pam}share/doc/samba/README.pam_smbpass
+share/doc/samba/Win-2Kx-XPP-DeleteCachedProfiles.reg
+share/doc/samba/Win-2Kx-XPP-ForceLocalProfile.reg
+share/doc/samba/Win-NT-DeleteRoamingProfile.reg
+share/doc/samba/Win2000_PlainPassword.reg
+share/doc/samba/Win95_PlainPassword.reg
+share/doc/samba/Win98_PlainPassword.reg
+share/doc/samba/Win9X-CacheHandling.reg
+share/doc/samba/WinME_PlainPassword.reg
+share/doc/samba/WinXP_PlainPassword.reg
+share/doc/samba/WindowsTerminalServer.reg
+share/examples/rc.d/nmbd
+share/examples/rc.d/samba
+share/examples/rc.d/smbd
+${PLIST.winbind}share/examples/rc.d/winbindd
+share/examples/samba/adduser.sh
+share/examples/samba/deluser.sh
+share/examples/samba/mknissmbpasswd.sh
+share/examples/samba/mknissmbpwdtbl.sh
+share/examples/samba/mksmbpasswd.sh
+${PLIST.pam}share/examples/samba/pam_smbpass/kdc-pdc
+${PLIST.pam}share/examples/samba/pam_smbpass/password-mature
+${PLIST.pam}share/examples/samba/pam_smbpass/password-migration
+${PLIST.pam}share/examples/samba/pam_smbpass/password-sync
+share/examples/samba/samba.schema
+share/examples/samba/smb.conf.default
+share/examples/samba/updatesmbpasswd.sh
+share/samba/swat/help/Samba3-ByExample/2000users.html
+share/samba/swat/help/Samba3-ByExample/Big500users.html
+share/samba/swat/help/Samba3-ByExample/DMSMig.html
+share/samba/swat/help/Samba3-ByExample/DomApps.html
+share/samba/swat/help/Samba3-ByExample/ExNetworks.html
+share/samba/swat/help/Samba3-ByExample/HA.html
+share/samba/swat/help/Samba3-ByExample/RefSection.html
+share/samba/swat/help/Samba3-ByExample/apa.html
+share/samba/swat/help/Samba3-ByExample/appendix.html
+share/samba/swat/help/Samba3-ByExample/ch14.html
+share/samba/swat/help/Samba3-ByExample/go01.html
+share/samba/swat/help/Samba3-ByExample/happy.html
+share/samba/swat/help/Samba3-ByExample/images/AccountingNetwork.png
+share/samba/swat/help/Samba3-ByExample/images/Charity-Network.png
+share/samba/swat/help/Samba3-ByExample/images/HostAnnouncment.png
+share/samba/swat/help/Samba3-ByExample/images/NullConnect.png
+share/samba/swat/help/Samba3-ByExample/images/UNIX-Samba-and-LDAP.png
+share/samba/swat/help/Samba3-ByExample/images/UserConnect.png
+share/samba/swat/help/Samba3-ByExample/images/UserMgrNT4.png
+share/samba/swat/help/Samba3-ByExample/images/WINREPRESSME-Capture.png
+share/samba/swat/help/Samba3-ByExample/images/WINREPRESSME-Capture2.png
+share/samba/swat/help/Samba3-ByExample/images/WindowsXP-NullConnection.png
+share/samba/swat/help/Samba3-ByExample/images/WindowsXP-UserConnection.png
+share/samba/swat/help/Samba3-ByExample/images/XP-screen001.png
+share/samba/swat/help/Samba3-ByExample/images/acct2net.png
+share/samba/swat/help/Samba3-ByExample/images/ch7-dual-additive-LDAP-Ok.png
+share/samba/swat/help/Samba3-ByExample/images/ch7-dual-additive-LDAP.png
+share/samba/swat/help/Samba3-ByExample/images/ch7-fail-overLDAP.png
+share/samba/swat/help/Samba3-ByExample/images/ch7-singleLDAP.png
+share/samba/swat/help/Samba3-ByExample/images/ch8-migration.png
+share/samba/swat/help/Samba3-ByExample/images/chap4-net.png
+share/samba/swat/help/Samba3-ByExample/images/chap5-net.png
+share/samba/swat/help/Samba3-ByExample/images/chap6-net.png
+share/samba/swat/help/Samba3-ByExample/images/chap7-idresol.png
+share/samba/swat/help/Samba3-ByExample/images/chap7-net-Ar.png
+share/samba/swat/help/Samba3-ByExample/images/chap7-net2-Br.png
+share/samba/swat/help/Samba3-ByExample/images/chap9-ADSDC.png
+share/samba/swat/help/Samba3-ByExample/images/chap9-SambaDC.png
+share/samba/swat/help/Samba3-ByExample/images/imc-usermanager2.png
+share/samba/swat/help/Samba3-ByExample/images/lam-config.png
+share/samba/swat/help/Samba3-ByExample/images/lam-group-members.png
+share/samba/swat/help/Samba3-ByExample/images/lam-groups.png
+share/samba/swat/help/Samba3-ByExample/images/lam-hosts.png
+share/samba/swat/help/Samba3-ByExample/images/lam-login.png
+share/samba/swat/help/Samba3-ByExample/images/lam-users.png
+share/samba/swat/help/Samba3-ByExample/images/openmag.png
+share/samba/swat/help/Samba3-ByExample/images/wxpp001.png
+share/samba/swat/help/Samba3-ByExample/images/wxpp004.png
+share/samba/swat/help/Samba3-ByExample/images/wxpp006.png
+share/samba/swat/help/Samba3-ByExample/images/wxpp007.png
+share/samba/swat/help/Samba3-ByExample/images/wxpp008.png
+share/samba/swat/help/Samba3-ByExample/index.html
+share/samba/swat/help/Samba3-ByExample/ix01.html
+share/samba/swat/help/Samba3-ByExample/kerberos.html
+share/samba/swat/help/Samba3-ByExample/ntmigration.html
+share/samba/swat/help/Samba3-ByExample/nw4migration.html
+share/samba/swat/help/Samba3-ByExample/pr01.html
+share/samba/swat/help/Samba3-ByExample/pr02.html
+share/samba/swat/help/Samba3-ByExample/pr03.html
+share/samba/swat/help/Samba3-ByExample/preface.html
+share/samba/swat/help/Samba3-ByExample/primer.html
+share/samba/swat/help/Samba3-ByExample/secure.html
+share/samba/swat/help/Samba3-ByExample/simple.html
+share/samba/swat/help/Samba3-ByExample/small.html
+share/samba/swat/help/Samba3-ByExample/unixclients.html
+share/samba/swat/help/Samba3-ByExample/upgrades.html
+share/samba/swat/help/Samba3-Developers-Guide/CodingSuggestions.html
+share/samba/swat/help/Samba3-Developers-Guide/Packaging.html
+share/samba/swat/help/Samba3-Developers-Guide/architecture.html
+share/samba/swat/help/Samba3-Developers-Guide/contributing.html
+share/samba/swat/help/Samba3-Developers-Guide/debug.html
+share/samba/swat/help/Samba3-Developers-Guide/devprinting.html
+share/samba/swat/help/Samba3-Developers-Guide/index.html
+share/samba/swat/help/Samba3-Developers-Guide/internals.html
+share/samba/swat/help/Samba3-Developers-Guide/modules.html
+share/samba/swat/help/Samba3-Developers-Guide/ntdomain.html
+share/samba/swat/help/Samba3-Developers-Guide/parsing.html
+share/samba/swat/help/Samba3-Developers-Guide/pr01.html
+share/samba/swat/help/Samba3-Developers-Guide/pt01.html
+share/samba/swat/help/Samba3-Developers-Guide/pt02.html
+share/samba/swat/help/Samba3-Developers-Guide/pt03.html
+share/samba/swat/help/Samba3-Developers-Guide/pt04.html
+share/samba/swat/help/Samba3-Developers-Guide/pt05.html
+share/samba/swat/help/Samba3-Developers-Guide/pwencrypt.html
+share/samba/swat/help/Samba3-Developers-Guide/rpc-plugin.html
+share/samba/swat/help/Samba3-Developers-Guide/tracing.html
+share/samba/swat/help/Samba3-Developers-Guide/unix-smb.html
+share/samba/swat/help/Samba3-Developers-Guide/vfs.html
+share/samba/swat/help/Samba3-Developers-Guide/wins.html
+share/samba/swat/help/Samba3-HOWTO/AccessControls.html
+share/samba/swat/help/Samba3-HOWTO/AdvancedNetworkManagement.html
+share/samba/swat/help/Samba3-HOWTO/Appendix.html
+share/samba/swat/help/Samba3-HOWTO/Backup.html
+share/samba/swat/help/Samba3-HOWTO/CUPS-printing.html
+share/samba/swat/help/Samba3-HOWTO/ChangeNotes.html
+share/samba/swat/help/Samba3-HOWTO/ClientConfig.html
+share/samba/swat/help/Samba3-HOWTO/DNSDHCP.html
+share/samba/swat/help/Samba3-HOWTO/FastStart.html
+share/samba/swat/help/Samba3-HOWTO/InterdomainTrusts.html
+share/samba/swat/help/Samba3-HOWTO/IntroSMB.html
+share/samba/swat/help/Samba3-HOWTO/NT4Migration.html
+share/samba/swat/help/Samba3-HOWTO/NetCommand.html
+share/samba/swat/help/Samba3-HOWTO/NetworkBrowsing.html
+share/samba/swat/help/Samba3-HOWTO/Other-Clients.html
+share/samba/swat/help/Samba3-HOWTO/PolicyMgmt.html
+share/samba/swat/help/Samba3-HOWTO/Portability.html
+share/samba/swat/help/Samba3-HOWTO/ProfileMgmt.html
+share/samba/swat/help/Samba3-HOWTO/SWAT.html
+share/samba/swat/help/Samba3-HOWTO/SambaHA.html
+share/samba/swat/help/Samba3-HOWTO/ServerType.html
+share/samba/swat/help/Samba3-HOWTO/StandAloneServer.html
+share/samba/swat/help/Samba3-HOWTO/TOSHpreface.html
+share/samba/swat/help/Samba3-HOWTO/VFS.html
+share/samba/swat/help/Samba3-HOWTO/apa.html
+share/samba/swat/help/Samba3-HOWTO/bugreport.html
+share/samba/swat/help/Samba3-HOWTO/cfgsmarts.html
+share/samba/swat/help/Samba3-HOWTO/ch-ldap-tls.html
+share/samba/swat/help/Samba3-HOWTO/ch47.html
+share/samba/swat/help/Samba3-HOWTO/classicalprinting.html
+share/samba/swat/help/Samba3-HOWTO/compiling.html
+share/samba/swat/help/Samba3-HOWTO/diagnosis.html
+share/samba/swat/help/Samba3-HOWTO/domain-member.html
+share/samba/swat/help/Samba3-HOWTO/go01.html
+share/samba/swat/help/Samba3-HOWTO/groupmapping.html
+share/samba/swat/help/Samba3-HOWTO/idmapper.html
+share/samba/swat/help/Samba3-HOWTO/images/10small.png
+share/samba/swat/help/Samba3-HOWTO/images/11small.png
+share/samba/swat/help/Samba3-HOWTO/images/12small.png
+share/samba/swat/help/Samba3-HOWTO/images/13small.png
+share/samba/swat/help/Samba3-HOWTO/images/14small.png
+share/samba/swat/help/Samba3-HOWTO/images/1small.png
+share/samba/swat/help/Samba3-HOWTO/images/2small.png
+share/samba/swat/help/Samba3-HOWTO/images/3small.png
+share/samba/swat/help/Samba3-HOWTO/images/4small.png
+share/samba/swat/help/Samba3-HOWTO/images/5small.png
+share/samba/swat/help/Samba3-HOWTO/images/6small.png
+share/samba/swat/help/Samba3-HOWTO/images/7small.png
+share/samba/swat/help/Samba3-HOWTO/images/8small.png
+share/samba/swat/help/Samba3-HOWTO/images/9small.png
+share/samba/swat/help/Samba3-HOWTO/images/WME001.png
+share/samba/swat/help/Samba3-HOWTO/images/WME002.png
+share/samba/swat/help/Samba3-HOWTO/images/WME003.png
+share/samba/swat/help/Samba3-HOWTO/images/WME005.png
+share/samba/swat/help/Samba3-HOWTO/images/WME009.png
+share/samba/swat/help/Samba3-HOWTO/images/WME010.png
+share/samba/swat/help/Samba3-HOWTO/images/WME013.png
+share/samba/swat/help/Samba3-HOWTO/images/WME014.png
+share/samba/swat/help/Samba3-HOWTO/images/WXPP002.png
+share/samba/swat/help/Samba3-HOWTO/images/WXPP003.png
+share/samba/swat/help/Samba3-HOWTO/images/WXPP005.png
+share/samba/swat/help/Samba3-HOWTO/images/WXPP009.png
+share/samba/swat/help/Samba3-HOWTO/images/WXPP014.png
+share/samba/swat/help/Samba3-HOWTO/images/a_small.png
+share/samba/swat/help/Samba3-HOWTO/images/access1.png
+share/samba/swat/help/Samba3-HOWTO/images/browsing1.png
+share/samba/swat/help/Samba3-HOWTO/images/cups1.png
+share/samba/swat/help/Samba3-HOWTO/images/cups2.png
+share/samba/swat/help/Samba3-HOWTO/images/domain.png
+share/samba/swat/help/Samba3-HOWTO/images/ethereal1.png
+share/samba/swat/help/Samba3-HOWTO/images/ethereal2.png
+share/samba/swat/help/Samba3-HOWTO/images/idmap-gid2sid.png
+share/samba/swat/help/Samba3-HOWTO/images/idmap-sid2gid.png
+share/samba/swat/help/Samba3-HOWTO/images/idmap-sid2uid.png
+share/samba/swat/help/Samba3-HOWTO/images/idmap-store-gid2sid.png
+share/samba/swat/help/Samba3-HOWTO/images/idmap-uid2sid.png
+share/samba/swat/help/Samba3-HOWTO/images/idmap_winbind_no_loop.png
+share/samba/swat/help/Samba3-HOWTO/images/pdftoepsonusb.png
+share/samba/swat/help/Samba3-HOWTO/images/pdftosocket.png
+share/samba/swat/help/Samba3-HOWTO/images/trusts1.png
+share/samba/swat/help/Samba3-HOWTO/images/w2kp001.png
+share/samba/swat/help/Samba3-HOWTO/images/w2kp002.png
+share/samba/swat/help/Samba3-HOWTO/images/w2kp003.png
+share/samba/swat/help/Samba3-HOWTO/images/w2kp004.png
+share/samba/swat/help/Samba3-HOWTO/images/w2kp005.png
+share/samba/swat/help/Samba3-HOWTO/images/wxpp001.png
+share/samba/swat/help/Samba3-HOWTO/images/wxpp004.png
+share/samba/swat/help/Samba3-HOWTO/images/wxpp006.png
+share/samba/swat/help/Samba3-HOWTO/images/wxpp007.png
+share/samba/swat/help/Samba3-HOWTO/images/wxpp008.png
+share/samba/swat/help/Samba3-HOWTO/index.html
+share/samba/swat/help/Samba3-HOWTO/install.html
+share/samba/swat/help/Samba3-HOWTO/integrate-ms-networks.html
+share/samba/swat/help/Samba3-HOWTO/introduction.html
+share/samba/swat/help/Samba3-HOWTO/ix01.html
+share/samba/swat/help/Samba3-HOWTO/largefile.html
+share/samba/swat/help/Samba3-HOWTO/locking.html
+share/samba/swat/help/Samba3-HOWTO/migration.html
+share/samba/swat/help/Samba3-HOWTO/msdfs.html
+share/samba/swat/help/Samba3-HOWTO/optional.html
+share/samba/swat/help/Samba3-HOWTO/pam.html
+share/samba/swat/help/Samba3-HOWTO/passdb.html
+share/samba/swat/help/Samba3-HOWTO/pr01.html
+share/samba/swat/help/Samba3-HOWTO/pr02.html
+share/samba/swat/help/Samba3-HOWTO/pr03.html
+share/samba/swat/help/Samba3-HOWTO/problems.html
+share/samba/swat/help/Samba3-HOWTO/rights.html
+share/samba/swat/help/Samba3-HOWTO/samba-bdc.html
+share/samba/swat/help/Samba3-HOWTO/samba-pdc.html
+share/samba/swat/help/Samba3-HOWTO/securing-samba.html
+share/samba/swat/help/Samba3-HOWTO/speed.html
+share/samba/swat/help/Samba3-HOWTO/troubleshooting.html
+share/samba/swat/help/Samba3-HOWTO/type.html
+share/samba/swat/help/Samba3-HOWTO/unicode.html
+share/samba/swat/help/Samba3-HOWTO/upgrading-to-3.0.html
+share/samba/swat/help/Samba3-HOWTO/winbind.html
+share/samba/swat/help/manpages/cifs.upcall.8.html
+share/samba/swat/help/manpages/eventlogadm.8.html
+share/samba/swat/help/manpages/findsmb.1.html
+share/samba/swat/help/manpages/idmap_ad.8.html
+share/samba/swat/help/manpages/idmap_ldap.8.html
+share/samba/swat/help/manpages/idmap_nss.8.html
+share/samba/swat/help/manpages/idmap_rid.8.html
+share/samba/swat/help/manpages/idmap_tdb.8.html
+share/samba/swat/help/manpages/index.html
+share/samba/swat/help/manpages/libsmbclient.7.html
+share/samba/swat/help/manpages/lmhosts.5.html
+share/samba/swat/help/manpages/log2pcap.1.html
+share/samba/swat/help/manpages/mount.cifs.8.html
+share/samba/swat/help/manpages/net.8.html
+share/samba/swat/help/manpages/nmbd.8.html
+share/samba/swat/help/manpages/nmblookup.1.html
+share/samba/swat/help/manpages/ntlm_auth.1.html
+share/samba/swat/help/manpages/pam_winbind.7.html
+share/samba/swat/help/manpages/pdbedit.8.html
+share/samba/swat/help/manpages/profiles.1.html
+share/samba/swat/help/manpages/rpcclient.1.html
+share/samba/swat/help/manpages/samba.7.html
+share/samba/swat/help/manpages/smb.conf.5.html
+share/samba/swat/help/manpages/smbcacls.1.html
+share/samba/swat/help/manpages/smbclient.1.html
+share/samba/swat/help/manpages/smbcontrol.1.html
+share/samba/swat/help/manpages/smbcquotas.1.html
+share/samba/swat/help/manpages/smbd.8.html
+share/samba/swat/help/manpages/smbget.1.html
+share/samba/swat/help/manpages/smbgetrc.5.html
+share/samba/swat/help/manpages/smbmnt.8.html
+share/samba/swat/help/manpages/smbmount.8.html
+share/samba/swat/help/manpages/smbpasswd.5.html
+share/samba/swat/help/manpages/smbpasswd.8.html
+share/samba/swat/help/manpages/smbspool.8.html
+share/samba/swat/help/manpages/smbstatus.1.html
+share/samba/swat/help/manpages/smbtar.1.html
+share/samba/swat/help/manpages/smbtree.1.html
+share/samba/swat/help/manpages/smbumount.8.html
+share/samba/swat/help/manpages/swat.8.html
+share/samba/swat/help/manpages/tdbbackup.8.html
+share/samba/swat/help/manpages/tdbdump.8.html
+share/samba/swat/help/manpages/tdbtool.8.html
+share/samba/swat/help/manpages/testparm.1.html
+share/samba/swat/help/manpages/umount.cifs.8.html
+share/samba/swat/help/manpages/vfs_audit.8.html
+share/samba/swat/help/manpages/vfs_cacheprime.8.html
+share/samba/swat/help/manpages/vfs_cap.8.html
+share/samba/swat/help/manpages/vfs_catia.8.html
+share/samba/swat/help/manpages/vfs_commit.8.html
+share/samba/swat/help/manpages/vfs_default_quota.8.html
+share/samba/swat/help/manpages/vfs_extd_audit.8.html
+share/samba/swat/help/manpages/vfs_fake_perms.8.html
+share/samba/swat/help/manpages/vfs_full_audit.8.html
+share/samba/swat/help/manpages/vfs_gpfs.8.html
+share/samba/swat/help/manpages/vfs_netatalk.8.html
+share/samba/swat/help/manpages/vfs_notify_fam.8.html
+share/samba/swat/help/manpages/vfs_prealloc.8.html
+share/samba/swat/help/manpages/vfs_readahead.8.html
+share/samba/swat/help/manpages/vfs_readonly.8.html
+share/samba/swat/help/manpages/vfs_recycle.8.html
+share/samba/swat/help/manpages/vfs_shadow_copy.8.html
+share/samba/swat/help/manpages/vfs_xattr_tdb.8.html
+share/samba/swat/help/manpages/vfstest.1.html
+share/samba/swat/help/manpages/wbinfo.1.html
+share/samba/swat/help/manpages/winbindd.8.html
+share/samba/swat/help/welcome-no-samba-doc.html
+share/samba/swat/help/welcome.html
+share/samba/swat/images/globals.gif
+share/samba/swat/images/home.gif
+share/samba/swat/images/passwd.gif
+share/samba/swat/images/printers.gif
+share/samba/swat/images/samba.gif
+share/samba/swat/images/shares.gif
+share/samba/swat/images/status.gif
+share/samba/swat/images/viewconfig.gif
+share/samba/swat/images/wizard.gif
+share/samba/swat/include/footer.html
+share/samba/swat/include/header.html
+share/samba/swat/lang/ja/help/welcome.html
+share/samba/swat/lang/tr/help/welcome.html
+share/samba/swat/lang/tr/images/globals.gif
+share/samba/swat/lang/tr/images/home.gif
+share/samba/swat/lang/tr/images/passwd.gif
+share/samba/swat/lang/tr/images/printers.gif
+share/samba/swat/lang/tr/images/samba.gif
+share/samba/swat/lang/tr/images/shares.gif
+share/samba/swat/lang/tr/images/status.gif
+share/samba/swat/lang/tr/images/viewconfig.gif
+share/samba/swat/using_samba/appa.html
+share/samba/swat/using_samba/appb.html
+share/samba/swat/using_samba/appc.html
+share/samba/swat/using_samba/appd.html
+share/samba/swat/using_samba/appe.html
+share/samba/swat/using_samba/appf.html
+share/samba/swat/using_samba/appg.html
+share/samba/swat/using_samba/ch00.html
+share/samba/swat/using_samba/ch01.html
+share/samba/swat/using_samba/ch02.html
+share/samba/swat/using_samba/ch03.html
+share/samba/swat/using_samba/ch04.html
+share/samba/swat/using_samba/ch05.html
+share/samba/swat/using_samba/ch06.html
+share/samba/swat/using_samba/ch07.html
+share/samba/swat/using_samba/ch08.html
+share/samba/swat/using_samba/ch09.html
+share/samba/swat/using_samba/ch10.html
+share/samba/swat/using_samba/ch11.html
+share/samba/swat/using_samba/ch12.html
+share/samba/swat/using_samba/figs/sam2_0101.gif
+share/samba/swat/using_samba/figs/sam2_0102.gif
+share/samba/swat/using_samba/figs/sam2_0103.gif
+share/samba/swat/using_samba/figs/sam2_0104.gif
+share/samba/swat/using_samba/figs/sam2_0105.gif
+share/samba/swat/using_samba/figs/sam2_0106.gif
+share/samba/swat/using_samba/figs/sam2_0107.gif
+share/samba/swat/using_samba/figs/sam2_0108.gif
+share/samba/swat/using_samba/figs/sam2_0109.gif
+share/samba/swat/using_samba/figs/sam2_0110.gif
+share/samba/swat/using_samba/figs/sam2_0111.gif
+share/samba/swat/using_samba/figs/sam2_0112.gif
+share/samba/swat/using_samba/figs/sam2_0113.gif
+share/samba/swat/using_samba/figs/sam2_0114.gif
+share/samba/swat/using_samba/figs/sam2_0201.gif
+share/samba/swat/using_samba/figs/sam2_0202.gif
+share/samba/swat/using_samba/figs/sam2_0203.gif
+share/samba/swat/using_samba/figs/sam2_0204.gif
+share/samba/swat/using_samba/figs/sam2_0301.gif
+share/samba/swat/using_samba/figs/sam2_0302.gif
+share/samba/swat/using_samba/figs/sam2_0303.gif
+share/samba/swat/using_samba/figs/sam2_0304.gif
+share/samba/swat/using_samba/figs/sam2_0305.gif
+share/samba/swat/using_samba/figs/sam2_0306.gif
+share/samba/swat/using_samba/figs/sam2_0307.gif
+share/samba/swat/using_samba/figs/sam2_0308.gif
+share/samba/swat/using_samba/figs/sam2_0309.gif
+share/samba/swat/using_samba/figs/sam2_0310.gif
+share/samba/swat/using_samba/figs/sam2_0311.gif
+share/samba/swat/using_samba/figs/sam2_0312.gif
+share/samba/swat/using_samba/figs/sam2_0313.gif
+share/samba/swat/using_samba/figs/sam2_0314.gif
+share/samba/swat/using_samba/figs/sam2_0315.gif
+share/samba/swat/using_samba/figs/sam2_0316.gif
+share/samba/swat/using_samba/figs/sam2_0317.gif
+share/samba/swat/using_samba/figs/sam2_0318.gif
+share/samba/swat/using_samba/figs/sam2_0319.gif
+share/samba/swat/using_samba/figs/sam2_0320.gif
+share/samba/swat/using_samba/figs/sam2_0321.gif
+share/samba/swat/using_samba/figs/sam2_0322.gif
+share/samba/swat/using_samba/figs/sam2_0323.gif
+share/samba/swat/using_samba/figs/sam2_0324.gif
+share/samba/swat/using_samba/figs/sam2_0325.gif
+share/samba/swat/using_samba/figs/sam2_0326.gif
+share/samba/swat/using_samba/figs/sam2_0327.gif
+share/samba/swat/using_samba/figs/sam2_0328.gif
+share/samba/swat/using_samba/figs/sam2_0329.gif
+share/samba/swat/using_samba/figs/sam2_0330.gif
+share/samba/swat/using_samba/figs/sam2_0331.gif
+share/samba/swat/using_samba/figs/sam2_0332.gif
+share/samba/swat/using_samba/figs/sam2_0333.gif
+share/samba/swat/using_samba/figs/sam2_0334.gif
+share/samba/swat/using_samba/figs/sam2_0335.gif
+share/samba/swat/using_samba/figs/sam2_0336.gif
+share/samba/swat/using_samba/figs/sam2_0337.gif
+share/samba/swat/using_samba/figs/sam2_0338.gif
+share/samba/swat/using_samba/figs/sam2_0339.gif
+share/samba/swat/using_samba/figs/sam2_0340.gif
+share/samba/swat/using_samba/figs/sam2_0341.gif
+share/samba/swat/using_samba/figs/sam2_0342.gif
+share/samba/swat/using_samba/figs/sam2_0343.gif
+share/samba/swat/using_samba/figs/sam2_0344.gif
+share/samba/swat/using_samba/figs/sam2_0345.gif
+share/samba/swat/using_samba/figs/sam2_0346.gif
+share/samba/swat/using_samba/figs/sam2_0347.gif
+share/samba/swat/using_samba/figs/sam2_0348.gif
+share/samba/swat/using_samba/figs/sam2_0349.gif
+share/samba/swat/using_samba/figs/sam2_0350.gif
+share/samba/swat/using_samba/figs/sam2_0351.gif
+share/samba/swat/using_samba/figs/sam2_0352.gif
+share/samba/swat/using_samba/figs/sam2_0353.gif
+share/samba/swat/using_samba/figs/sam2_0354.gif
+share/samba/swat/using_samba/figs/sam2_0355.gif
+share/samba/swat/using_samba/figs/sam2_0356.gif
+share/samba/swat/using_samba/figs/sam2_0357.gif
+share/samba/swat/using_samba/figs/sam2_0358.gif
+share/samba/swat/using_samba/figs/sam2_0359.gif
+share/samba/swat/using_samba/figs/sam2_0360.gif
+share/samba/swat/using_samba/figs/sam2_0361.gif
+share/samba/swat/using_samba/figs/sam2_0401.gif
+share/samba/swat/using_samba/figs/sam2_0402.gif
+share/samba/swat/using_samba/figs/sam2_0403.gif
+share/samba/swat/using_samba/figs/sam2_0404.gif
+share/samba/swat/using_samba/figs/sam2_0405.gif
+share/samba/swat/using_samba/figs/sam2_0406.gif
+share/samba/swat/using_samba/figs/sam2_0407.gif
+share/samba/swat/using_samba/figs/sam2_0408.gif
+share/samba/swat/using_samba/figs/sam2_0409.gif
+share/samba/swat/using_samba/figs/sam2_0410.gif
+share/samba/swat/using_samba/figs/sam2_0411.gif
+share/samba/swat/using_samba/figs/sam2_0412.gif
+share/samba/swat/using_samba/figs/sam2_0413.gif
+share/samba/swat/using_samba/figs/sam2_0414.gif
+share/samba/swat/using_samba/figs/sam2_0415.gif
+share/samba/swat/using_samba/figs/sam2_0416.gif
+share/samba/swat/using_samba/figs/sam2_0417.gif
+share/samba/swat/using_samba/figs/sam2_0501.gif
+share/samba/swat/using_samba/figs/sam2_0502.gif
+share/samba/swat/using_samba/figs/sam2_0503.gif
+share/samba/swat/using_samba/figs/sam2_0504.gif
+share/samba/swat/using_samba/figs/sam2_0505.gif
+share/samba/swat/using_samba/figs/sam2_0506.gif
+share/samba/swat/using_samba/figs/sam2_0507.gif
+share/samba/swat/using_samba/figs/sam2_0508.gif
+share/samba/swat/using_samba/figs/sam2_0601.gif
+share/samba/swat/using_samba/figs/sam2_0602.gif
+share/samba/swat/using_samba/figs/sam2_0603.gif
+share/samba/swat/using_samba/figs/sam2_0604.gif
+share/samba/swat/using_samba/figs/sam2_0605.gif
+share/samba/swat/using_samba/figs/sam2_0701.gif
+share/samba/swat/using_samba/figs/sam2_0801.gif
+share/samba/swat/using_samba/figs/sam2_0802.gif
+share/samba/swat/using_samba/figs/sam2_0803.gif
+share/samba/swat/using_samba/figs/sam2_0804.gif
+share/samba/swat/using_samba/figs/sam2_0805.gif
+share/samba/swat/using_samba/figs/sam2_0806.gif
+share/samba/swat/using_samba/figs/sam2_0807.gif
+share/samba/swat/using_samba/figs/sam2_0808.gif
+share/samba/swat/using_samba/figs/sam2_0809.gif
+share/samba/swat/using_samba/figs/sam2_0810.gif
+share/samba/swat/using_samba/figs/sam2_0811.gif
+share/samba/swat/using_samba/figs/sam2_0901.gif
+share/samba/swat/using_samba/figs/sam2_0902.gif
+share/samba/swat/using_samba/figs/sam2_0903.gif
+share/samba/swat/using_samba/figs/sam2_1001.gif
+share/samba/swat/using_samba/figs/sam2_1002.gif
+share/samba/swat/using_samba/figs/sam2_1003.gif
+share/samba/swat/using_samba/figs/sam2_1004.gif
+share/samba/swat/using_samba/figs/sam2_1005.gif
+share/samba/swat/using_samba/figs/sam2_1006.gif
+share/samba/swat/using_samba/figs/sam2_1101.gif
+share/samba/swat/using_samba/figs/sam2_1102.gif
+share/samba/swat/using_samba/figs/sam2_af01.gif
+share/samba/swat/using_samba/figs/sam2_af02.gif
+share/samba/swat/using_samba/figs/sam2_af03.gif
+share/samba/swat/using_samba/figs/sam2_af04.gif
+share/samba/swat/using_samba/figs/sam2_af05.gif
+share/samba/swat/using_samba/figs/sam2_af06.gif
+share/samba/swat/using_samba/figs/sam2_af07.gif
+share/samba/swat/using_samba/inx.html
+share/samba/swat/using_samba/samba2_s.gif
+share/samba/swat/using_samba/samba2_xs.gif
+share/samba/swat/using_samba/toc.html
diff --git a/net/samba30/buildlink3.mk b/net/samba30/buildlink3.mk
new file mode 100644
index 00000000000..619ca805161
--- /dev/null
+++ b/net/samba30/buildlink3.mk
@@ -0,0 +1,16 @@
+# $NetBSD: buildlink3.mk,v 1.1.1.1 2011/12/15 22:23:23 asau Exp $
+
+BUILDLINK_TREE+= samba
+
+.if !defined(SAMBA_BUILDLINK3_MK)
+SAMBA_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.samba+= samba>=3.0.7
+BUILDLINK_ABI_DEPENDS.samba?= samba>=3.0.34nb1
+BUILDLINK_PKGSRCDIR.samba?= ../../net/samba
+
+.include "../../converters/libiconv/buildlink3.mk"
+.include "../../devel/readline/buildlink3.mk"
+.endif # SAMBA_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -samba
diff --git a/net/samba30/distinfo b/net/samba30/distinfo
new file mode 100644
index 00000000000..65660aa9e16
--- /dev/null
+++ b/net/samba30/distinfo
@@ -0,0 +1,44 @@
+$NetBSD: distinfo,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+SHA1 (samba-3.0.37.tar.gz) = 5ec6bc6558b3c799f747eb49fbba019d5edf0cbd
+RMD160 (samba-3.0.37.tar.gz) = 06b76ae22729e10c83d6af42d03b03ad69e49103
+Size (samba-3.0.37.tar.gz) = 23416703 bytes
+SHA1 (patch-aa) = c3a1fd7cf6f8db8ea4001c697b19df555b496b29
+SHA1 (patch-ac) = 47529dfe904768e6a3076131978c89fe2d1e3619
+SHA1 (patch-ae) = 28fc3d1ad158f8025f1f9ba8e170d93c31fa45ba
+SHA1 (patch-af) = 9f14842b7d0b5e66bf1d52bcacefe5e1aa392b7c
+SHA1 (patch-ag) = c73e717e053b6618b2a334602fefabe5a5f98a98
+SHA1 (patch-ak) = 0c69720954282022c7982d36eaee94a03db7b689
+SHA1 (patch-at) = de18d1fa7f1d4a2e9e3c0b28173584c7d42ed710
+SHA1 (patch-au) = e8a86ff28c2e22e1a9c3b80b90bcaea573b856ca
+SHA1 (patch-av) = c29ba19e96c24ef95a9a043f8678d77c00d73506
+SHA1 (patch-aw) = 5b6c1bf65d23564eaabf1bafda41a29d1f687538
+SHA1 (patch-ax) = e528921710514bc2651bfca808c21d608f928a95
+SHA1 (patch-ay) = e6ccc4fb20fa909f5d3cecbc4bf3628ba5b355e9
+SHA1 (patch-ba) = e343938306be37a5d364f47effe0b1187b64fe47
+SHA1 (patch-bc) = d525b9201a5cda85346704ad7b860e2b3a3aeb08
+SHA1 (patch-bd) = faf24c792ecff76972d0a80f5418d8c38ca9ed21
+SHA1 (patch-be) = b3386824969a1a02cf8e5d5a9889ce55f6813f48
+SHA1 (patch-bg) = fb37c0496006258ac437f95acf6fe506bd19a68a
+SHA1 (patch-bh) = 3098da6f800f66f46615af853c94e09e2a984b24
+SHA1 (patch-bi) = 187427d1b884c6ae49369a7d33785cdd810e1769
+SHA1 (patch-bm) = 20107d012f7e17f34cbaca8b8059214273f687ba
+SHA1 (patch-bn) = e6071e4adf05c132d7e5ef0cc529b4e3df1cf567
+SHA1 (patch-bo) = a846f8ae3f7c92c99cf34c04a33ef0cf89dae9cf
+SHA1 (patch-bp) = ab55020e477ff36403b1e5a9ce97b2118cdf5cde
+SHA1 (patch-bq) = dc25eb43336d4ad7ecef1b4ea8c5dcd72cc91a7b
+SHA1 (patch-br) = fc0d4c1f638a534f86e59ed8ebaddbf1978fa64f
+SHA1 (patch-bs) = da62a8e59fbab1b9ef9fbcd623f5d63816667447
+SHA1 (patch-bu) = 317d0a197e4564c6ab734890302c1f73cc54e1df
+SHA1 (patch-bv) = 2d80f4e24edab32bf4f620f651e70b9e63d28cc5
+SHA1 (patch-bw) = 83a57fd2c21e1abd1bfab046e867096d46931958
+SHA1 (patch-ca) = 0c2c4c1bdb3348de3e8719cc468a6e0c28a36b73
+SHA1 (patch-ce) = 81c6c2d9c6c0df7180d41a0382f2b4600f545620
+SHA1 (patch-cf) = 8b50f657f8f4fa71936ec4766c2517ca5d128ff7
+SHA1 (patch-cg) = 2755a019759826a39c3e201f6a0d1646e6dd2fba
+SHA1 (patch-ch) = 3c4c404519154e294cee134ddb4d2b9c7d8e02a2
+SHA1 (patch-ci) = d78298d0997cf7877cfe2411355fb6c61dec17f6
+SHA1 (patch-da) = 2dddd250b2207d658b02ff43b46199ce4305b7f8
+SHA1 (patch-ee) = d52511dc7d065db7ba1464138c4bc85cfe2f0d59
+SHA1 (patch-lib_replace_test_os2__delete.c) = 27958a98f37fdc03e109c641d768721e4e587f31
+SHA1 (patch-libsmb_clikrb5.c) = 0efe8e7b06588a727b8cf459ed6e9dc46d1b8f13
diff --git a/net/samba30/files/adduser.sh b/net/samba30/files/adduser.sh
new file mode 100644
index 00000000000..6d136a6f444
--- /dev/null
+++ b/net/samba30/files/adduser.sh
@@ -0,0 +1,161 @@
+#!@SH@
+#
+# $NetBSD: adduser.sh,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+#
+# This is an adduser script for NetBSD systems whose useradd(8) doesn't
+# accept "$" in the username. This script may be used for the
+# "add machine script" in smb.conf.
+
+awkprog="@AWK@"
+catprog="@CAT@"
+mktempprog="@MKTEMP@"
+pwdmkdbprog="@PWD_MKDB@"
+rmprog="@RM@"
+
+progname=adduser
+
+usage() {
+ echo "Usage: $progname [-c comment] [-d homedir] [-n] [-r low..high]"
+ echo " [-s shell] -g gid name"
+ exit 1
+}
+
+isnum() {
+ case "$1" in
+ 0[0-9]*|*[!0-9]*)
+ return 1
+ ;;
+ esac
+ return 0
+}
+
+doit=""
+gid=""
+minuid=1000
+maxuid=60000
+comment=""
+homedir=""
+shell=/sbin/nologin
+
+while getopts c:d:g:nr:s: flag; do
+ case $flag in
+ c) comment="${OPTARG}" ;;
+ d) homedir="${OPTARG}" ;;
+ g) gid="${OPTARG}" ;;
+ n) doit=":" ;;
+ r) minuid=${OPTARG%%..*}; maxuid=${OPTARG##*..} ;;
+ s) shell="${OPTARG}" ;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+if [ $# -lt 1 ]; then
+ usage
+fi
+
+name="$1"
+if [ -z "$gid" ]; then
+ echo "$progname: \`-g gid' is a required option" 1>&2
+ exit 1
+fi
+if ! isnum "$gid"; then
+ echo "$progname: \`$gid' is not a valid gid" 1>&2
+ exit 1
+fi
+if ! isnum "$minuid"; then
+ echo "$progname: \`$minuid' is not a valid minimum uid" 1>&2
+ exit 1
+fi
+if ! isnum "$maxuid"; then
+ echo "$progname: \`$maxuid' is not a valid maximum uid" 1>&2
+ exit 1
+fi
+if [ $minuid -gt $maxuid ]; then
+ echo "$progname: \`$minuid..$maxuid' is not a valid range" 1>&2
+ exit 1
+fi
+case "$comment" in
+*:*)
+ echo "$progname: \`$comment' is not a valid comment" 1>&2
+ exit 1
+ ;;
+esac
+case "$homedir" in
+*:*)
+ echo "$progname: \`$homedir' is not a valid home directory" 1>&2
+ exit 1
+ ;;
+%*)
+ # This is an unsubstituted variable (probably %H in smbd).
+ # Silently change this to a proper default.
+ #
+ homedir="/nonexistent"
+ ;;
+esac
+case "$shell" in
+*:*)
+ echo "$progname: \`$shell' is not a valid shell" 1>&2
+ exit 1
+ ;;
+esac
+case "$name" in
+*:*)
+ echo "$progname: \`$name' is not a valid username" 1>&2
+ exit 1
+ ;;
+esac
+
+ptmp=`$mktempprog -q /etc/ptmp`
+case "$ptmp" in
+/etc/ptmp)
+ ;;
+*)
+ echo "$progname: can't create /etc/ptmp" 1>&2
+ exit 1
+ ;;
+esac
+
+if [ ! -f /etc/master.passwd ]; then
+ echo "$progname: /etc/master.passwd not found" 1>&2
+ $rmprog -f $ptmp
+ exit 1
+fi
+
+$catprog /etc/master.passwd >> $ptmp
+
+uid=` \
+ $awkprog -v minuid=$minuid -v maxuid=maxuid ' \
+ BEGIN { FS = ":" } \
+ { seen_uids[$3] = 1 } \
+ END { \
+ uid = minuid; \
+ while (uid <= maxuid) { \
+ if (uid in seen_uids) { \
+ uid++; \
+ continue; \
+ } \
+ print uid; \
+ exit; \
+ } \
+ print -1; \
+ }' $ptmp \
+`
+if [ $uid -lt 0 ]; then
+ echo "$progname: no uid can be allocated in $minuid..$maxuid" 1>&2
+ $rmprog -f $ptmp
+ exit 1
+fi
+
+case "${name}" in
+*$) : ${comment:=${name%%[$]*} samba machine account} ;;
+*) : ${comment:=${name} samba user} ;;
+esac
+entry="${name}:*:${uid}:${gid}::0:0:${comment}:${homedir}:${shell}"
+
+echo "$entry" >> $ptmp
+
+$doit $pwdmkdbprog -p -u "${name}" $ptmp
+rc=$?
+
+$rmprog -f $ptmp
+exit $rc
diff --git a/net/samba30/files/deluser.sh b/net/samba30/files/deluser.sh
new file mode 100644
index 00000000000..d3bf6548263
--- /dev/null
+++ b/net/samba30/files/deluser.sh
@@ -0,0 +1,68 @@
+#!@SH@
+#
+# $NetBSD: deluser.sh,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+#
+# This is a deluser script for NetBSD systems whose userdel(8) doesn't
+# accept "$" in the username.
+
+awkprog="@AWK@"
+mktempprog="@MKTEMP@"
+pwdmkdbprog="@PWD_MKDB@"
+rmprog="@RM@"
+
+progname=deluser
+
+usage() {
+ echo "Usage: $progname [-n] name"
+ exit 1
+}
+
+doit=""
+
+while getopts n flag; do
+ case $flag in
+ n) doit=":" ;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+if [ $# -lt 1 ]; then
+ usage
+fi
+
+name="$1"
+
+case "$name" in
+*:*)
+ echo "$progname: \`$name' is not a valid user name" 1>&2
+ exit 1
+esac
+
+ptmp=`$mktempprog -q /etc/ptmp`
+case "$ptmp" in
+/etc/ptmp)
+ ;;
+*)
+ echo "$progname: can't create /etc/ptmp" 1>&2
+ exit 1
+ ;;
+esac
+
+if [ ! -f /etc/master.passwd ]; then
+ echo "$progname: /etc/master.passwd not found" 1>&2
+ $rmprog -f $ptmp
+ exit 1
+fi
+
+$awkprog -v name="${name}" ' \
+ BEGIN { FS = ":" } \
+ { \
+ if ($1 != name) \
+ print $0; \
+ }' /etc/master.passwd > $ptmp
+
+$doit $pwdmkdbprog -p $ptmp
+rc=$?
+
+$rmprog -f $ptmp
+exit $rc
diff --git a/net/samba30/files/nmbd.sh b/net/samba30/files/nmbd.sh
new file mode 100755
index 00000000000..ee9ab077e98
--- /dev/null
+++ b/net/samba30/files/nmbd.sh
@@ -0,0 +1,21 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: nmbd.sh,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+#
+# PROVIDE: nmbd
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="nmbd"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+required_files="@SAMBA_ETCDIR@/smb.conf"
+extra_commands="reload"
+command_args="-D" # _must_ start as daemon from rc.d;
+ # add more flags through ${${name}_flags}
+
+reload_cmd=":" # avoid dumping debug output on SIGHUP
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net/samba30/files/samba.sh b/net/samba30/files/samba.sh
new file mode 100644
index 00000000000..3959a01df18
--- /dev/null
+++ b/net/samba30/files/samba.sh
@@ -0,0 +1,52 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: samba.sh,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+#
+# KEYWORD: nostart
+#
+# This script is intended for the end-user.
+# It is not started by /etc/rc.
+# It manipulates various samba services (smbd, nmbd, winbindd),
+# which are controlled via their appropriate rc.conf(5) settings.
+#
+
+. /etc/rc.subr
+
+rcd_dir=`@DIRNAME@ $0`
+
+# NOTE: run_rc_command sets $rc_arg
+#
+forward_commands()
+{
+ # Backward compat with NetBSD <1.6:
+ [ -z "$rc_arg" ] && rc_arg=$_arg
+
+ for file in $COMMAND_LIST; do
+ $rcd_dir/$file $rc_arg
+ done
+}
+
+reverse_commands()
+{
+ # Backward compat with NetBSD <1.6:
+ [ -z "$rc_arg" ] && rc_arg=$_arg
+
+ REVCOMMAND_LIST=
+ for file in $COMMAND_LIST; do
+ REVCOMMAND_LIST="$file $REVCOMMAND_LIST"
+ done
+ for file in $REVCOMMAND_LIST; do
+ $rcd_dir/$file $rc_arg
+ done
+}
+
+COMMAND_LIST="nmbd @WINBINDD_RCD_SCRIPT@ smbd"
+
+name="samba"
+start_cmd="forward_commands"
+stop_cmd="reverse_commands"
+reload_cmd="forward_commands"
+status_cmd="forward_commands"
+extra_commands="reload status"
+
+run_rc_command "$1"
diff --git a/net/samba30/files/smbd.sh b/net/samba30/files/smbd.sh
new file mode 100755
index 00000000000..c5234a6b05d
--- /dev/null
+++ b/net/samba30/files/smbd.sh
@@ -0,0 +1,32 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: smbd.sh,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+#
+# PROVIDE: smbd
+
+. /etc/rc.subr
+
+name="smbd"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+required_files="@SAMBA_ETCDIR@/smb.conf"
+extra_commands="reload"
+command_args="-D" # _must_ start as daemon from rc.d;
+ # add more flags through ${${name}_flags}
+
+# load_rc_config_var() from /etc/rc.subr on the netbsd-3 branch, for
+# the benefit of platforms with older versions of /etc/rc.subr.
+#
+load_rc_config_var()
+{
+ eval $(eval '(
+ load_rc_config '$1' >/dev/null;
+ if [ -n "${'$2'}" -o "${'$2'-UNSET}" != "UNSET" ]; then
+ echo '$2'=\'\''${'$2'}\'\'';
+ fi
+ )' )
+}
+
+load_rc_config $name
+load_rc_config_var nmbd nmbd
+run_rc_command "$1"
diff --git a/net/samba30/files/winbindd.sh b/net/samba30/files/winbindd.sh
new file mode 100644
index 00000000000..c3eeae19712
--- /dev/null
+++ b/net/samba30/files/winbindd.sh
@@ -0,0 +1,17 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: winbindd.sh,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+#
+# PROVIDE: winbindd
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="winbindd"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+required_files="@SAMBA_ETCDIR@/smb.conf"
+extra_commands="reload"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net/samba30/hacks.mk b/net/samba30/hacks.mk
new file mode 100644
index 00000000000..4d0cf335298
--- /dev/null
+++ b/net/samba30/hacks.mk
@@ -0,0 +1,8 @@
+# $NetBSD: hacks.mk,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+# Enabling PIE results in a 'Unsupported relocation type 6 in non-PLT
+# relocations' error under NetBSD/macppc.
+.if ${OPSYS} == "NetBSD" && ${MACHINE_ARCH} == "powerpc"
+PKG_HACKS+= pie
+CONFIGURE_ARGS+= --disable-pie
+.endif
diff --git a/net/samba30/options.mk b/net/samba30/options.mk
new file mode 100644
index 00000000000..ef1a965e9dc
--- /dev/null
+++ b/net/samba30/options.mk
@@ -0,0 +1,183 @@
+# $NetBSD: options.mk,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+# Recommended package options for various setups:
+#
+# Standalone Samba server cups
+# Domain Member server cups ldap winbind
+# Active Directory Member server ads cups winbind
+# Domain Controller ldap winbind
+#
+PKG_OPTIONS_VAR= PKG_OPTIONS.samba
+PKG_SUPPORTED_OPTIONS= ads cups fam ldap pam winbind
+PKG_SUGGESTED_OPTIONS= ads ldap pam winbind
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+SAMBA_ACL_OPSYS= AIX Darwin FreeBSD HPUX IRIX Linux OSF1 SunOS
+.if !empty(SAMBA_ACL_OPSYS:M${OPSYS})
+PKG_SUPPORTED_OPTIONS+= acl
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+SAMBA_STATIC_MODULES:= # empty
+
+###
+### Allow Samba to join as a member server of an Active Directory domain.
+###
+.if !empty(PKG_OPTIONS:Mads)
+. include "../../mk/krb5.buildlink3.mk"
+. if empty(PKG_OPTIONS:Mldap)
+PKG_OPTIONS+= ldap
+. endif
+CONFIGURE_ARGS+= --with-ads
+CONFIGURE_ARGS+= --with-krb5=${KRB5BASE:Q}
+
+# Avoid build failures with recent version of Heimdal under NetBSD.
+. if ${OPSYS} == "NetBSD"
+CONFIGURE_ENV+= samba_cv_HAVE_KRB5_DEPRECATED_WITH_IDENTIFIER=no
+. endif
+
+# ignore gssapi.h on Solaris as it conflicts with <gssapi/gssapi.h>
+. if ${OPSYS} == "SunOS"
+CONFIGURE_ENV+= ac_cv_header_gssapi_h=no
+. endif
+.else
+CONFIGURE_ARGS+= --without-ads
+CONFIGURE_ARGS+= --without-krb5
+.endif
+
+###
+### Access Control List support.
+###
+.if !empty(PKG_OPTIONS:Macl)
+CONFIGURE_ARGS+= --with-acl-support
+.endif
+
+###
+### Native CUPS support for providing printing services.
+###
+PLIST_VARS+= cups
+.if !empty(PKG_OPTIONS:Mcups)
+. include "../../print/cups/buildlink3.mk"
+CONFIGURE_ARGS+= --enable-cups
+PLIST.cups= yes
+INSTALLATION_DIRS+= libexec/cups/backend
+
+.PHONY: samba-cups-install
+post-install: samba-cups-install
+samba-cups-install:
+ cd ${DESTDIR}${PREFIX}/libexec/cups/backend && \
+ ${LN} -fs ../../../bin/smbspool smb
+.else
+CONFIGURE_ARGS+= --disable-cups
+.endif
+
+###
+### Access Control List support.
+###
+PLIST_VARS+= fam
+.if !empty(PKG_OPTIONS:Mfam)
+. include "../../mk/fam.buildlink3.mk"
+CONFIGURE_ARGS+= --enable-fam
+PLIST.fam= yes
+.else
+CONFIGURE_ARGS+= --disable-fam
+.endif
+
+###
+### Support LDAP authentication and storage of Samba account information.
+###
+.if !empty(PKG_OPTIONS:Mldap)
+. include "../../databases/openldap-client/buildlink3.mk"
+CONFIGURE_ARGS+= --with-ldap
+.else
+CONFIGURE_ARGS+= --without-ldap
+.endif
+
+###
+### Support PAM authentication and build smbpass and winbind PAM modules.
+###
+PLIST_VARS+= pam
+.if !empty(PKG_OPTIONS:Mpam)
+. include "../../security/PAM/module.mk"
+CONFIGURE_ARGS+= --with-pam
+CONFIGURE_ARGS+= --with-pam_smbpass
+CONFIGURE_ARGS+= --with-pammodulesdir=${PAM_INSTMODULEDIR}
+PLIST.pam= yes
+INSTALLATION_DIRS+= ${EGDIR}/pam_smbpass
+
+.PHONY: samba-pam-smbpass-install
+post-install: samba-pam-smbpass-install
+samba-pam-smbpass-install:
+ ${INSTALL_DATA} ${WRKSRC}/pam_smbpass/README \
+ ${DESTDIR}${PREFIX}/${DOCDIR}/README.pam_smbpass
+ cd ${WRKSRC}/pam_smbpass/samples; for f in [a-z]*; do \
+ ${INSTALL_DATA} $${f} \
+ ${DESTDIR}${PREFIX}/${EGDIR}/pam_smbpass/$${f}; \
+ done
+.endif
+
+###
+### Support querying a PDC for domain user and group information, e.g.,
+### through NSS or PAM.
+###
+PLIST_VARS+= winbind
+.if !empty(PKG_OPTIONS:Mwinbind)
+CONFIGURE_ARGS+= --with-winbind
+
+SAMBA_STATIC_MODULES:= ${SAMBA_STATIC_MODULES},idmap_rid
+. if !empty(PKG_OPTIONS:Mads)
+SAMBA_STATIC_MODULES:= ${SAMBA_STATIC_MODULES},idmap_ad
+. endif
+
+WINBINDD_RCD_SCRIPT= winbindd
+PLIST.winbind= yes
+
+# Install the NSS winbind module if it exists.
+PLIST_SUBST+= NSS_WINBIND=${NSS_WINBIND:Q}
+NSS_WINBIND= ${NSS_WINBIND_cmd:sh}
+NSS_WINBIND_cmd= \
+ ${TEST} -x ${WRKSRC}/config.status || \
+ { ${ECHO} "@comment no NSS winbind module" ; exit 0; }; \
+ cd ${WRKDIR} && ${ECHO} @WINBIND_NSS@ | \
+ ${WRKSRC}/config.status --file=-:- | \
+ ${AWK} '/^$$/ { print "@comment no NSS winbind module"; exit 0; } \
+ { sub(".*/", "lib/"); print; }' && \
+ ${RM} -f config.log
+
+.PHONY: samba-nss-winbind-install
+post-install: samba-nss-winbind-install
+samba-nss-winbind-install:
+ lib=${WRKSRC:Q}/nsswitch/${NSS_WINBIND:T:Q}; \
+ ${TEST} ! -f $$lib || ${INSTALL_LIB} $$lib ${DESTDIR}${PREFIX:Q}/lib
+
+# Install the NSS WINS module if it exists.
+PLIST_SUBST+= NSS_WINS=${NSS_WINS:Q}
+NSS_WINS= ${NSS_WINS_cmd:sh}
+NSS_WINS_cmd= \
+ ${TEST} -x ${WRKSRC}/config.status || \
+ { ${ECHO} "@comment no NSS WINS module" ; exit 0; }; \
+ cd ${WRKDIR} && ${ECHO} @WINBIND_WINS_NSS@ | \
+ ${WRKSRC}/config.status --file=-:- | \
+ ${AWK} '/^$$/ { print "@comment no NSS WINS module"; exit 0; } \
+ { sub(".*/", "lib/"); print; }' && \
+ ${RM} -f config.log
+
+.PHONY: samba-nss-wins-install
+post-install: samba-nss-wins-install
+samba-nss-wins-install:
+ lib=${WRKSRC:Q}/nsswitch/${NSS_WINS:T:Q}; \
+ ${TEST} ! -f $$lib || ${INSTALL_LIB} $$lib ${DESTDIR}${PREFIX:Q}/lib
+.else
+CONFIGURE_ARGS+= --without-winbind
+PLIST_SUBST+= NSS_WINBIND="no NSS winbind module"
+PLIST_SUBST+= NSS_WINS="no NSS WINS module"
+.endif
+
+###
+### Add the optional static modules to the configuration.
+###
+.if !empty(SAMBA_STATIC_MODULES)
+CONFIGURE_ARGS+= --with-static-modules=${SAMBA_STATIC_MODULES:S/^,//}
+.endif
diff --git a/net/samba30/patches/patch-aa b/net/samba30/patches/patch-aa
new file mode 100644
index 00000000000..ddd99da9f16
--- /dev/null
+++ b/net/samba30/patches/patch-aa
@@ -0,0 +1,13 @@
+$NetBSD: patch-aa,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- nsswitch/pam_winbind.c.orig 2009-09-30 21:21:56.000000000 +0900
++++ nsswitch/pam_winbind.c
+@@ -1295,6 +1295,8 @@ static char *_pam_delete(register char *
+ return NULL;
+ }
+
++PAM_EXTERN int pam_sm_close_session(pam_handle_t *, int, int, const char **);
++
+ /*
+ * obtain a password from the user
+ */
diff --git a/net/samba30/patches/patch-ac b/net/samba30/patches/patch-ac
new file mode 100644
index 00000000000..59524819778
--- /dev/null
+++ b/net/samba30/patches/patch-ac
@@ -0,0 +1,17 @@
+$NetBSD: patch-ac,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- include/local.h.orig 2005-10-12 13:03:38.000000000 -0400
++++ include/local.h
+@@ -170,10 +170,10 @@
+ * Default passwd chat script.
+ */
+
+-#define DEFAULT_PASSWD_CHAT "*new*password* %n\\n *new*password* %n\\n *changed*"
++#define DEFAULT_PASSWD_CHAT "*\\n*ew\\spassword* %n\\n *ew\\spassword* %n\\n *updating\\sthe\\sdatabase...\\npasswd:\\sdone\\n"
+
+ /* Minimum length of allowed password when changing UNIX password. */
+-#define MINPASSWDLENGTH 5
++#define MINPASSWDLENGTH 6
+
+ /* maximum ID number used for session control. This cannot be larger
+ than 62*62 for the current code */
diff --git a/net/samba30/patches/patch-ae b/net/samba30/patches/patch-ae
new file mode 100644
index 00000000000..262206e5a15
--- /dev/null
+++ b/net/samba30/patches/patch-ae
@@ -0,0 +1,15 @@
+$NetBSD: patch-ae,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- auth/pampass.c.orig 2005-10-12 13:03:28.000000000 -0400
++++ auth/pampass.c
+@@ -43,6 +43,10 @@
+
+ #include <security/pam_appl.h>
+
++#if defined(PAM_AUTHTOK_RECOVERY_ERR) && !defined(PAM_AUTHTOK_RECOVER_ERR)
++#define PAM_AUTHTOK_RECOVER_ERR PAM_AUTHTOK_RECOVERY_ERR
++#endif
++
+ /*
+ * Structure used to communicate between the conversation function
+ * and the server_login/change password functions.
diff --git a/net/samba30/patches/patch-af b/net/samba30/patches/patch-af
new file mode 100644
index 00000000000..60b9a0499fb
--- /dev/null
+++ b/net/samba30/patches/patch-af
@@ -0,0 +1,57 @@
+$NetBSD: patch-af,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- ../examples/smb.conf.default.orig 2007-02-04 18:59:31.000000000 +0000
++++ ../examples/smb.conf.default 2007-02-11 15:22:45.000000000 +0000
+@@ -26,7 +26,7 @@
+ workgroup = MYGROUP
+
+ # server string is the equivalent of the NT Description field
+- server string = Samba Server
++ server string = Samba %v (%h)
+
+ # Security mode. Defines in which mode Samba will operate. Possible
+ # values are share, user, server, domain and ads. Most people will want
+@@ -63,10 +63,10 @@
+
+ # this tells Samba to use a separate log file for each machine
+ # that connects
+- log file = /usr/local/samba/var/log.%m
++; log file = /usr/local/samba/var/log.%m
+
+ # Put a capping on the size of the log files (in Kb).
+- max log size = 50
++; max log size = 50
+
+ # Use password server option only with security = server
+ # The argument list may include:
+@@ -145,7 +145,7 @@
+
+ # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
+ # via DNS nslookups. The default is NO.
+- dns proxy = no
++; dns proxy = no
+
+ # These scripts are used on a domain controller or stand-alone
+ # machine to add or delete corresponding unix accounts
+@@ -182,14 +182,14 @@
+
+ # NOTE: If you have a BSD-style print system there is no need to
+ # specifically define each individual printer
+-[printers]
+- comment = All Printers
+- path = /usr/spool/samba
+- browseable = no
++;[printers]
++; comment = All Printers
++; path = /var/tmp
++; browseable = no
+ # Set public = yes to allow user 'guest account' to print
+- guest ok = no
+- writable = no
+- printable = yes
++; guest ok = no
++; writable = no
++; printable = yes
+
+ # This one is useful for people to share files
+ ;[tmp]
diff --git a/net/samba30/patches/patch-ag b/net/samba30/patches/patch-ag
new file mode 100644
index 00000000000..0a30b826ae0
--- /dev/null
+++ b/net/samba30/patches/patch-ag
@@ -0,0 +1,23 @@
+$NetBSD: patch-ag,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- passdb/passdb.c.orig 2007-05-24 00:29:17.000000000 +0900
++++ passdb/passdb.c
+@@ -135,6 +135,7 @@ static NTSTATUS samu_set_unix_internal(s
+ const char *guest_account = lp_guestaccount();
+ const char *domain = global_myname();
+ uint32 urid;
++ char *gecos;
+
+ if ( !pwd ) {
+ return NT_STATUS_NO_SUCH_USER;
+@@ -143,7 +144,9 @@ static NTSTATUS samu_set_unix_internal(s
+ /* Basic properties based upon the Unix account information */
+
+ pdb_set_username(user, pwd->pw_name, PDB_SET);
+- pdb_set_fullname(user, pwd->pw_gecos, PDB_SET);
++ gecos = passwd_expand_gecos(pwd);
++ pdb_set_fullname(user, gecos, PDB_SET);
++ SAFE_FREE(gecos);
+ pdb_set_domain (user, get_global_sam_name(), PDB_DEFAULT);
+ #if 0
+ /* This can lead to a primary group of S-1-22-2-XX which
diff --git a/net/samba30/patches/patch-ak b/net/samba30/patches/patch-ak
new file mode 100644
index 00000000000..d4cee8d8042
--- /dev/null
+++ b/net/samba30/patches/patch-ak
@@ -0,0 +1,13 @@
+$NetBSD: patch-ak,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- pam_smbpass/general.h.orig 2005-10-12 13:03:29.000000000 -0400
++++ pam_smbpass/general.h
+@@ -1,8 +1,4 @@
+-#ifndef LINUX
+-/* This is only needed by modules in the Sun implementation. */
+ #include <security/pam_appl.h>
+-#endif /* LINUX */
+-
+ #include <security/pam_modules.h>
+
+ #ifndef PAM_AUTHTOK_RECOVER_ERR
diff --git a/net/samba30/patches/patch-at b/net/samba30/patches/patch-at
new file mode 100644
index 00000000000..97d04a2d4f5
--- /dev/null
+++ b/net/samba30/patches/patch-at
@@ -0,0 +1,298 @@
+$NetBSD: patch-at,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- configure.orig 2009-09-30 22:08:58.000000000 +0900
++++ configure
+@@ -765,6 +765,7 @@ swatdir
+ privatedir
+ logfilebase
+ piddir
++statedir
+ lockdir
+ configdir
+ target_os
+@@ -827,6 +828,7 @@ with_fhs
+ with_privatedir
+ with_rootsbindir
+ with_lockdir
++with_statedir
+ with_piddir
+ with_swatdir
+ with_configdir
+@@ -1537,6 +1539,7 @@ Optional Packages:
+ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)
+ --with-rootsbindir=DIR Which directory to use for root sbin ($ac_default_prefix/sbin)
+ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)
++ --with-statedir=DIR Where to put state files ($ac_default_prefix/var/locks)
+ --with-piddir=DIR Where to put pid files ($ac_default_prefix/var/locks)
+ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)
+ --with-configdir=DIR Where to put configuration files ($libdir)
+@@ -2296,6 +2299,7 @@ fi
+
+ rootsbindir="\${SBINDIR}"
+ lockdir="\${VARDIR}/locks"
++statedir="\${VARDIR}/locks"
+ piddir="\${VARDIR}/locks"
+ test "${mandir}" || mandir="\${prefix}/man"
+ logfilebase="\${VARDIR}"
+@@ -2310,7 +2314,8 @@ swatdir="\${prefix}/swat"
+ if test "${with_fhs+set}" = set; then
+ withval=$with_fhs; case "$withval" in
+ yes)
+- lockdir="\${VARDIR}/lib/samba"
++ lockdir="\${VARDIR}/run/samba"
++ statedir="\${VARDIR}/lib/samba"
+ piddir="\${VARDIR}/run"
+ mandir="\${prefix}/share/man"
+ logfilebase="\${VARDIR}/log/samba"
+@@ -2384,6 +2389,26 @@ fi
+
+
+ #################################################
++# set state directory location
++
++# Check whether --with-statedir was given.
++if test "${with_statedir+set}" = set; then
++ withval=$with_statedir; case "$withval" in
++ yes|no)
++ #
++ # Just in case anybody calls it without argument
++ #
++ { $as_echo "$as_me:$LINENO: WARNING: --with-statedir called without argument - will use default" >&5
++$as_echo "$as_me: WARNING: --with-statedir called without argument - will use default" >&2;}
++ ;;
++ * )
++ statedir="$withval"
++ ;;
++ esac
++fi
++
++
++#################################################
+ # set pid directory location
+
+ # Check whether --with-piddir was given.
+@@ -2624,6 +2649,7 @@ fi
+
+
+
++
+ ## check for --enable-debug first before checking CFLAGS before
+ ## so that we don't mix -O and -g
+ # Check whether --enable-debug was given.
+@@ -33670,7 +33696,8 @@ done
+
+
+
+-for ac_func in getdents getdents64
++
++for ac_func in getdents getdents64 getpwent_r
+ do
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+@@ -49983,6 +50010,77 @@ done
+ ##################
+ # look for a method of finding the list of network interfaces
+ iface=no;
++{ $as_echo "$as_me:$LINENO: checking for iface ifaddrs" >&5
++$as_echo_n "checking for iface ifaddrs... " >&6; }
++if test "${samba_cv_HAVE_IFACE_IFADDRS+set}" = set; then
++ $as_echo_n "(cached) " >&6
++else
++
++SAVE_CPPFLAGS="$CPPFLAGS"
++CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
++if test "$cross_compiling" = yes; then
++ samba_cv_HAVE_IFACE_IFADDRS=cross
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++#define HAVE_IFACE_IFADDRS 1
++#define AUTOCONF_TEST 1
++#include "${srcdir-.}/lib/interfaces.c"
++_ACEOF
++rm -f conftest$ac_exeext
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
++ { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ samba_cv_HAVE_IFACE_IFADDRS=yes
++else
++ $as_echo "$as_me: program exited with status $ac_status" >&5
++$as_echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++( exit $ac_status )
++samba_cv_HAVE_IFACE_IFADDRS=no
++fi
++rm -rf conftest.dSYM
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++fi
++
++
++fi
++{ $as_echo "$as_me:$LINENO: result: $samba_cv_HAVE_IFACE_IFADDRS" >&5
++$as_echo "$samba_cv_HAVE_IFACE_IFADDRS" >&6; }
++CPPFLAGS="$SAVE_CPPFLAGS"
++if test x"$samba_cv_HAVE_IFACE_IFADDRS" = x"yes"; then
++ iface=yes;
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_IFACE_IFADDRS 1
++_ACEOF
++
++fi
++
++if test $iface = no; then
+ { $as_echo "$as_me:$LINENO: checking for iface AIX" >&5
+ $as_echo_n "checking for iface AIX... " >&6; }
+ if test "${samba_cv_HAVE_IFACE_AIX+set}" = set; then
+@@ -50053,6 +50151,7 @@ cat >>confdefs.h <<\_ACEOF
+ _ACEOF
+
+ fi
++fi
+
+ if test $iface = no; then
+ { $as_echo "$as_me:$LINENO: checking for iface ifconf" >&5
+@@ -53580,9 +53679,9 @@ LIBS="-lcrypto $KRB5_LIBS $LIBS"
+
+
+
+- { $as_echo "$as_me:$LINENO: checking for des_set_key in -lcrypto" >&5
+-$as_echo_n "checking for des_set_key in -lcrypto... " >&6; }
+-if test "${ac_cv_lib_ext_crypto_des_set_key+set}" = set; then
++ { $as_echo "$as_me:$LINENO: checking for EVP_des_cbc in -lcrypto" >&5
++$as_echo_n "checking for EVP_des_cbc in -lcrypto... " >&6; }
++if test "${ac_cv_lib_ext_crypto_EVP_des_cbc+set}" = set; then
+ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -53598,11 +53697,11 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char des_set_key ();
++char EVP_des_cbc ();
+ int
+ main ()
+ {
+-return des_set_key ();
++return EVP_des_cbc ();
+ ;
+ return 0;
+ }
+@@ -53628,13 +53727,13 @@ $as_echo "$ac_try_echo") >&5
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+- ac_cv_lib_ext_crypto_des_set_key=yes;
++ ac_cv_lib_ext_crypto_EVP_des_cbc=yes;
+ ac_cv_lib_ext_crypto=yes
+ else
+ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+- ac_cv_lib_ext_crypto_des_set_key=no;
++ ac_cv_lib_ext_crypto_EVP_des_cbc=no;
+ ac_cv_lib_ext_crypto=no
+ fi
+
+@@ -53643,11 +53742,11 @@ rm -f core conftest.err conftest.$ac_obj
+ conftest$ac_exeext conftest.$ac_ext
+
+ fi
+-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ext_crypto_des_set_key" >&5
+-$as_echo "$ac_cv_lib_ext_crypto_des_set_key" >&6; }
+- if test $ac_cv_lib_ext_crypto_des_set_key = yes; then
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ext_crypto_EVP_des_cbc" >&5
++$as_echo "$ac_cv_lib_ext_crypto_EVP_des_cbc" >&6; }
++ if test $ac_cv_lib_ext_crypto_EVP_des_cbc = yes; then
+ cat >>confdefs.h <<_ACEOF
+-#define HAVE_DES_SET_KEY 1
++#define HAVE_EVP_DES_CBC 1
+ _ACEOF
+
+ fi
+@@ -67399,31 +67498,39 @@ case "$host_os" in
+ NSSSONAMEVERSIONSUFFIX=".2"
+ WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_linux.o"
+ ;;
+- *freebsd[5-9]*)
+- # FreeBSD winbind client is implemented as a wrapper around
+- # the Linux version.
+- NSSSONAMEVERSIONSUFFIX=".1"
+- WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_freebsd.o \
+- nsswitch/winbind_nss_linux.o"
+- WINBIND_NSS="nsswitch/nss_winbind.$SHLIBEXT"
+- WINBIND_WINS_NSS="nsswitch/nss_wins.$SHLIBEXT"
+- ;;
+-
+- *netbsd*[3-9]*)
+- # NetBSD winbind client is implemented as a wrapper
+- # around the Linux version. It needs getpwent_r() to
+- # indicate libc's use of the correct nsdispatch API.
+- #
+- if test x"$ac_cv_func_getpwent_r" = x"yes"; then
+- WINBIND_NSS_EXTRA_OBJS="\
+- nsswitch/winbind_nss_netbsd.o \
++ *freebsd*)
++ case "$UNAME_R" in
++ [5-9]*)
++ # FreeBSD winbind client is implemented as a wrapper
++ # around the Linux version.
++ NSSSONAMEVERSIONSUFFIX=".1"
++ WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_freebsd.o \
+ nsswitch/winbind_nss_linux.o"
+ WINBIND_NSS="nsswitch/nss_winbind.$SHLIBEXT"
+ WINBIND_WINS_NSS="nsswitch/nss_wins.$SHLIBEXT"
+- else
+- HAVE_WINBIND=no
+- winbind_no_reason=", getpwent_r is missing on $host_os so winbind is unsupported"
+- fi
++ ;;
++ esac
++ ;;
++
++ *netbsd*)
++ case "$UNAME_R" in
++ [3-9]*)
++ # NetBSD winbind client is implemented as a wrapper
++ # around the Linux version. It needs getpwent_r() to
++ # indicate libc's use of the correct nsdispatch API.
++ #
++ if test x"$ac_cv_func_getpwent_r" = x"yes"; then
++ WINBIND_NSS_EXTRA_OBJS="\
++ nsswitch/winbind_nss_netbsd.o \
++ nsswitch/winbind_nss_linux.o"
++ WINBIND_NSS="nsswitch/nss_winbind.$SHLIBEXT"
++ WINBIND_WINS_NSS="nsswitch/nss_wins.$SHLIBEXT"
++ else
++ HAVE_WINBIND=no
++ winbind_no_reason=", getpwent_r is missing on $host_os so winbind is unsupported"
++ fi
++ ;;
++ esac
+ ;;
+ *irix*)
+ # IRIX has differently named shared libraries
diff --git a/net/samba30/patches/patch-au b/net/samba30/patches/patch-au
new file mode 100644
index 00000000000..cf8c9a9bdbf
--- /dev/null
+++ b/net/samba30/patches/patch-au
@@ -0,0 +1,161 @@
+$NetBSD: patch-au,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+--- configure.in.orig 2009-09-30 21:21:56.000000000 +0900
++++ configure.in
+@@ -38,6 +38,7 @@ AC_PREFIX_DEFAULT(/usr/local/samba)
+
+ rootsbindir="\${SBINDIR}"
+ lockdir="\${VARDIR}/locks"
++statedir="\${VARDIR}/locks"
+ piddir="\${VARDIR}/locks"
+ test "${mandir}" || mandir="\${prefix}/man"
+ logfilebase="\${VARDIR}"
+@@ -51,7 +52,8 @@ AC_ARG_WITH(fhs,
+ [ --with-fhs Use FHS-compliant paths (default=no)],
+ [ case "$withval" in
+ yes)
+- lockdir="\${VARDIR}/lib/samba"
++ lockdir="\${VARDIR}/run/samba"
++ statedir="\${VARDIR}/lib/samba"
+ piddir="\${VARDIR}/run"
+ mandir="\${prefix}/share/man"
+ logfilebase="\${VARDIR}/log/samba"
+@@ -111,6 +113,22 @@ AC_ARG_WITH(lockdir,
+ esac])
+
+ #################################################
++# set state directory location
++AC_ARG_WITH(statedir,
++[ --with-statedir=DIR Where to put state files ($ac_default_prefix/var/locks)],
++[ case "$withval" in
++ yes|no)
++ #
++ # Just in case anybody calls it without argument
++ #
++ AC_MSG_WARN([--with-statedir called without argument - will use default])
++ ;;
++ * )
++ statedir="$withval"
++ ;;
++ esac])
++
++#################################################
+ # set pid directory location
+ AC_ARG_WITH(piddir,
+ [ --with-piddir=DIR Where to put pid files ($ac_default_prefix/var/locks)],
+@@ -257,6 +275,7 @@ fi
+
+ AC_SUBST(configdir)
+ AC_SUBST(lockdir)
++AC_SUBST(statedir)
+ AC_SUBST(piddir)
+ AC_SUBST(logfilebase)
+ AC_SUBST(privatedir)
+@@ -1245,7 +1264,7 @@ AC_CHECK_FUNCS(lstat64 fopen64 atexit gr
+ AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
+ AC_CHECK_FUNCS(opendir64 readdir64 seekdir64 telldir64 rewinddir64 closedir64)
+ AC_CHECK_FUNCS(getpwent_r)
+-AC_CHECK_FUNCS(getdents getdents64)
++AC_CHECK_FUNCS(getdents getdents64 getpwent_r)
+ AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
+ AC_CHECK_FUNCS(syslog vsyslog timegm)
+ AC_CHECK_FUNCS(setlocale nl_langinfo)
+@@ -2824,6 +2843,20 @@ AC_CHECK_FUNCS(getpagesize)
+ ##################
+ # look for a method of finding the list of network interfaces
+ iface=no;
++AC_CACHE_CHECK([for iface ifaddrs],samba_cv_HAVE_IFACE_IFADDRS,[
++SAVE_CPPFLAGS="$CPPFLAGS"
++CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
++AC_TRY_RUN([
++#define HAVE_IFACE_IFADDRS 1
++#define AUTOCONF_TEST 1
++#include "${srcdir-.}/lib/interfaces.c"],
++ samba_cv_HAVE_IFACE_IFADDRS=yes,samba_cv_HAVE_IFACE_IFADDRS=no,samba_cv_HAVE_IFACE_IFADDRS=cross)])
++CPPFLAGS="$SAVE_CPPFLAGS"
++if test x"$samba_cv_HAVE_IFACE_IFADDRS" = x"yes"; then
++ iface=yes;AC_DEFINE(HAVE_IFACE_IFADDRS,1,[Whether iface ifaddrs is available])
++fi
++
++if test $iface = no; then
+ AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
+@@ -2837,6 +2870,7 @@ CPPFLAGS="$SAVE_CPPFLAGS"
+ if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
+ iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
+ fi
++fi
+
+ if test $iface = no; then
+ AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
+@@ -3531,7 +3565,7 @@ if test x"$with_ads_support" != x"no"; t
+ AC_CHECK_LIB_EXT(k5crypto, KRB5_LIBS, krb5_encrypt_data)
+
+ # Heimdal checks.
+- AC_CHECK_LIB_EXT(crypto, KRB5_LIBS, des_set_key)
++ AC_CHECK_LIB_EXT(crypto, KRB5_LIBS, EVP_des_cbc)
+ AC_CHECK_LIB_EXT(asn1, KRB5_LIBS, copy_Authenticator)
+ AC_CHECK_LIB_EXT(roken, KRB5_LIBS, roken_getaddrinfo_hostspec)
+
+@@ -5830,31 +5864,39 @@ case "$host_os" in
+ NSSSONAMEVERSIONSUFFIX=".2"
+ WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_linux.o"
+ ;;
+- *freebsd[[5-9]]*)
+- # FreeBSD winbind client is implemented as a wrapper around
+- # the Linux version.
+- NSSSONAMEVERSIONSUFFIX=".1"
+- WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_freebsd.o \
+- nsswitch/winbind_nss_linux.o"
+- WINBIND_NSS="nsswitch/nss_winbind.$SHLIBEXT"
+- WINBIND_WINS_NSS="nsswitch/nss_wins.$SHLIBEXT"
+- ;;
+-
+- *netbsd*[[3-9]]*)
+- # NetBSD winbind client is implemented as a wrapper
+- # around the Linux version. It needs getpwent_r() to
+- # indicate libc's use of the correct nsdispatch API.
+- #
+- if test x"$ac_cv_func_getpwent_r" = x"yes"; then
+- WINBIND_NSS_EXTRA_OBJS="\
+- nsswitch/winbind_nss_netbsd.o \
++ *freebsd*)
++ case "$UNAME_R" in
++ [[5-9]]*)
++ # FreeBSD winbind client is implemented as a wrapper
++ # around the Linux version.
++ NSSSONAMEVERSIONSUFFIX=".1"
++ WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_freebsd.o \
+ nsswitch/winbind_nss_linux.o"
+ WINBIND_NSS="nsswitch/nss_winbind.$SHLIBEXT"
+ WINBIND_WINS_NSS="nsswitch/nss_wins.$SHLIBEXT"
+- else
+- HAVE_WINBIND=no
+- winbind_no_reason=", getpwent_r is missing on $host_os so winbind is unsupported"
+- fi
++ ;;
++ esac
++ ;;
++
++ *netbsd*)
++ case "$UNAME_R" in
++ [[3-9]]*)
++ # NetBSD winbind client is implemented as a wrapper
++ # around the Linux version. It needs getpwent_r() to
++ # indicate libc's use of the correct nsdispatch API.
++ #
++ if test x"$ac_cv_func_getpwent_r" = x"yes"; then
++ WINBIND_NSS_EXTRA_OBJS="\
++ nsswitch/winbind_nss_netbsd.o \
++ nsswitch/winbind_nss_linux.o"
++ WINBIND_NSS="nsswitch/nss_winbind.$SHLIBEXT"
++ WINBIND_WINS_NSS="nsswitch/nss_wins.$SHLIBEXT"
++ else
++ HAVE_WINBIND=no
++ winbind_no_reason=", getpwent_r is missing on $host_os so winbind is unsupported"
++ fi
++ ;;
++ esac
+ ;;
+ *irix*)
+ # IRIX has differently named shared libraries
diff --git a/net/samba30/patches/patch-av b/net/samba30/patches/patch-av
new file mode 100644
index 00000000000..920291426cb
--- /dev/null
+++ b/net/samba30/patches/patch-av
@@ -0,0 +1,13 @@
+$NetBSD: patch-av,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- script/installman.sh.orig 2007-03-01 13:55:02.000000000 +0900
++++ script/installman.sh
+@@ -33,7 +33,7 @@ for lang in $langs; do
+ langdir=$MANDIR/$lang
+ for d in $MANDIR $langdir $langdir/man1 $langdir/man5 $langdir/man7 $langdir/man8; do
+ if [ ! -d $d ]; then
+- mkdir $d
++ mkdir -p $d
+ if [ ! -d $d ]; then
+ echo Failed to make directory $d, does $USER have privileges?
+ exit 1
diff --git a/net/samba30/patches/patch-aw b/net/samba30/patches/patch-aw
new file mode 100644
index 00000000000..2d80b3b6cc3
--- /dev/null
+++ b/net/samba30/patches/patch-aw
@@ -0,0 +1,13 @@
+$NetBSD: patch-aw,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- script/installmodules.sh.orig 2006-04-20 03:29:42.000000000 +0100
++++ script/installmodules.sh 2007-02-11 17:24:32.000000000 +0000
+@@ -11,7 +11,7 @@
+
+ for d in $prefix $LIBDIR; do
+ if [ ! -d $DESTDIR/$d ]; then
+-mkdir $DESTDIR/$d
++mkdir -p $DESTDIR/$d
+ if [ ! -d $DESTDIR/$d ]; then
+ echo Failed to make directory $DESTDIR/$d
+ exit 1
diff --git a/net/samba30/patches/patch-ax b/net/samba30/patches/patch-ax
new file mode 100644
index 00000000000..433677403a9
--- /dev/null
+++ b/net/samba30/patches/patch-ax
@@ -0,0 +1,13 @@
+$NetBSD: patch-ax,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- script/installscripts.sh.orig 2007-11-14 22:15:04.000000000 -0500
++++ script/installscripts.sh
+@@ -12,7 +12,7 @@ echo Installing scripts in $BINDIR
+
+ for d in $BINDIR; do
+ if [ ! -d $d ]; then
+- mkdir $d
++ mkdir -p $d
+ if [ ! -d $d ]; then
+ echo Failed to make directory $d
+ echo Have you run installbin first?
diff --git a/net/samba30/patches/patch-ay b/net/samba30/patches/patch-ay
new file mode 100644
index 00000000000..1965646857f
--- /dev/null
+++ b/net/samba30/patches/patch-ay
@@ -0,0 +1,13 @@
+$NetBSD: patch-ay,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- script/installswat.sh.orig 2007-11-14 22:15:04.000000000 -0500
++++ script/installswat.sh
+@@ -140,7 +140,7 @@ if [ -d $SRCDIR../docs/htmldocs/ ]; then
+
+ INSTALLDIR="$DESTDIR/$SWATDIR/help/`echo $dir | sed 's/htmldocs\///g'`"
+ if test ! -d "$INSTALLDIR" -a "$mode" = 'install'; then
+- mkdir "$INSTALLDIR"
++ mkdir -p "$INSTALLDIR"
+ if test ! -d "$INSTALLDIR"; then
+ echo "Failed to make directory $INSTALLDIR, does $USER have privileges? "
+ exit 1
diff --git a/net/samba30/patches/patch-ba b/net/samba30/patches/patch-ba
new file mode 100644
index 00000000000..6e4aa9995a2
--- /dev/null
+++ b/net/samba30/patches/patch-ba
@@ -0,0 +1,118 @@
+$NetBSD: patch-ba,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- Makefile.in.orig Mon Jan 19 10:40:09 2009
++++ Makefile.in Wed Sep 9 11:00:17 2009
+@@ -106,6 +106,9 @@
+ # the directory where lock files go
+ LOCKDIR = @lockdir@
+
++# the directory where persistent-state files go
++STATEDIR = @statedir@
++
+ # the directory where pid files go
+ PIDDIR = @piddir@
+
+@@ -136,7 +139,7 @@
+ PATH_FLAGS1 = -DCONFIGFILE=\"$(CONFIGFILE)\" -DSBINDIR=\"$(SBINDIR)\"
+ PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\"$(BINDIR)\"
+ PATH_FLAGS3 = $(PATH_FLAGS2) -DLMHOSTSFILE=\"$(LMHOSTSFILE)\"
+-PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\"$(SWATDIR)\" -DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\"
++PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\"$(SWATDIR)\" -DLOCKDIR=\"$(LOCKDIR)\" -DSTATEDIR=\"$(STATEDIR)\" -DPIDDIR=\"$(PIDDIR)\"
+ PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\"$(LIBDIR)\" \
+ -DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"@SHLIBEXT@\"
+ PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\"$(CONFIGDIR)\"
+@@ -1059,7 +1062,7 @@
+
+ bin/smbget@EXEEXT@: proto_exists $(SMBGET_OBJ) @BUILD_POPT@ bin/.dummy
+ @echo Linking $@
+- @$(CC) $(FLAGS) -o $@ $(SMBGET_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS)
++ @$(CC) $(FLAGS) -o $@ $(SMBGET_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) $(PASSDB_LIBS)
+
+ bin/samtest@EXEEXT@: $(SAMTEST_OBJ) @BUILD_POPT@ bin/.dummy
+ @echo Linking $@
+@@ -1094,12 +1097,12 @@
+ bin/smbcacls@EXEEXT@: proto_exists $(SMBCACLS_OBJ) @BUILD_POPT@ bin/.dummy
+ @echo Linking $@
+ @$(CC) $(FLAGS) -o $@ $(SMBCACLS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ \
+- $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS)
++ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) $(PASSDB_LIBS)
+
+ bin/smbcquotas@EXEEXT@: proto_exists $(SMBCQUOTAS_OBJ) @BUILD_POPT@ bin/.dummy
+ @echo Linking $@
+ @$(CC) $(FLAGS) -o $@ $(SMBCQUOTAS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ \
+- $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS)
++ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) $(PASSDB_LIBS)
+
+ bin/eventlogadm@EXEEXT@: proto_exists $(EVTLOGADM_OBJ) @BUILD_POPT@ bin/.dummy
+ @echo Linking $@
+@@ -1162,7 +1165,7 @@
+ bin/libsmbclient.@SHLIBEXT@: proto_exists $(LIBSMBCLIENT_OBJ)
+ @echo Linking libsmbclient shared library $@
+ @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBSMBCLIENT_OBJ) $(LIBS) \
+- $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
++ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) $(PASSDB_LIBS) \
+ @SONAMEFLAG@`basename $@`.$(LIBSMBCLIENT_MAJOR)
+
+ bin/libsmbclient.a: proto_exists $(LIBSMBCLIENT_OBJ)
+@@ -1534,11 +1537,11 @@
+ @echo Linking $@
+ @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(NTLM_AUTH_OBJ) \
+ $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(LIBS) \
+- @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS)
++ @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) $(PASSDB_LIBS)
+
+ bin/pam_smbpass.@SHLIBEXT@: $(PAM_SMBPASS_OBJ)
+ @echo "Linking shared library $@"
+- @$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_OBJ) -lpam $(DYNEXP) $(LIBS) $(LDAP_LIBS) $(KRB5LIBS) $(NSCD_LIBS)
++ @$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_OBJ) -lpam $(DYNEXP) $(LIBS) $(LDAP_LIBS) $(KRB5LIBS) $(NSCD_LIBS) $(PASSDB_LIBS)
+
+ bin/tdbbackup@EXEEXT@: proto_exists $(TDBBACKUP_OBJ) bin/.dummy
+ @echo Linking $@
+@@ -1573,7 +1576,7 @@
+ @echo Linking $@
+ @$(CC) $(FLAGS) -o $@ $(DYNEXP) script/tests/timelimit.o
+
+-install: installservers installbin @INSTALL_CIFSMOUNT@ @INSTALL_CIFSUPCALL@ installman installscripts installdat installswat installmodules @INSTALL_LIBSMBCLIENT@ @INSTALL_LIBMSRPC@ @INSTALL_PAM_MODULES@ @INSTALL_LIBSMBSHAREMODES@
++install: installservers installbin @INSTALL_CIFSMOUNT@ @INSTALL_CIFSUPCALL@ installman installscripts installdat installswat installmodules @INSTALL_LIBSMBCLIENT@ @INSTALL_LIBMSRPC@ @INSTALL_PAM_MODULES@ @INSTALL_LIBSMBSHAREMODES@ @INSTALL_LIBADDNS@
+
+ install-everything: install installmodules
+
+@@ -1586,7 +1589,7 @@
+ # is not used
+
+ installdirs:
+- @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS) $(DESTDIR) $(prefix) $(BINDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(PRIVATEDIR) $(PIDDIR) $(LOCKDIR) $(MANDIR)
++ @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS) $(DESTDIR) $(prefix) $(BINDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(STATEDIR) $(PRIVATEDIR) $(PIDDIR) $(LOCKDIR) $(MANDIR)
+
+ installservers: all installdirs
+ @$(SHELL) script/installbin.sh $(INSTALLPERMS) $(DESTDIR) $(prefix) $(SBINDIR) $(SBIN_PROGS)
+@@ -1609,7 +1612,9 @@
+ @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) $(prefix) $(PDBLIBDIR) $(PDB_MODULES)
+ @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) $(prefix) $(RPCLIBDIR) $(RPC_MODULES)
+ @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) $(prefix) $(IDMAPLIBDIR) $(IDMAP_MODULES)
+- @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) $(prefix) $(NSSINFOLIBDIR) $(NSS_INFO_MODULES)
++ @if [ -n "$(NSS_INFO_MODULES)" ]; then \
++ $(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) $(prefix) $(NSSINFOLIBDIR) $(NSS_INFO_MODULES); \
++ fi
+ @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) $(prefix) $(CHARSETLIBDIR) $(CHARSET_MODULES)
+ @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) $(prefix) $(AUTHLIBDIR) $(AUTH_MODULES)
+ @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(PDBLIBDIR) ldapsam.@SHLIBEXT@ ldapsam_compat.@SHLIBEXT@
+@@ -1617,7 +1622,9 @@
+ @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) sam.@SHLIBEXT@ sam_ignoredomain.@SHLIBEXT@
+ @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) domain.@SHLIBEXT@ trustdomain.@SHLIBEXT@ ntdomain.@SHLIBEXT@
+ @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) builtin.@SHLIBEXT@ guest.@SHLIBEXT@ fixed_challenge.@SHLIBEXT@ name_to_ntstatus.@SHLIBEXT@
+- @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(NSSINFOLIBDIR) ../idmap/ad.@SHLIBEXT@ rfc2307.@SHLIBEXT@ sfu.@SHLIBEXT@
++ @if [ -n "$(NSS_INFO_MODULES)" ]; then \
++ $(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(NSSINFOLIBDIR) ../idmap/ad.@SHLIBEXT@ rfc2307.@SHLIBEXT@ sfu.@SHLIBEXT@; \
++ fi
+
+ installscripts: installdirs
+ @$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS)
+@@ -1715,6 +1722,7 @@
+ @echo " privatedir: $(PRIVATE_DIR)"
+ @echo " configdir: $(CONFIGDIR)"
+ @echo " lockdir: $(LOCKDIR)"
++ @echo " statedir: $(STATEDIR)"
+ @echo " piddir: $(PIDDIR)"
+ @echo " swatdir: $(SWATDIR)"
+
diff --git a/net/samba30/patches/patch-bc b/net/samba30/patches/patch-bc
new file mode 100644
index 00000000000..c35378ab2fd
--- /dev/null
+++ b/net/samba30/patches/patch-bc
@@ -0,0 +1,13 @@
+$NetBSD: patch-bc,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- intl/lang_tdb.c.orig 2007-03-01 13:54:31.000000000 +0900
++++ intl/lang_tdb.c
+@@ -139,7 +139,7 @@ BOOL lang_tdb_init(const char *lang)
+ goto done;
+ }
+
+- asprintf(&path, "%s%s.tdb", lock_path("lang_"), lang);
++ asprintf(&path, "%s%s.tdb", state_path("lang_"), lang);
+
+ DEBUG(10, ("lang_tdb_init: loading %s\n", path));
+
diff --git a/net/samba30/patches/patch-bd b/net/samba30/patches/patch-bd
new file mode 100644
index 00000000000..36192e126d5
--- /dev/null
+++ b/net/samba30/patches/patch-bd
@@ -0,0 +1,16 @@
+$NetBSD: patch-bd,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- lib/account_pol.c.orig 2007-03-01 13:54:30.000000000 +0900
++++ lib/account_pol.c
+@@ -213,9 +213,9 @@ BOOL init_account_policy(void)
+ return True;
+ }
+
+- tdb = tdb_open_log(lock_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
++ tdb = tdb_open_log(state_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
+ if (!tdb) { /* the account policies files does not exist or open failed, try to create a new one */
+- tdb = tdb_open_log(lock_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
++ tdb = tdb_open_log(state_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ if (!tdb) {
+ DEBUG(0,("Failed to open account policy database\n"));
+ return False;
diff --git a/net/samba30/patches/patch-be b/net/samba30/patches/patch-be
new file mode 100644
index 00000000000..f079ed11130
--- /dev/null
+++ b/net/samba30/patches/patch-be
@@ -0,0 +1,31 @@
+$NetBSD: patch-be,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- nmbd/nmbd_winsserver.c.orig 2008-03-08 10:33:35.000000000 -0500
++++ nmbd/nmbd_winsserver.c
+@@ -574,7 +574,7 @@ BOOL initialise_wins(void)
+ }
+
+ /* Open the wins.tdb. */
+- wins_tdb = tdb_open_log(lock_path("wins.tdb"), 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST, O_CREAT|O_RDWR, 0600);
++ wins_tdb = tdb_open_log(state_path("wins.tdb"), 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST, O_CREAT|O_RDWR, 0600);
+ if (!wins_tdb) {
+ DEBUG(0,("initialise_wins: failed to open wins.tdb. Error was %s\n",
+ strerror(errno) ));
+@@ -585,7 +585,7 @@ BOOL initialise_wins(void)
+
+ add_samba_names_to_subnet(wins_server_subnet);
+
+- if((fp = x_fopen(lock_path(WINS_LIST),O_RDONLY,0)) == NULL) {
++ if((fp = x_fopen(state_path(WINS_LIST),O_RDONLY,0)) == NULL) {
+ DEBUG(2,("initialise_wins: Can't open wins database file %s. Error was %s\n",
+ WINS_LIST, strerror(errno) ));
+ return True;
+@@ -2338,7 +2338,7 @@ void wins_write_database(time_t t, BOOL
+ }
+ }
+
+- slprintf(fname,sizeof(fname)-1,"%s/%s", lp_lockdir(), WINS_LIST);
++ pstrcpy(fname, state_path(WINS_LIST));
+ all_string_sub(fname,"//", "/", 0);
+ slprintf(fnamenew,sizeof(fnamenew)-1,"%s.%u", fname, (unsigned int)sys_getpid());
+
diff --git a/net/samba30/patches/patch-bg b/net/samba30/patches/patch-bg
new file mode 100644
index 00000000000..fa7337fae14
--- /dev/null
+++ b/net/samba30/patches/patch-bg
@@ -0,0 +1,49 @@
+$NetBSD: patch-bg,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- printing/nt_printing.c.orig 2009-09-30 21:21:56.000000000 +0900
++++ printing/nt_printing.c
+@@ -351,8 +351,7 @@ static int sec_desc_upg_fn( TDB_CONTEXT
+ SEC_DESC *sec, *new_sec;
+ TALLOC_CTX *ctx = state;
+ int result, i;
+- uint32 sd_size;
+- size_t size_new_sec;
++ size_t sd_size, size_new_sec;
+ DOM_SID sid;
+
+ if (!data.dptr || data.dsize == 0) {
+@@ -560,28 +559,28 @@ BOOL nt_printing_init(void)
+
+ if (tdb_drivers)
+ tdb_close(tdb_drivers);
+- tdb_drivers = tdb_open_log(lock_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
++ tdb_drivers = tdb_open_log(state_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ if (!tdb_drivers) {
+ DEBUG(0,("nt_printing_init: Failed to open nt drivers database %s (%s)\n",
+- lock_path("ntdrivers.tdb"), strerror(errno) ));
++ state_path("ntdrivers.tdb"), strerror(errno) ));
+ return False;
+ }
+
+ if (tdb_printers)
+ tdb_close(tdb_printers);
+- tdb_printers = tdb_open_log(lock_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
++ tdb_printers = tdb_open_log(state_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ if (!tdb_printers) {
+ DEBUG(0,("nt_printing_init: Failed to open nt printers database %s (%s)\n",
+- lock_path("ntprinters.tdb"), strerror(errno) ));
++ state_path("ntprinters.tdb"), strerror(errno) ));
+ return False;
+ }
+
+ if (tdb_forms)
+ tdb_close(tdb_forms);
+- tdb_forms = tdb_open_log(lock_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
++ tdb_forms = tdb_open_log(state_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ if (!tdb_forms) {
+ DEBUG(0,("nt_printing_init: Failed to open nt forms database %s (%s)\n",
+- lock_path("ntforms.tdb"), strerror(errno) ));
++ state_path("ntforms.tdb"), strerror(errno) ));
+ return False;
+ }
+
diff --git a/net/samba30/patches/patch-bh b/net/samba30/patches/patch-bh
new file mode 100644
index 00000000000..df73b1c3b91
--- /dev/null
+++ b/net/samba30/patches/patch-bh
@@ -0,0 +1,34 @@
+$NetBSD: patch-bh,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- registry/reg_db.c.orig 2007-03-01 13:55:05.000000000 +0900
++++ registry/reg_db.c
+@@ -234,12 +234,12 @@ BOOL regdb_init( void )
+ if ( tdb_reg )
+ return True;
+
+- if ( !(tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600)) )
++ if ( !(tdb_reg = tdb_open_log(state_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600)) )
+ {
+- tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
++ tdb_reg = tdb_open_log(state_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ if ( !tdb_reg ) {
+ DEBUG(0,("regdb_init: Failed to open registry %s (%s)\n",
+- lock_path("registry.tdb"), strerror(errno) ));
++ state_path("registry.tdb"), strerror(errno) ));
+ return False;
+ }
+
+@@ -281,11 +281,11 @@ WERROR regdb_open( void )
+
+ become_root();
+
+- tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
++ tdb_reg = tdb_open_log(state_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
+ if ( !tdb_reg ) {
+ result = ntstatus_to_werror( map_nt_error_from_unix( errno ) );
+ DEBUG(0,("regdb_open: Failed to open %s! (%s)\n",
+- lock_path("registry.tdb"), strerror(errno) ));
++ state_path("registry.tdb"), strerror(errno) ));
+ }
+
+ unbecome_root();
diff --git a/net/samba30/patches/patch-bi b/net/samba30/patches/patch-bi
new file mode 100644
index 00000000000..92ae1df7b75
--- /dev/null
+++ b/net/samba30/patches/patch-bi
@@ -0,0 +1,17 @@
+$NetBSD: patch-bi,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- lib/sharesec.c.orig 2007-03-01 13:54:29.000000000 +0900
++++ lib/sharesec.c
+@@ -47,10 +47,10 @@ BOOL share_info_db_init(void)
+ return True;
+ }
+
+- share_tdb = tdb_open_log(lock_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
++ share_tdb = tdb_open_log(state_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ if (!share_tdb) {
+ DEBUG(0,("Failed to open share info database %s (%s)\n",
+- lock_path("share_info.tdb"), strerror(errno) ));
++ state_path("share_info.tdb"), strerror(errno) ));
+ return False;
+ }
+
diff --git a/net/samba30/patches/patch-bm b/net/samba30/patches/patch-bm
new file mode 100644
index 00000000000..cb7b5d1ace4
--- /dev/null
+++ b/net/samba30/patches/patch-bm
@@ -0,0 +1,17 @@
+$NetBSD: patch-bm,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- dynconfig.c.orig 2007-02-04 18:59:28.000000000 +0000
++++ dynconfig.c 2007-02-11 17:51:32.000000000 +0000
+@@ -68,5 +68,12 @@
+ pstring dyn_LOCKDIR = LOCKDIR;
+ pstring dyn_PIDDIR = PIDDIR;
+
++/**
++ * @brief Directory holding persistent-state files.
++ *
++ * Not writable, but used to set a default in the parameter table.
++ **/
++pstring dyn_STATEDIR = STATEDIR;
++
+ pstring dyn_SMB_PASSWD_FILE = SMB_PASSWD_FILE;
+ pstring dyn_PRIVATE_DIR = PRIVATE_DIR;
diff --git a/net/samba30/patches/patch-bn b/net/samba30/patches/patch-bn
new file mode 100644
index 00000000000..4a8aa39d972
--- /dev/null
+++ b/net/samba30/patches/patch-bn
@@ -0,0 +1,11 @@
+$NetBSD: patch-bn,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- include/dynconfig.h.orig 2007-02-04 18:59:23.000000000 +0000
++++ include/dynconfig.h 2007-02-11 17:52:33.000000000 +0000
+@@ -34,5 +34,6 @@
+ extern fstring dyn_SHLIBEXT;
+ extern pstring dyn_LOCKDIR;
+ extern pstring dyn_PIDDIR;
++extern pstring dyn_STATEDIR;
+ extern pstring dyn_SMB_PASSWD_FILE;
+ extern pstring dyn_PRIVATE_DIR;
diff --git a/net/samba30/patches/patch-bo b/net/samba30/patches/patch-bo
new file mode 100644
index 00000000000..8c14ec32564
--- /dev/null
+++ b/net/samba30/patches/patch-bo
@@ -0,0 +1,15 @@
+$NetBSD: patch-bo,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- nmbd/nmbd.c.orig 2009-09-30 21:21:56.000000000 +0900
++++ nmbd/nmbd.c
+@@ -769,6 +769,10 @@ static BOOL open_sockets(BOOL isdaemon,
+ mkdir(lp_lockdir(), 0755);
+ }
+
++ if (!directory_exist(lp_statedir(), NULL)) {
++ mkdir(lp_statedir(), 0755);
++ }
++
+ pidfile_create("nmbd");
+ message_init();
+ message_register(MSG_FORCE_ELECTION, nmbd_message_election, NULL);
diff --git a/net/samba30/patches/patch-bp b/net/samba30/patches/patch-bp
new file mode 100644
index 00000000000..58391f39063
--- /dev/null
+++ b/net/samba30/patches/patch-bp
@@ -0,0 +1,14 @@
+$NetBSD: patch-bp,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- smbd/server.c.orig 2009-09-30 21:21:56.000000000 +0900
++++ smbd/server.c
+@@ -1008,6 +1008,9 @@ extern void build_options(BOOL screen);
+ if (!directory_exist(lp_lockdir(), NULL))
+ mkdir(lp_lockdir(), 0755);
+
++ if (!directory_exist(lp_statedir(), NULL))
++ mkdir(lp_statedir(), 0755);
++
+ if (is_daemon)
+ pidfile_create("smbd");
+
diff --git a/net/samba30/patches/patch-bq b/net/samba30/patches/patch-bq
new file mode 100644
index 00000000000..6f093da3a37
--- /dev/null
+++ b/net/samba30/patches/patch-bq
@@ -0,0 +1,17 @@
+$NetBSD: patch-bq,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- utils/testparm.c.orig 2005-10-12 13:03:42.000000000 -0400
++++ utils/testparm.c
+@@ -67,6 +67,12 @@ cannot be set in the smb.conf file. nmbd
+ ret = 1;
+ }
+
++ if (!directory_exist(lp_statedir(), &st)) {
++ fprintf(stderr, "ERROR: state directory %s does not exist\n",
++ lp_statedir());
++ ret = 1;
++ }
++
+ if (!directory_exist(lp_piddir(), &st)) {
+ fprintf(stderr, "ERROR: pid directory %s does not exist\n",
+ lp_piddir());
diff --git a/net/samba30/patches/patch-br b/net/samba30/patches/patch-br
new file mode 100644
index 00000000000..92f521b675e
--- /dev/null
+++ b/net/samba30/patches/patch-br
@@ -0,0 +1,31 @@
+$NetBSD: patch-br,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- lib/util.c.orig 2008-03-08 10:33:34.000000000 -0500
++++ lib/util.c
+@@ -2598,6 +2598,26 @@ char *lock_path(const char *name)
+ }
+
+ /*****************************************************************
++ A useful function for returning a path in the Samba state directory.
++*****************************************************************/
++
++char *state_path(const char *name)
++{
++ static pstring fname;
++
++ pstrcpy(fname,lp_statedir());
++ trim_char(fname,'\0','/');
++
++ if (!directory_exist(fname,NULL))
++ mkdir(fname,0755);
++
++ pstrcat(fname,"/");
++ pstrcat(fname,name);
++
++ return fname;
++}
++
++/*****************************************************************
+ A useful function for returning a path in the Samba pid directory.
+ *****************************************************************/
+
diff --git a/net/samba30/patches/patch-bs b/net/samba30/patches/patch-bs
new file mode 100644
index 00000000000..74435ad09ad
--- /dev/null
+++ b/net/samba30/patches/patch-bs
@@ -0,0 +1,77 @@
+$NetBSD: patch-bs,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- param/loadparm.c.orig 2009-09-30 12:21:56.000000000 +0000
++++ param/loadparm.c
+@@ -109,6 +109,7 @@ typedef struct {
+ char *szDeletePrinterCommand;
+ char *szOs2DriverMap;
+ char *szLockDir;
++ char *szStateDir;
+ char *szPidDir;
+ char *szRootdir;
+ char *szDefaultService;
+@@ -276,6 +277,7 @@ typedef struct {
+ BOOL bUnixPasswdSync;
+ BOOL bPasswdChatDebug;
+ int iPasswdChatTimeout;
++ BOOL bPasswdExpandGecos;
+ BOOL bTimestampLogs;
+ BOOL bNTSmbSupport;
+ BOOL bNTPipeSupport;
+@@ -564,7 +566,7 @@ static service sDefault = {
+ True, /* bLevel2OpLocks */
+ False, /* bOnlyUser */
+ True, /* bMangledNames */
+- True, /* bWidelinks */
++ False, /* bWidelinks */
+ True, /* bSymlinks */
+ False, /* bSyncAlways */
+ False, /* bStrictAllocate */
+@@ -890,6 +892,7 @@ static struct parm_struct parm_table[] =
+ {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, FLAG_ADVANCED},
+ {"passwd chat debug", P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, FLAG_ADVANCED},
+ {"passwd chat timeout", P_INTEGER, P_GLOBAL, &Globals.iPasswdChatTimeout, NULL, NULL, FLAG_ADVANCED},
++ {"passwd expand gecos", P_BOOL, P_GLOBAL, &Globals.bPasswdExpandGecos, NULL, NULL, FLAG_ADVANCED},
+ {"check password script", P_STRING, P_GLOBAL, &Globals.szCheckPasswordScript, NULL, NULL, FLAG_ADVANCED},
+ {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, FLAG_ADVANCED},
+ {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, FLAG_ADVANCED},
+@@ -1212,6 +1215,7 @@ static struct parm_struct parm_table[] =
+ {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED},
+ {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_ADVANCED},
+ {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_HIDE},
++ {"state directory", P_STRING, P_GLOBAL, &Globals.szStateDir, NULL, NULL, FLAG_ADVANCED},
+ {"pid directory", P_STRING, P_GLOBAL, &Globals.szPidDir, NULL, NULL, FLAG_ADVANCED},
+ #ifdef WITH_UTMP
+ {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, FLAG_ADVANCED},
+@@ -1476,6 +1480,7 @@ static void init_globals(BOOL first_time
+ string_set(&Globals.szPasswdProgram, "");
+ string_set(&Globals.szPidDir, dyn_PIDDIR);
+ string_set(&Globals.szLockDir, dyn_LOCKDIR);
++ string_set(&Globals.szStateDir, dyn_STATEDIR);
+ string_set(&Globals.szSocketAddress, "0.0.0.0");
+ pstrcpy(s, "Samba ");
+ pstrcat(s, SAMBA_VERSION_STRING);
+@@ -1559,6 +1564,7 @@ static void init_globals(BOOL first_time
+ Globals.bPamPasswordChange = False;
+ Globals.bPasswdChatDebug = False;
+ Globals.iPasswdChatTimeout = 2; /* 2 second default. */
++ Globals.bPasswdExpandGecos = False;
+ Globals.bNTPipeSupport = True; /* Do NT pipes by default. */
+ Globals.bNTStatusSupport = True; /* Use NT status by default. */
+ Globals.bStatCache = True; /* use stat cache by default */
+@@ -1806,6 +1812,7 @@ FN_GLOBAL_STRING(lp_addprinter_cmd, &Glo
+ FN_GLOBAL_STRING(lp_deleteprinter_cmd, &Globals.szDeletePrinterCommand)
+ FN_GLOBAL_STRING(lp_os2_driver_map, &Globals.szOs2DriverMap)
+ FN_GLOBAL_STRING(lp_lockdir, &Globals.szLockDir)
++FN_GLOBAL_STRING(lp_statedir, &Globals.szStateDir)
+ FN_GLOBAL_STRING(lp_piddir, &Globals.szPidDir)
+ FN_GLOBAL_STRING(lp_mangling_method, &Globals.szManglingMethod)
+ FN_GLOBAL_INTEGER(lp_mangle_prefix, &Globals.mangle_prefix)
+@@ -1979,6 +1986,7 @@ FN_GLOBAL_BOOL(lp_pam_password_change, &
+ FN_GLOBAL_BOOL(lp_unix_password_sync, &Globals.bUnixPasswdSync)
+ FN_GLOBAL_BOOL(lp_passwd_chat_debug, &Globals.bPasswdChatDebug)
+ FN_GLOBAL_INTEGER(lp_passwd_chat_timeout, &Globals.iPasswdChatTimeout)
++FN_GLOBAL_BOOL(lp_passwd_expand_gecos, &Globals.bPasswdExpandGecos)
+ FN_GLOBAL_BOOL(lp_nt_pipe_support, &Globals.bNTPipeSupport)
+ FN_GLOBAL_BOOL(lp_nt_status_support, &Globals.bNTStatusSupport)
+ FN_GLOBAL_BOOL(lp_stat_cache, &Globals.bStatCache)
diff --git a/net/samba30/patches/patch-bu b/net/samba30/patches/patch-bu
new file mode 100644
index 00000000000..db85542c21b
--- /dev/null
+++ b/net/samba30/patches/patch-bu
@@ -0,0 +1,36 @@
+$NetBSD: patch-bu,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- ../docs/manpages/smb.conf.5.orig 2009-09-30 21:28:02.000000000 +0900
++++ ../docs/manpages/smb.conf.5
+@@ -7084,6 +7084,15 @@ Example:
+ \fI\fIpasswd chat\fR\fR\fI = \fR\fI\FC"*Enter NEW password*" %n\en "*Reenter NEW password*" %n\en "*Password changed*"\F[]\fR\fI \fR
+ .RE
+
++passwd expand gecos (G)
++.PP
++.RS 4
++This boolean specifies if ampersand characters in the GECOS field of a passwd database entry should be replaced with the capitalized login name for that entry when the information is used by various Samba programs\&. This parameter is off by default\&.
++.sp
++Default: \fB\fIpasswd expand gecos\fR = no \fR
++.TP 3n
++.sp
++
+ passwd program (G)
+ .\" passwd program
+ .PP
+@@ -9199,6 +9208,15 @@ Default:
+ \fI\fIstat cache\fR\fR\fI = \fR\fI\FCyes\F[]\fR\fI \fR
+ .RE
+
++state directory (G)
++.PP
++.RS 4
++This parameter defines the directory the Samba daemon processes will use for storing state files that must persist across machine reboots.
++.sp
++Default:
++\fB\fIstate directory\fR = /var/db/samba \fR
++.RE
++
+ store dos attributes (S)
+ .\" store dos attributes
+ .PP
diff --git a/net/samba30/patches/patch-bv b/net/samba30/patches/patch-bv
new file mode 100644
index 00000000000..e2b101ca725
--- /dev/null
+++ b/net/samba30/patches/patch-bv
@@ -0,0 +1,71 @@
+$NetBSD: patch-bv,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- lib/util_pw.c.orig 2006-04-20 03:29:23.000000000 +0100
++++ lib/util_pw.c 2007-02-11 17:57:22.000000000 +0000
+@@ -4,6 +4,7 @@
+ Safe versions of getpw* calls
+
+ Copyright (C) Andrew Bartlett 2002
++ Copyright (C) Luke Mewburn 2004
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+@@ -25,6 +26,7 @@
+ struct passwd *tcopy_passwd(TALLOC_CTX *mem_ctx, const struct passwd *from)
+ {
+ struct passwd *ret = TALLOC_P(mem_ctx, struct passwd);
++ char *gecos;
+ if (!ret) {
+ return NULL;
+ }
+@@ -32,7 +34,10 @@
+ ret->pw_passwd = talloc_strdup(ret, from->pw_passwd);
+ ret->pw_uid = from->pw_uid;
+ ret->pw_gid = from->pw_gid;
+- ret->pw_gecos = talloc_strdup(ret, from->pw_gecos);
++ gecos = (from->pw_gecos != NULL) ? passwd_expand_gecos(from) : NULL;
++ ret->pw_gecos = talloc_strdup(ret, gecos);
++ if (gecos != NULL)
++ SAFE_FREE(gecos);
+ ret->pw_dir = talloc_strdup(ret, from->pw_dir);
+ ret->pw_shell = talloc_strdup(ret, from->pw_shell);
+ return ret;
+@@ -126,3 +131,38 @@
+
+ return tcopy_passwd(mem_ctx, temp);
+ }
++
++
++/****************************************************************
++ Expand any `&' characters in pw_gecos with a capitalized pw_name.
++****************************************************************/
++
++char *passwd_expand_gecos(const struct passwd *pw)
++{
++ char *p, *bp, *buf;
++ size_t ac, buflen;
++
++ if (!lp_passwd_expand_gecos()) {
++ return smb_xstrdup(pw->pw_gecos);
++ }
++
++ ac = 0;
++ /* count number of `&' in pw_gecos */
++ for (p = pw->pw_gecos; *p; p++) {
++ if (*p == '&')
++ ac++;
++ }
++ buflen = strlen(pw->pw_gecos) + (ac * (strlen(pw->pw_name) - 1)) + 1;
++ buf = smb_xmalloc_array(sizeof(char), buflen);
++ bp = buf;
++ for (p = pw->pw_gecos; *p; p++) {
++ if (*p == '&') { /* replace & with capitalized pw_name */
++ ac = snprintf(bp, buflen - (bp - buf),
++ "%s", pw->pw_name);
++ *bp = toupper((unsigned char)*bp);
++ bp += ac;
++ } else
++ *bp++ = *p;
++ }
++ return buf;
++}
diff --git a/net/samba30/patches/patch-bw b/net/samba30/patches/patch-bw
new file mode 100644
index 00000000000..2b5f1e00c3c
--- /dev/null
+++ b/net/samba30/patches/patch-bw
@@ -0,0 +1,34 @@
+$NetBSD: patch-bw,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- include/config.h.in.orig 2009-09-30 22:08:50.000000000 +0900
++++ include/config.h.in
+@@ -324,9 +324,6 @@
+ /* Define to 1 if you have the `delproplist' function. */
+ #undef HAVE_DELPROPLIST
+
+-/* Define to 1 if you have the `des_set_key' function. */
+-#undef HAVE_DES_SET_KEY
+-
+ /* Whether the 'dev64_t' type is available */
+ #undef HAVE_DEV64_T
+
+@@ -391,6 +388,9 @@
+ /* Whether the EncryptedData struct has a etype property */
+ #undef HAVE_ETYPE_IN_ENCRYPTEDDATA
+
++/* Define to 1 if you have the `EVP_des_cbc' function. */
++#undef HAVE_EVP_DES_CBC
++
+ /* Define to 1 if you have the <execinfo.h> header file. */
+ #undef HAVE_EXECINFO_H
+
+@@ -664,6 +664,9 @@
+ /* Whether iface AIX is available */
+ #undef HAVE_IFACE_AIX
+
++/* Whether iface ifaddrs is available */
++#undef HAVE_IFACE_IFADDRS
++
+ /* Whether iface ifconf is available */
+ #undef HAVE_IFACE_IFCONF
+
diff --git a/net/samba30/patches/patch-ca b/net/samba30/patches/patch-ca
new file mode 100644
index 00000000000..a3f92f399e4
--- /dev/null
+++ b/net/samba30/patches/patch-ca
@@ -0,0 +1,11 @@
+$NetBSD: patch-ca,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- VERSION.orig 2008-03-08 10:56:26.000000000 -0500
++++ VERSION
+@@ -95,5 +95,5 @@ SAMBA_VERSION_IS_GIT_SNAPSHOT=
+ # e.g. SAMBA_VERSION_VENDOR_SUFFIX=vendor_version() #
+ # -> "CVS 3.0.0rc2-VendorVersion" #
+ ########################################################
+-SAMBA_VERSION_VENDOR_SUFFIX=
++SAMBA_VERSION_VENDOR_SUFFIX="pkgsrc"
+ SAMBA_VERSION_VENDOR_PATCH=
diff --git a/net/samba30/patches/patch-ce b/net/samba30/patches/patch-ce
new file mode 100644
index 00000000000..3999b378f5b
--- /dev/null
+++ b/net/samba30/patches/patch-ce
@@ -0,0 +1,13 @@
+$NetBSD: patch-ce,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- groupdb/mapping_tdb.c.orig 2007-04-25 18:38:59.000000000 +0900
++++ groupdb/mapping_tdb.c
+@@ -39,7 +39,7 @@ static TDB_CONTEXT *tdb; /* used for dri
+ if (tdb)
+ return True;
+
+- tdb = tdb_open_log(lock_path("group_mapping.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
++ tdb = tdb_open_log(state_path("group_mapping.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ if (!tdb) {
+ DEBUG(0,("Failed to open group mapping database\n"));
+ return False;
diff --git a/net/samba30/patches/patch-cf b/net/samba30/patches/patch-cf
new file mode 100644
index 00000000000..6b5dc6ce18c
--- /dev/null
+++ b/net/samba30/patches/patch-cf
@@ -0,0 +1,13 @@
+$NetBSD: patch-cf,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- nsswitch/idmap_tdb.c.orig 2007-05-11 07:09:34.000000000 +0900
++++ nsswitch/idmap_tdb.c
+@@ -247,7 +247,7 @@ static NTSTATUS idmap_tdb_open_db(TALLOC
+ }
+
+ /* use the old database if present */
+- tdbfile = talloc_strdup(ctx, lock_path("winbindd_idmap.tdb"));
++ tdbfile = talloc_strdup(ctx, state_path("winbindd_idmap.tdb"));
+ if (!tdbfile) {
+ DEBUG(0, ("Out of memory!\n"));
+ ret = NT_STATUS_NO_MEMORY;
diff --git a/net/samba30/patches/patch-cg b/net/samba30/patches/patch-cg
new file mode 100644
index 00000000000..b365976b87d
--- /dev/null
+++ b/net/samba30/patches/patch-cg
@@ -0,0 +1,13 @@
+$NetBSD: patch-cg,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- passdb/pdb_tdb.c.orig 2007-03-01 13:54:41.000000000 +0900
++++ passdb/pdb_tdb.c
+@@ -1559,7 +1559,7 @@ static BOOL tdbsam_new_rid(struct pdb_me
+ uint32 rid;
+ BOOL ret = False;
+
+- tdb = tdb_open_log(lock_path("winbindd_idmap.tdb"), 0,
++ tdb = tdb_open_log(state_path("winbindd_idmap.tdb"), 0,
+ TDB_DEFAULT, O_RDWR | O_CREAT, 0644);
+
+ if (tdb == NULL) {
diff --git a/net/samba30/patches/patch-ch b/net/samba30/patches/patch-ch
new file mode 100644
index 00000000000..a56d88f57d7
--- /dev/null
+++ b/net/samba30/patches/patch-ch
@@ -0,0 +1,22 @@
+$NetBSD: patch-ch,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- rpc_server/srv_eventlog_lib.c.orig 2007-03-01 13:54:40.000000000 +0900
++++ rpc_server/srv_eventlog_lib.c
+@@ -67,7 +67,7 @@ char *elog_tdbname( const char *name )
+ {
+ fstring path;
+ char *tdb_fullpath;
+- char *eventlogdir = lock_path( "eventlog" );
++ char *eventlogdir = state_path( "eventlog" );
+
+ pstr_sprintf( path, "%s/%s.tdb", eventlogdir, name );
+ strlower_m( path );
+@@ -349,7 +349,7 @@ ELOG_TDB *elog_open_tdb( char *logname,
+
+ /* make sure that the eventlog dir exists */
+
+- eventlogdir = lock_path( "eventlog" );
++ eventlogdir = state_path( "eventlog" );
+ if ( !directory_exist( eventlogdir, NULL ) )
+ mkdir( eventlogdir, 0755 );
+
diff --git a/net/samba30/patches/patch-ci b/net/samba30/patches/patch-ci
new file mode 100644
index 00000000000..622ce0a7cc5
--- /dev/null
+++ b/net/samba30/patches/patch-ci
@@ -0,0 +1,13 @@
+$NetBSD: patch-ci,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- libsmb/samlogon_cache.c.orig 2009-09-30 21:21:56.000000000 +0900
++++ libsmb/samlogon_cache.c
+@@ -34,7 +34,7 @@ static TDB_CONTEXT *netsamlogon_tdb = NU
+ BOOL netsamlogon_cache_init(void)
+ {
+ if (!netsamlogon_tdb) {
+- netsamlogon_tdb = tdb_open_log(lock_path(NETSAMLOGON_TDB), 0,
++ netsamlogon_tdb = tdb_open_log(state_path(NETSAMLOGON_TDB), 0,
+ TDB_DEFAULT, O_RDWR | O_CREAT, 0600);
+ }
+
diff --git a/net/samba30/patches/patch-da b/net/samba30/patches/patch-da
new file mode 100644
index 00000000000..45561a5a02e
--- /dev/null
+++ b/net/samba30/patches/patch-da
@@ -0,0 +1,47 @@
+$NetBSD: patch-da,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+--- lib/interfaces.c.orig 2007-03-01 05:54:30.000000000 +0100
++++ lib/interfaces.c
+@@ -343,6 +343,42 @@ static int _get_interfaces(struct iface_
+
+ #define _FOUND_IFACE_ANY
+ #endif /* HAVE_IFACE_AIX */
++#ifdef HAVE_IFACE_IFADDRS
++
++#include <ifaddrs.h>
++
++static int _get_interfaces(struct iface_struct *ifaces, int max_interfaces)
++{
++ struct ifaddrs *ia;
++ int total;
++
++ if (getifaddrs(&ia) < 0)
++ return -1;
++
++ total = 0;
++ while (ia && total < max_interfaces) {
++ if (ia->ifa_addr->sa_family != AF_INET ||
++ !(ia->ifa_flags & IFF_UP)) {
++ ia = ia->ifa_next;
++ continue;
++ }
++ strncpy(ifaces[total].name, ia->ifa_name,
++ sizeof(ifaces[total].name) - 1);
++ ifaces[total].name[sizeof(ifaces[total].name) - 1] = 0;
++ ifaces[total].ip = ((struct sockaddr_in *)(ia->ifa_addr))
++ ->sin_addr;
++ ifaces[total].netmask = ((struct sockaddr_in *)(ia->ifa_netmask))
++ ->sin_addr;
++ total++;
++ ia = ia->ifa_next;
++ }
++
++ freeifaddrs(ia);
++ return total;
++}
++
++#define _FOUND_IFACE_ANY
++#endif /* HAVE_IFACE_IFADDRS */
+ #ifndef _FOUND_IFACE_ANY
+ static int _get_interfaces(struct iface_struct *ifaces, int max_interfaces)
+ {
diff --git a/net/samba30/patches/patch-ee b/net/samba30/patches/patch-ee
new file mode 100644
index 00000000000..f242b8d6f29
--- /dev/null
+++ b/net/samba30/patches/patch-ee
@@ -0,0 +1,40 @@
+$NetBSD: patch-ee,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+Patch to fix CVE-2010-2063.
+
+--- smbd/process.c.orig 2009-09-30 12:21:56.000000000 +0000
++++ smbd/process.c
+@@ -1159,6 +1159,7 @@ int chain_reply(char *inbuf,char *outbuf
+ {
+ static char *orig_inbuf;
+ static char *orig_outbuf;
++ static int orig_size;
+ int smb_com1, smb_com2 = CVAL(inbuf,smb_vwv0);
+ unsigned smb_off2 = SVAL(inbuf,smb_vwv1);
+ char *inbuf2, *outbuf2;
+@@ -1178,6 +1179,13 @@ int chain_reply(char *inbuf,char *outbuf
+ /* this is the first part of the chain */
+ orig_inbuf = inbuf;
+ orig_outbuf = outbuf;
++ orig_size = size;
++ }
++
++ /* Validate smb_off2 */
++ if ((smb_off2 < smb_wct - 4) || orig_size < (smb_off2 + 4 - smb_wct)) {
++ exit_server_cleanly("Bad chained packet");
++ return -1;
+ }
+
+ /*
+@@ -1192,6 +1200,11 @@ int chain_reply(char *inbuf,char *outbuf
+ SSVAL(outbuf,smb_vwv1,smb_offset(outbuf+outsize,outbuf));
+ SCVAL(outbuf,smb_vwv0,smb_com2);
+
++ if (outsize <= smb_wct) {
++ exit_server_cleanly("Bad chained packet");
++ return -1;
++ }
++
+ /* remember how much the caller added to the chain, only counting stuff
+ after the parameter words */
+ chain_size += outsize - smb_wct;
diff --git a/net/samba30/patches/patch-lib_replace_test_os2__delete.c b/net/samba30/patches/patch-lib_replace_test_os2__delete.c
new file mode 100644
index 00000000000..3bc1e81b795
--- /dev/null
+++ b/net/samba30/patches/patch-lib_replace_test_os2__delete.c
@@ -0,0 +1,14 @@
+$NetBSD: patch-lib_replace_test_os2__delete.c,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+Workaround for NetBSD 5.99.54.
+
+--- lib/replace/test/os2_delete.c.orig 2009-09-30 12:21:56.000000000 +0000
++++ lib/replace/test/os2_delete.c
+@@ -103,6 +103,7 @@ int test_readdir_os2_delete(void)
+ while (1) {
+ int n = os2_delete(d);
+ if (n == 0) break;
++ if (test_readdir_os2_delete_ret != 0) break; /* if FAILED */
+ total_deleted += n;
+ }
+ closedir(d);
diff --git a/net/samba30/patches/patch-libsmb_clikrb5.c b/net/samba30/patches/patch-libsmb_clikrb5.c
new file mode 100644
index 00000000000..79ea8e1f5fc
--- /dev/null
+++ b/net/samba30/patches/patch-libsmb_clikrb5.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-libsmb_clikrb5.c,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
+
+* KRB5_DEPRECATED would not be defined as boolean 0 or 1.
+
+--- libsmb/clikrb5.c.orig 2009-09-30 12:21:56.000000000 +0000
++++ libsmb/clikrb5.c
+@@ -22,7 +22,7 @@
+ */
+
+ #define KRB5_PRIVATE 1 /* this file uses PRIVATE interfaces! */
+-#define KRB5_DEPRECATED 1 /* this file uses DEPRECATED interfaces! */
++#define KRB5_DEPRECATED /* this file uses DEPRECATED interfaces! */
+
+ #include "includes.h"
+