summaryrefslogtreecommitdiff
path: root/net/samba32/files
diff options
context:
space:
mode:
authorTimur I. Bakeyev <timur@FreeBSD.org>2008-10-12 01:37:46 +0000
committerTimur I. Bakeyev <timur@FreeBSD.org>2008-10-12 01:37:46 +0000
commitc90dd9a0cfb4ca92b844795f5a8be202dab70ece (patch)
tree7393b1c4965488c02bd885f2cda1aed2cc86c5de /net/samba32/files
parent- update to 0.38 (diff)
Add new experimantal version of Samba 3.2.4
Notes
Notes: svn path=/head/; revision=221452
Diffstat (limited to 'net/samba32/files')
-rw-r--r--net/samba32/files/README.FreeBSD35
-rw-r--r--net/samba32/files/patch-Makefile.in20
-rw-r--r--net/samba32/files/patch-configure.in240
-rw-r--r--net/samba32/files/patch-include__includes.h16
-rw-r--r--net/samba32/files/patch-lib__iconv.c11
-rw-r--r--net/samba32/files/patch-lib__replace__libreplace_cc.m413
-rw-r--r--net/samba32/files/patch-libaddns__dns.h19
-rw-r--r--net/samba32/files/patch-m4__aclocal.m4161
-rw-r--r--net/samba32/files/patch-nsswitch__pam_winbind.c39
-rw-r--r--net/samba32/files/patch-nsswitch__wins_freebsd.c115
-rw-r--r--net/samba32/files/patch-smbd__quotas.c20
-rw-r--r--net/samba32/files/patch-smbd__statvfs.c64
-rw-r--r--net/samba32/files/patch-utils__net_time.c18
-rw-r--r--net/samba32/files/pkg-deinstall.in44
-rw-r--r--net/samba32/files/pkg-install.in41
-rw-r--r--net/samba32/files/pkg-message.in7
-rw-r--r--net/samba32/files/samba.in162
-rw-r--r--net/samba32/files/smb.conf.sample.in291
18 files changed, 1316 insertions, 0 deletions
diff --git a/net/samba32/files/README.FreeBSD b/net/samba32/files/README.FreeBSD
new file mode 100644
index 000000000000..885f5f33e4b4
--- /dev/null
+++ b/net/samba32/files/README.FreeBSD
@@ -0,0 +1,35 @@
+If you want to run this port:
+
+1. Copy /usr/local/etc/smb.conf.default to /usr/local/etc/smb.conf and edit
+ it.
+2. Put string 'samba_enable="YES"' into your /etc/rc.conf.
+3. Run '/usr/local/etc/rc.d/samba start' or reboot.
+
+This port doesn't create 'smbpasswd' file automatically anymore. Users
+are encouraged to use 'tdbsam' backend instead:
+
+ [global]
+ passdb backend = tdbsam, smbpasswd
+
+You can use pdbedit to migrate accounts from 'smbpasswd' to 'tdbsam',
+see the Samba3-HOWTO-Collection.
+
+You still can create 'smbpasswd' file with the supplied 'make_smbpasswd'
+script:
+
+ cat /etc/passwd | grep -v "^#" | make_smbpasswd > smbpasswd
+ chmod 600 smbpasswd
+
+But the usage of it is deprecated.
+
+See document files in /usr/local/share/doc/samba and example config files in
+/usr/local/share/examples/samba for details.
+
+This port doesn't come anymore with the IDEALX Samba LDAP management tools.
+They are a separate port now, net/smbldap-tools. Please, install it, if you
+are going to use Samba LDAP back end.
+
+Japanese users, please, take a look onto japanese/samba3 port instead -
+it comes with additional multibyte characters support.
+
+FreeBSD Samba3 port maintainer: Timur Bakeyev <timur@FreeBSD.org>
diff --git a/net/samba32/files/patch-Makefile.in b/net/samba32/files/patch-Makefile.in
new file mode 100644
index 000000000000..616839fad711
--- /dev/null
+++ b/net/samba32/files/patch-Makefile.in
@@ -0,0 +1,20 @@
+--- ./Makefile.in.orig 2008-09-18 08:49:02.000000000 +0200
++++ ./Makefile.in 2008-09-23 01:38:57.000000000 +0200
+@@ -122,7 +122,7 @@
+ # These can be overridden by command line switches (see smbd(8))
+ # or in smb.conf (see smb.conf(5))
+ LOGFILEBASE = @logfilebase@
+-CONFIGFILE = $(CONFIGDIR)/smb.conf
++CONFIGFILE = $(CONFIGDIR)/%%SAMBA_CONFIG%%
+ LMHOSTSFILE = $(CONFIGDIR)/lmhosts
+ CTDBDIR = @ctdbdir@
+
+@@ -961,7 +961,7 @@
+
+ WINBIND_WINS_NSS_OBJ = nsswitch/wins.o $(PARAM_OBJ) \
+ $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) $(NSSWINS_OBJ) $(KRBCLIENT_OBJ) \
+- $(LIBNDR_GEN_OBJ0)
++ $(LIBNDR_GEN_OBJ0) @WINBIND_WINS_NSS_EXTRA_OBJS@
+
+ PAM_SMBPASS_OBJ_0 = pam_smbpass/pam_smb_auth.o pam_smbpass/pam_smb_passwd.o \
+ pam_smbpass/pam_smb_acct.o pam_smbpass/support.o
diff --git a/net/samba32/files/patch-configure.in b/net/samba32/files/patch-configure.in
new file mode 100644
index 000000000000..c2a185f54ac7
--- /dev/null
+++ b/net/samba32/files/patch-configure.in
@@ -0,0 +1,240 @@
+--- ./configure.in.orig 2008-09-18 06:49:02.000000000 +0000
++++ ./configure.in 2008-10-10 00:42:10.000000000 +0000
+@@ -184,16 +184,6 @@
+ fi
+ fi
+
+-AC_ARG_ENABLE(dmalloc, [AS_HELP_STRING([--enable-dmalloc], [Enable heap debugging [default=no]])])
+-
+-if test "x$enable_dmalloc" = xyes
+-then
+- AC_DEFINE(ENABLE_DMALLOC, 1, [Define to turn on dmalloc debugging])
+- AC_DEFINE(DMALLOC_FUNC_CHECK, 1,
+- [Define to check invariants around some common functions])
+- LIBS="$LIBS -ldmalloc"
+-fi
+-
+ #################################################
+ # check for a shared memory profiling support
+ AC_MSG_CHECKING(whether to use profiling)
+@@ -873,6 +863,21 @@
+ [#include <signal.h>])
+ fi
+
++AC_CACHE_CHECK([for struct sigevent type],samba_cv_struct_sigevent, [
++ AC_TRY_COMPILE([
++#include <sys/types.h>
++#if STDC_HEADERS
++#include <stdlib.h>
++#include <stddef.h>
++#endif
++#include <signal.h>],[struct sigevent s;],
++ samba_cv_struct_sigevent=yes,samba_cv_struct_sigevent=no)])
++if test x"$samba_cv_struct_sigevent" = x"yes"; then
++ AC_DEFINE(HAVE_STRUCT_SIGEVENT,1,[Whether we have the struct sigevent])
++ AC_CHECK_MEMBERS([struct sigevent.sigev_value.sival_ptr,struct sigevent.sigev_value.sigval_ptr], , ,
++ [#include <signal.h>])
++fi
++
+ AC_CACHE_CHECK([for struct timespec type],samba_cv_struct_timespec, [
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+@@ -1038,6 +1043,7 @@
+
+ # Find a method of generating a stack trace
+ AC_CHECK_HEADERS(execinfo.h libexc.h libunwind.h)
++AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
+ AC_CHECK_FUNCS(backtrace_symbols)
+ AC_CHECK_LIB(exc, trace_back_stack)
+
+@@ -1841,9 +1847,6 @@
+ AC_MSG_CHECKING([PICFLAG])
+ AC_MSG_RESULT([$PICFLAG])
+
+-AC_MSG_CHECKING([NSSSONAMEVERSIONSUFFIX])
+-AC_MSG_RESULT([$NSSSONAMEVERSIONSUFFIX])
+-
+ AC_CACHE_CHECK([whether building shared libraries actually works],
+ [ac_cv_shlib_works],[
+ # try building a trivial shared library
+@@ -2282,31 +2285,15 @@
+
+ # This is here to handle -withval stuff for --with-libiconv
+ # Perhaps we should always add a -L
++ LDFLAGS="$save_LDFLAGS -L$i/lib"
+ CPPFLAGS="$save_CPPFLAGS -I$i/include"
+-
+- # Check lib and lib32 library variants to cater for IRIX ABI-specific
+- # installation paths. This gets a little tricky since we might have iconv
+- # in both libiconv and in libc. In this case the jm_ICONV test will always
+- # succeed when the header is found. To counter this, make sure the
+- # library directory is there and check the ABI directory first (which
+- # should be harmless on other systems.
+- # For IA64 HPUX systems, the libs are located in lib/hpux32 instead of lib.
+- for l in "lib32" "lib" "lib/hpux32"; do
+- if test -d "$i/$l" ; then
+- LDFLAGS="$save_LDFLAGS -L$i/$l"
+- LIBS=
+- export LDFLAGS LIBS CPPFLAGS
+- # Try to find iconv(3)
+- jm_ICONV($i/$l)
+- if test x"$ICONV_FOUND" = "xyes" ; then
+- libext="$l"
+- break
+- fi
+- fi
+- done
++ LIBS=
++ export LDFLAGS LIBS CPPFLAGS
++ # Try to find iconv(3)
++ jm_ICONV($i/lib)
+
+ if test x"$ICONV_FOUND" = "xyes" ; then
+- iconv_current_LDFLAGS="-L$i/$libext"
++ iconv_current_LDFLAGS="-L$i/lib"
+ iconv_current_CPPFLAGS="-I$i/include"
+
+ if test x"$jm_cv_lib_iconv" != x; then
+@@ -2315,7 +2302,6 @@
+ # We found iconv in libc.
+ iconv_current_LIBS=""
+ fi
+-
+ fi
+
+ if test x"$ICONV_FOUND" = "xyes" ; then
+@@ -4013,10 +3999,10 @@
+
+ ################################################################
+ # first test for Active Directory support being enabled
+- #if test x"$with_ads_support" = x"no"; then
+- # AC_MSG_ERROR(Active Directory support is required to enable DNS Update support)
+- # with_dnsupdate_support=no
+- #fi
++ if test x"$with_ads_support" = x"no"; then
++ AC_MSG_ERROR(Active Directory support is required to enable DNS Update support)
++ with_dnsupdate_support=no
++ fi
+ ##################################################################
+ # then test for uuid.h (necessary to generate unique DNS keynames
+ # (uuid.h is required for this test)
+@@ -5640,6 +5626,7 @@
+ NSSSONAMEVERSIONSUFFIX=".1"
+ WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_freebsd.o \
+ nsswitch/winbind_nss_linux.o"
++ WINBIND_WINS_NSS_EXTRA_OBJS="nsswitch/wins_freebsd.o"
+ WINBIND_NSS="nsswitch/nss_winbind.$SHLIBEXT"
+ WINBIND_WINS_NSS="nsswitch/nss_wins.$SHLIBEXT"
+ ;;
+@@ -5718,23 +5705,15 @@
+ fi
+
+ # Display test results
+-
+ if test x"$HAVE_WINBIND" = x"no"; then
+ WINBIND_NSS=""
+ WINBIND_WINS_NSS=""
+ fi
+
+-if test x"$enable_developer" = x"yes" -a x"$LINK_LIBWBCLIENT" = x"STATIC" ; then
+- BUILD_LIBWBCLIENT_SHARED=no
+-else
+- BUILD_LIBWBCLIENT_SHARED=yes
+-fi
+-
+ LIBWBCLIENT_SHARED_TARGET=bin/libwbclient.$SHLIBEXT
+ LIBWBCLIENT_STATIC_TARGET=bin/libwbclient.a
+ LIBWBCLIENT_SOVER=0
+ if test $BLDSHARED = true -a x"$HAVE_WINBIND" = x"yes" -a x"$BUILD_LIBWBCLIENT_SHARED" = x"yes"; then
+- NSS_MODULES="${WINBIND_NSS} ${WINBIND_WINS_NSS}"
+ ## Only worry about libwbclient if we have shared library support
+ ## and winbindd
+ LIBWBCLIENT_SHARED=$LIBWBCLIENT_SHARED_TARGET
+@@ -5752,26 +5731,34 @@
+
+ EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/wbinfo\$(EXEEXT)"
+ EXTRA_SBIN_PROGS="$EXTRA_SBIN_PROGS bin/winbindd\$(EXEEXT)"
+- if test $BLDSHARED = true -a x"$create_pam_modules" = x"yes"; then
++ if test $BLDSHARED = true; then
++ NSS_MODULES="${WINBIND_NSS} ${WINBIND_WINS_NSS}"
++ if test x"$create_pam_modules" = x"yes"; then
+ PAM_MODULES="$PAM_MODULES pam_winbind"
+ INSTALL_PAM_MODULES="installpammodules"
+ UNINSTALL_PAM_MODULES="uninstallpammodules"
++ fi
+ fi
+ else
+ AC_MSG_RESULT(no$winbind_no_reason)
+ fi
+
+-AC_CHECK_LIB(pthread, pthread_mutex_lock, [WINBIND_NSS_PTHREAD="-lpthread"
++AC_MSG_CHECKING([NSSSONAMEVERSIONSUFFIX])
++AC_MSG_RESULT([$NSSSONAMEVERSIONSUFFIX])
++
++AC_CHECK_LIB(pthread, pthread_mutex_lock, [WINBIND_NSS_PTHREAD="-pthread"
+ AC_DEFINE(HAVE_PTHREAD, 1, [whether pthread exists])])
+
+ AC_SUBST(WINBIND_NSS_PTHREAD)
+ AC_SUBST(WINBIND_NSS)
+-AC_SUBST(WINBIND_WINS_NSS)
+ AC_SUBST(WINBIND_NSS_LDSHFLAGS)
+ AC_SUBST(WINBIND_NSS_EXTRA_OBJS)
+ AC_SUBST(WINBIND_NSS_EXTRA_LIBS)
+-AC_SUBST(NSSSONAMEVERSIONSUFFIX)
+ AC_SUBST(PAM_WINBIND_EXTRA_LIBS)
++AC_SUBST(WINBIND_WINS_NSS)
++AC_SUBST(WINBIND_WINS_NSS_EXTRA_OBJS)
++AC_SUBST(WINBIND_WINS_NSS_EXTRA_LIBS)
++AC_SUBST(NSSSONAMEVERSIONSUFFIX)
+
+ AC_SUBST(WINBIND_KRB5_LOCATOR)
+
+@@ -5866,7 +5853,7 @@
+ AC_CHECK_FUNCS(DNSServiceRegister)
+ AC_CHECK_LIB_EXT(dns_sd, DNSSD_LIBS, DNSServiceRegister)
+ if test x"$ac_cv_func_DNSServiceRegister" != x"yes" -a \
+- x"$ac_cv_lib_ext_DNSServiceRegister" != x"yes"; then
++ x"$ac_cv_lib_ext_dns_sd_DNSServiceRegister" != x"yes"; then
+ have_dnssd_support=no
+ fi
+
+@@ -5922,13 +5909,21 @@
+ # Start
+ AC_CHECK_FUNC(getmntent)
+
+-AC_CHECK_HEADERS(sys/statfs.h)
++AC_CHECK_HEADERS(sys/statfs.h sys/mount.h)
+
+ AC_MSG_CHECKING([vfs_fileid: checking for statfs() and struct statfs.f_fsid)])
+ AC_CACHE_VAL(vfsfileid_cv_statfs,[
+ AC_TRY_RUN([
+ #include <sys/types.h>
++ #ifdef HAVE_SYS_PARAM_H
++ #include <sys/param.h>
++ #endif
++ #ifdef HAVE_SYS_MOUNT_H
++ #include <sys/mount.h>
++ #endif
++ #ifdef HAVE_SYS_STATFS_H
+ #include <sys/statfs.h>
++ #endif
+ int main(void)
+ {
+ struct statfs fsd;
+@@ -6173,6 +6168,16 @@
+
+ fi
+
++AC_ARG_ENABLE(dmalloc, [AS_HELP_STRING([--enable-dmalloc], [Enable heap debugging [default=no]])])
++
++if test "x$enable_dmalloc" = xyes
++then
++ AC_DEFINE(ENABLE_DMALLOC, 1, [Define to turn on dmalloc debugging])
++ AC_DEFINE(DMALLOC_FUNC_CHECK, 1,
++ [Define to check invariants around some common functions])
++ LIBS="$LIBS -ldmalloc"
++fi
++
+ dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
+ LIB_REMOVE_USR_LIB(LDFLAGS)
+ LIB_REMOVE_USR_LIB(LIBS)
diff --git a/net/samba32/files/patch-include__includes.h b/net/samba32/files/patch-include__includes.h
new file mode 100644
index 000000000000..5b3b649209bd
--- /dev/null
+++ b/net/samba32/files/patch-include__includes.h
@@ -0,0 +1,16 @@
+--- ./include/includes.h.orig 2008-09-18 06:49:02.000000000 +0000
++++ ./include/includes.h 2008-10-10 00:42:10.000000000 +0000
+@@ -207,10 +207,10 @@
+ #undef HAVE_LDAP
+ #endif
+
+-#if HAVE_GSSAPI_H
+-#include <gssapi.h>
+-#elif HAVE_GSSAPI_GSSAPI_H
++#if HAVE_GSSAPI_GSSAPI_H
+ #include <gssapi/gssapi.h>
++#elif HAVE_GSSAPI_H
++#include <gssapi.h>
+ #elif HAVE_GSSAPI_GSSAPI_GENERIC_H
+ #include <gssapi/gssapi_generic.h>
+ #endif
diff --git a/net/samba32/files/patch-lib__iconv.c b/net/samba32/files/patch-lib__iconv.c
new file mode 100644
index 000000000000..a08c2744f60c
--- /dev/null
+++ b/net/samba32/files/patch-lib__iconv.c
@@ -0,0 +1,11 @@
+--- ./lib/iconv.c.orig 2008-09-18 06:49:02.000000000 +0000
++++ ./lib/iconv.c 2008-10-10 00:42:10.000000000 +0000
+@@ -136,7 +136,7 @@
+ char **outbuf, size_t *outbytesleft)
+ {
+ size_t ret = iconv((iconv_t)cd,
+- (char **)inbuf, inbytesleft,
++ inbuf, inbytesleft,
+ outbuf, outbytesleft);
+ if (ret == (size_t)-1) {
+ int saved_errno = errno;
diff --git a/net/samba32/files/patch-lib__replace__libreplace_cc.m4 b/net/samba32/files/patch-lib__replace__libreplace_cc.m4
new file mode 100644
index 000000000000..55e116f8cc89
--- /dev/null
+++ b/net/samba32/files/patch-lib__replace__libreplace_cc.m4
@@ -0,0 +1,13 @@
+--- ./lib/replace/libreplace_cc.m4.orig 2008-09-18 06:49:02.000000000 +0000
++++ ./lib/replace/libreplace_cc.m4 2008-10-10 00:42:10.000000000 +0000
+@@ -145,6 +145,10 @@
+ AC_CHECK_TYPE(uintptr_t, unsigned long long)
+ AC_CHECK_TYPE(ptrdiff_t, unsigned long long)
+
++if test x"$ac_cv_type_intptr_t" = x"yes"; then
++ AC_DEFINE(HAVE_INTPTR_T,1,[Whether the host has intptr_t])
++fi
++
+ if test x"$ac_cv_type_long_long" != x"yes";then
+ AC_MSG_ERROR([LIBREPLACE needs type 'long long'])
+ fi
diff --git a/net/samba32/files/patch-libaddns__dns.h b/net/samba32/files/patch-libaddns__dns.h
new file mode 100644
index 000000000000..d4d2484f5e54
--- /dev/null
+++ b/net/samba32/files/patch-libaddns__dns.h
@@ -0,0 +1,19 @@
+--- ./libaddns/dns.h.orig 2008-10-10 00:47:19.000000000 +0000
++++ ./libaddns/dns.h 2008-10-10 00:47:57.000000000 +0000
+@@ -81,12 +81,12 @@
+ #include <krb5.h>
+ #endif
+
+-#if HAVE_GSSAPI_H
+-#include <gssapi.h>
++#if HAVE_GSSAPI_GSSAPI_GENERIC_H
++#include <gssapi/gssapi_generic.h>
+ #elif HAVE_GSSAPI_GSSAPI_H
+ #include <gssapi/gssapi.h>
+-#elif HAVE_GSSAPI_GSSAPI_GENERIC_H
+-#include <gssapi/gssapi_generic.h>
++#elif HAVE_GSSAPI_H
++#include <gssapi.h>
+ #endif
+
+ #if defined(HAVE_GSSAPI_H) || defined(HAVE_GSSAPI_GSSAPI_H) || defined(HAVE_GSSAPI_GSSAPI_GENERIC_H)
diff --git a/net/samba32/files/patch-m4__aclocal.m4 b/net/samba32/files/patch-m4__aclocal.m4
new file mode 100644
index 000000000000..173f3c611e5e
--- /dev/null
+++ b/net/samba32/files/patch-m4__aclocal.m4
@@ -0,0 +1,161 @@
+--- ./m4/aclocal.m4.orig 2008-09-18 06:49:02.000000000 +0000
++++ ./m4/aclocal.m4 2008-10-10 00:42:10.000000000 +0000
+@@ -416,101 +416,79 @@
+ dnl those with the standalone portable libiconv installed).
+ AC_MSG_CHECKING(for iconv in $1)
+ jm_cv_func_iconv="no"
++ jm_cv_include=""
+ jm_cv_lib_iconv=""
+- jm_cv_giconv=no
++ jm_cv_giconv="no"
+ jm_save_LIBS="$LIBS"
+
+ dnl Check for include in funny place but no lib needed
+ if test "$jm_cv_func_iconv" != yes; then
+ AC_TRY_LINK([#include <stdlib.h>
+ #include <giconv.h>],
+- [iconv_t cd = iconv_open("","");
+- iconv(cd,NULL,NULL,NULL,NULL);
+- iconv_close(cd);],
+- jm_cv_func_iconv=yes
+- jm_cv_include="giconv.h"
+- jm_cv_giconv="yes"
+- jm_cv_lib_iconv="")
++ [iconv_t cd = iconv_open("","");
++ iconv(cd,NULL,NULL,NULL,NULL);
++ iconv_close(cd);],
++ jm_cv_func_iconv=yes
++ jm_cv_include="giconv.h"
++ jm_cv_lib_iconv=""
++ jm_cv_giconv="yes")
+
+ dnl Standard iconv.h include, lib in glibc or libc ...
+ if test "$jm_cv_func_iconv" != yes; then
+- AC_TRY_LINK([#include <stdlib.h>
++ AC_TRY_LINK([#include <stdlib.h>
+ #include <iconv.h>],
+- [iconv_t cd = iconv_open("","");
+- iconv(cd,NULL,NULL,NULL,NULL);
+- iconv_close(cd);],
+- jm_cv_include="iconv.h"
+- jm_cv_func_iconv=yes
+- jm_cv_lib_iconv="")
++ [iconv_t cd = iconv_open("","");
++ iconv(cd,NULL,NULL,NULL,NULL);
++ iconv_close(cd);],
++ jm_cv_func_iconv=yes
++ jm_cv_include="iconv.h"
++ jm_cv_lib_iconv="")
+
+- if test "$jm_cv_lib_iconv" != yes; then
+- jm_save_LIBS="$LIBS"
+- LIBS="$LIBS -lgiconv"
+- AC_TRY_LINK([#include <stdlib.h>
++ if test "$jm_cv_func_iconv" != yes; then
++ jm_save_LIBS="$LIBS"
++ LIBS="$LIBS -lgiconv"
++ AC_TRY_LINK([#include <stdlib.h>
+ #include <giconv.h>],
+- [iconv_t cd = iconv_open("","");
+- iconv(cd,NULL,NULL,NULL,NULL);
+- iconv_close(cd);],
+- jm_cv_lib_iconv=yes
+- jm_cv_func_iconv=yes
+- jm_cv_include="giconv.h"
+- jm_cv_giconv=yes
+- jm_cv_lib_iconv="giconv")
++ [iconv_t cd = iconv_open("","");
++ iconv(cd,NULL,NULL,NULL,NULL);
++ iconv_close(cd);],
++ jm_cv_func_iconv=yes
++ jm_cv_include="giconv.h"
++ jm_cv_lib_iconv="giconv"
++ jm_cv_giconv=yes)
+
+- LIBS="$jm_save_LIBS"
++ LIBS="$jm_save_LIBS"
+
+- if test "$jm_cv_func_iconv" != yes; then
+- jm_save_LIBS="$LIBS"
+- LIBS="$LIBS -liconv"
+- AC_TRY_LINK([#include <stdlib.h>
++ if test "$jm_cv_func_iconv" != yes; then
++ jm_save_LIBS="$LIBS"
++ LIBS="$LIBS -liconv"
++ AC_TRY_LINK([#include <stdlib.h>
+ #include <iconv.h>],
+- [iconv_t cd = iconv_open("","");
+- iconv(cd,NULL,NULL,NULL,NULL);
+- iconv_close(cd);],
+- jm_cv_include="iconv.h"
+- jm_cv_func_iconv=yes
+- jm_cv_lib_iconv="iconv")
+- LIBS="$jm_save_LIBS"
+-
+- if test "$jm_cv_lib_iconv" != yes; then
+- jm_save_LIBS="$LIBS"
+- LIBS="$LIBS -lbiconv"
+- AC_TRY_LINK([#include <stdlib.h>
+-#include <biconv.h>],
+- [iconv_t cd = iconv_open("","");
+- iconv(cd,NULL,NULL,NULL,NULL);
+- iconv_close(cd);],
+- jm_cv_lib_iconv=yes
+- jm_cv_func_iconv=yes
+- jm_cv_include="biconv.h"
+- jm_cv_biconv=yes
+- jm_cv_lib_iconv="biconv")
++ [iconv_t cd = iconv_open("","");
++ iconv(cd,NULL,NULL,NULL,NULL);
++ iconv_close(cd);],
++ jm_cv_func_iconv=yes
++ jm_cv_include="iconv.h"
++ jm_cv_lib_iconv="iconv")
+
+- LIBS="$jm_save_LIBS"
++ LIBS="$jm_save_LIBS"
+ fi
+- fi
++ fi
+ fi
+ fi
+- fi
+- if test "$jm_cv_func_iconv" = yes; then
+- if test "$jm_cv_giconv" = yes; then
+- AC_DEFINE(HAVE_GICONV, 1, [What header to include for iconv() function: giconv.h])
+- AC_MSG_RESULT(yes)
+- ICONV_FOUND=yes
+- else
+- if test "$jm_cv_biconv" = yes; then
+- AC_DEFINE(HAVE_BICONV, 1, [What header to include for iconv() function: biconv.h])
+- AC_MSG_RESULT(yes)
+- ICONV_FOUND=yes
++ if test "$jm_cv_func_iconv" = yes; then
++ if test "$jm_cv_giconv" = yes; then
++ AC_DEFINE(HAVE_GICONV, 1, [What header to include for iconv() function: giconv.h])
++ AC_MSG_RESULT(yes)
++ ICONV_FOUND=yes
+ else
+ AC_DEFINE(HAVE_ICONV, 1, [What header to include for iconv() function: iconv.h])
+ AC_MSG_RESULT(yes)
+ ICONV_FOUND=yes
+ fi
++ else
++ AC_MSG_RESULT(no)
+ fi
+- else
+- AC_MSG_RESULT(no)
+- fi
+ ])
+
+ AC_DEFUN(rjs_CHARSET,[
+@@ -815,6 +793,9 @@
+ #include <fcntl.h>
+ #include <signal.h>
+
++#ifndef SIGRTMIN
++#define SIGRTMIN NSIG
++#endif
+ /* from smbd/notify_kernel.c */
+ #ifndef RT_SIGNAL_NOTIFY
+ #define RT_SIGNAL_NOTIFY (SIGRTMIN+2)
diff --git a/net/samba32/files/patch-nsswitch__pam_winbind.c b/net/samba32/files/patch-nsswitch__pam_winbind.c
new file mode 100644
index 000000000000..be0b470971e7
--- /dev/null
+++ b/net/samba32/files/patch-nsswitch__pam_winbind.c
@@ -0,0 +1,39 @@
+--- ./nsswitch/pam_winbind.c.orig 2008-09-18 06:49:02.000000000 +0000
++++ ./nsswitch/pam_winbind.c 2008-10-10 00:42:10.000000000 +0000
+@@ -39,14 +39,14 @@
+ const void *_item)
+ {
+ const void **item = (const void **)_item;
+- return pam_get_item(pamh, item_type, item);
++ return pam_get_item((pam_handle_t *)pamh, item_type, item);
+ }
+ static int _pam_get_data(const pam_handle_t *pamh,
+ const char *module_data_name,
+ const void *_data)
+ {
+- const void **data = (const void **)_data;
+- return pam_get_data(pamh, module_data_name, data);
++ void **data = (void **)_data;
++ return pam_get_data((pam_handle_t *)pamh, module_data_name, data);
+ }
+
+ /* some syslogging */
+@@ -177,7 +177,7 @@
+ if (item_type != 0) {
+ pam_get_item(ctx->pamh, item_type, &data);
+ } else {
+- pam_get_data(ctx->pamh, key, &data);
++ _pam_get_data(ctx->pamh, key, data);
+ }
+ if (data != NULL) {
+ const char *type = (item_type != 0) ? "ITEM" : "DATA";
+@@ -2203,8 +2203,7 @@
+ ret = PAM_USER_UNKNOWN;
+ goto out;
+ case 0:
+- pam_get_data(pamh, PAM_WINBIND_NEW_AUTHTOK_REQD,
+- (const void **)&tmp);
++ _pam_get_data(pamh, PAM_WINBIND_NEW_AUTHTOK_REQD, tmp);
+ if (tmp != NULL) {
+ ret = atoi((const char *)tmp);
+ switch (ret) {
diff --git a/net/samba32/files/patch-nsswitch__wins_freebsd.c b/net/samba32/files/patch-nsswitch__wins_freebsd.c
new file mode 100644
index 000000000000..d105e18b679d
--- /dev/null
+++ b/net/samba32/files/patch-nsswitch__wins_freebsd.c
@@ -0,0 +1,115 @@
+--- ./nsswitch/wins_freebsd.c.orig 2008-10-10 00:42:10.000000000 +0000
++++ ./nsswitch/wins_freebsd.c 2008-10-10 00:42:10.000000000 +0000
+@@ -0,0 +1,112 @@
++/*
++ Unix SMB/CIFS implementation.
++
++ Copyright (C) Timur I. Bakeyev 2007
++
++ This library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Library General Public
++ License as published by the Free Software Foundation; either
++ version 2 of the License, or (at your option) any later version.
++
++ This library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this library; if not, write to the
++ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ Boston, MA 02111-1307, USA.
++*/
++
++#include "winbind_client.h"
++
++NSS_STATUS _nss_wins_gethostbyname_r(const char *hostname, struct hostent *he,
++ char *buffer, size_t buflen, int *h_errnop);
++NSS_STATUS _nss_wins_gethostbyname2_r(const char *name, int af, struct hostent *he,
++ char *buffer, size_t buflen, int *h_errnop);
++
++NSS_METHOD_PROTOTYPE(__nss_wins_freebsd_gethostbyname_r);
++NSS_METHOD_PROTOTYPE(__nss_wins_freebsd_gethostbyname2_r);
++
++static ns_mtab methods[] =
++{
++/*
++ { NSDB_HOSTS, "getaddrinfo", NULL, NULL },
++ { NSDB_HOSTS, "ghbyname", NULL, NULL },
++ { NSDB_HOSTS, "ghbyaddr", NULL, NULL },
++*/
++ { NSDB_HOSTS, "gethostbyaddr_r", __nss_wins_freebsd_gethostbyname_r, _nss_wins_gethostbyname_r },
++ { NSDB_HOSTS, "gethostbyname2_r", __nss_wins_freebsd_gethostbyname2_r, _nss_wins_gethostbyname2_r },
++/*
++ { NSDB_HOSTS, "getnetbyname_r", NULL, NULL },
++ { NSDB_HOSTS, "getnetbyaddr_r", NULL, NULL },
++ { NSDB_HOSTS, "gethostbyname", NULL, NULL },
++ { NSDB_HOSTS, "gethostbyaddr", NULL, NULL },
++ { NSDB_HOSTS, "getnetbyname", NULL, NULL },
++ { NSDB_HOSTS, "getnetbyaddr", NULL, NULL }
++*/
++};
++
++int
++__nss_wins_freebsd_gethostbyname_r(void *retval, void *mdata, va_list ap)
++{
++ int (*fn)(const char *, struct hostent *, char *, size_t, int *);
++ const char *hostname;
++ struct hostent *he;
++ char *buffer;
++ size_t buflen;
++ int *h_errnop;
++ enum nss_status status;
++
++ fn = mdata;
++ hostname = va_arg(ap, const char *);
++ he = va_arg(ap, struct hostent *);
++ buffer = va_arg(ap, char *);
++ buflen = va_arg(ap, size_t);
++ h_errnop = va_arg(ap, int *);
++
++ status = fn(hostname, he, buffer, buflen, h_errnop);
++ status = __nss_compat_result(status, *h_errnop);
++ if (status == NS_SUCCESS)
++ *(struct hostent **)retval = he;
++
++ return (status);
++}
++
++int
++__nss_wins_freebsd_gethostbyname2_r(void *retval, void *mdata, va_list ap)
++{
++ int (*fn)(const char *, int, struct hostent *, char *, size_t, int *);
++ const char *hostname;
++ int af;
++ struct hostent *he;
++ char *buffer;
++ size_t buflen;
++ int *h_errnop;
++ enum nss_status status;
++
++ fn = mdata;
++ hostname = va_arg(ap, const char *);
++ af = va_arg(ap, int);
++ he = va_arg(ap, struct hostent *);
++ buffer = va_arg(ap, char *);
++ buflen = va_arg(ap, size_t);
++ h_errnop = va_arg(ap, int *);
++
++ status = fn(hostname, af, he, buffer, buflen, h_errnop);
++ status = __nss_compat_result(status, *h_errnop);
++ if (status == NS_SUCCESS)
++ *(struct hostent **)retval = he;
++
++ return (status);
++}
++
++ns_mtab *
++nss_module_register(const char *source __unused, unsigned int *mtabsize,
++ nss_module_unregister_fn *unreg)
++{
++ *mtabsize = sizeof(methods) / sizeof(methods[0]);
++ *unreg = NULL;
++ return (methods);
++}
diff --git a/net/samba32/files/patch-smbd__quotas.c b/net/samba32/files/patch-smbd__quotas.c
new file mode 100644
index 000000000000..297ee470c73a
--- /dev/null
+++ b/net/samba32/files/patch-smbd__quotas.c
@@ -0,0 +1,20 @@
+--- ./smbd/quotas.c.orig 2008-10-10 00:48:11.000000000 +0000
++++ ./smbd/quotas.c 2008-10-10 00:48:41.000000000 +0000
+@@ -1023,6 +1023,8 @@
+ enum clnt_stat clnt_stat;
+ bool ret = True;
+
++ memset(&D, 0, sizeof(D));
++
+ *bsize = *dfree = *dsize = (SMB_BIG_UINT)0;
+
+ len=strcspn(mnttype, ":");
+@@ -1039,7 +1041,7 @@
+ args.gqa_pathp = testpath+1;
+ args.gqa_uid = uid;
+
+- DEBUG(5,("nfs_quotas: Asking for host \"%s\" rpcprog \"%i\" rpcvers \"%i\" network \"%s\"\n", host, RQUOTAPROG, RQUOTAVERS, "udp"));
++ DEBUG(5,("nfs_quotas: Asking for host \"%s\" rpcprog \"%lu\" rpcvers \"%lu\" network \"%s\"\n", host, RQUOTAPROG, RQUOTAVERS, "udp"));
+
+ if ((clnt = clnt_create(host, RQUOTAPROG, RQUOTAVERS, "udp")) == NULL) {
+ ret = False;
diff --git a/net/samba32/files/patch-smbd__statvfs.c b/net/samba32/files/patch-smbd__statvfs.c
new file mode 100644
index 000000000000..3202ebb8bd10
--- /dev/null
+++ b/net/samba32/files/patch-smbd__statvfs.c
@@ -0,0 +1,64 @@
+--- ./smbd/statvfs.c.orig 2008-09-18 06:49:02.000000000 +0000
++++ ./smbd/statvfs.c 2008-10-10 00:42:10.000000000 +0000
+@@ -3,6 +3,7 @@
+ VFS API's statvfs abstraction
+ Copyright (C) Alexander Bokovoy 2005
+ Copyright (C) Steve French 2005
++ Copyright (C) Timur I. Bakeyev 2005
+ Copyright (C) James Peach 2006
+
+ This program is free software; you can redistribute it and/or modify
+@@ -47,9 +48,42 @@
+ }
+ return result;
+ }
+-#endif
++#elif defined(FREEBSD)
++static int bsd_statvfs(const char *path, vfs_statvfs_struct *statbuf)
++{
++ struct statfs statfs_buf;
++ int result;
+
+-#if defined(DARWINOS)
++ result = statfs(path, &statfs_buf);
++ if(result != 0) {
++ return result;
++ }
++
++ statbuf->OptimalTransferSize = statfs_buf.f_iosize;
++ statbuf->BlockSize = statfs_buf.f_bsize;
++ statbuf->TotalBlocks = statfs_buf.f_blocks;
++ statbuf->BlocksAvail = statfs_buf.f_bfree;
++ statbuf->UserBlocksAvail = statfs_buf.f_bavail;
++ statbuf->TotalFileNodes = statfs_buf.f_files;
++ statbuf->FreeFileNodes = statfs_buf.f_ffree;
++ statbuf->FsIdentifier =
++ (((SMB_BIG_UINT)statfs_buf.f_fsid.val[0]<<32) & 0xffffffff00000000LL) | (SMB_BIG_UINT)statfs_buf.f_fsid.val[1];
++ /* Try to extrapolate some of the fs flags into the
++ * capabilities
++ */
++ statbuf->FsCapabilities =
++ FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
++ if(statfs_buf.f_flags & MNT_ACLS)
++ statbuf->FsCapabilities |= FILE_PERSISTENT_ACLS;
++ if(statfs_buf.f_flags & MNT_QUOTA)
++ statbuf->FsCapabilities |= FILE_VOLUME_QUOTAS;
++ if(statfs_buf.f_flags & MNT_RDONLY)
++ statbuf->FsCapabilities |= FILE_READ_ONLY_VOLUME;
++
++ return 0;
++}
++
++#elif defined(DARWINOS)
+
+ #include <sys/attr.h>
+
+@@ -135,6 +169,8 @@
+ {
+ #if defined(LINUX) && defined(HAVE_FSID_INT)
+ return linux_statvfs(path, statbuf);
++#elif defined(FREEBSD)
++ return bsd_statvfs(path, statbuf);
+ #elif defined(DARWINOS)
+ return darwin_statvfs(path, statbuf);
+ #else
diff --git a/net/samba32/files/patch-utils__net_time.c b/net/samba32/files/patch-utils__net_time.c
new file mode 100644
index 000000000000..1cc240ce820f
--- /dev/null
+++ b/net/samba32/files/patch-utils__net_time.c
@@ -0,0 +1,18 @@
+--- ./utils/net_time.c.orig 2008-09-18 06:49:02.000000000 +0000
++++ ./utils/net_time.c 2008-10-10 00:42:10.000000000 +0000
+@@ -84,9 +84,15 @@
+ return "unknown";
+ }
+
++#if defined(FREEBSD)
++ fstr_sprintf(s, "%02d%02d%02d%02d%02d.%02d",
++ tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,
++ tm->tm_hour,tm->tm_min,tm->tm_sec);
++#else
+ fstr_sprintf(s, "%02d%02d%02d%02d%04d.%02d",
+ tm->tm_mon+1, tm->tm_mday, tm->tm_hour,
+ tm->tm_min, tm->tm_year + 1900, tm->tm_sec);
++#endif /* !FREEBSD */
+ return s;
+ }
+
diff --git a/net/samba32/files/pkg-deinstall.in b/net/samba32/files/pkg-deinstall.in
new file mode 100644
index 000000000000..e881cdc438d2
--- /dev/null
+++ b/net/samba32/files/pkg-deinstall.in
@@ -0,0 +1,44 @@
+#! /bin/sh
+#
+PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
+
+SAMBA_CONFIG="%%SAMBA_CONFIG%%"
+SAMBA_CONFDIR="%%SAMBA_CONFDIR%%"
+SAMBA_SPOOL="%%SAMBA_SPOOL%%"
+SAMBA_LOGDIR="%%SAMBA_LOGDIR%%"
+SAMBA_LOCKDIR="%%SAMBA_LOCKDIR%%"
+SAMBA_PRIVATEDIR="%%SAMBA_PRIVATEDIR%%"
+SAMBA_OWNER=root
+SAMBA_GROUP=wheel
+CMP="cmp"
+RM="rm"
+RMDIR="rmdir"
+ECHO_CMD="echo"
+
+post-deinstall() {
+ if ${CMP} -s ${SAMBA_CONFDIR}/${SAMBA_CONFIG} ${SAMBA_CONFDIR}/${SAMBA_CONFIG}.sample; then
+ ${RM} -f ${SAMBA_CONFDIR}/${SAMBA_CONFIG}
+ fi
+ ${RM} -f ${SAMBA_CONFDIR}/${SAMBA_CONFIG}.sample
+ ${RM} -rf ${SAMBA_SPOOL}
+ ${RMDIR} ${SAMBA_LOGDIR} 2>/dev/null || true
+ for f in connections.tdb locking.tdb messages.tdb sessionid.tdb \
+ unexpected.tdb brlock.tdb namelist.debug
+ do
+ ${RM} -f "${SAMBA_LOCKDIR}/${f}"
+ done
+ ${RMDIR} ${SAMBA_LOCKDIR} 2>/dev/null || true
+ ${RMDIR} ${SAMBA_PRIVATEDIR} 2>/dev/null || true
+ ${ECHO_CMD} "WARNING: If you will *NOT* use this package anymore, please remove the"
+ ${ECHO_CMD} " following directories manually:"
+ ${ECHO_CMD} " ${SAMBA_PRIVATEDIR}"
+ ${ECHO_CMD} " ${SAMBA_LOGDIR}"
+ ${ECHO_CMD} " ${SAMBA_LOCKDIR}"
+ ${ECHO_CMD}
+}
+
+case $2 in
+ POST-DEINSTALL)
+ post-deinstall
+ ;;
+esac
diff --git a/net/samba32/files/pkg-install.in b/net/samba32/files/pkg-install.in
new file mode 100644
index 000000000000..4272647e0b45
--- /dev/null
+++ b/net/samba32/files/pkg-install.in
@@ -0,0 +1,41 @@
+#! /bin/sh
+#
+PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
+
+EXAMPLESDIR="%%EXAMPLESDIR%%"
+SAMBA_CONFIG="%%SAMBA_CONFIG%%"
+SAMBA_CONFDIR="%%SAMBA_CONFDIR%%"
+SAMBA_SPOOL="%%SAMBA_SPOOL%%"
+SAMBA_LOGDIR="%%SAMBA_LOGDIR%%"
+SAMBA_LOCKDIR="%%SAMBA_LOCKDIR%%"
+SAMBA_PRIVATEDIR="%%SAMBA_PRIVATEDIR%%"
+SAMBA_OWNER=root
+SAMBA_GROUP=wheel
+INSTALL_DATA="install -c -m 0444"
+MKDIR="mkdir -p"
+CHMOD="chmod"
+CHOWN="chown"
+
+post-install() {
+ ${MKDIR} ${SAMBA_SPOOL} && ${CHMOD} 1777 ${SAMBA_SPOOL}
+ ${MKDIR} ${SAMBA_LOGDIR} && ${CHMOD} 0755 ${SAMBA_LOGDIR}
+ ${MKDIR} ${SAMBA_LOCKDIR} && ${CHMOD} 0755 ${SAMBA_LOCKDIR}
+ ${MKDIR} ${SAMBA_PRIVATEDIR} && ${CHMOD} 0700 ${SAMBA_PRIVATEDIR}
+ if [ $(id -u) -eq 0 ]; then
+ INSTALL_DATA="${INSTALL_DATA} -o ${SAMBA_OWNER} -g ${SAMBA_GROUP}"
+ ${CHOWN} ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_SPOOL}
+ ${CHOWN} ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_LOGDIR}
+ ${CHOWN} ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_LOCKDIR}
+ ${CHOWN} ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_PRIVATEDIR}
+ fi
+ ${INSTALL_DATA} ${EXAMPLESDIR}/${SAMBA_CONFIG}.sample ${SAMBA_CONFDIR}
+ if [ ! -f ${SAMBA_CONFDIR}/${SAMBA_CONFIG} ]; then
+ ${INSTALL_DATA} ${EXAMPLESDIR}/${SAMBA_CONFIG}.sample ${SAMBA_CONFDIR}/${SAMBA_CONFIG}
+ fi
+}
+
+case $2 in
+ POST-INSTALL)
+ post-install
+ ;;
+esac
diff --git a/net/samba32/files/pkg-message.in b/net/samba32/files/pkg-message.in
new file mode 100644
index 000000000000..e0f463aacaa3
--- /dev/null
+++ b/net/samba32/files/pkg-message.in
@@ -0,0 +1,7 @@
+===============================================================================
+Samba3 *package* now doesn't include ADS support due the portability problems
+with Kerberos5 libraries on different installations. You need to compile port
+yourself to get this functionality.
+
+For additional hints and directions, please, look into the README.FreeBSD file.
+===============================================================================
diff --git a/net/samba32/files/samba.in b/net/samba32/files/samba.in
new file mode 100644
index 000000000000..753507e69223
--- /dev/null
+++ b/net/samba32/files/samba.in
@@ -0,0 +1,162 @@
+#!/bin/sh
+#
+# $FreeBSD: /tmp/pcvs/ports/net/samba32/files/Attic/samba.in,v 1.1 2008-10-12 01:37:46 timur Exp $
+#
+
+# PROVIDE: nmbd smbd
+%%WINBIND%%# PROVIDE: winbindd
+# REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv
+%%CUPS%%# REQUIRE: cupsd
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+#samba_enable="YES"
+# or, for fine grain control:
+#nmbd_enable="YES"
+#smbd_enable="YES"
+%%WINBIND%%# You need to enable winbindd separately, by adding:
+%%WINBIND%%#winbindd_enable="YES"
+#
+# Configuration file can be set with:
+#samba_config="%%SAMBA_CONFDIR%%/%%SAMBA_CONFIG%%"
+#
+
+. %%RC_SUBR%%
+
+name="samba"
+rcvar=$(set_rcvar)
+
+load_rc_config "${name}"
+# Custom commands
+extra_commands="reload status"
+start_precmd="samba_start_precmd"
+start_cmd="samba_cmd"
+stop_cmd="samba_cmd"
+status_cmd="samba_cmd"
+restart_precmd="samba_checkconfig"
+reload_precmd="samba_checkconfig"
+reload_cmd="samba_reload_cmd"
+rcvar_cmd="samba_rcvar_cmd"
+# Defaults
+samba_enable=${samba_enable:=NO}
+samba_config_default="%%SAMBA_CONFDIR%%/%%SAMBA_CONFIG%%"
+samba_config=${samba_config="${samba_config_default}"}
+command_args=${samba_config:+-s "${samba_config}"}
+samba_daemons="nmbd smbd"
+%%WINBIND%%samba_daemons="${samba_daemons} winbindd"
+testparm_command="%%PREFIX%%/bin/testparm"
+smbcontrol_command="%%PREFIX%%/bin/smbcontrol"
+# Fetch parameters from configuration file
+samba_parm="${testparm_command} -s -v --parameter-name"
+%%WINBIND%%samba_idmap=$(${samba_parm} 'idmap uid' "${samba_config}" 2>/dev/null)
+samba_lockdir=$(${samba_parm} 'lock directory' "${samba_config}" 2>/dev/null)
+# Setup dependent variables
+if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then
+ nmbd_enable=${nmbd_enable=YES}
+ smbd_enable=${smbd_enable=YES}
+%%WINBIND%% # Check that winbindd is actually configured
+%%WINBIND%% if [ -n "${samba_idmap}" ]; then
+%%WINBIND%% winbindd_enable=${winbindd_enable=YES}
+%%WINBIND%% fi
+fi
+# Hack to work around name change of pid file with non-default config
+pid_extra=
+if [ -n "${samba_config}" -a "${samba_config}" != "${samba_config_default}" ]; then
+ pid_extra="-$(basename "${samba_config}")"
+fi
+# Hack to enable check of dependent variables
+eval real_${rcvar}="\${${rcvar}:=NO}" ${rcvar}=YES
+# Defaults for dependent variables
+nmbd_enable=${nmbd_enable:=NO}
+nmbd_flags=${nmbd_flags="-D"}
+smbd_enable=${smbd_enable:=NO}
+smbd_flags=${smbd_flags="-D"}
+%%WINBIND%%winbindd_enable=${winbindd_enable:=NO}
+%%WINBIND%%winbindd_flags=${winbindd_flags=''}
+# Requirements
+required_files="${samba_config}"
+required_dirs="${samba_lockdir}"
+samba_checkconfig() {
+ echo -n "Performing sanity check on Samba configuration: "
+ if ${testparm_command} -s ${samba_config:+"${samba_config}"} >/dev/null 2>&1; then
+ echo "OK"
+ else
+ echo "FAILED"
+ return 1
+ fi
+}
+
+samba_start_precmd() {
+ # XXX: Never delete winbindd_idmap, winbindd_cache and group_mapping
+ if [ -n "${samba_lockdir}" -a -d "${samba_lockdir}" ]; then
+ echo -n "Removing stale Samba tdb files: "
+ for file in brlock.tdb browse.dat connections.tdb gencache.tdb \
+ locking.tdb messages.tdb namelist.debug sessionid.tdb \
+ unexpected.tdb
+ do
+ rm "${samba_lockdir}/${file}" </dev/null 2>/dev/null && echo -n '.'
+ done
+ echo " done"
+ fi
+}
+
+samba_rcvar_cmd() {
+ # Prevent recursive calling
+ unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd"
+ # Check master variable
+ echo "# ${name}"
+ if [ -n "${rcvar}" ]; then
+ # Use original configured value
+ if checkyesno "real_${rcvar}"; then
+ echo "\$${rcvar}=YES"
+ else
+ echo "\$${rcvar}=NO"
+ fi
+ fi
+ # Check dependent variables
+ samba_cmd "${_rc_prefix}${rc_arg}" ${rc_extra_args}
+}
+
+samba_reload_cmd() {
+ local name rcvar command pidfile
+ # Prevent recursive calling
+ unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd"
+ # Apply to all daemons
+ for name in ${samba_daemons}; do
+ rcvar=$(set_rcvar)
+ command="%%PREFIX%%/sbin/${name}"
+ pidfile="%%SAMBA_RUNDIR%%/${name}${pid_extra}.pid"
+ # Daemon should be enabled and running
+ if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then
+ if [ -n "$(check_pidfile "${pidfile}" "${command}")" ]; then
+ debug "reloading ${name} configuration"
+ echo "Reloading ${name}."
+ # XXX: Hack with pid_extra
+ ${smbcontrol_command} "${name}${pid_extra}" 'reload-config' ${command_args} >/dev/null 2>&1
+ fi
+ fi
+ done
+}
+
+samba_cmd() {
+ local name rcvar command pidfile samba_daemons
+ # Prevent recursive calling
+ unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd"
+ # Stop processes in the reverse to order
+ if [ "${rc_arg}" = "stop" ] ; then
+ samba_daemons=$(reverse_list ${samba_daemons})
+ fi
+ # Apply to all daemons
+ for name in ${samba_daemons}; do
+ rcvar=$(set_rcvar)
+ command="%%PREFIX%%/sbin/${name}"
+ pidfile="%%SAMBA_RUNDIR%%/${name}${pid_extra}.pid"
+
+ run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args}
+ done
+}
+
+run_rc_command "$1"
diff --git a/net/samba32/files/smb.conf.sample.in b/net/samba32/files/smb.conf.sample.in
new file mode 100644
index 000000000000..b55405bd56b4
--- /dev/null
+++ b/net/samba32/files/smb.conf.sample.in
@@ -0,0 +1,291 @@
+# This is the main Samba configuration file. You should read the
+# smb.conf(5) manual page in order to understand the options listed
+# here. Samba has a huge number of configurable options (perhaps too
+# many!) most of which are not shown in this example
+#
+# For a step to step guide on installing, configuring and using samba,
+# read the Samba-HOWTO-Collection. This may be obtained from:
+# http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
+#
+# Many working examples of smb.conf files can be found in the
+# Samba-Guide which is generated daily and can be downloaded from:
+# http://www.samba.org/samba/docs/Samba-Guide.pdf
+#
+# Any line which starts with a ; (semi-colon) or a # (hash)
+# is a comment and is ignored. In this example we will use a #
+# for commentry and a ; for parts of the config file that you
+# may wish to enable
+#
+# NOTE: Whenever you modify this file you should run the command "testparm"
+# to check that you have not made any basic syntactic errors.
+#
+#======================= Global Settings =====================================
+[global]
+
+# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
+ workgroup = MYGROUP
+
+# server string is the equivalent of the NT Description field
+ server string = Samba Server
+
+# Security mode. Defines in which mode Samba will operate. Possible
+# values are share, user, server, domain and ads. Most people will want
+# user level security. See the Samba-HOWTO-Collection for details.
+ security = user
+
+# This option is important for security. It allows you to restrict
+# connections to machines which are on your local network. The
+# following example restricts access to two C class networks and
+# the "loopback" interface. For more examples of the syntax see
+# the smb.conf man page
+; hosts allow = 192.168.1. 192.168.2. 127.
+
+# If you want to automatically load your printer list rather
+# than setting them up individually then you'll need this
+ load printers = yes
+
+# you may wish to override the location of the printcap file
+; printcap name = /etc/printcap
+
+# on SystemV system setting printcap name to lpstat should allow
+# you to automatically obtain a printer list from the SystemV spool
+# system
+; printcap name = lpstat
+
+# It should not be necessary to specify the print system type unless
+# it is non-standard. Currently supported print systems include:
+# bsd, cups, sysv, plp, lprng, aix, hpux, qnx
+; printing = cups
+
+# Uncomment this if you want a guest account, you must add this to /etc/passwd
+# otherwise the user "nobody" is used
+; guest account = pcguest
+
+# this tells Samba to use a separate log file for each machine
+# that connects
+ log file = %%SAMBA_LOGDIR%%/log.%m
+
+# Put a capping on the size of the log files (in Kb).
+ max log size = 50
+
+# Use password server option only with security = server
+# The argument list may include:
+# password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
+# or to auto-locate the domain controller/s
+# password server = *
+; password server = <NT-Server-Name>
+
+# Use the realm option only with security = ads
+# Specifies the Active Directory realm the host is part of
+; realm = MY_REALM
+
+# Backend to store user information in. New installations should
+# use either tdbsam or ldapsam. smbpasswd is available for backwards
+# compatibility. tdbsam requires no further configuration.
+; passdb backend = tdbsam
+
+# Using the following line enables you to customise your configuration
+# on a per machine basis. The %m gets replaced with the netbios name
+# of the machine that is connecting.
+# Note: Consider carefully the location in the configuration file of
+# this line. The included file is read at that point.
+; include = %%SAMBA_CONFDIR%%/smb.conf.%m
+
+# Most people will find that this option gives better performance.
+# See the chapter 'Samba performance issues' in the Samba HOWTO Collection
+# and the manual pages for details.
+# You may want to add the following on a Linux system:
+; socket options = SO_RCVBUF=8192 SO_SNDBUF=8192
+
+# Configure Samba to use multiple interfaces
+# If you have multiple network interfaces then you must list them
+# here. See the man page for details.
+; interfaces = 192.168.12.2/24 192.168.13.2/24
+
+# Browser Control Options:
+# set local master to no if you don't want Samba to become a master
+# browser on your network. Otherwise the normal election rules apply
+; local master = no
+
+# OS Level determines the precedence of this server in master browser
+# elections. The default value should be reasonable
+; os level = 33
+
+# Domain Master specifies Samba to be the Domain Master Browser. This
+# allows Samba to collate browse lists between subnets. Don't use this
+# if you already have a Windows NT domain controller doing this job
+; domain master = yes
+
+# Preferred Master causes Samba to force a local browser election on startup
+# and gives it a slightly higher chance of winning the election
+; preferred master = yes
+
+# Enable this if you want Samba to be a domain logon server for
+# Windows95 workstations.
+; domain logons = yes
+
+# if you enable domain logons then you may want a per-machine or
+# per user logon script
+# run a specific logon batch file per workstation (machine)
+; logon script = %m.bat
+# run a specific logon batch file per username
+; logon script = %U.bat
+
+# Where to store roving profiles (only for Win95 and WinNT)
+# %L substitutes for this servers netbios name, %U is username
+# You must uncomment the [Profiles] share below
+; logon path = \\%L\Profiles\%U
+
+# Windows Internet Name Serving Support Section:
+# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
+; wins support = yes
+
+# WINS Server - Tells the NMBD components of Samba to be a WINS Client
+# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
+; wins server = w.x.y.z
+
+# WINS Proxy - Tells Samba to answer name resolution queries on
+# behalf of a non WINS capable client, for this to work there must be
+# at least one WINS Server on the network. The default is NO.
+; wins proxy = yes
+
+# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
+# via DNS nslookups. The default is NO.
+ dns proxy = no
+
+# Charset settings
+; display charset = koi8-r
+; unix charset = koi8-r
+; dos charset = cp866
+
+# Use extended attributes to store file modes
+; store dos attributes = yes
+; map hidden = no
+; map system = no
+; map archive = no
+
+# Use inherited ACLs for directories
+; nt acl support = yes
+; inherit acls = yes
+; map acl inherit = yes
+
+# These scripts are used on a domain controller or stand-alone
+# machine to add or delete corresponding unix accounts
+; add user script = /usr/sbin/useradd %u
+; add group script = /usr/sbin/groupadd %g
+; add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
+; delete user script = /usr/sbin/userdel %u
+; delete user from group script = /usr/sbin/deluser %u %g
+; delete group script = /usr/sbin/groupdel %g
+
+
+#============================ Share Definitions ==============================
+[homes]
+ comment = Home Directories
+ browseable = no
+ writable = yes
+
+# Un-comment the following and create the netlogon directory for Domain Logons
+; [netlogon]
+; comment = Network Logon Service
+; path = /usr/local/samba/lib/netlogon
+; guest ok = yes
+; writable = no
+; share modes = no
+
+
+# Un-comment the following to provide a specific roving profile share
+# the default is to use the user's home directory
+;[Profiles]
+; path = /usr/local/samba/profiles
+; browseable = no
+; guest ok = yes
+
+
+# NOTE: If you have a BSD-style print system there is no need to
+# specifically define each individual printer
+[printers]
+ comment = All Printers
+ path = %%SAMBA_SPOOL%%
+ browseable = no
+# Set public = yes to allow user 'guest account' to print
+ guest ok = no
+ writable = no
+ printable = yes
+
+# This one is useful for people to share files
+;[tmp]
+; comment = Temporary file space
+; path = /tmp
+; read only = no
+; public = yes
+
+# A publicly accessible directory, but read only, except for people in
+# the "staff" group
+;[public]
+; comment = Public Stuff
+; path = /home/samba
+; public = yes
+; writable = yes
+; printable = no
+; write list = @staff
+
+# Other examples.
+#
+# A private printer, usable only by fred. Spool data will be placed in fred's
+# home directory. Note that fred must have write access to the spool directory,
+# wherever it is.
+;[fredsprn]
+; comment = Fred's Printer
+; valid users = fred
+; path = /homes/fred
+; printer = freds_printer
+; public = no
+; writable = no
+; printable = yes
+
+# A private directory, usable only by fred. Note that fred requires write
+# access to the directory.
+;[fredsdir]
+; comment = Fred's Service
+; path = /usr/somewhere/private
+; valid users = fred
+; public = no
+; writable = yes
+; printable = no
+
+# a service which has a different directory for each machine that connects
+# this allows you to tailor configurations to incoming machines. You could
+# also use the %U option to tailor it by user name.
+# The %m gets replaced with the machine name that is connecting.
+;[pchome]
+; comment = PC Directories
+; path = /usr/pc/%m
+; public = no
+; writable = yes
+
+# A publicly accessible directory, read/write to all users. Note that all files
+# created in the directory by users will be owned by the default user, so
+# any user with access can delete any other user's files. Obviously this
+# directory must be writable by the default user. Another user could of course
+# be specified, in which case all files would be owned by that user instead.
+;[public]
+; path = /usr/somewhere/else/public
+; public = yes
+; only guest = yes
+; writable = yes
+; printable = no
+
+# The following two entries demonstrate how to share a directory so that two
+# users can place files there that will be owned by the specific users. In this
+# setup, the directory should be writable by both users and should have the
+# sticky bit set on it to prevent abuse. Obviously this could be extended to
+# as many users as required.
+;[myshare]
+; comment = Mary's and Fred's stuff
+; path = /usr/somewhere/shared
+; valid users = mary fred
+; public = no
+; writable = yes
+; printable = no
+; create mask = 0765