ports/185721: I have updated net/samba4 to version 4.1.4
Douglas Carmichael
dcarmich at dcarmichael.net
Sun Jan 12 19:00:01 UTC 2014
>Number: 185721
>Category: ports
>Synopsis: I have updated net/samba4 to version 4.1.4
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sun Jan 12 19:00:01 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator: Douglas Carmichael
>Release: 9.2-RELEASE
>Organization:
n/a
>Environment:
n/a
>Description:
I have updated net/samba4 to version 4.1.4.
A patch is attached.
(Note: Samba 4.1.4 does not link properly with another Samba 4.1.x version installed, so I had to deinstall Samba 4.1.3 to make 4.1.4 install properly.)
>How-To-Repeat:
n/a
>Fix:
n/a
Patch attached with submission follows:
diff -ruN samba4.orig/Makefile samba4/Makefile
--- samba4.orig/Makefile 2013-12-17 01:39:55.000000000 -0600
+++ samba4/Makefile 2014-01-12 11:29:55.000000000 -0600
@@ -18,7 +18,7 @@
SAMBA4_BASENAME= samba
SAMBA4_PORTNAME= ${SAMBA4_BASENAME}4
-SAMBA4_VERSION= 4.0.13
+SAMBA4_VERSION= 4.1.4
SAMBA4_DISTNAME= ${SAMBA4_BASENAME}-${SAMBA4_VERSION:S|.p|pre|:S|.r|rc|:S|.t|tp|:S|.a|alpha|}
WRKSRC?= ${WRKDIR}/${DISTNAME}
@@ -116,7 +116,7 @@
# Options
OPTIONS_DEFINE= ACL_SUPPORT ADS AIO_SUPPORT CUPS DEBUG \
DNSUPDATE FAM_SUPPORT LDAP PAM_SMBPASS \
- PTHREADPOOL QUOTAS SWAT SYSLOG UTMP WINBIND
+ PTHREADPOOL QUOTAS SYSLOG UTMP WINBIND
OPTIONS_DEFAULT:= ${OPTIONS_DEFINE}
@@ -130,7 +130,6 @@
PAM_SMBPASS_DESC= PAM authentication via passdb backends
PTHREADPOOL_DESC= Pthread pool
QUOTAS_DESC= Disk quota support
-SWAT_DESC= SWAT WebGUI
UTMP_DESC= UTMP accounting support
WINBIND_DESC= WinBIND support
##############################################################################
@@ -147,7 +146,7 @@
OPTIONS_DEFAULT+= NSUPDATE
OPTIONS_RADIO= ZEROCONF
-OPTIONS_RADIO_ZEROCONF= AVAHI MDNSRESPONDER
+OPTIONS_RADIO_ZEROCONF= AVAHI
OPTIONS_DEFAULT+= AVAHI
.include <bsd.port.options.mk>
@@ -265,13 +264,6 @@
CONFIGURE_ARGS+= --disable-avahi
.endif
-.if ${PORT_OPTIONS:MMDNSRESPONDER}
-LIB_DEPENDS+= libdns_sd.so:${PORTSDIR}/net/mDNSResponder
-CONFIGURE_ARGS+= --enable-dnssd
-.else
-CONFIGURE_ARGS+= --disable-dnssd
-.endif
-
.if ${PORT_OPTIONS:MCUPS}
LIB_DEPENDS+= libcups.so:${PORTSDIR}/print/cups-client
CONFIGURE_ARGS+= --enable-cups --enable-iprint
@@ -327,14 +319,6 @@
CONFIGURE_ARGS+= --without-syslog
.endif
-.if ${PORT_OPTIONS:MSWAT}
-CONFIGURE_ARGS+= --with-swat
-PLIST_SUB+= SWAT=""
-.else
-CONFIGURE_ARGS+= --without-swat
-PLIST_SUB+= SWAT="@comment "
-.endif
-
.if ${PORT_OPTIONS:MUTMP}
CONFIGURE_ARGS+= --with-utmp
.else
@@ -344,9 +328,11 @@
.if ${PORT_OPTIONS:MWINBIND}
CONFIGURE_ARGS+= --with-winbind
PLIST_SUB+= WINBIND=""
+SUB_LIST+= WINBIND=""
.else
CONFIGURE_ARGS+= --without-winbind
PLIST_SUB+= WINBIND="@comment "
+SUB_LIST+= WINBIND="@comment "
.endif
.if defined(SAMBA4_WANT_ADS)
@@ -467,8 +453,7 @@
@${REINPLACE_CMD} -e 's|%%GDB_CMD%%|${GDB_CMD}|g' \
${PATCH_WRKSRC}/buildtools/scripts/abi_gen.sh
@${REINPLACE_CMD} -e 's|%%SAMBA4_CONFIG%%|${SAMBA4_CONFIG}|g' \
- ${PATCH_WRKSRC}/dynconfig/wscript \
- ${PATCH_WRKSRC}/dynconfig/config.m4
+ ${PATCH_WRKSRC}/dynconfig/wscript
# Make sure that the right version of Python is used by the tools
# https://bugzilla.samba.org/show_bug.cgi?id=7305
@for f in ${PATCH_WRKSRC}/source4/scripting/bin/* ${WRKSRC}/${WAF_TOOL}; do \
diff -ruN samba4.orig/distinfo samba4/distinfo
--- samba4.orig/distinfo 2013-12-17 01:39:55.000000000 -0600
+++ samba4/distinfo 2014-01-12 11:29:58.000000000 -0600
@@ -1,2 +1,2 @@
-SHA256 (samba-4.0.13.tar.gz) = cb970bb016fd6403a31a2002b8db57f9201c6333feaafcc6b689eb5bd24174ac
-SIZE (samba-4.0.13.tar.gz) = 22105105
+SHA256 (samba-4.1.4.tar.gz) = 1733e1aaa37b4fcb0fc781b07fc6f20831023ce971d8bcd97940c3fbe35766a7
+SIZE (samba-4.1.4.tar.gz) = 23169480
diff -ruN samba4.orig/files/patch-dynconfig__config.m4 samba4/files/patch-dynconfig__config.m4
--- samba4.orig/files/patch-dynconfig__config.m4 2013-12-17 01:39:55.000000000 -0600
+++ samba4/files/patch-dynconfig__config.m4 1969-12-31 18:00:00.000000000 -0600
@@ -1,34 +0,0 @@
---- ./dynconfig/config.m4.orig 2012-10-02 08:38:44.000000000 +0000
-+++ ./dynconfig/config.m4 2013-01-27 07:13:46.156404375 +0000
-@@ -60,6 +60,22 @@
- PRIVILEGED_SOCKET_DIR="\${localstatedir}/lib/samba"
- fi
-
-+AC_ARG_WITH(pkgconfigdir,
-+[AS_HELP_STRING([--with-pkgconfigdir=DIR],
-+ [Which directory to use for .pc files ($libdir/pkgconfig)])],
-+[ case "$withval" in
-+ yes|no)
-+ #
-+ # Just in case anybody calls it without argument
-+ #
-+ AC_MSG_WARN([--with-pkgconfigdir called without argument - will use default])
-+ ;;
-+ * )
-+ PKGCONFIGDIR="$withval"
-+ ;;
-+ esac])
-+
-+
- AC_ARG_WITH(modulesdir,
- [AS_HELP_STRING([--with-modulesdir=DIR],
- [Which directory to use for modules ($exec_prefix/modules)])],
-@@ -261,7 +277,7 @@
- NMBDSOCKETDIR="${SOCKET_DIR}/nmbd"
- NTP_SIGND_SOCKET_DIR="${SOCKET_DIR}/ntp_signd"
- NCALRPCDIR="${SOCKET_DIR}/ncalrpc"
--CONFIGFILE="${CONFIGDIR}/smb.conf"
-+CONFIGFILE="${CONFIGDIR}/%%SAMBA4_CONFIG%%"
- LMHOSTSFILE="${CONFIGDIR}/lmhosts"
- SMB_PASSWD_FILE="${PRIVATE_DIR}/smbpasswd"
-
diff -ruN samba4.orig/files/patch-lib__util__pidfile.c samba4/files/patch-lib__util__pidfile.c
--- samba4.orig/files/patch-lib__util__pidfile.c 1969-12-31 18:00:00.000000000 -0600
+++ samba4/files/patch-lib__util__pidfile.c 2014-01-12 11:08:34.000000000 -0600
@@ -0,0 +1,20 @@
+*** lib/util/pidfile.c.orig Thu Dec 19 18:07:02 2013
+--- lib/util/pidfile.c Thu Dec 19 18:07:43 2013
+***************
+*** 149,155 ****
+ }
+ ret = unlink(pidFile);
+ if (ret == -1) {
+! DEBUG(0,("Failed to delete pidfile %s. Error was %s\n",
+! pidFile, strerror(errno)));
+ }
+ }
+--- 149,156 ----
+ }
+ ret = unlink(pidFile);
+ if (ret == -1) {
+! /* Comment this out so as not to have spurious log messages */
+! /* DEBUG(0,("Failed to delete pidfile %s. Error was %s\n",
+! pidFile, strerror(errno))); */
+ }
+ }
diff -ruN samba4.orig/files/patch-source3__modules__vfs_zfsacl.c samba4/files/patch-source3__modules__vfs_zfsacl.c
--- samba4.orig/files/patch-source3__modules__vfs_zfsacl.c 2013-12-17 01:39:55.000000000 -0600
+++ samba4/files/patch-source3__modules__vfs_zfsacl.c 1969-12-31 18:00:00.000000000 -0600
@@ -1,19 +0,0 @@
---- ./source3/modules/vfs_zfsacl.c.orig 2013-02-05 12:25:25.000000000 +0000
-+++ ./source3/modules/vfs_zfsacl.c 2013-02-06 02:16:53.149872040 +0000
-@@ -269,13 +269,14 @@
-
- static SMB_ACL_T zfsacl_fail__sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
-- SMB_ACL_TYPE_T type)
-+ SMB_ACL_TYPE_T type,
-+ TALLOC_CTX *mem_ctx)
- {
- return (SMB_ACL_T)NULL;
- }
-
- static SMB_ACL_T zfsacl_fail__sys_acl_get_fd(vfs_handle_struct *handle,
-- files_struct *fsp)
-+ files_struct *fsp, TALLOC_CTX *mem_ctx)
- {
- return (SMB_ACL_T)NULL;
- }
diff -ruN samba4.orig/files/patch-source3__utils__net_lookup.c samba4/files/patch-source3__utils__net_lookup.c
--- samba4.orig/files/patch-source3__utils__net_lookup.c 2013-12-17 01:39:55.000000000 -0600
+++ samba4/files/patch-source3__utils__net_lookup.c 1969-12-31 18:00:00.000000000 -0600
@@ -1,11 +0,0 @@
---- ./source3/utils/net_lookup.c.orig 2013-11-18 23:13:25.859884543 +0000
-+++ ./source3/utils/net_lookup.c 2013-11-18 23:21:48.283312520 +0000
-@@ -321,7 +321,7 @@
-
- print_sockaddr(addr, sizeof(addr), &kdcs[i].ss);
-
-- d_printf("%s:%hd\n", addr, kdcs[i].port);
-+ d_printf("%s:%u\n", addr, kdcs[i].port);
- }
-
- return 0;
diff -ruN samba4.orig/files/patch-source3__wscript samba4/files/patch-source3__wscript
--- samba4.orig/files/patch-source3__wscript 2013-12-17 01:39:55.000000000 -0600
+++ samba4/files/patch-source3__wscript 1969-12-31 18:00:00.000000000 -0600
@@ -1,105 +0,0 @@
---- ./source3/wscript.orig 2013-10-07 08:49:10.000000000 +0000
-+++ ./source3/wscript 2013-11-18 22:45:12.808702339 +0000
-@@ -35,6 +35,7 @@
- opt.SAMBA3_ADD_OPTION('utmp')
- opt.SAMBA3_ADD_OPTION('pthreadpool', with_name="enable", without_name="disable", default=True)
- opt.SAMBA3_ADD_OPTION('avahi', with_name="enable", without_name="disable")
-+ opt.SAMBA3_ADD_OPTION('dnssd', with_name="enable", without_name="disable")
- opt.SAMBA3_ADD_OPTION('iconv')
- opt.SAMBA3_ADD_OPTION('acl-support')
- opt.SAMBA3_ADD_OPTION('dnsupdate')
-@@ -312,7 +312,9 @@
-
- # Check if the compiler will optimize out functions
- conf.CHECK_CODE('''
--if (0) {
-+char s = "string";
-+int len = 6;
-+if (sizeof(s) != len && sizeof(s) != sizeof(char *)) {
- this_function_does_not_exist();
- } else {
- return 1;
-@@ -502,7 +504,7 @@
- conf.CHECK_CODE('struct aiocb a; return aio_return(&a);', 'HAVE_AIO_RETURN', msg='Checking for aio_return', headers='aio.h', lib='aio rt')
- conf.CHECK_CODE('struct aiocb a; return aio_error(&a);', 'HAVE_AIO_ERROR', msg='Checking for aio_error', headers='aio.h', lib='aio rt')
- conf.CHECK_CODE('struct aiocb a; return aio_cancel(1, &a);', 'HAVE_AIO_CANCEL', msg='Checking for aio_cancel', headers='aio.h', lib='aio rt')
-- conf.CHECK_CODE('struct aiocb a; struct timespec t; return aio_suspend(&a, 1, &t);', 'HAVE_AIO_SUSPEND', msg='Checking for aio_suspend', headers='aio.h', lib='aio rt')
-+ conf.CHECK_CODE('const struct aiocb * const a[1]; struct timespec t; return aio_suspend(a, 1, &t);', 'HAVE_AIO_SUSPEND', msg='Checking for aio_suspend', headers='aio.h', lib='aio rt')
- if not conf.CONFIG_SET('HAVE_AIO'):
- conf.DEFINE('HAVE_NO_AIO', '1')
- else:
-@@ -812,6 +813,17 @@
- conf.SET_TARGET_TYPE('avahi-common', 'EMPTY')
- conf.SET_TARGET_TYPE('avahi-client', 'EMPTY')
-
-+ if Options.options.with_dnssd:
-+ conf.env.with_dnssd = True
-+ if not conf.CHECK_HEADERS('dns_sd.h'):
-+ conf.env.with_dnssd = False
-+ if not conf.CHECK_FUNCS_IN('DNSServiceRegister', 'dns_sd'):
-+ conf.env.with_dnssd = False
-+ if conf.env.with_dnssd:
-+ conf.DEFINE('WITH_DNSSD_SUPPORT', 1)
-+ else:
-+ conf.SET_TARGET_TYPE('dns_sd', 'EMPTY')
-+
- if Options.options.with_iconv:
- conf.env.with_iconv = True
- if not conf.CHECK_FUNCS_IN('iconv_open', 'iconv', headers='iconv.h'):
-@@ -1670,26 +1670,8 @@
-
- if PTHREAD_LDFLAGS == 'error':
- if conf.CHECK_FUNCS_IN('pthread_attr_init', 'pthread'):
-- PTHREAD_CFLAGS='-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS'
-- PTHREAD_LDFLAGS='-lpthread'
-- if PTHREAD_LDFLAGS == 'error':
-- if conf.CHECK_FUNCS_IN('pthread_attr_init', 'pthreads'):
-- PTHREAD_CFLAGS='-D_THREAD_SAFE'
-- PTHREAD_LDFLAGS='-lpthreads'
-- if PTHREAD_LDFLAGS == 'error':
-- if conf.CHECK_FUNCS_IN('pthread_attr_init', 'c_r'):
-- PTHREAD_CFLAGS='-D_THREAD_SAFE -pthread'
-+ PTHREAD_CFLAGS='-pthread'
- PTHREAD_LDFLAGS='-pthread'
-- if PTHREAD_LDFLAGS == 'error':
-- if conf.CHECK_FUNCS('pthread_attr_init'):
-- PTHREAD_CFLAGS='-D_REENTRANT'
-- PTHREAD_LDFLAGS='-lpthread'
-- # especially for HP-UX, where the CHECK_FUNC macro fails to test for
-- # pthread_attr_init. On pthread_mutex_lock it works there...
-- if PTHREAD_LDFLAGS == 'error':
-- if conf.CHECK_FUNCS_IN('pthread_mutex_lock', 'pthread'):
-- PTHREAD_CFLAGS='-D_REENTRANT'
-- PTHREAD_LDFLAGS='-lpthread'
-
- if PTHREAD_CFLAGS != 'error' and PTHREAD_LDFLAGS != 'error':
- conf.ADD_CFLAGS(PTHREAD_CFLAGS)
-@@ -1719,8 +1701,8 @@
- auth_script vfs_readahead vfs_xattr_tdb vfs_posix_eadb
- vfs_streams_xattr vfs_streams_depot vfs_acl_xattr vfs_acl_tdb
- vfs_smb_traffic_analyzer vfs_preopen vfs_catia vfs_scannedonly
-- vfs_media_harmony
-- vfs_commit
-+ vfs_media_harmony
-+ vfs_commit
- vfs_crossrename vfs_linux_xfs_sgid
- vfs_time_audit idmap_autorid idmap_tdb2
- idmap_rid idmap_hash'''))
-@@ -1733,7 +1715,7 @@
-
- if Options.options.enable_selftest or Options.options.developer:
- default_shared_modules.extend(TO_LIST('vfs_fake_acls'))
--
-+
-
- if conf.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
- default_static_modules.extend(TO_LIST('pdb_samba_dsdb auth_samba4 vfs_dfs_samba4'))
-@@ -1766,7 +1748,7 @@
- default_static_modules.extend(TO_LIST('charset_macosxfs'))
-
- if conf.CONFIG_SET('HAVE_GPFS'):
-- default_shared_modules.extend(TO_LIST('vfs_gpfs'))
-+ default_shared_modules.extend(TO_LIST('vfs_gpfs'))
-
- if conf.CONFIG_SET('SAMBA_FAM_LIBS'):
- default_shared_modules.extend(TO_LIST('vfs_notify_fam'))
diff -ruN samba4.orig/files/patch-source3__wscript_build samba4/files/patch-source3__wscript_build
--- samba4.orig/files/patch-source3__wscript_build 2013-12-17 01:39:55.000000000 -0600
+++ samba4/files/patch-source3__wscript_build 2014-01-12 11:08:34.000000000 -0600
@@ -1,61 +1,73 @@
---- source3/wscript_build.orig 2013-07-01 09:15:40.000000000 +0200
-+++ source3/wscript_build 2013-11-12 10:13:36.004046408 +0100
-@@ -1,7 +1,8 @@
- #!/usr/bin/env python
-
- from samba_utils import *
--import samba_version, samba3
-+import samba_version, samba3, sys
-+host_os = sys.platform
-
- TDB_LIB_SRC = '''
- lib/dbwrap/dbwrap_open.c
-@@ -651,7 +652,16 @@
- vnum='0',
- vars=locals())
-
--bld.SAMBA3_LIBRARY('nss_wins',
-+if (host_os.rfind('freebsd') > -1):
-+ # FreeBSD winbind client is implemented as a wrapper around
-+ # the Linux version.
-+ bld.SAMBA3_LIBRARY('nss_wins',
-+ source=' '.join([WINBIND_WINS_NSS_SRC, '../nsswitch/wins_freebsd.c']),
-+ deps='''param libsmb LIBTSOCKET''',
-+ realname='nss_wins.so.1',
-+ vnum='1')
-+else:
-+ bld.SAMBA3_LIBRARY('nss_wins',
- source=WINBIND_WINS_NSS_SRC,
- deps='''param libsmb LIBTSOCKET''',
- realname='libnss_wins.so.2',
-@@ -972,10 +982,12 @@
- LIBAFS_SETTOKEN
- RPC_SERVER
- NDR_SMBXSRV
-- LIBASYS
-+ LIBASYS
- ccan-hash
- NDR_SMB_ACL
- netapi
-+ inotify
-+ dns_sd
- ''' + bld.env['dmapi_lib'],
- private_library=True,
- vars=locals())
-@@ -1277,6 +1289,7 @@
- libsmb
- msrpc3
- RPC_NDR_SRVSVC
-+ dns_sd
- cli_smb_common''')
-
- bld.SAMBA3_BINARY('net',
-@@ -1629,7 +1642,7 @@
-
- bld.SAMBA3_PYTHON('pylibsmb',
- source='libsmb/pylibsmb.c',
-- deps='smbclient samba-credentials',
-+ deps='smbclient samba-credentials libsmb errors',
- realname='samba/samba3/libsmb_samba_internal.so'
- )
-
+*** source3/wscript_build.orig Tue Dec 17 03:07:22 2013
+--- source3/wscript_build Tue Dec 17 03:46:31 2013
+***************
+*** 1,7 ****
+ #!/usr/bin/env python
+
+ from samba_utils import *
+! import samba_version, samba3
+
+ TDB_LIB_SRC = '''
+ lib/dbwrap/dbwrap_open.c
+--- 1,8 ----
+ #!/usr/bin/env python
+
+ from samba_utils import *
+! import samba_version, samba3, sys
+! host_os = sys.platform
+
+ TDB_LIB_SRC = '''
+ lib/dbwrap/dbwrap_open.c
+***************
+*** 654,660 ****
+ vnum='0',
+ vars=locals())
+
+! bld.SAMBA3_LIBRARY('nss_wins',
+ source=WINBIND_WINS_NSS_SRC,
+ deps='''param libsmb LIBTSOCKET''',
+ realname='libnss_wins.so.2',
+--- 655,670 ----
+ vnum='0',
+ vars=locals())
+
+! if (host_os.rfind('freebsd') > -1):
+! # FreeBSD winbind client is implemented as a wrapper around
+! # the Linux version.
+! bld.SAMBA3_LIBRARY('nss_wins',
+! source=' '.join([WINBIND_WINS_NSS_SRC, '../nsswitch/wins_freebsd.c']),
+! deps='''param libsmb LIBTSOCKET''',
+! realname='nss_wins.so.1',
+! vnum='1')
+! else:
+! bld.SAMBA3_LIBRARY('nss_wins',
+ source=WINBIND_WINS_NSS_SRC,
+ deps='''param libsmb LIBTSOCKET''',
+ realname='libnss_wins.so.2',
+***************
+*** 980,985 ****
+--- 990,996 ----
+ ccan-hash
+ NDR_SMB_ACL
+ netapi
++ inotify
+ NDR_IOCTL
+ ''' + bld.env['dmapi_lib'],
+ private_library=True,
+***************
+*** 1613,1619 ****
+
+ bld.SAMBA3_PYTHON('pylibsmb',
+ source='libsmb/pylibsmb.c',
+! deps='smbclient samba-credentials',
+ realname='samba/samba3/libsmb_samba_internal.so'
+ )
+
+--- 1624,1630 ----
+
+ bld.SAMBA3_PYTHON('pylibsmb',
+ source='libsmb/pylibsmb.c',
+! deps='smbclient samba-credentials libsmb errors',
+ realname='samba/samba3/libsmb_samba_internal.so'
+ )
+
diff -ruN samba4.orig/files/samba4.in samba4/files/samba4.in
--- samba4.orig/files/samba4.in 2013-12-17 01:39:55.000000000 -0600
+++ samba4/files/samba4.in 2014-01-12 11:08:34.000000000 -0600
@@ -16,7 +16,11 @@
# Configuration file can be set with:
#samba4_config="%%SAMBA4_CONFDIR%%/%%SAMBA4_CONFIG%%"
#
-
+# You can disable/enable any of the Samba daemons by specifying:
+#nmbd_enable="NO"
+#smbd_enable="NO"
+%%WINBIND%%# You need to enable winbindd separately, by adding:
+%%WINBIND%%#winbindd_enable="YES"
. /etc/rc.subr
name="samba4"
@@ -30,7 +34,16 @@
samba4_config_default="%%SAMBA4_CONFDIR%%/%%SAMBA4_CONFIG%%"
samba4_config=${samba4_config=${samba4_config_default}}
samba4_configfile_arg=${samba4_config:+--configfile="${samba4_config}"} #"
-testparm_command="%%PREFIX%%/bin/samba-tool testparm --suppress-prompt --verbose ${samba4_configfile_arg}"
+testparm_command="/usr/local/bin/samba-tool testparm --suppress-prompt --verbose ${samba4_configfile_arg}"
+samba_daemons="nmbd smbd"
+%%WINBIND%%samba_daemons="${samba_daemons} winbindd"
+
+# Custom commands
+extra_commands="reload status"
+start_cmd="samba4_cmd"
+stop_cmd="samba4_cmd"
+status_cmd="samba4_cmd"
+rcvar_cmd="samba4_rcvar_cmd"
# Fetch parameters from configuration file
samba4_role=$(${testparm_command} --parameter-name='server role' 2>/dev/null)
samba4_lockdir=$(${testparm_command} --parameter-name='lock directory' 2>/dev/null)
@@ -62,10 +75,120 @@
if [ ! -d "${samba4_piddir}" -a ! -e "${samba4_piddir}" ]; then
install -m 0755 -d "${samba4_piddir}"
fi
- # Remove smbd.pid before starting up samba(needed for s3fs)
- if [ -e "${samba4_piddir}/smbd.pid" ] ; then
- rm -f "${samba4_piddir}/smbd.pid"
+}
+
+samba_start_precmd() {
+ # Make sure rundir exists
+ if [ ! -d "%%SAMBA4_RUNDIR%%" -a ! -e "%%SAMBA4_RUNDIR%%" ]; then
+ install -m 0755 -d "%%SAMBA4_RUNDIR%%"
+ fi
+ # 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
}
+samba4_rcvar_cmd() {
+ local name rcvar
+ rcvar=${name}_enable
+ # Prevent recursive calling
+ unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd"
+ # Check master variable
+ run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args}
+ # Check dependent variables
+ for name in ${samba_daemons}; do
+ # XXX
+ rcvars=''; v=''
+ rcvar=${name}_enable
+ run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args}
+ done
+}
+
+samba4_config_init() {
+ local name
+ # Load configuration
+ load_rc_config "${name}"
+ for name in ${samba_daemons}; do
+ load_rc_config "${name}"
+ done
+ # Location of the config
+ samba_config=${samba_config="${samba_config_default}"} #"
+ # XXX: Hack to work around name change of pid file with non-default config
+ if [ -n "${samba_config}" -a "${samba_config}" != "${samba_config_default}" ]; then
+ pid_extra="-$(basename "${samba_config}")"
+ fi
+ # Defaults
+ samba_enable=${samba_enable:=NO}
+ # Setup dependent variables
+ if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then
+ nmbd_enable=${nmbd_enable=YES}
+ smbd_enable=${smbd_enable=YES}
+ fi
+ nmbd_enable=${nmbd_enable:=NO}
+ smbd_enable=${smbd_enable:=NO}
+%%WINBIND%% # Winbindd
+%%WINBIND%% if [ -z "${winbind_enable}" ]; then
+%%WINBIND%% samba_idmap=$(${samba_parm} 'idmap uid' "${samba_config}" 2>/dev/null)
+%%WINBIND%% # Check that winbindd is actually configured
+%%WINBIND%% if [ -n "${samba_idmap}" ]; then
+%%WINBIND%% winbindd_enable="YES"
+%%WINBIND%% fi
+%%WINBIND%% winbindd_enable=${winbindd_enable:=NO}
+%%WINBIND%% fi
+}
+
+samba4_cmd() {
+ local name rcvar rcvars v command pidfile samba_daemons result force_run
+ # Prevent recursive calling
+ unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd"
+ # Hack to check if the server role is a domain controller
+ if [ "${samba4_role}" = "active directory domain controller" ]; then
+ samba_daemons="samba"
+ samba_flags=${samba_flags="-D"}
+ fi
+ # Stop processes in the reverse order
+ if [ "${rc_arg}" = "stop" ] ; then
+ samba_daemons=$(reverse_list ${samba_daemons})
+ fi
+ # Ignore rcvar and run command
+ if [ -n "${_rc_prefix}" -a "${_rc_prefix}" = "one" ] || [ -n "${rc_force}" ] || [ -n "${rc_fast}" ]; then
+ force_run=yes
+ fi
+ # Assume success
+ result=0
+ # Apply to all daemons
+ for name in ${samba_daemons}; do
+ # XXX
+ rcvars=''; v=''
+ rcvar=${name}_enable
+ command="%%PREFIX%%/sbin/${name}"
+ pidfile="%%SAMBA4_RUNDIR%%/${name}${pid_extra}.pid"
+ # Daemon should be enabled and running
+ if ( [ -n "${rcvar}" ] && checkyesno "${rcvar}" ) || [ -n "$force_run" ]; then
+ run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args}
+ # If any of the commands failed, take it as a global result
+ result=$((${result} || $?))
+ fi
+ done
+ return ${result}
+}
+
+# Load configuration variables
+samba4_config_init
+# Common flags
+command_args=${samba_config:+-s "${samba_config}"} #"
+nmbd_flags=${nmbd_flags="-D"}
+smbd_flags=${smbd_flags="-D"}
+%%WINBIND%%winbindd_flags=${winbindd_flags=''}
+# Requirements
+required_files="${samba_config}"
+required_dirs="${samba_lockdir}"
+#
run_rc_command "$1"
diff -ruN samba4.orig/pkg-plist samba4/pkg-plist
--- samba4.orig/pkg-plist 2013-12-17 01:39:55.000000000 -0600
+++ samba4/pkg-plist 2014-01-12 11:08:34.000000000 -0600
@@ -41,7 +41,6 @@
sbin/samba_spnupdate
sbin/samba_upgradedns
sbin/smbd
-%%SWAT%%sbin/swat
%%WINBIND%%sbin/winbindd
include/samba4/charset.h
include/samba4/core/doserr.h
@@ -209,10 +208,10 @@
lib/libwbclient.so
lib/libwbclient.so.0
lib/mit_samba.so
-lib/nss_winbind.so.1
+%%WINBIND%%lib/nss_winbind.so.1
lib/nss_wins.so.1
%%SMBPASS%%lib/pam_smbpass.so
-lib/pam_winbind.so
+%%WINBIND%%lib/pam_winbind.so
lib/winbind_krb5_locator.so
lib/samba/libCHARSET3.so
lib/samba/libHDB_SAMBA4.so
@@ -274,6 +273,7 @@
lib/samba/libnetif.so
lib/samba/libnpa_tstream.so
lib/samba/libnss_info.so
+lib/samba/libntdb.so.0
lib/samba/libntvfs.so
lib/samba/libpac.so
lib/samba/libpopt_samba3.so
@@ -307,7 +307,8 @@
lib/samba/libutil_reg.so
lib/samba/libutil_setid.so
lib/samba/libutil_tdb.so
-lib/samba/libwinbind-client.so
+lib/samba/libutil_ntdb.so
+%%WINBIND%%lib/samba/libwinbind-client.so
lib/samba/libwind-samba4.so.0
lib/samba/libxattr_tdb.so
%%LDAP%%lib/samba/libsmbldaphelper.so
@@ -382,7 +383,7 @@
lib/shared-modules/service/s3fs.so
lib/shared-modules/service/smb.so
lib/shared-modules/service/web.so
-lib/shared-modules/service/winbind.so
+%%WINBIND%%lib/shared-modules/service/winbind.so
lib/shared-modules/service/wrepl.so
lib/shared-modules/vfs/acl_tdb.so
lib/shared-modules/vfs/acl_xattr.so
@@ -636,7 +637,6 @@
%%PYTHON_SITELIBDIR%%/samba/external/testtools/deferredruntest.py
%%PYTHON_SITELIBDIR%%/samba/external/testtools/distutilscmd.py
%%PYTHON_SITELIBDIR%%/samba/external/testtools/helpers.py
-%%PYTHON_SITELIBDIR%%/samba/external/testtools/matchers.py
%%PYTHON_SITELIBDIR%%/samba/external/testtools/monkey.py
%%PYTHON_SITELIBDIR%%/samba/external/testtools/run.py
%%PYTHON_SITELIBDIR%%/samba/external/testtools/runtest.py
@@ -653,7 +653,6 @@
%%PYTHON_SITELIBDIR%%/samba/external/testtools/tests/test_distutilscmd.py
%%PYTHON_SITELIBDIR%%/samba/external/testtools/tests/test_fixturesupport.py
%%PYTHON_SITELIBDIR%%/samba/external/testtools/tests/test_helpers.py
-%%PYTHON_SITELIBDIR%%/samba/external/testtools/tests/test_matchers.py
%%PYTHON_SITELIBDIR%%/samba/external/testtools/tests/test_monkey.py
%%PYTHON_SITELIBDIR%%/samba/external/testtools/tests/test_run.py
%%PYTHON_SITELIBDIR%%/samba/external/testtools/tests/test_runtest.py
@@ -778,6 +777,7 @@
%%PYTHON_SITELIBDIR%%/samba/xattr.py
%%PYTHON_SITELIBDIR%%/samba/xattr_native.so
%%PYTHON_SITELIBDIR%%/samba/xattr_tdb.so
+%%PYTHON_SITELIBDIR%%/ntdb.so
@unexec find %D/%%PYTHON_SITELIBDIR%%/samba -name '*.py[co]' -delete >/dev/null 2>&1
@dirrm %%PYTHON_SITELIBDIR%%/samba/web_server
@dirrm %%PYTHON_SITELIBDIR%%/samba/tests/samba_tool
@@ -801,17 +801,7 @@
@dirrm %%PYTHON_SITELIBDIR%%/samba
@dirrmtry %%PYTHON_SITELIBDIR%%
@dirrmtry %%PYTHON_LIBDIR%%
-%%DATADIR%%/codepages/de.msg
-%%DATADIR%%/codepages/en.msg
-%%DATADIR%%/codepages/fi.msg
-%%DATADIR%%/codepages/fr.msg
-%%DATADIR%%/codepages/it.msg
-%%DATADIR%%/codepages/ja.msg
%%DATADIR%%/codepages/lowcase.dat
-%%DATADIR%%/codepages/nl.msg
-%%DATADIR%%/codepages/pl.msg
-%%DATADIR%%/codepages/ru.msg
-%%DATADIR%%/codepages/tr.msg
%%DATADIR%%/codepages/upcase.dat
%%DATADIR%%/codepages/valid.dat
%%DATADIR%%/setup/DB_CONFIG
@@ -904,54 +894,6 @@
%%DATADIR%%/setup/slapd.conf
%%DATADIR%%/setup/spn_update_list
%%DATADIR%%/setup/ypServ30.ldif
-%%DATADIR%%/swat/help/welcome-no-samba-doc.html
-%%DATADIR%%/swat/help/welcome.html
-%%DATADIR%%/swat/images/globals.gif
-%%DATADIR%%/swat/images/home.gif
-%%DATADIR%%/swat/images/passwd.gif
-%%DATADIR%%/swat/images/printers.gif
-%%DATADIR%%/swat/images/samba.gif
-%%DATADIR%%/swat/images/shares.gif
-%%DATADIR%%/swat/images/status.gif
-%%DATADIR%%/swat/images/viewconfig.gif
-%%DATADIR%%/swat/images/wizard.gif
-%%DATADIR%%/swat/include/footer.html
-%%DATADIR%%/swat/include/header.html
-%%DATADIR%%/swat/lang/ja/help/welcome.html
-%%DATADIR%%/swat/lang/ru/help/welcome-no-samba-doc.html
-%%DATADIR%%/swat/lang/ru/help/welcome.html
-%%DATADIR%%/swat/lang/ru/images/globals.gif
-%%DATADIR%%/swat/lang/ru/images/home.gif
-%%DATADIR%%/swat/lang/ru/images/passwd.gif
-%%DATADIR%%/swat/lang/ru/images/printers.gif
-%%DATADIR%%/swat/lang/ru/images/shares.gif
-%%DATADIR%%/swat/lang/ru/images/status.gif
-%%DATADIR%%/swat/lang/ru/images/viewconfig.gif
-%%DATADIR%%/swat/lang/ru/images/wizard.gif
-%%DATADIR%%/swat/lang/ru/include/header.html
-%%DATADIR%%/swat/lang/tr/help/welcome.html
-%%DATADIR%%/swat/lang/tr/images/globals.gif
-%%DATADIR%%/swat/lang/tr/images/home.gif
-%%DATADIR%%/swat/lang/tr/images/passwd.gif
-%%DATADIR%%/swat/lang/tr/images/printers.gif
-%%DATADIR%%/swat/lang/tr/images/samba.gif
-%%DATADIR%%/swat/lang/tr/images/shares.gif
-%%DATADIR%%/swat/lang/tr/images/status.gif
-%%DATADIR%%/swat/lang/tr/images/viewconfig.gif
- at dirrm %%DATADIR%%/swat/lang/tr/images
- at dirrm %%DATADIR%%/swat/lang/tr/help
- at dirrm %%DATADIR%%/swat/lang/tr
- at dirrm %%DATADIR%%/swat/lang/ru/include
- at dirrm %%DATADIR%%/swat/lang/ru/images
- at dirrm %%DATADIR%%/swat/lang/ru/help
- at dirrm %%DATADIR%%/swat/lang/ru
- at dirrm %%DATADIR%%/swat/lang/ja/help
- at dirrm %%DATADIR%%/swat/lang/ja
- at dirrm %%DATADIR%%/swat/lang
- at dirrm %%DATADIR%%/swat/include
- at dirrm %%DATADIR%%/swat/images
- at dirrm %%DATADIR%%/swat/help
- at dirrm %%DATADIR%%/swat
@dirrm %%DATADIR%%/setup/display-specifiers
@dirrm %%DATADIR%%/setup/ad-schema
@dirrm %%DATADIR%%/setup
@@ -1014,7 +956,6 @@
man/man8/smbpasswd.8.gz
man/man8/smbspool.8.gz
man/man8/smbta-util.8.gz
-man/man8/swat.8.gz
man/man8/vfs_acl_tdb.8.gz
man/man8/vfs_acl_xattr.8.gz
man/man8/vfs_aio_fork.8.gz
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list