summaryrefslogtreecommitdiff
path: root/net-fs/samba/files
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2016-09-07 00:08:54 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2016-09-07 00:08:54 +0300
commit7c0800e7ae19001dce65fb7a4202a0f31b5140bf (patch)
treeaae9d811dc085abf82418661fb9eb7a196e06295 /net-fs/samba/files
parent4cd1a46b5bf140565c9465adade10eacfa20d523 (diff)
samba-scm (dependent on gentoo patches, will be broken soon)
Diffstat (limited to 'net-fs/samba/files')
-rw-r--r--net-fs/samba/files/4.4/samba4.confd38
-rw-r--r--net-fs/samba/files/4.4/samba4.initd-r156
-rw-r--r--net-fs/samba/files/named.conf.dlz.patch15
-rw-r--r--net-fs/samba/files/nmbd.service12
-rw-r--r--net-fs/samba/files/samba-3.4.2-lib.tevent.python.mk6
-rw-r--r--net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch57
-rw-r--r--net-fs/samba/files/samba-4.1.14-libsystemd.patch51
-rw-r--r--net-fs/samba/files/samba-4.1.14-named.conf.dlz.patch15
-rw-r--r--net-fs/samba/files/samba-4.2.3-heimdal_compilefix.patch22
-rw-r--r--net-fs/samba/files/samba-4.2.7-pam.patch36
-rw-r--r--net-fs/samba/files/samba-4.4.0-pam.patch29
-rw-r--r--net-fs/samba/files/samba.conf2
-rw-r--r--net-fs/samba/files/samba.service10
-rw-r--r--net-fs/samba/files/smbd.service12
-rw-r--r--net-fs/samba/files/smbd.socket9
-rw-r--r--net-fs/samba/files/smbd_at.service7
-rw-r--r--net-fs/samba/files/winbindd.service12
17 files changed, 389 insertions, 0 deletions
diff --git a/net-fs/samba/files/4.4/samba4.confd b/net-fs/samba/files/4.4/samba4.confd
new file mode 100644
index 0000000..58b2c78
--- /dev/null
+++ b/net-fs/samba/files/4.4/samba4.confd
@@ -0,0 +1,38 @@
+# Add "winbind" to the daemon_list if you also want winbind to start.
+# Replace "smbd nmbd" by "samba4" if you want the active directory domain controller part or the ntvfs
+# file server part or the rpc proxy to start.
+# Note that samba4 controls 'smbd' by itself, thus it can't be started manually. You can, however,
+# tweak the behaviour of a samba4-controlled smbd by modifying your '/etc/samba/smb.conf' file
+# accordingly.
+daemon_list="smbd nmbd"
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+my_service_name="samba"
+my_service_PRE="unset TMP TMPDIR"
+my_service_POST=""
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+smbd_start_options="-D"
+smbd_start="start-stop-daemon --start --exec /usr/sbin/smbd -- ${smbd_start_options}"
+smbd_stop="start-stop-daemon --stop --exec /usr/sbin/smbd"
+smbd_reload="killall -HUP smbd"
+
+nmbd_start_options="-D"
+nmbd_start="start-stop-daemon --start --exec /usr/sbin/nmbd -- ${nmbd_start_options}"
+nmbd_stop="start-stop-daemon --stop --exec /usr/sbin/nmbd"
+nmbd_reload="killall -HUP nmbd"
+
+samba4_start_options=""
+samba4_start="start-stop-daemon --start --exec /usr/sbin/samba -- ${samba4_start_options}"
+samba4_stop="start-stop-daemon --stop --exec /usr/sbin/samba"
+samba4_reload="killall -HUP samba"
+
+winbind_start_options=""
+winbind_start="start-stop-daemon --start --exec /usr/sbin/winbindd -- ${winbind_start_options}"
+winbind_stop="start-stop-daemon --stop --exec /usr/sbin/winbindd"
+winbind_reload="killall -HUP winbindd"
+
diff --git a/net-fs/samba/files/4.4/samba4.initd-r1 b/net-fs/samba/files/4.4/samba4.initd-r1
new file mode 100644
index 0000000..bf162ad
--- /dev/null
+++ b/net-fs/samba/files/4.4/samba4.initd-r1
@@ -0,0 +1,56 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_started_commands="reload"
+piddir="/run/samba"
+
+depend() {
+ after slapd
+ need net
+ use cupsd
+}
+
+DAEMONNAME="${SVCNAME##samba.}"
+[ "${DAEMONNAME}" != "samba" ] && daemon_list=${DAEMONNAME}
+
+signal_do() {
+ local signal="$1"
+ [ -z "${signal}" ] && return 0
+
+ local result=0 last_result=0 daemon= cmd_exec=
+ for daemon in ${daemon_list} ; do
+ eval cmd_exec=\$${daemon}_${signal}
+ if [ -n "${cmd_exec}" ]; then
+ ebegin "${my_service_name} -> ${signal}: ${daemon}"
+ #echo ${cmd} '->' ${!cmd}
+ ${cmd_exec} > /dev/null
+ last_result=$?
+ eend ${last_result}
+ fi
+ result=$(( ${result} + ${last_result} ))
+ done
+ return ${result}
+}
+
+start() {
+ ${my_service_PRE}
+ [ -d "${piddir}" ] || mkdir -p "${piddir}"
+ signal_do start && return 0
+
+ eerror "Error: starting services (see system logs)"
+ signal_do stop
+ return 1
+}
+stop() {
+ ${my_service_PRE}
+ if signal_do stop ; then
+ ${my_service_POST}
+ return 0
+ fi
+}
+reload() {
+ ${my_service_PRE}
+ signal_do reload
+}
diff --git a/net-fs/samba/files/named.conf.dlz.patch b/net-fs/samba/files/named.conf.dlz.patch
new file mode 100644
index 0000000..ad8486c
--- /dev/null
+++ b/net-fs/samba/files/named.conf.dlz.patch
@@ -0,0 +1,15 @@
+diff --git a/source4/setup/named.conf.dlz b/source4/setup/named.conf.dlz
+index be20a57..d86f766 100644
+--- a/source4/setup/named.conf.dlz
++++ b/source4/setup/named.conf.dlz
+@@ -11,9 +11,9 @@
+ #
+ dlz "AD DNS Zone" {
+ # For BIND 9.8.0
+- database "dlopen ${MODULESDIR}/bind9/dlz_bind9.so";
++ # database "dlopen ${MODULESDIR}/bind9/dlz_bind9.so";
+
+ # For BIND 9.9.0
+- # database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
++ database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
+ };
diff --git a/net-fs/samba/files/nmbd.service b/net-fs/samba/files/nmbd.service
new file mode 100644
index 0000000..44b4ffb
--- /dev/null
+++ b/net-fs/samba/files/nmbd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba NetBIOS name server
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/nmbd.pid
+ExecStart=/usr/sbin/nmbd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/samba/files/samba-3.4.2-lib.tevent.python.mk b/net-fs/samba/files/samba-3.4.2-lib.tevent.python.mk
new file mode 100644
index 0000000..3a03755
--- /dev/null
+++ b/net-fs/samba/files/samba-3.4.2-lib.tevent.python.mk
@@ -0,0 +1,6 @@
+[PYTHON::pytevent]
+LIBRARY_REALNAME = tevent.$(SHLIBEXT)
+PRIVATE_DEPENDENCIES = LIBTEVENT PYTALLOC LIBSAMBA-UTIL LIBREPLACE
+
+pytevent_OBJ_FILES = $(libteventsrcdir)/pytevent.o
+
diff --git a/net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch b/net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch
new file mode 100644
index 0000000..ec351db
--- /dev/null
+++ b/net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch
@@ -0,0 +1,57 @@
+https://bugzilla.samba.org/show_bug.cgi?id=10370
+
+--- samba-4.0.19/source3/wscript
++++ samba-4.0.19/source3/wscript
+@@ -507,9 +507,10 @@
+ else:
+ conf.DEFINE('HAVE_NO_AIO', '1')
+
+- if host_os.rfind('linux') > -1:
+- conf.CHECK_FUNCS_IN('io_submit', 'aio')
+- conf.CHECK_CODE('''
++ if Options.options.with_aio_support != False:
++ if host_os.rfind('linux') > -1:
++ conf.CHECK_FUNCS_IN('io_submit', 'aio')
++ conf.CHECK_CODE('''
+ struct io_event ioev;
+ struct iocb *ioc;
+ io_context_t ctx;
+@@ -526,11 +527,11 @@
+ io_getevents(ctx, 1, 1, &ioev, &ts);
+ ''',
+ 'HAVE_LINUX_KERNEL_AIO',
+- msg='Checking for linux kernel asynchronous io support',
+- headers='unistd.h stdlib.h sys/types.h fcntl.h sys/eventfd.h libaio.h',
+- lib='aio')
++ msg='Checking for linux kernel asynchronous io support',
++ headers='unistd.h stdlib.h sys/types.h fcntl.h sys/eventfd.h libaio.h',
++ lib='aio')
+
+- conf.CHECK_CODE('''
++ conf.CHECK_CODE('''
+ struct msghdr msg;
+ union {
+ struct cmsghdr cm;
+@@ -540,17 +541,17 @@
+ msg.msg_controllen = sizeof(control_un.control);
+ ''',
+ 'HAVE_MSGHDR_MSG_CONTROL',
+- msg='Checking if we can use msg_control for passing file descriptors',
+- headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
+- conf.CHECK_CODE('''
++ msg='Checking if we can use msg_control for passing file descriptors',
++ headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
++ conf.CHECK_CODE('''
+ struct msghdr msg;
+ int fd;
+ msg.msg_acctrights = (caddr_t) &fd;
+ msg.msg_acctrightslen = sizeof(fd);
+ ''',
+ 'HAVE_MSGHDR_MSG_ACCTRIGHTS',
+- msg='Checking if we can use msg_acctrights for passing file descriptors',
+- headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
++ msg='Checking if we can use msg_acctrights for passing file descriptors',
++ headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
+
+ if Options.options.with_winbind:
+ conf.env.build_winbind = True
diff --git a/net-fs/samba/files/samba-4.1.14-libsystemd.patch b/net-fs/samba/files/samba-4.1.14-libsystemd.patch
new file mode 100644
index 0000000..94b30c0
--- /dev/null
+++ b/net-fs/samba/files/samba-4.1.14-libsystemd.patch
@@ -0,0 +1,51 @@
+From 0f9b06ade820ce165015526220569db81e00150b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 3 Jan 2015 18:59:48 +0100
+Subject: [PATCH] Support libsystemd, renamed from libsystemd-daemon
+
+---
+ lib/util/wscript_build | 2 +-
+ wscript | 4 ++++
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/lib/util/wscript_build b/lib/util/wscript_build
+index f161f96..6b6b511 100755
+--- a/lib/util/wscript_build
++++ b/lib/util/wscript_build
+@@ -10,7 +10,7 @@ bld.SAMBA_LIBRARY('samba-util',
+ server_id.c dprintf.c parmlist.c bitmap.c pidfile.c
+ tevent_debug.c util_process.c memcache.c''',
+ deps='DYNCONFIG',
+- public_deps='talloc tevent execinfo uid_wrapper pthread LIBCRYPTO charset util_setid systemd-daemon',
++ public_deps='talloc tevent execinfo uid_wrapper pthread LIBCRYPTO charset util_setid systemd systemd-daemon',
+ public_headers='debug.h attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h samba_util.h string_wrappers.h',
+ header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ],
+ local_include=False,
+diff --git a/wscript b/wscript
+index f389f90..3c4fa21 100644
+--- a/wscript
++++ b/wscript
+@@ -183,9 +183,12 @@ def configure(conf):
+ conf.env['ENABLE_PIE'] = True
+
+ if Options.options.enable_systemd != False:
++ conf.check_cfg(package='libsystemd', args='--cflags --libs',
++ msg='Checking for libsystemd', uselib_store="SYSTEMD")
+ conf.check_cfg(package='libsystemd-daemon', args='--cflags --libs',
+ msg='Checking for libsystemd-daemon', uselib_store="SYSTEMD-DAEMON")
+ conf.CHECK_HEADERS('systemd/sd-daemon.h', lib='systemd-daemon')
++ conf.CHECK_LIB('systemd', shlib=True)
+ conf.CHECK_LIB('systemd-daemon', shlib=True)
+
+ if conf.CONFIG_SET('HAVE_SYSTEMD_SD_DAEMON_H'):
+@@ -193,6 +196,7 @@ def configure(conf):
+ conf.env['ENABLE_SYSTEMD'] = True
+ else:
+ conf.SET_TARGET_TYPE('systemd-daemon', 'EMPTY')
++ conf.SET_TARGET_TYPE('systemd', 'EMPTY')
+ conf.undefine('HAVE_SYSTEMD')
+
+ conf.SAMBA_CONFIG_H('include/config.h')
+--
+2.2.1
+
diff --git a/net-fs/samba/files/samba-4.1.14-named.conf.dlz.patch b/net-fs/samba/files/samba-4.1.14-named.conf.dlz.patch
new file mode 100644
index 0000000..9f1ebb8
--- /dev/null
+++ b/net-fs/samba/files/samba-4.1.14-named.conf.dlz.patch
@@ -0,0 +1,15 @@
+--- samba-4.1.14/source4/setup/named.conf.dlz
++++ samba-4.1.14/source4/setup/named.conf.dlz
+@@ -11,10 +11,10 @@
+ #
+ dlz "AD DNS Zone" {
+ # For BIND 9.8.x
+- database "dlopen ${MODULESDIR}/bind9/dlz_bind9.so";
++ # database "dlopen ${MODULESDIR}/bind9/dlz_bind9.so";
+
+ # For BIND 9.9.x
+- # database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
++ database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
+
+ # For BIND 9.10.x
+ # database "dlopen ${MODULESDIR}/bind9/dlz_bind9_10.so";
diff --git a/net-fs/samba/files/samba-4.2.3-heimdal_compilefix.patch b/net-fs/samba/files/samba-4.2.3-heimdal_compilefix.patch
new file mode 100644
index 0000000..c6f5007
--- /dev/null
+++ b/net-fs/samba/files/samba-4.2.3-heimdal_compilefix.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/542638
+
+From: Stephan Wolf <stephan@letzte-bankreihe.de>
+
+Samba uses the build in implementation of heimdal from year 2011.
+The ebuild uses the portage version of heimdal.
+I got it fixed to patch samba kdc_init function.
+
+--- samba-4.2.3/source4/kdc/kdc.c
++++ samba-4.2.3/source4/kdc/kdc.c
+@@ -967,9 +967,9 @@
+ * The old behavior in the _kdc_get_preferred_key()
+ * function is use_strongest_server_key=TRUE.
+ */
+- kdc->config->as_use_strongest_session_key = false;
++ kdc->config->tgt_use_strongest_session_key = false;
+ kdc->config->preauth_use_strongest_session_key = false;
+- kdc->config->tgs_use_strongest_session_key = false;
++ kdc->config->svc_use_strongest_session_key = false;
+ kdc->config->use_strongest_server_key = true;
+
+ /* Register hdb-samba4 hooks for use as a keytab */
diff --git a/net-fs/samba/files/samba-4.2.7-pam.patch b/net-fs/samba/files/samba-4.2.7-pam.patch
new file mode 100644
index 0000000..22b393e
--- /dev/null
+++ b/net-fs/samba/files/samba-4.2.7-pam.patch
@@ -0,0 +1,36 @@
+--- samba-4.2.7/source3/wscript
++++ samba-4.2.7/source3/wscript
+@@ -853,11 +853,11 @@
+ if not conf.CHECK_FUNCS_IN('iconv_open', 'iconv', headers='iconv.h'):
+ conf.env.with_iconv = False
+ if conf.env.with_iconv:
+ conf.DEFINE('HAVE_ICONV', 1)
+
+- if Options.options.with_pam:
++ if Options.options.with_pam != False:
+ use_pam=True
+ conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h')
+ if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'):
+ Logs.warn("--with-pam=yes but pam_appl.h not found")
+ use_pam=False
+@@ -926,10 +926,20 @@
+ msg="Checking whether PAM_RADIO_TYPE is available");
+ if use_pam:
+ conf.DEFINE('WITH_PAM', 1)
+ conf.DEFINE('WITH_PAM_MODULES', 1)
+
++ else:
++ Logs.warn("PAM disabled")
++ use_pam=False
++ conf.undefine('WITH_PAM')
++ conf.undefine('WITH_PAM_MODULES')
++ conf.undefine('HAVE_SECURITY_PAM_APPL_H')
++ conf.undefine('PAM_RHOST')
++ conf.undefine('PAM_TTY')
++ conf.undefine('HAVE_PAM_PAM_APPL_H')
++
+ if Options.options.with_pam_smbpass:
+ conf.env.with_pam_smbpass = True
+
+ seteuid = False
+
diff --git a/net-fs/samba/files/samba-4.4.0-pam.patch b/net-fs/samba/files/samba-4.4.0-pam.patch
new file mode 100644
index 0000000..4516013
--- /dev/null
+++ b/net-fs/samba/files/samba-4.4.0-pam.patch
@@ -0,0 +1,29 @@
+--- samba-4.4.0rc2/source3/wscript
++++ samba-4.4.0rc2/source3/wscript
+@@ -870,7 +870,7 @@
+ if conf.env.with_iconv:
+ conf.DEFINE('HAVE_ICONV', 1)
+
+- if Options.options.with_pam:
++ if Options.options.with_pam != False:
+ use_pam=True
+ conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h')
+ if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'):
+@@ -943,6 +943,17 @@
+ conf.DEFINE('WITH_PAM', 1)
+ conf.DEFINE('WITH_PAM_MODULES', 1)
+
++ else:
++ Logs.warn("PAM disabled")
++ use_pam=False
++ conf.undefine('WITH_PAM')
++ conf.undefine('WITH_PAM_MODULES')
++ conf.undefine('HAVE_SECURITY_PAM_APPL_H')
++ conf.undefine('PAM_RHOST')
++ conf.undefine('PAM_TTY')
++ conf.undefine('HAVE_PAM_PAM_APPL_H')
++
++
+ seteuid = False
+
+ #
diff --git a/net-fs/samba/files/samba.conf b/net-fs/samba/files/samba.conf
new file mode 100644
index 0000000..e0a6f32
--- /dev/null
+++ b/net-fs/samba/files/samba.conf
@@ -0,0 +1,2 @@
+D /run/samba 0755 root root
+D /run/lock/samba 0755 root root
diff --git a/net-fs/samba/files/samba.service b/net-fs/samba/files/samba.service
new file mode 100644
index 0000000..8214ff8
--- /dev/null
+++ b/net-fs/samba/files/samba.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Samba AD server
+After=network.target winbindd.service
+Conflicts=nmbd.service smbd.service
+
+[Service]
+ExecStart=/usr/sbin/samba --interactive
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/samba/files/smbd.service b/net-fs/samba/files/smbd.service
new file mode 100644
index 0000000..5c006a4
--- /dev/null
+++ b/net-fs/samba/files/smbd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba SMB/CIFS server
+After=network.target nmbd.service winbindd.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/smbd.pid
+ExecStart=/usr/sbin/smbd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/samba/files/smbd.socket b/net-fs/samba/files/smbd.socket
new file mode 100644
index 0000000..833bf43
--- /dev/null
+++ b/net-fs/samba/files/smbd.socket
@@ -0,0 +1,9 @@
+[Unit]
+Description=Samba SMB/CIFS server socket
+
+[Socket]
+ListenStream=445
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/net-fs/samba/files/smbd_at.service b/net-fs/samba/files/smbd_at.service
new file mode 100644
index 0000000..e1f71be
--- /dev/null
+++ b/net-fs/samba/files/smbd_at.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Samba SMB/CIFS server instance
+
+[Service]
+ExecStart=/usr/sbin/smbd -F
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
diff --git a/net-fs/samba/files/winbindd.service b/net-fs/samba/files/winbindd.service
new file mode 100644
index 0000000..67a778f
--- /dev/null
+++ b/net-fs/samba/files/winbindd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba Winbind daemon
+After=network.target nmbd.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/winbindd.pid
+ExecStart=/usr/sbin/winbindd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target