diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-fs/samba/files | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-fs/samba/files')
42 files changed, 1407 insertions, 0 deletions
diff --git a/net-fs/samba/files/3.5/lmhosts b/net-fs/samba/files/3.5/lmhosts new file mode 100644 index 000000000000..fe7b466eb16a --- /dev/null +++ b/net-fs/samba/files/3.5/lmhosts @@ -0,0 +1,2 @@ +# $Id$ +127.0.0.1 localhost diff --git a/net-fs/samba/files/3.5/nsswitch.conf-winbind b/net-fs/samba/files/3.5/nsswitch.conf-winbind new file mode 100644 index 000000000000..32d9b98b8505 --- /dev/null +++ b/net-fs/samba/files/3.5/nsswitch.conf-winbind @@ -0,0 +1,17 @@ +# $Id$ +passwd: files winbind +group: files winbind + +hosts: files dns +networks: files dns + +services: db files +protocols: db files +rpc: db files +ethers: db files +netmasks: files +netgroup: files +bootparams: files + +automount: files +aliases: files diff --git a/net-fs/samba/files/3.5/nsswitch.conf-wins b/net-fs/samba/files/3.5/nsswitch.conf-wins new file mode 100644 index 000000000000..44c01aed9557 --- /dev/null +++ b/net-fs/samba/files/3.5/nsswitch.conf-wins @@ -0,0 +1,17 @@ +# $Id$ +passwd: files +group: files + +hosts: files dns wins +networks: files dns + +services: db files +protocols: db files +rpc: db files +ethers: db files +netmasks: files +netgroup: files +bootparams: files + +automount: files +aliases: files diff --git a/net-fs/samba/files/3.5/samba-3.5.6-kerberos-dummy.patch b/net-fs/samba/files/3.5/samba-3.5.6-kerberos-dummy.patch new file mode 100644 index 000000000000..ef76afff7ef6 --- /dev/null +++ b/net-fs/samba/files/3.5/samba-3.5.6-kerberos-dummy.patch @@ -0,0 +1,30 @@ +diff -NrU5 samba-3.5.6.original/source3/include/krb5_protos.h samba-3.5.6/source3/include/krb5_protos.h +--- samba-3.5.6.original/source3/include/krb5_protos.h 2010-10-07 10:41:16.000000000 -0600 ++++ samba-3.5.6/source3/include/krb5_protos.h 2010-12-23 11:01:09.000000000 -0600 +@@ -86,15 +86,10 @@ + const char *name, + krb5_principal *principal); + bool smb_krb5_principal_compare_any_realm(krb5_context context, + krb5_const_principal princ1, + krb5_const_principal princ2); +-int cli_krb5_get_ticket(const char *principal, time_t time_offset, +- DATA_BLOB *ticket, DATA_BLOB *session_key_krb5, +- uint32 extra_ap_opts, const char *ccname, +- time_t *tgs_expire, +- const char *impersonate_princ_s); + krb5_error_code smb_krb5_renew_ticket(const char *ccache_string, const char *client_string, const char *service_string, time_t *expire_time); + krb5_error_code kpasswd_err_to_krb5_err(krb5_error_code res_code); + krb5_error_code smb_krb5_gen_netbios_krb5_address(smb_krb5_addresses **kerb_addr); + krb5_error_code smb_krb5_free_addresses(krb5_context context, smb_krb5_addresses *addr); + NTSTATUS krb5_to_nt_status(krb5_error_code kerberos_error); +@@ -144,5 +139,10 @@ + krb5_creds **creds_p); + char *smb_krb5_principal_get_realm(krb5_context context, + krb5_principal principal); + #endif /* HAVE_KRB5 */ + ++int cli_krb5_get_ticket(const char *principal, time_t time_offset, ++ DATA_BLOB *ticket, DATA_BLOB *session_key_krb5, ++ uint32 extra_ap_opts, const char *ccname, ++ time_t *tgs_expire, ++ const char *impersonate_princ_s); diff --git a/net-fs/samba/files/3.5/samba-3.5.8-uclib-build.patch b/net-fs/samba/files/3.5/samba-3.5.8-uclib-build.patch new file mode 100644 index 000000000000..905b06a5db16 --- /dev/null +++ b/net-fs/samba/files/3.5/samba-3.5.8-uclib-build.patch @@ -0,0 +1,58 @@ +From a5bfd634ecd0e81eb92b065da311ee4cf6f08757 Mon Sep 17 00:00:00 2001 +From: Jeff Layton <jlayton@samba.org> +Date: Mon, 5 Jul 2010 08:39:45 -0400 +Subject: [PATCH] mount.cifs: switch to using _PATH_MNTTAB and paths.h + +The code currently uses fstab.h and _PATH_FSTAB, but uClibc apparently +doesn't have that header. It does have paths.h and _PATH_MNTTAB however +and so does glibc, so use that instead. + +Reported-by: Armin Kuster <linux@kama-aina.net> +Signed-off-by: Jeff Layton <jlayton@samba.org> +--- +diff -NrU5 samba-3.5.8.original/client/mount.cifs.c samba-3.5.8/client/mount.cifs.c +--- samba-3.5.8.original/client/mount.cifs.c 2011-03-06 12:48:05.000000000 -0600 ++++ samba-3.5.8/client/mount.cifs.c 2011-05-04 08:51:42.000000000 -0600 +@@ -37,11 +37,11 @@ + #include <netdb.h> + #include <string.h> + #include <mntent.h> + #include <fcntl.h> + #include <limits.h> +-#include <fstab.h> ++#include <paths.h> + #include "mount.h" + + #define MOUNT_CIFS_VERSION_MAJOR "1" + #define MOUNT_CIFS_VERSION_MINOR "14" + +@@ -261,14 +261,14 @@ + { + FILE *fstab; + struct mntent *mnt; + + /* make sure this mount is listed in /etc/fstab */ +- fstab = setmntent(_PATH_FSTAB, "r"); ++ fstab = setmntent(_PATH_MNTTAB, "r"); + if (!fstab) { + fprintf(stderr, "Couldn't open %s for reading!\n", +- _PATH_FSTAB); ++ _PATH_MNTTAB); + return EX_FILEIO; + } + + while((mnt = getmntent(fstab))) { + if (!strcmp(mountpoint, mnt->mnt_dir)) +@@ -277,11 +277,11 @@ + endmntent(fstab); + + if (mnt == NULL || strcmp(mnt->mnt_fsname, devname)) { + fprintf(stderr, "%s: permission denied: no match for " + "%s found in %s\n", progname, mountpoint, +- _PATH_FSTAB); ++ _PATH_MNTTAB); + return EX_USAGE; + } + + /* + * 'mount' munges the options from fstab before passing them diff --git a/net-fs/samba/files/3.5/samba.confd b/net-fs/samba/files/3.5/samba.confd new file mode 100644 index 000000000000..1b329dae6b18 --- /dev/null +++ b/net-fs/samba/files/3.5/samba.confd @@ -0,0 +1,28 @@ +#add "winbind" to the daemon_list if you also want winbind to start +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" + +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/3.5/samba.initd b/net-fs/samba/files/3.5/samba.initd new file mode 100644 index 000000000000..0e1802f31f77 --- /dev/null +++ b/net-fs/samba/files/3.5/samba.initd @@ -0,0 +1,59 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Id$ + +extra_started_commands="reload" + +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} +} + +mkdir_sambadirs() { + [ -d /var/run/samba ] || mkdir -p /var/run/samba +} + +start() { + ${my_service_PRE} + mkdir_sambadirs + 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/3.5/samba.pam b/net-fs/samba/files/3.5/samba.pam new file mode 100644 index 000000000000..91beadd478a4 --- /dev/null +++ b/net-fs/samba/files/3.5/samba.pam @@ -0,0 +1,8 @@ +#%PAM-1.0 +# * pam_smbpass.so authenticates against the smbpasswd file +# * changed Redhat's 'pam_stack' with 'include' for *BSD compatibility +# (Diego "Flameeyes" Petteno'): enable with pam>=0.78 only +auth required pam_smbpass.so nodelay +account include system-auth +session include system-auth +password required pam_smbpass.so nodelay smbconf=/etc/samba/smb.conf diff --git a/net-fs/samba/files/3.5/smb.conf.default b/net-fs/samba/files/3.5/smb.conf.default new file mode 100644 index 000000000000..4c9a4a6d529f --- /dev/null +++ b/net-fs/samba/files/3.5/smb.conf.default @@ -0,0 +1,271 @@ +# 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 = /var/log/samba/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 = /etc/samba/smb.conf.%m + +# 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 + +# 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 = /var/lib/samba/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 = /var/lib/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 = /var/spool/samba + 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 + + diff --git a/net-fs/samba/files/3.5/smb.conf.default.patch b/net-fs/samba/files/3.5/smb.conf.default.patch new file mode 100644 index 000000000000..e9d62db164f4 --- /dev/null +++ b/net-fs/samba/files/3.5/smb.conf.default.patch @@ -0,0 +1,86 @@ +--- samba-3.5.9/examples/smb.conf.default 2011-06-14 05:17:28.000000000 -0600 ++++ /etc/samba/smb.conf.default 2011-06-29 10:12:13.000000000 -0600 +@@ -61,11 +61,11 @@ + # 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 = /usr/local/samba/var/log.%m ++ log file = /var/log/samba/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 +@@ -79,19 +79,22 @@ + # 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. ++# compatibility. tdbsam requires no further configuration. If you're ++# migrating from < samba 3.4, you'll have to convert your old user ++# passwords to the new backend with the command: ++# pdbedit -i smbpasswd:/var/lib/samba/private/smbpasswd -e + ; 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 = /usr/local/samba/lib/smb.conf.%m ++; include = /etc/samba/smb.conf.%m + + # 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 +@@ -164,29 +167,29 @@ + 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 ++; path = /var/lib/samba/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 ++; path = /var/lib/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 = /usr/spool/samba ++ path = /var/spool/samba + browseable = no + # Set public = yes to allow user 'guest account' to print + guest ok = no + writable = no + printable = yes +@@ -202,11 +205,11 @@ + # the "staff" group + ;[public] + ; comment = Public Stuff + ; path = /home/samba + ; public = yes +-; writable = no ++; writable = yes + ; printable = no + ; write list = @staff + + # Other examples. + # diff --git a/net-fs/samba/files/3.5/smbusers b/net-fs/samba/files/3.5/smbusers new file mode 100644 index 000000000000..7acb6dc817af --- /dev/null +++ b/net-fs/samba/files/3.5/smbusers @@ -0,0 +1,7 @@ +# $Id$ + +# Syntax: +# Unix_name = SMB_name1 SMB_name2 ... + +root = Administrator admin +nobody = guest pcguest smbguest diff --git a/net-fs/samba/files/3.5/swat.xinetd b/net-fs/samba/files/3.5/swat.xinetd new file mode 100644 index 000000000000..45e977df11aa --- /dev/null +++ b/net-fs/samba/files/3.5/swat.xinetd @@ -0,0 +1,17 @@ +# default: off +# description: SWAT is the Samba Web Admin Tool. Use swat \ +# to configure your Samba server. To use SWAT, \ +# connect to port 901 with your favorite web browser. +# $Id$ + +service swat +{ + port = 901 + socket_type = stream + wait = no + only_from = localhost + user = root + server = /usr/sbin/swat + log_on_failure += USERID + disable = yes +} diff --git a/net-fs/samba/files/3.5/system-auth-winbind.pam b/net-fs/samba/files/3.5/system-auth-winbind.pam new file mode 100644 index 000000000000..8d6746b7aeb6 --- /dev/null +++ b/net-fs/samba/files/3.5/system-auth-winbind.pam @@ -0,0 +1,18 @@ +#%PAM-1.0 +# $Id$ + +auth required pam_env.so +auth sufficient pam_winbind.so +auth sufficient pam_unix.so likeauth nullok use_first_pass +auth required pam_deny.so + +account sufficient pam_winbind.so +account required pam_unix.so + +password required pam_cracklib.so retry=3 +password sufficient pam_unix.so nullok use_authtok md5 shadow +password required pam_deny.so + +session required pam_mkhomedir.so skel=/etc/skel/ umask=0022 +session required pam_limits.so +session required pam_unix.so diff --git a/net-fs/samba/files/3.6/lmhosts b/net-fs/samba/files/3.6/lmhosts new file mode 100644 index 000000000000..fe7b466eb16a --- /dev/null +++ b/net-fs/samba/files/3.6/lmhosts @@ -0,0 +1,2 @@ +# $Id$ +127.0.0.1 localhost diff --git a/net-fs/samba/files/3.6/samba.confd b/net-fs/samba/files/3.6/samba.confd new file mode 100644 index 000000000000..1b329dae6b18 --- /dev/null +++ b/net-fs/samba/files/3.6/samba.confd @@ -0,0 +1,28 @@ +#add "winbind" to the daemon_list if you also want winbind to start +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" + +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/3.6/samba.initd b/net-fs/samba/files/3.6/samba.initd new file mode 100644 index 000000000000..1ebd2e72b926 --- /dev/null +++ b/net-fs/samba/files/3.6/samba.initd @@ -0,0 +1,60 @@ +#!/sbin/runscript +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Id$ + +extra_started_commands="reload" +piddir="/var/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} +} + +mkdir_sambadirs() { + [ -d "${piddir}" ] || mkdir -p ${piddir} +} + +start() { + ${my_service_PRE} + mkdir_sambadirs + 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/3.6/samba.pam b/net-fs/samba/files/3.6/samba.pam new file mode 100644 index 000000000000..91beadd478a4 --- /dev/null +++ b/net-fs/samba/files/3.6/samba.pam @@ -0,0 +1,8 @@ +#%PAM-1.0 +# * pam_smbpass.so authenticates against the smbpasswd file +# * changed Redhat's 'pam_stack' with 'include' for *BSD compatibility +# (Diego "Flameeyes" Petteno'): enable with pam>=0.78 only +auth required pam_smbpass.so nodelay +account include system-auth +session include system-auth +password required pam_smbpass.so nodelay smbconf=/etc/samba/smb.conf diff --git a/net-fs/samba/files/3.6/smb.conf.default.patch b/net-fs/samba/files/3.6/smb.conf.default.patch new file mode 100644 index 000000000000..c2a9a72cedad --- /dev/null +++ b/net-fs/samba/files/3.6/smb.conf.default.patch @@ -0,0 +1,68 @@ +--- samba-3.6.0rc2/examples/smb.conf.default~ 2011-06-07 19:13:47.000000000 +0100 ++++ samba-3.6.0rc2/examples/smb.conf.default 2011-06-30 16:12:42.388102480 +0100 +@@ -63,7 +63,7 @@ + + # this tells Samba to use a separate log file for each machine + # that connects +- log file = /usr/local/samba/var/log.%m ++ log file = /var/log/samba/log.%m + + # Put a capping on the size of the log files (in Kb). + max log size = 50 +@@ -81,7 +81,10 @@ + + # 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. ++# compatibility. tdbsam requires no further configuration. If you're ++# migrating from < samba 3.4, you'll have to convert your old user ++# passwords to the new backend with the command: ++# pdbedit -i smbpasswd:/var/lib/samba/private/smbpasswd -e + ; passdb backend = tdbsam + + # Using the following line enables you to customise your configuration +@@ -89,7 +92,7 @@ + # 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 = /usr/local/samba/lib/smb.conf.%m ++; include = /etc/samba/smb.conf.%m + + # Configure Samba to use multiple interfaces + # If you have multiple network interfaces then you must list them +@@ -166,7 +169,7 @@ + # Un-comment the following and create the netlogon directory for Domain Logons + ; [netlogon] + ; comment = Network Logon Service +-; path = /usr/local/samba/lib/netlogon ++; path = /var/lib/samba/netlogon + ; guest ok = yes + ; writable = no + ; share modes = no +@@ -175,7 +178,7 @@ + # 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 ++; path = /var/lib/samba/profiles + ; browseable = no + ; guest ok = yes + +@@ -184,7 +187,7 @@ + # specifically define each individual printer + [printers] + comment = All Printers +- path = /usr/spool/samba ++ path = /var/spool/samba + browseable = no + # Set public = yes to allow user 'guest account' to print + guest ok = no +@@ -204,7 +207,7 @@ + ; comment = Public Stuff + ; path = /home/samba + ; public = yes +-; writable = no ++; writable = yes + ; printable = no + ; write list = @staff + diff --git a/net-fs/samba/files/3.6/smbusers b/net-fs/samba/files/3.6/smbusers new file mode 100644 index 000000000000..7acb6dc817af --- /dev/null +++ b/net-fs/samba/files/3.6/smbusers @@ -0,0 +1,7 @@ +# $Id$ + +# Syntax: +# Unix_name = SMB_name1 SMB_name2 ... + +root = Administrator admin +nobody = guest pcguest smbguest diff --git a/net-fs/samba/files/3.6/swat.xinetd b/net-fs/samba/files/3.6/swat.xinetd new file mode 100644 index 000000000000..45e977df11aa --- /dev/null +++ b/net-fs/samba/files/3.6/swat.xinetd @@ -0,0 +1,17 @@ +# default: off +# description: SWAT is the Samba Web Admin Tool. Use swat \ +# to configure your Samba server. To use SWAT, \ +# connect to port 901 with your favorite web browser. +# $Id$ + +service swat +{ + port = 901 + socket_type = stream + wait = no + only_from = localhost + user = root + server = /usr/sbin/swat + log_on_failure += USERID + disable = yes +} diff --git a/net-fs/samba/files/3.6/system-auth-winbind.pam b/net-fs/samba/files/3.6/system-auth-winbind.pam new file mode 100644 index 000000000000..8d6746b7aeb6 --- /dev/null +++ b/net-fs/samba/files/3.6/system-auth-winbind.pam @@ -0,0 +1,18 @@ +#%PAM-1.0 +# $Id$ + +auth required pam_env.so +auth sufficient pam_winbind.so +auth sufficient pam_unix.so likeauth nullok use_first_pass +auth required pam_deny.so + +account sufficient pam_winbind.so +account required pam_unix.so + +password required pam_cracklib.so retry=3 +password sufficient pam_unix.so nullok use_authtok md5 shadow +password required pam_deny.so + +session required pam_mkhomedir.so skel=/etc/skel/ umask=0022 +session required pam_limits.so +session required pam_unix.so diff --git a/net-fs/samba/files/4.0/com_err.patch b/net-fs/samba/files/4.0/com_err.patch new file mode 100644 index 000000000000..2c9ad88f01d7 --- /dev/null +++ b/net-fs/samba/files/4.0/com_err.patch @@ -0,0 +1,35 @@ +From 2f34bfbc1941127d17a7a91c6598d6a6c35620e2 Mon Sep 17 00:00:00 2001 +From: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> +Date: Thu, 6 Oct 2011 00:19:01 +0200 +Subject: [PATCH] Add missing com_err dependencies + +--- + auth/kerberos/wscript_build | 2 +- + nsswitch/wscript_build | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/auth/kerberos/wscript_build b/auth/kerberos/wscript_build +index 1070770..2421b16 100644 +--- a/auth/kerberos/wscript_build ++++ b/auth/kerberos/wscript_build +@@ -1,3 +1,3 @@ + bld.SAMBA_SUBSYSTEM('KRB5_PAC', + source='gssapi_pac.c kerberos_pac.c', +- deps='gssapi_krb5 krb5 ndr-krb5pac') ++ deps='gssapi_krb5 krb5 ndr-krb5pac com_err') +diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build +index 298da06..4e353d3 100644 +--- a/nsswitch/wscript_build ++++ b/nsswitch/wscript_build +@@ -33,7 +33,7 @@ if bld.CONFIG_SET('WITH_PAM_MODULES') and bld.CONFIG_SET('HAVE_PAM_START'): + if bld.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'): + bld.SAMBA_LIBRARY('winbind_krb5_locator', + source='winbind_krb5_locator.c', +- deps='wbclient krb5', ++ deps='wbclient krb5 com_err', + realname='winbind_krb5_locator.so') + + bld.SAMBA_SUBSYSTEM('WB_REQTRANS', +-- +1.7.3.4 + diff --git a/net-fs/samba/files/4.0/samba4.confd b/net-fs/samba/files/4.0/samba4.confd new file mode 100644 index 000000000000..58b2c7827bdf --- /dev/null +++ b/net-fs/samba/files/4.0/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.0/samba4.initd-r1 b/net-fs/samba/files/4.0/samba4.initd-r1 new file mode 100644 index 000000000000..012e19edc92c --- /dev/null +++ b/net-fs/samba/files/4.0/samba4.initd-r1 @@ -0,0 +1,56 @@ +#!/sbin/runscript +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Id$ + +extra_started_commands="reload" +piddir="/var/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/4.1/com_err.patch b/net-fs/samba/files/4.1/com_err.patch new file mode 100644 index 000000000000..2c9ad88f01d7 --- /dev/null +++ b/net-fs/samba/files/4.1/com_err.patch @@ -0,0 +1,35 @@ +From 2f34bfbc1941127d17a7a91c6598d6a6c35620e2 Mon Sep 17 00:00:00 2001 +From: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> +Date: Thu, 6 Oct 2011 00:19:01 +0200 +Subject: [PATCH] Add missing com_err dependencies + +--- + auth/kerberos/wscript_build | 2 +- + nsswitch/wscript_build | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/auth/kerberos/wscript_build b/auth/kerberos/wscript_build +index 1070770..2421b16 100644 +--- a/auth/kerberos/wscript_build ++++ b/auth/kerberos/wscript_build +@@ -1,3 +1,3 @@ + bld.SAMBA_SUBSYSTEM('KRB5_PAC', + source='gssapi_pac.c kerberos_pac.c', +- deps='gssapi_krb5 krb5 ndr-krb5pac') ++ deps='gssapi_krb5 krb5 ndr-krb5pac com_err') +diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build +index 298da06..4e353d3 100644 +--- a/nsswitch/wscript_build ++++ b/nsswitch/wscript_build +@@ -33,7 +33,7 @@ if bld.CONFIG_SET('WITH_PAM_MODULES') and bld.CONFIG_SET('HAVE_PAM_START'): + if bld.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'): + bld.SAMBA_LIBRARY('winbind_krb5_locator', + source='winbind_krb5_locator.c', +- deps='wbclient krb5', ++ deps='wbclient krb5 com_err', + realname='winbind_krb5_locator.so') + + bld.SAMBA_SUBSYSTEM('WB_REQTRANS', +-- +1.7.3.4 + diff --git a/net-fs/samba/files/4.1/samba4.confd b/net-fs/samba/files/4.1/samba4.confd new file mode 100644 index 000000000000..58b2c7827bdf --- /dev/null +++ b/net-fs/samba/files/4.1/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.1/samba4.initd-r1 b/net-fs/samba/files/4.1/samba4.initd-r1 new file mode 100644 index 000000000000..012e19edc92c --- /dev/null +++ b/net-fs/samba/files/4.1/samba4.initd-r1 @@ -0,0 +1,56 @@ +#!/sbin/runscript +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Id$ + +extra_started_commands="reload" +piddir="/var/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/4.2/samba4.confd b/net-fs/samba/files/4.2/samba4.confd new file mode 100644 index 000000000000..58b2c7827bdf --- /dev/null +++ b/net-fs/samba/files/4.2/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.2/samba4.initd-r1 b/net-fs/samba/files/4.2/samba4.initd-r1 new file mode 100644 index 000000000000..ff42552e5d43 --- /dev/null +++ b/net-fs/samba/files/4.2/samba4.initd-r1 @@ -0,0 +1,56 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Id$ + +extra_started_commands="reload" +piddir="/var/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 000000000000..ad8486ce1c67 --- /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 000000000000..44b4ffba1f7f --- /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 000000000000..3a0375580bea --- /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 000000000000..ec351db7a2d0 --- /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 000000000000..94b30c00e162 --- /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 000000000000..9f1ebb819906 --- /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 000000000000..c6f50073317a --- /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.conf b/net-fs/samba/files/samba.conf new file mode 100644 index 000000000000..fce6812e6393 --- /dev/null +++ b/net-fs/samba/files/samba.conf @@ -0,0 +1 @@ +D /var/run/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 000000000000..8214ff863182 --- /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 000000000000..5c006a44edb6 --- /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 000000000000..833bf438832f --- /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 000000000000..e1f71be3f7fa --- /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 000000000000..67a778fc76c7 --- /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 |