summaryrefslogtreecommitdiff
path: root/net/samba-devel/files
diff options
context:
space:
mode:
Diffstat (limited to 'net/samba-devel/files')
-rw-r--r--net/samba-devel/files/README.FreeBSD4
-rw-r--r--net/samba-devel/files/patch-installman.sh11
-rw-r--r--net/samba-devel/files/patch-source_Makefile.in70
-rw-r--r--net/samba-devel/files/samba.sh.sample126
-rw-r--r--net/samba-devel/files/smb.conf.default84
5 files changed, 218 insertions, 77 deletions
diff --git a/net/samba-devel/files/README.FreeBSD b/net/samba-devel/files/README.FreeBSD
index 67cc86c58cb2..24234b687c89 100644
--- a/net/samba-devel/files/README.FreeBSD
+++ b/net/samba-devel/files/README.FreeBSD
@@ -2,8 +2,8 @@ If you want to use samba ports,
1. Copy /usr/local/etc/smb.conf.default to /usr/local/etc/smb.conf, and edit
it.
-2. Copy /usr/local/etc/rc.d/samba.sh.sample to /usr/local/etc/rc.d/samba.sh
-3. Type /usr/local/etc/rc.d/samba.sh or reboot.
+2. Put string 'samba_enable="YES"' into your /etc/rc.conf.
+3. Type '/usr/local/etc/rc.d/samba.sh start' or reboot.
See document files in /usr/local/share/doc/samba and example config files in
/usr/local/share/examples/samba for details.
diff --git a/net/samba-devel/files/patch-installman.sh b/net/samba-devel/files/patch-installman.sh
deleted file mode 100644
index 5ec4061a559e..000000000000
--- a/net/samba-devel/files/patch-installman.sh
+++ /dev/null
@@ -1,11 +0,0 @@
---- script/installman.sh.orig Wed Aug 21 09:33:36 2002
-+++ script/installman.sh Wed Aug 21 09:33:53 2002
-@@ -22,7 +22,7 @@
- echo Installing \"$lang\" man pages in $MANDIR/lang/$lang
- fi
-
-- langdir=$MANDIR/$lang
-+ langdir=$MANDIR
- for d in $MANDIR $langdir $langdir/man1 $langdir/man5 $langdir/man7 $langdir/man8; do
- if [ ! -d $d ]; then
- mkdir $d
diff --git a/net/samba-devel/files/patch-source_Makefile.in b/net/samba-devel/files/patch-source_Makefile.in
index 55fa7639dcb0..05811dbdd358 100644
--- a/net/samba-devel/files/patch-source_Makefile.in
+++ b/net/samba-devel/files/patch-source_Makefile.in
@@ -1,11 +1,73 @@
---- Makefile.in.orig Tue Feb 24 10:13:47 2004
-+++ Makefile.in Tue Feb 24 10:14:00 2004
-@@ -1204,7 +1204,7 @@
+--- Makefile.in.orig Fri Feb 6 23:40:27 2004
++++ Makefile.in Thu Mar 4 05:47:34 2004
+@@ -101,6 +101,7 @@
+ LIBSMBCLIENT_MAJOR=0
+ LIBSMBCLIENT_MINOR=1
+
++NSS_VERSION=1
+
+ FLAGS1 = $(CFLAGS) @FLAGS1@ -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper -I. $(CPPFLAGS) -I$(srcdir)
+ FLAGS2 =
+@@ -951,8 +952,8 @@
+ @SONAMEFLAG@`basename $@`
+
+ bin/libsmbclient.@SHLIBEXT@: $(LIBSMBCLIENT_PICOBJS)
+- @echo Linking libsmbclient shared library $@
+- @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBSMBCLIENT_PICOBJS) $(LDFLAGS) $(DYNEXP) $(LIBS) \
++ @echo Linking libsmbclient shared library $@.$(LIBSMBCLIENT_MAJOR)
++ @$(SHLD) $(LDSHFLAGS) -o $@.$(LIBSMBCLIENT_MAJOR) $(LIBSMBCLIENT_PICOBJS) $(LDFLAGS) $(DYNEXP) $(LIBS) \
+ $(KRB5LIBS) $(LDAP_LIBS) \
+ @SONAMEFLAG@`basename $@`.$(LIBSMBCLIENT_MAJOR)
+
+@@ -1035,13 +1036,13 @@
+ @WINBIND_NSS@: $(WINBIND_NSS_PICOBJS)
+ @echo "Linking $@"
+ @$(SHLD) $(WINBIND_NSS_LDSHFLAGS) -o $@ $(WINBIND_NSS_PICOBJS) \
+- @WINBIND_NSS_EXTRA_LIBS@ @SONAMEFLAG@`basename $@`
++ @WINBIND_NSS_EXTRA_LIBS@ @SONAMEFLAG@`basename $@`.$(NSS_VERSION)
+
+ @WINBIND_WINS_NSS@: $(WINBIND_WINS_NSS_PICOBJS)
+ @echo "Linking $@"
+ @$(SHLD) $(LDSHFLAGS) -o $@ $(WINBIND_WINS_NSS_PICOBJS) \
+ $(LDAP_LIBS) $(KRB5LIBS) -lc \
+- @SONAMEFLAG@`basename $@`
++ @SONAMEFLAG@`basename $@`.$(NSS_VERSION)
+
+ nsswitch/pam_winbind.@SHLIBEXT@: $(PAM_WINBIND_PICOBJ) bin/.dummy
+ @echo "Linking $@"
+@@ -1204,7 +1205,7 @@
bin/t_snprintf@EXEEXT@: lib/snprintf.c
$(CC) $(FLAGS) -o $@ -DTEST_SNPRINTF lib/snprintf.c -lm
-install: installbin installman installscripts installdat installswat installmodules @INSTALLCLIENT@
-+install: installbin installman installscripts installdat installswat installmodules
++install: installbin installscripts installdat installswat installmodules @INSTALLCLIENT@
install-everything: install installmodules
+@@ -1256,7 +1257,7 @@
+
+ installclientlib: installdirs libsmbclient
+ @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)${prefix}/lib
+- -$(INSTALLCLIENTCMD_SH) bin/libsmbclient.@SHLIBEXT@ $(DESTDIR)${prefix}/lib
++ -$(INSTALLCLIENTCMD_SH) bin/libsmbclient.@SHLIBEXT@.$(LIBSMBCLIENT_MAJOR) $(DESTDIR)${prefix}/lib
+ -$(INSTALLCLIENTCMD_A) bin/libsmbclient.a $(DESTDIR)${prefix}/lib
+ @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)${prefix}/include
+ -$(INSTALLCMD) $(srcdir)/include/libsmbclient.h $(DESTDIR)${prefix}/include
+@@ -1276,7 +1277,7 @@
+ fi
+ PYTHON_OBJS="$(PYTHON_PICOBJS)" \
+ PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS) $(FLAGS)" \
+- LIBS="$(LIBS) $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS)" \
++ LIBS="$(LDFLAGS) $(LIBS) $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS)" \
+ $(PYTHON) python/setup.py build
+
+ python_install: $(PYTHON_PICOBJS)
+@@ -1286,7 +1287,7 @@
+ fi
+ PYTHON_OBJS="$(PYTHON_PICOBJS)" \
+ PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \
+- LIBS="$(LIBS)" \
++ LIBS="$(LDFLAGS) $(LIBS)" \
+ $(PYTHON) python/setup.py install
+
+ python_clean:
diff --git a/net/samba-devel/files/samba.sh.sample b/net/samba-devel/files/samba.sh.sample
index d0a46a32d30e..0221db03567c 100644
--- a/net/samba-devel/files/samba.sh.sample
+++ b/net/samba-devel/files/samba.sh.sample
@@ -1,61 +1,123 @@
#!/bin/sh
#
+# $FreeBSD$
+#
-# PROVIDE: samba
-# REQUIRE: DAEMON
-# BEFORE: LOGIN
+# PROVIDE: nmbd smbd
+%%WINBIND%%# PROVIDE: winbindd
+# REQUIRE: NETWORKING SERVERS named %%CUPS%%
+# BEFORE: DAEMON
# KEYWORD: FreeBSD shutdown
#
# Add the following lines to /etc/rc.conf to enable samba:
#
-#smbd_enable="YES"
-#smbd_flags="-D" - optional because "-D" is the default flag
+#samba_enable="YES"
#
-#nmbd_enable="YES"
-#nmbd_flags="-D" - optional because "-D" is the default flag
+# or, for fine grain control
#
-#winbindd_enable="YES"
-#winbindd_flags="" - optional
+#nmbd_enable="YES"
+#smbd_enable="YES"
+%%WINBIND%%#winbindd_enable="YES"
#
. %%RC_SUBR%%
-name=smbd
+name=samba
rcvar=`set_rcvar`
-command=%%PREFIX%%/sbin/smbd
-required_files=%%SAMBA_CONFDIR%%/smb.conf
-pidfile=/var/run/smbd.pid
-
-# set defaults
-smbd_enable=${smbd_enable:-"NO"}
-smbd_flags=${smbd_flags:-"-D"}
load_rc_config $name
-run_rc_command "$1"
+# Set defaults
+samba_config=${samba_config:-"%%SAMBA_CONFIG%%"}
+# Config file is required
+if [ ! -r ${samba_config} ]; then
+ warn "${samba_config} is not readable."
+ case $1 in
+ force*) : ;;
+ *) exit 1 ;;
+ esac
+fi
-name=nmbd
-rcvar=`set_rcvar`
-command=%%PREFIX%%/sbin/nmbd
-required_files=%%SAMBA_CONFDIR%%/smb.conf
-pidfile=/var/run/nmbd.pid
+if checkyesno samba_enable; then
+ nmbd_enable=${nmbd_enable:-"YES"}
+ smbd_enable=${smbd_enable:-"YES"}
+%%WINBIND%% winbindd_enable=${winbindd_enable:-"YES"}
+%%WINBIND%% # Check, that winbind is actally configured
+%%WINBIND%% if [ ! "`egrep -i '(idmap.*uid|winbind.*uid)' ${samba_config} 2>/dev/null | egrep -v [\#\;]`" ]; then
+%%WINBIND%% #warn "Winbind support is not configured"
+%%WINBIND%% winbindd_enable="NO"
+%%WINBIND%% fi
+fi
+
+# Hack until run_rc_command() get rid of exit()
+samba_stop() {
+ pid=$(check_pidfile ${pidfile} ${command})
+ if [ -z ${pid} ]; then
+ echo "${name} not running? (check ${pidfile})."
+ return 1
+ fi
+ echo "Stopping ${command}."
+ kill -${sig_stop:-TERM} ${pid}
+ [ $? -ne 0 ] && [ -z "$rc_force" ] && return 1
+ wait_for_pids ${pid}
+}
-# set defaults
+nmbd_precmd() {
+ # XXX: Never delete winbindd_idmap.tdb and winbindd_cache.tdb
+ if [ -d "%%SAMBA_SPOOL%%" ]; then
+ echo "Starting SAMBA: removing stale tdbs :"
+ for file in connections.tdb locking.tdb messages.tdb \
+ sessionid.tdb unexpected.tdb brlock.tdb \
+ namelist.debug
+ do
+ rm -vf "%%SAMBA_SPOOL%%/$file"
+ done
+ fi
+}
+# nmbd
+name=nmbd
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/${name}"
+required_dirs="%%SAMBA_SPOOL%%"
+pidfile=%%SAMBA_RUNDIR%%/${name}.pid
+start_precmd="nmbd_precmd"
+stop_cmd="samba_stop"
+# Defaults
nmbd_enable=${nmbd_enable:-"NO"}
nmbd_flags=${nmbd_flags:-"-D"}
+command_args="${nmbd_flags} -s ${samba_config}"
+
load_rc_config $name
run_rc_command "$1"
-name=winbindd
+# smbd
+name=smbd
rcvar=`set_rcvar`
-command=%%PREFIX%%/sbin/winbindd
-required_files=%%SAMBA_CONFDIR%%/smb.conf
-pidfile=/var/run/winbindd.pid
-
-# set defaults
+command="%%PREFIX%%/sbin/${name}"
+pidfile=%%SAMBA_RUNDIR%%/${name}.pid
+start_precmd=":"
+stop_cmd="samba_stop"
+# Defaults
+smbd_enable=${smbd_enable:-"NO"}
+smbd_flags=${smbd_flags:-"-D"}
+command_args="${smbd_flags} -s ${samba_config}"
-winbindd_enable=${winbindd_enable:-"NO"}
-winbindd_flags=${winbindd_flags:-""}
load_rc_config $name
run_rc_command "$1"
+%%WINBIND%%
+%%WINBIND%%# winbindd
+%%WINBIND%%name=winbindd
+%%WINBIND%%rcvar=`set_rcvar`
+%%WINBIND%%command="%%PREFIX%%/sbin/${name}"
+%%WINBIND%%required_dirs="%%SAMBA_SPOOL%%"
+%%WINBIND%%pidfile=%%SAMBA_RUNDIR%%/${name}.pid
+%%WINBIND%%start_precmd=":"
+%%WINBIND%%stop_cmd="samba_stop"
+%%WINBIND%%# Defaults
+%%WINBIND%%winbindd_enable=${winbindd_enable:-"NO"}
+%%WINBIND%%winbindd_flags=${winbindd_flags:-""}
+%%WINBIND%%command_args="${winbindd_flags} -s ${samba_config}"
+%%WINBIND%%
+%%WINBIND%%load_rc_config $name
+%%WINBIND%%run_rc_command "$1"
diff --git a/net/samba-devel/files/smb.conf.default b/net/samba-devel/files/smb.conf.default
index 8046bf75398a..20b7fecb2965 100644
--- a/net/samba-devel/files/smb.conf.default
+++ b/net/samba-devel/files/smb.conf.default
@@ -3,13 +3,16 @@
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
+# For a step by step guide on installation, configuration and usage of Samba,
+# read the Samba HOWTO Collection.
+#
# 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 many any basic syntactic errors.
+# to check that you have not made any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
@@ -20,6 +23,31 @@
# 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 HOWTO Collection for details.
+ security = user
+
+# 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>
+
+# You may wish to use password encryption. Please read
+# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
+# Do not enable this option unless you have read those documents
+; encrypt passwords = yes
+# 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
+
# 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
@@ -41,7 +69,7 @@
# It should not be necessary to specify the print system type unless
# it is non-standard. Currently supported print systems include:
-# bsd, sysv, plp, lprng, aix, hpux, qnx
+# cups, bsd, sysv, plp, lprng, aix, hpux, qnx
; printing = bsd
# Uncomment this if you want a guest account, you must add this to /etc/passwd
@@ -55,24 +83,17 @@
# Put a capping on the size of the log files (in Kb).
max log size = 50
-# Security mode. Most people will want user level security. See
-# security_level.txt for details.
- security = user
-# Use password server option only with security = server
-; password server = <NT-Server-Name>
-
-# You may wish to use password encryption. Please read
-# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
-# Do not enable this option unless you have read those documents
-; encrypt passwords = yes
# 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
+# of the machine that is connecting.
+# Note: Consider carefully the location in the configuration file of
+# this line. The included file is read at that point.
; include = %%SAMBA_CONFDIR%%/smb.conf.%m
# Most people will find that this option gives better performance.
-# See speed.txt and the manual pages for details
+# See the chapter 'Samba performance issues' in the Samba HOWTO Collection
+# and the manual pages for details.
socket options = TCP_NODELAY
# Configure Samba to use multiple interfaces
@@ -132,8 +153,7 @@
; wins proxy = yes
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
-# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
-# this has been changed in version 1.9.18 to no.
+# via DNS nslookups. The default is NO.
dns proxy = no
# charset settings
@@ -141,19 +161,27 @@
; unix charset = ASCII
; dos charset = ASCII
-#
+# 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
- writeable = yes
+ writable = yes
# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
; comment = Network Logon Service
; path = /usr/local/samba/lib/netlogon
; guest ok = yes
-; writeable = no
+; writable = no
; share modes = no
@@ -173,7 +201,7 @@
browseable = no
# Set public = yes to allow user 'guest account' to print
guest ok = no
- writeable = no
+ writable = no
printable = yes
# This one is useful for people to share files
@@ -189,7 +217,7 @@
; comment = Public Stuff
; path = /home/samba
; public = yes
-; writeable = yes
+; writable = yes
; printable = no
; write list = @staff
@@ -204,7 +232,7 @@
; path = /homes/fred
; printer = freds_printer
; public = no
-; writeable = no
+; writable = no
; printable = yes
# A private directory, usable only by fred. Note that fred requires write
@@ -214,7 +242,7 @@
; path = /usr/somewhere/private
; valid users = fred
; public = no
-; writeable = yes
+; writable = yes
; printable = no
# a service which has a different directory for each machine that connects
@@ -225,23 +253,23 @@
; comment = PC Directories
; path = /usr/pc/%m
; public = no
-; writeable = yes
+; 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 writeable by the default user. Another user could of course
+# 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
-; writeable = 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 writeable by both users and should have the
+# 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]
@@ -249,7 +277,7 @@
; path = /usr/somewhere/shared
; valid users = mary fred
; public = no
-; writeable = yes
+; writable = yes
; printable = no
; create mask = 0765